DATAKIT SDK  V2026.2
3dxmlw.hpp
Go to the documentation of this file.
1 #ifndef _3DXMLW_HPP_
2 #define _3DXMLW_HPP_
3 
4 
5 //! \brief Exported APIs for 3dxml (.3dxml) Write Library
6 namespace _3dxmlw
7 {
8  //! \class WriteParameters
9  //! \brief This class provides several parameters to tunes 3dxml Writter.\n
10  //! It must be provided to addInstance3D method.
11  //! \code
12  //! //...
13  //! \endcode
15  {
16  protected:
21  public:
22  //! \BaseConstructor
24  {
25  }
26 
27  //! \BaseDestructor
29  {
30  }
31 
32  //! \brief Sets the blanked status for the written instance node.
33  //! \param [in] inBlanked : blanked status.
34  inline void SetBlankedStatus( const Dtk_Int32 inBlanked )
35  {
36  _Blanked = inBlanked;
37  }
38  //! \brief Retrieve the Written blanked status.
39  inline Dtk_Int32 GetBlankedStatus() const
40  {
41  return _Blanked;
42  }
43  //! \brief Sets the color for the written instance node.
44  //! \param [in] inColor : color.
45  inline void SetColor( const Dtk_RGB & inColor )
46  {
47  _Color = inColor;
48  }
49  //! \brief Retrieve the Written color.
50  inline Dtk_RGB GetColor() const
51  {
52  return _Color;
53  }
54  //! \brief Sets the curve type for the written instance node.
55  //! \param [in] inCurvetype : curve type.
56  inline void SetCurveType( Dtk_FontLineType inCurveType )
57  {
58  _CurveType = inCurveType;
59  }
60  //! \brief Retrieve the Written curve type.
62  {
63  return _CurveType;
64  }
65  //! \brief Sets the curve thickness for the written instance node.
66  //! \param [in] inCurveThickness : curve thickness.
67  inline void SetCurveThickness( Dtk_Double64 inCurveThickness )
68  {
69  _CurveThickness = inCurveThickness;
70  }
71  //! \brief Retrieve the Written curve thickness.
73  {
74  return _CurveThickness;
75  }
76  };
77 
78  //! \class WriteOptions
79  //! \brief This class provides several options to tune 3dxml Writer.\n
80  //! It must be provided to _3dxmlw::InitWrite method.
81  //! \code
82  //! //...
83  //! Dtk_string LogFile = L"MyLogFile.log";
84  //! _3dxmlw::WriteOptions 3DxmlOptions;
85  //! Dtk_ErrorStatus err = _3dxmlw::InitWrite( LogFile, 3DxmlOptions);
86  //! //...
87  //! \endcode
89  {
90  protected:
91 
92  public:
93  //! \BaseConstructor
95 
96  //! \BaseDestructor
98 
99  };
100 
101  //! \brief Initialize the 3dxmlw Writer
102  //! \return dtkNoError if it is OK.
103  //! \param [in] inOutputFile : Output file name
104  //! \param [in] inLogFile : Log file
105  //! \param [in] inOptions : Options
106  //! \remark This function is the first call for the writer, it must me called after Dtk_API::StartAPI(...)
107  DtkErrorStatus InitWrite(const Dtk_string& inOutputFile, const Dtk_string& inLogFile, WriteOptions& inOptions);
108 
109  //! \brief Creation of the output file and free the 3dxmlw Writer
110  //! \return dtkNoError if it is OK.
111  //! \remark used as the last function used for the writer.
113 
114  //! \brief Don't create a component already viewed. Is instantiate by an instance
115  //! \param [in] inCurrentChildId : Current child id
116  //! \return DTK_TRUE if component already exist.
117  //! \remark
119 
120  //! \brief Create Reference3D node
121  //! \param [in] inName : Node Name
122  //! \param [in] inComponentId : Component id
123  //! \param [in] inMetadata : metadata
124  //! \return
125  //! \remark : add only V_description
126  void addReference3D(const Dtk_string & inName, Dtk_ID inComponentId,Dtk_tab<Dtk_MetaDataPtr> & inMetadata);
127 
128  //! \brief Create ReferenceRep node
129  //! \param [in] inMesh : Mesh Array
130  //! \param [in] inName : Node Name
131  //! \param [in] inComponentId : Component id
132  //! \return
133  //! \remark
134  void addReferenceRep(const Dtk_tab<Dtk_MeshPtr> & inMesh, const Dtk_string & inName, Dtk_Size_t inComponentId);
135 
136  //! \brief Create Instance3D node
137  //! \param [in] inParentId : Parent id
138  //! \param [in] inChildId : Child id
139  //! \param [in] inMatrix : Instance matrix
140  //! \param [in] inInstanceName : Instance Name
141  //! \param [in] inMetadata : metadata
142  //! \param [in] inParameters : parameters
143  //! \return
144  //! \remark : add only V_description
145  void addInstance3D( Dtk_ID parentId,
146  Dtk_ID ref3dId,
147  const Dtk_transfo &matrix,
148  const Dtk_string &objectName,
149  Dtk_MetaDataPtr & inMetadata,
150  const WriteParameters & inParameters = WriteParameters() );
151 }
152 
153 #endif
Dtk_ID
uint32_t Dtk_ID
Definition: define.h:681
Dtk_transfo
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
_3dxmlw::WriteParameters::GetBlankedStatus
Dtk_Int32 GetBlankedStatus() const
Retrieve the Written blanked status.
Definition: 3dxmlw.hpp:39
_3dxmlw::WriteOptions::WriteOptions
WriteOptions()
Default constructor.
Definition: 3dxmlw.hpp:94
_3dxmlw::WriteOptions
This class provides several options to tune 3dxml Writer. It must be provided to _3dxmlw::InitWrite m...
Definition: 3dxmlw.hpp:89
_3dxmlw::WriteParameters::SetCurveThickness
void SetCurveThickness(Dtk_Double64 inCurveThickness)
Sets the curve thickness for the written instance node.
Definition: 3dxmlw.hpp:67
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:53
_3dxmlw::WriteParameters::GetCurveThickness
Dtk_Double64 GetCurveThickness() const
Retrieve the Written curve thickness.
Definition: 3dxmlw.hpp:72
Dtk_Size_t
size_t Dtk_Size_t
Definition: define.h:704
_3dxmlw::addInstance3D
void addInstance3D(Dtk_ID parentId, Dtk_ID ref3dId, const Dtk_transfo &matrix, const Dtk_string &objectName, Dtk_MetaDataPtr &inMetadata, const WriteParameters &inParameters=WriteParameters())
Create Instance3D node.
_3dxmlw::addReference3D
void addReference3D(const Dtk_string &inName, Dtk_ID inComponentId, Dtk_tab< Dtk_MetaDataPtr > &inMetadata)
Create Reference3D node.
Dtk_bool
char Dtk_bool
Definition: define.h:717
_3dxmlw::WriteParameters::~WriteParameters
~WriteParameters()
Destructor.
Definition: 3dxmlw.hpp:28
Dtk_Double64
double Dtk_Double64
Definition: define.h:691
_3dxmlw::WriteParameters::WriteParameters
WriteParameters()
Default constructor.
Definition: 3dxmlw.hpp:23
_3dxmlw::WriteOptions::~WriteOptions
~WriteOptions()
Destructor.
Definition: 3dxmlw.hpp:97
_3dxmlw::WriteParameters::GetCurveType
Dtk_FontLineType GetCurveType() const
Retrieve the Written curve type.
Definition: 3dxmlw.hpp:61
_3dxmlw::WriteParameters::_CurveThickness
Dtk_Double64 _CurveThickness
Definition: 3dxmlw.hpp:20
_3dxmlw::EndWrite
DtkErrorStatus EndWrite()
Creation of the output file and free the 3dxmlw Writer
_3dxmlw::WriteParameters::_Color
Dtk_RGB _Color
Definition: 3dxmlw.hpp:19
_3dxmlw::WriteParameters::SetColor
void SetColor(const Dtk_RGB &inColor)
Sets the color for the written instance node.
Definition: 3dxmlw.hpp:45
Dtk_Int32
int32_t Dtk_Int32
Definition: define.h:679
_3dxmlw::WriteParameters
This class provides several parameters to tunes 3dxml Writter. It must be provided to addInstance3D m...
Definition: 3dxmlw.hpp:15
_3dxmlw::WriteParameters::_CurveType
Dtk_FontLineType _CurveType
Definition: 3dxmlw.hpp:18
Dtk_ErrorStatus
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
_3dxmlw::isAlreadyAddComponent
Dtk_bool isAlreadyAddComponent(Dtk_ID inCurrentChildId)
Don't create a component already viewed. Is instantiate by an instance.
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
_3dxmlw::WriteParameters::SetBlankedStatus
void SetBlankedStatus(const Dtk_Int32 inBlanked)
Sets the blanked status for the written instance node.
Definition: 3dxmlw.hpp:34
_3dxmlw
Exported APIs for 3dxml (.3dxml) Write Library.
Definition: 3dxmlw.hpp:7
Dtk_FontLineType
Dtk_FontLineType
This is a set of line styles.
Definition: util_ent_dtk.hpp:45
DTK_NO_PATTERN
@ DTK_NO_PATTERN
Definition: util_ent_dtk.hpp:46
Dtk_tab
This is a high level array class.
Definition: util_stl_dtk.hpp:84
_3dxmlw::WriteParameters::_Blanked
Dtk_Int32 _Blanked
Definition: 3dxmlw.hpp:17
_3dxmlw::InitWrite
DtkErrorStatus InitWrite(const Dtk_string &inOutputFile, const Dtk_string &inLogFile, WriteOptions &inOptions)
Initialize the 3dxmlw Writer
_3dxmlw::WriteParameters::GetColor
Dtk_RGB GetColor() const
Retrieve the Written color.
Definition: 3dxmlw.hpp:50
_3dxmlw::addReferenceRep
void addReferenceRep(const Dtk_tab< Dtk_MeshPtr > &inMesh, const Dtk_string &inName, Dtk_Size_t inComponentId)
Create ReferenceRep node.
Dtk_RGB
Definition: dtk_rgb.hpp:7
_3dxmlw::WriteParameters::SetCurveType
void SetCurveType(Dtk_FontLineType inCurveType)
Sets the curve type for the written instance node.
Definition: 3dxmlw.hpp:56