File indexing completed on 2025-01-18 10:05:32
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef VrmlData_IndexedLineSet_HeaderFile
0017 #define VrmlData_IndexedLineSet_HeaderFile
0018
0019 #include <VrmlData_Geometry.hxx>
0020 #include <VrmlData_Coordinate.hxx>
0021 #include <VrmlData_Color.hxx>
0022
0023
0024
0025
0026
0027
0028 class VrmlData_IndexedLineSet : public VrmlData_Geometry
0029 {
0030 public:
0031
0032
0033
0034
0035
0036
0037 inline VrmlData_IndexedLineSet ()
0038 : myArrPolygons (0L),
0039 myArrColorInd (0L),
0040 myNbPolygons (0),
0041 myNbColors (0),
0042 myColorPerVertex (Standard_True)
0043 {}
0044
0045
0046
0047
0048 inline VrmlData_IndexedLineSet (const VrmlData_Scene& theScene,
0049 const char * theName,
0050 const Standard_Boolean isColorPerVertex
0051 = Standard_True)
0052 : VrmlData_Geometry (theScene, theName),
0053 myArrPolygons (0L),
0054 myArrColorInd (0L),
0055 myNbPolygons (0),
0056 myNbColors (0),
0057 myColorPerVertex (isColorPerVertex)
0058 {}
0059
0060
0061
0062
0063 inline const Handle(VrmlData_Coordinate)&
0064 Coordinates () const { return myCoords; }
0065
0066
0067
0068
0069 inline void SetCoordinates (const Handle(VrmlData_Coordinate)& theCoord)
0070 { myCoords = theCoord; }
0071
0072
0073
0074
0075 inline const Handle(VrmlData_Color)&
0076 Colors () const { return myColors; }
0077
0078
0079
0080
0081 inline void SetColors (const Handle(VrmlData_Color)& theColors)
0082 { myColors = theColors; }
0083
0084
0085
0086
0087
0088
0089 inline size_t Polygons (const Standard_Integer**& arrPolygons) const
0090 { arrPolygons = myArrPolygons; return myNbPolygons; }
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101 inline Standard_Integer
0102 Polygon (const Standard_Integer iPolygon,
0103 const Standard_Integer *& outIndice)
0104 { return * (outIndice = myArrPolygons[iPolygon])++; }
0105
0106
0107
0108
0109 inline void SetPolygons (const Standard_Size nPolygons,
0110 const Standard_Integer ** thePolygons)
0111 { myNbPolygons = nPolygons; myArrPolygons = thePolygons; }
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122 inline size_t ArrayColorInd (const Standard_Integer**& arrColorInd) const
0123 { arrColorInd = myArrColorInd; return myNbColors; }
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137 Standard_EXPORT Quantity_Color
0138 GetColor (const Standard_Integer iFace,
0139 const Standard_Integer iVertex);
0140
0141
0142
0143
0144 inline void SetColorInd (const Standard_Size nIndice,
0145 const Standard_Integer ** theIndice)
0146 { myNbColors = nIndice; myArrColorInd = theIndice; }
0147
0148
0149
0150
0151 inline void SetColorPerVertex (const Standard_Boolean isColorPerVertex)
0152 { myColorPerVertex = isColorPerVertex; }
0153
0154
0155
0156
0157
0158 Standard_EXPORT virtual const Handle(TopoDS_TShape)&
0159 TShape () Standard_OVERRIDE;
0160
0161
0162
0163
0164
0165
0166 Standard_EXPORT virtual Handle(VrmlData_Node)
0167 Clone (const Handle(VrmlData_Node)& theOther)const Standard_OVERRIDE;
0168
0169
0170
0171
0172 Standard_EXPORT virtual VrmlData_ErrorStatus
0173 Read (VrmlData_InBuffer& theBuffer) Standard_OVERRIDE;
0174
0175
0176
0177
0178 Standard_EXPORT virtual VrmlData_ErrorStatus
0179 Write (const char * thePrefix) const Standard_OVERRIDE;
0180
0181
0182
0183
0184 Standard_EXPORT virtual Standard_Boolean
0185 IsDefault () const Standard_OVERRIDE;
0186
0187
0188 private:
0189
0190 Handle(VrmlData_Coordinate) myCoords;
0191 Handle(VrmlData_Color) myColors;
0192 const Standard_Integer ** myArrPolygons;
0193 const Standard_Integer ** myArrColorInd;
0194 Standard_Size myNbPolygons;
0195 Standard_Size myNbColors;
0196 Standard_Boolean myColorPerVertex;
0197
0198 public:
0199
0200 DEFINE_STANDARD_RTTIEXT(VrmlData_IndexedLineSet,VrmlData_Geometry)
0201 };
0202
0203
0204 DEFINE_STANDARD_HANDLE (VrmlData_IndexedLineSet, VrmlData_Geometry)
0205
0206
0207 #endif