File indexing completed on 2025-01-18 10:04:42
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef _RWGltf_GltfLatePrimitiveArray_HeaderFile
0016 #define _RWGltf_GltfLatePrimitiveArray_HeaderFile
0017
0018 #include <RWMesh_TriangulationSource.hxx>
0019
0020 #include <NCollection_Sequence.hxx>
0021 #include <RWGltf_GltfArrayType.hxx>
0022 #include <RWGltf_GltfPrimitiveMode.hxx>
0023 #include <Quantity_ColorRGBA.hxx>
0024
0025 class RWGltf_GltfPrimArrayData;
0026 class RWGltf_MaterialMetallicRoughness;
0027 class RWGltf_MaterialCommon;
0028
0029
0030 class RWGltf_GltfLatePrimitiveArray : public RWMesh_TriangulationSource
0031 {
0032 DEFINE_STANDARD_RTTIEXT(RWGltf_GltfLatePrimitiveArray, RWMesh_TriangulationSource)
0033 public:
0034
0035
0036 Standard_EXPORT RWGltf_GltfLatePrimitiveArray (const TCollection_AsciiString& theId,
0037 const TCollection_AsciiString& theName);
0038
0039
0040 Standard_EXPORT virtual ~RWGltf_GltfLatePrimitiveArray();
0041
0042
0043 const TCollection_AsciiString& Id() const { return myId; }
0044
0045
0046 const TCollection_AsciiString& Name() const { return myName; }
0047
0048
0049 void SetName (const TCollection_AsciiString& theName) { myName = theName; }
0050
0051
0052 RWGltf_GltfPrimitiveMode PrimitiveMode() const { return myPrimMode; }
0053
0054
0055 void SetPrimitiveMode (RWGltf_GltfPrimitiveMode theMode) { myPrimMode = theMode; }
0056
0057
0058 bool HasStyle() const { return !myMaterialPbr.IsNull() || !myMaterialCommon.IsNull(); }
0059
0060
0061 Standard_EXPORT Quantity_ColorRGBA BaseColor() const;
0062
0063
0064 const Handle(RWGltf_MaterialMetallicRoughness)& MaterialPbr() const { return myMaterialPbr; }
0065
0066
0067 void SetMaterialPbr (const Handle(RWGltf_MaterialMetallicRoughness)& theMat) { myMaterialPbr = theMat; }
0068
0069
0070 const Handle(RWGltf_MaterialCommon)& MaterialCommon() const { return myMaterialCommon; }
0071
0072
0073 void SetMaterialCommon (const Handle(RWGltf_MaterialCommon)& theMat) { myMaterialCommon = theMat; }
0074
0075
0076 const NCollection_Sequence<RWGltf_GltfPrimArrayData>& Data() const { return myData; }
0077
0078
0079 Standard_EXPORT RWGltf_GltfPrimArrayData& AddPrimArrayData (RWGltf_GltfArrayType theType);
0080
0081
0082
0083 virtual Standard_Boolean HasDeferredData() const Standard_OVERRIDE
0084 {
0085 return !myData.IsEmpty() && RWMesh_TriangulationSource::HasDeferredData();
0086 }
0087
0088
0089 Standard_EXPORT Handle(Poly_Triangulation) LoadStreamData() const;
0090
0091 protected:
0092
0093 NCollection_Sequence<RWGltf_GltfPrimArrayData> myData;
0094 Handle(RWGltf_MaterialMetallicRoughness) myMaterialPbr;
0095 Handle(RWGltf_MaterialCommon) myMaterialCommon;
0096 TCollection_AsciiString myId;
0097 TCollection_AsciiString myName;
0098 RWGltf_GltfPrimitiveMode myPrimMode;
0099
0100 };
0101
0102 #endif