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