DATAKIT SDK  V2026.2
3mfw.hpp
Go to the documentation of this file.
1 #ifndef _3MFW_HPP_
2 #define _3MFW_HPP_
3 #include "def/define.h"
7 #include "util/error_dtk.hpp"
8 #include "util/util_ptr_dtk.hpp"
9 //! \defgroup 3mfw_utils 3mf Write Util Functions
10 //! \brief.
11 
12 //! \class Dtk_3MFWriter
13 //! \brief 3MF Writer main class.
14 //! \brief Exported APIs for 3mf (.3mf) Write Library
16 {
17 public:
18  //! \class WriteOptions
19  //! \brief This class provides several options to tune 3mf Writer.\n
20  //! It must be provided to _3mfw::InitWrite method.
21  //! \code
22  //! //...
23  //! Dtk_string LogFile = L"MyLogFile.log";
24  //! Objw::WriteOptions ObjOptions;
25  //! Dtk_ErrorStatus err = Objw::InitWrite( LogFile, ObjOptions);
26  //! //...
27  //! \endcode
29  {
30  public:
32  //! \BaseConstructor
34  {
36  }
37 
38  //! \BaseDestructor
40  {
41  }
42 
43  };
44 
45  //! \ingroup 3mfw_utils
46  //! \brief Constructor : Initialize the writer for a FBX File.
48 
49  //! \ingroup 3mfw_utils
50  //! \brief Destructor, Save the current work into a FBX file.
52 
53  //! \ingroup 3mfw_utils
54  //! \brief Initialize the 3mf Writer
55  //! \return dtkNoError if it is OK.
56  //! \param [in] inOutputFile : Output file name
57  //! \param [in] inLogFile : Log file
58  //! \param [in] inOptions : Options
59  //! \remark This function is the first call for the writer, it must me called after Dtk_API::StartAPI(...)
60  DtkErrorStatus InitWrite( const Dtk_string& inOutputFile, const Dtk_string& inLogFile, const WriteOptions& inOptions );
61 
62  //! \ingroup 3mfw_utils
63  //! \brief Creation of the output file and free the Obj Writer
64  //! \return dtkNoError if it is OK.
65  //! \remark used as the last function used for the writer.
67 
68  //! \ingroup 3mfw_utils
69  //! \brief Write the entity provided in parameter in a node.
70  //! \param [in] inEntity : The Entity to be written
71  //! \return dtkNoError if it is OK.
72  //! \remark This function is used to write entities (only Dtk_MeshPtr ) .
74 
75  //! \ingroup 3mfw_utils
76  //! \brief Open a new instance node for internal tree.
77  //! \return dtkNoError if ok.
78  //! \param [in] inInstanceName : Instance name
79  //! \param [in] inProtoID : provide a proto ID if you need to reinstanciate it later. Provide -1 if not.
80  //! \param [out] outWasAlreadyInstancied : gives back if this was reinstanciated (same ID given another time), in this case, previous prototype under instance is linker, you should just call CloseLastInstance.
81  //! \param [in] inTrans : Matrice to apply on the instance
82  //! \param [in] inRgb : Instance color (not yet supported)
84  Dtk_bool& outWasAlreadyInstancied, const Dtk_transfo& inTrans = Dtk_transfo(), const Dtk_RGB& inRgb = Dtk_RGB() );
85  //! \ingroup 3mfw_utils
86  //! \brief Close last instance node for internal tree. It should be called as many time as OpenInstance is called.
87  //! \return dtkNoError if ok.
89 
90 private:
91  // Anticopy methods.
93  {
94  }
95  Dtk_3MFWriter& operator=( const Dtk_3MFWriter& )
96  {
97  return *this;
98  }
99 
100 public:
101  // Internal data
102  void* m_p;
103 
104 };
105 
106 #endif
Dtk_transfo
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
Dtk_3MFWriter::WriteOptions::~WriteOptions
~WriteOptions()
Destructor.
Definition: 3mfw.hpp:39
Dtk_3MFWriter::Dtk_3MFWriter
Dtk_3MFWriter()
Constructor : Initialize the writer for a FBX File.
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:53
Dtk_3MFWriter::OpenInstance
Dtk_ErrorStatus OpenInstance(const Dtk_string &inInstanceName, Dtk_Int64 inProtoID, Dtk_bool &outWasAlreadyInstancied, const Dtk_transfo &inTrans=Dtk_transfo(), const Dtk_RGB &inRgb=Dtk_RGB())
Open a new instance node for internal tree.
Dtk_3MFWriter::~Dtk_3MFWriter
~Dtk_3MFWriter()
Destructor, Save the current work into a FBX file.
DTK_FALSE
#define DTK_FALSE
Definition: define.h:720
Dtk_bool
char Dtk_bool
Definition: define.h:717
Dtk_3MFWriter::CloseLastInstance
Dtk_ErrorStatus CloseLastInstance()
Close last instance node for internal tree. It should be called as many time as OpenInstance is calle...
Dtk_3MFWriter::InitWrite
DtkErrorStatus InitWrite(const Dtk_string &inOutputFile, const Dtk_string &inLogFile, const WriteOptions &inOptions)
Initialize the 3mf Writer
Dtk_Int64
int64_t Dtk_Int64
Definition: define.h:684
Dtk_3MFWriter::WriteOptions
This class provides several options to tune 3mf Writer. It must be provided to _3mfw::InitWrite metho...
Definition: 3mfw.hpp:29
Dtk_3MFWriter::WriteOptions::WriteOptions
WriteOptions()
Default constructor.
Definition: 3mfw.hpp:33
error_dtk.hpp
Dtk_ErrorStatus
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
Dtk_3MFWriter::WriteEntity
Dtk_ErrorStatus WriteEntity(const Dtk_EntityPtr &inEntity)
Write the entity provided in parameter in a node.
Dtk_SmartPtr< Dtk_Entity >
dtk_transfo.hpp
Dtk_3MFWriter
3MF Writer main class.
Definition: 3mfw.hpp:16
util_ptr_dtk.hpp
define.h
Dtk_3MFWriter::WriteOptions::m_OneMeshPerFace
Dtk_bool m_OneMeshPerFace
Definition: 3mfw.hpp:31
dtk_string.hpp
Dtk_3MFWriter::EndWrite
DtkErrorStatus EndWrite()
Creation of the output file and free the Obj Writer
catiav5w::inInstanceName
const Dtk_string & inInstanceName
Definition: catiav5w.hpp:621
dtk_rgb.hpp
Dtk_RGB
Definition: dtk_rgb.hpp:7
Dtk_3MFWriter::m_p
void * m_p
Definition: 3mfw.hpp:102