File: qwt3d_types.sip

package info (click to toggle)
pyqwt3d 0.1.8-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 984 kB
  • sloc: python: 3,932; cpp: 328; makefile: 115; sh: 7
file content (351 lines) | stat: -rw-r--r-- 6,587 bytes parent folder | download | duplicates (5)
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
// The SIP interface definition for:
// - enum PLOTSTYLE
// - enum SHADINGSTYLE
// - enum COORDINATESTYLE
// - enum SCALETYPE
// - enum FLOORSTYLE
// - enum DATATYPE
// - enum AXIS
// - enum SIDE
// - enum ANCHOR
// - struct Tuple
// - struct Triple
// - struct ParallelEpiped
// - struct FreeVector
// - struct RGBA
// - function GL2Qt
// - function Qt2GL
// - class Data
// - class GridData
// - class CellData
// - function normalizedcross (FIXME: normalizedCross?)
// - function dotProduct
// 
// Copyright (C) 2004-2008 Gerard Vermeulen
//
// This file is part of PyQwt3D. 
//
// PyQwt3D is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// PyQwt3D is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with PyQwt3D; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
//
// In addition, as a special exception, Gerard Vermeulen gives permission
// to link PyQwt3D dynamically with non-free versions of Qt and PyQt,
// and to distribute PyQwt3D in this form, provided that equally powerful
// versions of Qt and PyQt have been released under the terms of the GNU
// General Public License.
//
// If PyQwt3D is dynamically linked with non-free versions of Qt and PyQt,
// PyQwt3D becomes a free plug-in for a non-free program.


%ModuleHeaderCode
#include <qwt3d_types.h>
using namespace Qwt3D;
%End // %ModuleHeaderCode


enum PLOTSTYLE
{
    NOPLOT,
    WIREFRAME,
    HIDDENLINE,
    FILLED,
    FILLEDMESH,
    POINTS,
    USER,
}; // enum PLOTSTYLE


enum SHADINGSTYLE
{
    FLAT,
    GOURAUD,
}; // enum SHADINGSTYLE


enum COORDSTYLE
{
    NOCOORD,
    BOX,
    FRAME,
}; // enum COORDSTYLE


enum SCALETYPE
{
    LINEARSCALE,
    LOG10SCALE,
    USERSCALE,
}; // enum SCALETYPE


enum FLOORSTYLE
{
    NOFLOOR,
    FLOORISO,
    FLOORDATA,
}; // enum FLOORSTYLE


enum DATATYPE
{
    GRID,
    POLYGON,
}; // enum DATATYPE


enum AXIS
{
    X1 = X1,
    X2 = X2,
    X3 = X3,
    X4 = X4,
    Y1 = Y1,
    Y2 = Y2,
    Y3 = Y3,
    Y4 = Y4,
    Z1 = Z1,
    Z2 = Z2,
    Z3 = Z3,
    Z4 = Z4,
}; // enum AXIS


enum SIDE
{
    NOSIDEGRID = NOSIDEGRID,
    LEFT = LEFT,
    RIGHT = RIGHT,
    CEIL = CEIL,
    FLOOR = FLOOR,
    FRONT = FRONT,
    BACK = BACK,
}; // enum SIDE


enum ANCHOR
{
    BottomLeft,
    BottomRight,
    BottomCenter,
    TopLeft,
    TopRight,
    TopCenter,
    CenterLeft,
    CenterRight,
    Center
}; // enum ANCHOR


struct Tuple
{
%TypeHeaderCode
#include <qwt3d_types.h>
using namespace Qwt3D;
%End

    double x;
    double y;

    Tuple();
    Tuple(double, double);
}; // struct Tuple


struct Triple
{

%TypeHeaderCode
#include <qwt3d_types.h>
using namespace Qwt3D;
%End // %TypeHeaderCode


    double x;
    double y; 
    double z;

