attractors2DTransf.h 5.59 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
//------------------------------------------------------------------------------
//  Copyright (c) 2018-2020 Michele Morrone
//  All rights reserved.
//
//  https://michelemorrone.eu - https://BrutPitt.com
//
//  twitter: https://twitter.com/BrutPitt - github: https://github.com/BrutPitt
//
//  mailto:brutpitt@gmail.com - mailto:me@michelemorrone.eu
//  
//  This software is distributed under the terms of the BSD 2-Clause license
//------------------------------------------------------------------------------
#pragma once

//  Mira3D
////////////////////////////////////////////////////////////////////////////
class Mira3D : public attractorScalarK
{
public:

    Mira3D() {
        stepFn = (stepPtrFn) &Mira3D::Step;

        vMin = -10.0; vMax = 10.0; kMin = -1.0; kMax = 1.0;

        m_POV = vec3( 0.f, 0, 12.f);
    }

protected:
    void Step(vec4 &v, vec4 &vp);
    void startData();
    void searchAttractor()  { searchLyapunov(); }
};
//  Mira4D
////////////////////////////////////////////////////////////////////////////
class Mira4D : public attractorScalarK
{
public:

    Mira4D() {
        stepFn = (stepPtrFn) &Mira4D::Step;
        vMin = -10.0; vMax = 10.0; kMin = -1.0; kMax = 1.0;

        m_POV = vec3( 0.f, 0, 50.f);
    }

    int getPtSize() { return attPt4D; }
protected:
    void Step(vec4 &v, vec4 &vp);
    void startData();
    void searchAttractor()  { searchLyapunov(); }
};

//  PopCorn 4D BaseClasses
////////////////////////////////////////////////////////////////////////////
class PopCorn4DType : public attractorScalarK
{
public:

    PopCorn4DType() {
        vMin = -1.0; vMax = 1.0; kMin = -1.0; kMax = 1.0;
        m_POV = vec3( 0.f, 0, 12.f);
    }

    int getPtSize() { return attPt4D; }
protected:
    virtual void startData();
    //virtual void additionalDataCtrls();
};
class PopCorn4Dset : public PopCorn4DType
{
public:
    void Step(vec4 &v, vec4 &vp);

protected:
    double (*pfX)(double), (*pfY)(double), (*pfZ)(double), (*pfW)(double);
};

//  PopCorn 4D
////////////////////////////////////////////////////////////////////////////
class PopCorn4D : public PopCorn4Dset
{
public:
    PopCorn4D() { stepFn = (stepPtrFn) &PopCorn4Dset::Step;
                  pfX = pfY = pfZ = pfW = sin; }
};
////////////////////////////////////////////////////////////////////////////
class PopCorn4Dscss : public PopCorn4Dset
{
public:
    PopCorn4Dscss() { stepFn = (stepPtrFn) &PopCorn4Dset::Step;
                      pfX = pfZ = pfW = sin;  pfY = cos; }
};
////////////////////////////////////////////////////////////////////////////
class PopCorn4Dscsc : public PopCorn4Dset
{
public:
    PopCorn4Dscsc() { stepFn = (stepPtrFn) &PopCorn4Dset::Step;
                      pfX = pfZ = sin;  pfY = pfW = cos; }
};
////////////////////////////////////////////////////////////////////////////
class PopCorn4Dsscc : public PopCorn4Dset
{
public:
    PopCorn4Dsscc() { stepFn = (stepPtrFn) &PopCorn4Dset::Step;
                      pfX = pfY = sin;  pfZ = pfW = cos; }
};

class PopCorn4Dsimple : public PopCorn4DType
{
public:
    PopCorn4Dsimple() { stepFn = (stepPtrFn) &PopCorn4Dsimple::Step;
                      pfX = pfY = pfZ = pfW = sin; }
    void Step(vec4 &v, vec4 &vp);

protected:
    double (*pfX)(double), (*pfY)(double), (*pfZ)(double), (*pfW)(double);
};

////////////////////////////////////////////////////////////////////////////
class PopCorn4Drnd : public PopCorn4DType
{
public:
    void startData();
    PopCorn4Drnd() { stepFn = (stepPtrFn) &PopCorn4DType::Step; }
protected:
    void Step(vec4 &v, vec4 &vp);
};

//  PopCorn 3D
////////////////////////////////////////////////////////////////////////////
class PopCorn3D : public attractorScalarK
{
public:

    PopCorn3D() {
        stepFn = (stepPtrFn) &PopCorn3D::Step;
        vMin = -1.0; vMax = 1.0; kMin = -1.0; kMax = 1.0;

        m_POV = vec3( 0.f, 0, 12.f);
    }

protected:
    void Step(vec4 &v, vec4 &vp);
    void startData();
};
//  Martin 4D
////////////////////////////////////////////////////////////////////////////
class Martin4DBase : public attractorScalarK
{
public:
    Martin4DBase() {
        vMin = .0; vMax = .5; kMin = 2.7; kMax = 3.0;

        m_POV = vec3( 0.f, 0, 50.f);
    }

    int getPtSize() { return attPt4D; }

    void Step(vec4 &v, vec4 &vp);
protected:
    double (*pfX)(double), (*pfZ)(double);
    void startData();
};

class Martin4D : public Martin4DBase
{
public:
    Martin4D() { stepFn = (stepPtrFn) &Martin4DBase::Step;  pfX = pfZ = sin; }
};
class Martin4Dsc : public Martin4DBase
{
public:
    Martin4Dsc() { stepFn = (stepPtrFn) &Martin4DBase::Step;  pfX = sin; pfZ = cos; }
};
class Martin4Dcc : public Martin4DBase
{
public:
    Martin4Dcc() { stepFn = (stepPtrFn) &Martin4DBase::Step;  pfX = pfZ = cos; }
};

//  Symmetric Icons
////////////////////////////////////////////////////////////////////////////
class SymmetricIcons4D : public attractorScalarK
{
public:

    SymmetricIcons4D() {
        stepFn = (stepPtrFn) &SymmetricIcons4D::Step;
        vMin = -1.0; vMax = 1.0; kMin = -1.0; kMax = 1.0;

        m_POV = vec3( 0.f, 0, 12.f);
    }

    int getPtSize() { return attPt4D; }
protected:
    void Step(vec4 &v, vec4 &vp);
    void startData();
};


//  Hopalong 4D
////////////////////////////////////////////////////////////////////////////
class Hopalong4D : public attractorScalarK
{
public:

    Hopalong4D() {
        stepFn = (stepPtrFn) &Hopalong4D::Step;

        vMin = -1.0; vMax = 1.0; kMin = -1.0; kMax = 1.0;
        m_POV = vec3( 0.f, 0, 50.f);
    }

    int getPtSize() { return attPt4D; }
protected:
    void Step(vec4 &v, vec4 &vp);
    void startData();
    //void searchAttractor()  { searchLyapunov(); }
};