Warning, file /include/opencascade/RWObj_ObjWriterContext.hxx was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _RWObj_ObjWriterContext_HeaderFiler
0015 #define _RWObj_ObjWriterContext_HeaderFiler
0016
0017 #include <NCollection_Vec2.hxx>
0018
0019 #include <Standard_TypeDef.hxx>
0020
0021 #include <NCollection_Vec3.hxx>
0022
0023 #include <NCollection_Vec4.hxx>
0024
0025 #include <NCollection_Mat4.hxx>
0026 #include <TCollection_AsciiString.hxx>
0027 #include <NCollection_IndexedDataMap.hxx>
0028
0029
0030 class RWObj_ObjWriterContext
0031 {
0032 public:
0033
0034 Standard_EXPORT RWObj_ObjWriterContext(const TCollection_AsciiString& theName);
0035
0036
0037 Standard_EXPORT ~RWObj_ObjWriterContext();
0038
0039
0040 bool IsOpened() const { return myFile != nullptr; }
0041
0042
0043 Standard_EXPORT bool Close();
0044
0045
0046 bool HasNormals() const { return myHasNormals; }
0047
0048
0049 void SetNormals(const bool theHasNormals) { myHasNormals = theHasNormals; }
0050
0051
0052 bool HasTexCoords() const { return myHasTexCoords; }
0053
0054
0055 void SetTexCoords(const bool theHasTexCoords) { myHasTexCoords = theHasTexCoords; }
0056
0057
0058 Standard_EXPORT bool WriteHeader(
0059 const int theNbNodes,
0060 const int theNbElems,
0061 const TCollection_AsciiString& theMatLib,
0062 const NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>&
0063 theFileInfo);
0064
0065
0066 const TCollection_AsciiString& ActiveMaterial() const { return myActiveMaterial; }
0067
0068
0069 Standard_EXPORT bool WriteActiveMaterial(const TCollection_AsciiString& theMaterial);
0070
0071
0072 Standard_EXPORT bool WriteTriangle(const NCollection_Vec3<int>& theTri);
0073
0074
0075 Standard_EXPORT bool WriteQuad(const NCollection_Vec4<int>& theQuad);
0076
0077
0078 Standard_EXPORT bool WriteVertex(const NCollection_Vec3<float>& theValue);
0079
0080
0081 Standard_EXPORT bool WriteNormal(const NCollection_Vec3<float>& theValue);
0082
0083
0084 Standard_EXPORT bool WriteTexCoord(const NCollection_Vec2<float>& theValue);
0085
0086
0087 Standard_EXPORT bool WriteGroup(const TCollection_AsciiString& theValue);
0088
0089
0090 Standard_EXPORT void FlushFace(int theNbNodes);
0091
0092 public:
0093 int NbFaces;
0094
0095 private:
0096 FILE* myFile;
0097 TCollection_AsciiString myName;
0098 TCollection_AsciiString myActiveMaterial;
0099 NCollection_Vec4<int> myElemPosFirst;
0100 NCollection_Vec4<int> myElemNormFirst;
0101 NCollection_Vec4<int> myElemUVFirst;
0102 bool myHasNormals;
0103 bool myHasTexCoords;
0104 };
0105
0106 #endif