1 /*
2  * NodePopGeometry.h
3  *
4  * Copyright (C) 1999 Stephen F. White, 2018 J. "MUFTI" Scheurich
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program (see the file "COPYING" for details); if
18  * not, write to the Free Software Foundation, Inc., 675 Mass Ave,
19  * Cambridge, MA 02139, USA.
20  */
21 
22 #pragma once
23 
24 #include "Node.h"
25 #include "ProtoMacros.h"
26 #include "Proto.h"
27 #include "DuneApp.h"
28 #include "GeometryNode.h"
29 #include "SFMFTypes.h"
30 
31 class ProtoPopGeometry : public Proto {
32 public:
33                     ProtoPopGeometry(Scene *scene);
34     virtual Node   *create(Scene *scene);
35 
getType()36     virtual int     getType() const { return X3DOM_POP_GEOMETRY; }
37 
isX3domProto(void)38     virtual bool    isX3domProto(void) { return true; }
39 
40     x3domGeometryCommonFieldIndex()
41     FieldIndex attributeStride;
42     FieldIndex bbMaxModF;
43     FieldIndex bbMin;
44     FieldIndex bbMinModF;
45     FieldIndex bbShiftVec;
46     FieldIndex ccw;
47     FieldIndex colorOffset;
48     FieldIndex colorPrecision;
49     FieldIndex colorType;
50     FieldIndex coordType;
51     FieldIndex indexedRendering;
52     FieldIndex levels;
53     FieldIndex maxBBSize;
54     FieldIndex maxPrecisionLevel;
55     FieldIndex minPrecisionLevel;
56     FieldIndex normalOffset;
57     FieldIndex normalPrecision;
58     FieldIndex normalType;
59     FieldIndex numAnchorVertices;
60     FieldIndex originalVertexCount;
61     FieldIndex position;
62     FieldIndex positionOffset;
63     FieldIndex positionPrecision;
64     FieldIndex precisionFactor;
65     FieldIndex primType;
66     FieldIndex size;
67     FieldIndex solid;
68     FieldIndex sphericalNormals;
69     FieldIndex texcoordOffset;
70     FieldIndex texcoordPrecision;
71     FieldIndex texCoordType;
72     FieldIndex tightSize;
73     FieldIndex vertexBufferSize;
74     FieldIndex vertexCount;
75 };
76 
77 class NodePopGeometry : public GeometryNode {
78 public:
79                     NodePopGeometry(Scene *scene, Proto *proto);
80 
copy()81     virtual Node   *copy() const { return new NodePopGeometry(*this); }
82 
getX3dVersion(void)83     virtual int     getX3dVersion(void) const { return -1; }
84 
showFields()85     virtual bool    showFields() { return true; }
86 
87     x3domGeometryCommonFieldMacros(ProtoPopGeometry)
88     fieldMacros(SFInt32, attributeStride, ProtoPopGeometry)
89     fieldMacros(SFVec3f, bbMaxModF, ProtoPopGeometry)
90     fieldMacros(SFVec3f, bbMin, ProtoPopGeometry)
91     fieldMacros(SFVec3f, bbMinModF, ProtoPopGeometry)
92     fieldMacros(SFVec3f, bbShiftVec, ProtoPopGeometry)
93     fieldMacros(SFBool, ccw, ProtoPopGeometry)
94     fieldMacros(SFInt32, colorOffset, ProtoPopGeometry)
95     fieldMacros(SFInt32, colorPrecision, ProtoPopGeometry)
96     fieldMacros(SFString, colorType, ProtoPopGeometry)
97     fieldMacros(SFString, coordType, ProtoPopGeometry)
98     fieldMacros(SFBool, indexedRendering, ProtoPopGeometry)
99     fieldMacros(MFNode, levels, ProtoPopGeometry)
100     fieldMacros(SFVec3f, maxBBSize, ProtoPopGeometry)
101     fieldMacros(SFInt32, maxPrecisionLevel, ProtoPopGeometry)
102     fieldMacros(SFInt32, minPrecisionLevel, ProtoPopGeometry)
103     fieldMacros(SFInt32, normalOffset, ProtoPopGeometry)
104     fieldMacros(SFInt32, normalPrecision, ProtoPopGeometry)
105     fieldMacros(SFString, normalType, ProtoPopGeometry)
106     fieldMacros(SFInt32, numAnchorVertices, ProtoPopGeometry)
107     fieldMacros(MFInt32, originalVertexCount, ProtoPopGeometry)
108     fieldMacros(SFVec3f, position, ProtoPopGeometry)
109     fieldMacros(SFInt32, positionOffset, ProtoPopGeometry)
110     fieldMacros(SFInt32, positionPrecision, ProtoPopGeometry)
111     fieldMacros(SFFloat, precisionFactor, ProtoPopGeometry)
112     fieldMacros(MFString, primType, ProtoPopGeometry)
113     fieldMacros(SFVec3f, size, ProtoPopGeometry)
114     fieldMacros(SFBool, solid, ProtoPopGeometry)
115     fieldMacros(SFBool, sphericalNormals, ProtoPopGeometry)
116     fieldMacros(SFInt32, texcoordOffset, ProtoPopGeometry)
117     fieldMacros(SFInt32, texcoordPrecision, ProtoPopGeometry)
118     fieldMacros(SFString, texCoordType, ProtoPopGeometry)
119     fieldMacros(SFVec3f, tightSize, ProtoPopGeometry)
120     fieldMacros(SFInt32, vertexBufferSize, ProtoPopGeometry)
121     fieldMacros(MFInt32, vertexCount, ProtoPopGeometry)
122 };
123 
124