File indexing completed on 2026-05-02 08:23:54
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
0029 class VrmlData_IndexedLineSet : public VrmlData_Geometry
0030 {
0031 public:
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
0049 inline VrmlData_IndexedLineSet(const VrmlData_Scene& theScene,
0050 const char* theName,
0051 const Standard_Boolean isColorPerVertex = 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
0064 inline const Handle(VrmlData_Coordinate)& Coordinates() const { return myCoords; }
0065
0066
0067
0068
0069 inline void SetCoordinates(const Handle(VrmlData_Coordinate)& theCoord) { myCoords = theCoord; }
0070
0071
0072
0073
0074 inline const Handle(VrmlData_Color)& Colors() const { return myColors; }
0075
0076
0077
0078
0079 inline void SetColors(const Handle(VrmlData_Color)& theColors) { myColors = theColors; }
0080
0081
0082
0083
0084
0085
0086 inline size_t Polygons(const Standard_Integer**& arrPolygons) const
0087 {
0088 arrPolygons = myArrPolygons;
0089 return myNbPolygons;
0090 }
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101 inline Standard_Integer Polygon(const Standard_Integer iPolygon,
0102 const Standard_Integer*& outIndice)
0103 {
0104 return *(outIndice = myArrPolygons[iPolygon])++;
0105 }
0106
0107
0108
0109
0110 inline void SetPolygons(const Standard_Size nPolygons, const Standard_Integer** thePolygons)
0111 {
0112 myNbPolygons = nPolygons;
0113 myArrPolygons = thePolygons;
0114 }
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125 inline size_t ArrayColorInd(const Standard_Integer**& arrColorInd) const
0126 {
0127 arrColorInd = myArrColorInd;
0128 return myNbColors;
0129 }
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143 Standard_EXPORT Quantity_Color GetColor(const Standard_Integer iFace,
0144 const Standard_Integer iVertex);
0145
0146
0147
0148
0149 inline void SetColorInd(const Standard_Size nIndice, const Standard_Integer** theIndice)
0150 {
0151 myNbColors = nIndice;
0152 myArrColorInd = theIndice;
0153 }
0154
0155
0156
0157
0158 inline void SetColorPerVertex(const Standard_Boolean isColorPerVertex)
0159 {
0160 myColorPerVertex = isColorPerVertex;
0161 }
0162
0163
0164
0165
0166
0167 Standard_EXPORT virtual const Handle(TopoDS_TShape)& TShape() Standard_OVERRIDE;
0168
0169
0170
0171
0172
0173
0174 Standard_EXPORT virtual Handle(VrmlData_Node) Clone(const Handle(VrmlData_Node)& theOther) const
0175 Standard_OVERRIDE;
0176
0177
0178
0179
0180 Standard_EXPORT virtual VrmlData_ErrorStatus Read(VrmlData_InBuffer& theBuffer) Standard_OVERRIDE;
0181
0182
0183
0184
0185 Standard_EXPORT virtual VrmlData_ErrorStatus Write(const char* thePrefix) const Standard_OVERRIDE;
0186
0187
0188
0189
0190 Standard_EXPORT virtual Standard_Boolean IsDefault() const Standard_OVERRIDE;
0191
0192 private:
0193
0194 Handle(VrmlData_Coordinate) myCoords;
0195 Handle(VrmlData_Color) myColors;
0196 const Standard_Integer** myArrPolygons;
0197 const Standard_Integer** myArrColorInd;
0198 Standard_Size myNbPolygons;
0199 Standard_Size myNbColors;
0200 Standard_Boolean myColorPerVertex;
0201
0202 public:
0203
0204 DEFINE_STANDARD_RTTIEXT(VrmlData_IndexedLineSet, VrmlData_Geometry)
0205 };
0206
0207
0208 DEFINE_STANDARD_HANDLE(VrmlData_IndexedLineSet, VrmlData_Geometry)
0209
0210 #endif