    Triple(double = 0, double = 0, double = 0);
    Triple & operator+=(Triple);
    Triple & operator-=(Triple);
    Triple & operator*=(double);
    Triple & operator/=(double);
    Triple& operator*=(Triple);
    bool operator!=(Triple) const;
    bool operator==(Triple) const;
    double length() const;
    void normalize();

    // Triple operator+(const Triple &, const Triple &);
    Triple __add__(const Triple &);
    // Triple operator-(const Triple &, const Triple &);
    Triple __sub__(const Triple &);
    // FIXME: Triple operator*(double, const Triple &);
    // Triple operator*(const Triple &, double);
    Triple __mul__(const Triple &);
    // Triple operator*(const Triple &, const Triple &);
    Triple __mul__(double);
    // FIXME: Triple operator/(double, const Triple &);
    // Triple operator/(const Triple &, double);
    Triple __div__(double);
}; // struct Triple


struct ParallelEpiped
{

%TypeHeaderCode
#include <qwt3d_types.h>
using namespace Qwt3D;
%End // %TypeHeaderCode

    Triple minVertex;
    Triple maxVertex;

    ParallelEpiped();
    ParallelEpiped(Triple, Triple);
}; // struct ParallelEpiped


struct FreeVector
{

%TypeHeaderCode
#include <qwt3d_types.h>
using namespace Qwt3D;
%End // %TypeHeaderCode

    Triple base;
    Triple top;

    FreeVector();
    FreeVector(Triple, Triple);
}; // struct FreeVector

// FIXME: templates

struct RGBA
{

%TypeHeaderCode
#include <qwt3d_types.h>
using namespace Qwt3D;
%End // %TypeHeaderCode

    double r;
    double g;
    double b;
    double a;

    RGBA();
    RGBA(double, double, double, double = 1);
}; // struct RGBA


QColor GL2Qt(GLdouble, GLdouble, GLdouble);
RGBA Qt2GL(QColor);

//typedef double *Vertex;
//typedef std::vector<Vertex> DataRow;
//typedef std::vector<DataRow> DataMatrix;


class Data
{

%TypeHeaderCode
#include <qwt3d_types.h>
using namespace Qwt3D;
%End // %TypeHeaderCode

public:
    DATATYPE datatype;

    Data();
    virtual ~Data();
    virtual void clear() = 0;
    virtual bool empty() const = 0;
    void setHull(const ParallelEpiped &);
    const ParallelEpiped & hull() const;

//protected:
//    Qwt3D::ParallelEpiped hull_p;
}; // class Data

class GridData: Data
{

%TypeHeaderCode
#include <qwt3d_types.h>
using namespace Qwt3D;
%End // %TypeHeaderCode

public:
    //DataMatrix vertices;
    //DataMatrix normals;

    GridData();
    GridData(unsigned int, unsigned int);
    ~GridData();

    int columns() const;
    int rows() const;

    void clear();
    bool empty() const;
    void setSize(unsigned int, unsigned int);
    
    void setPeriodic(bool, bool);
    bool uperiodic() const;
    bool vperiodic() const;
}; // class GridData


class CellData: Data
{

%TypeHeaderCode
#include <qwt3d_types.h>
#include <sip_Qwt3DCellField.h>
#include <sip_Qwt3DTripleField.h>
using namespace Qwt3D;
%End // %TypeHeaderCode

public:
    CellField cells;
    TripleField nodes;
    TripleField normals;
    
    CellData();
    ~CellData();

    void clear();
    bool empty() const;

    const Triple & operator()(unsigned, unsigned);
%MethodCode
    sipRes = const_cast<Triple*>(&(sipCpp->operator()(a0, a1)));
%End
}; // class CellData


Triple normalizedcross(const Triple &, const Triple &);
double dotProduct(const Triple &, const Triple &);


// Local Variables:
// mode: C++
// c-file-style: "stroustrup"
// indent-tabs-mode: nil
// End: