DATAKIT API  V2025.3
dtk_CaddsReader.hpp
Go to the documentation of this file.
1 #ifndef _UTIL_CADDS_READER_HPP_
2 #define _UTIL_CADDS_READER_HPP_
3 
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <signal.h>
7 #include <string.h>
8 #include "util/dtk_reader.hpp"
9 #include "def/define.h"
11 #include "util/dtk_maindoc_ptr.hpp"
13 #include "util/error_dtk.hpp"
15 
16 class CaddsReader : public Dtk_Reader
17 {
18  class caddsReader_Handle;
19 
20 protected:
21  //int _MainFileType;
22 
23  CaddsReader::caddsReader_Handle * _private;
24 
26 
27  void _Init();
28  void _Reset();
29 
31  Dtk_transfo father_matrix,
32  Dtk_MainDocPtr& inoutDocument,
33  Dtk_ComponentPtr& outComponent);
34  void _SetAsmInfos(const Dtk_string& inAsmIdCounter, Dtk_ComponentPtr& inoutComponent);
36  Dtk_bool _IsItFromAsm(const Dtk_string& inAsmId);
38  const Dtk_ComponentPtr& inComponent,
39  const Dtk_string& inAsmId,
40  Dtk_NodePtr& outRootNode);
42  const Dtk_ComponentPtr& inComponent,
43  const Dtk_string& inAsmId,
44  Dtk_NodePtr& outRootNode);
46  const Dtk_ComponentPtr& inComponent,
47  const Dtk_string& inAsmId,
48  Dtk_NodePtr& outRootNode);
50  const Dtk_ComponentPtr& inComponent,
51  const Dtk_string& inAsmId,
52  Dtk_NodePtr& outRootNode);
54  const Dtk_ComponentPtr& inComponent,
55  Dtk_NodePtr& outRootNode);
57  const Dtk_ComponentPtr& inComponent,
58  Dtk_NodePtr& outFatherNode);
59 
60  void _ProcessSuccessorAssemblyJoints(Dtk_MainDocPtr& inoutDocument,Dtk_ComponentPtr & outJointComponent,Dtk_string & outAssemblyJointsName ,Dtk_Int32 inPosCurrentTree,Dtk_Int32 inIdJoints, const Dtk_string & inComponentId,Dtk_Int32 inBlanked);
61  Dtk_ErrorStatus _ProcessCaddsComponentJoints(Dtk_MainDocPtr& inoutDocument,Dtk_ComponentPtr & outJointComponent,const Dtk_string & inComponentId,Dtk_Int32 inBlanked);
63  Dtk_ErrorStatus Cadds_InitPart(const Dtk_string& inInputFile,const Dtk_UUID & inUuid);
64  Dtk_ErrorStatus _StartFile( const Dtk_string& inInputFile,const Dtk_UUID & inUuid,int & outFileType);
65  void _EndFile();
67  //Mandatory
68 public:
69 
71 
72  virtual ~CaddsReader();
73 
74  static Dtk_bool Enable();
75 
76  Dtk_ErrorStatus CreateDocument(const Dtk_string& inInputFile, Dtk_MainDocPtr& outDocument);
77  Dtk_ErrorStatus GetFileVersion(const Dtk_string &inInputFile, Dtk_string& outVersion);
78 
80  const Dtk_string& inInputFile,
81  Dtk_MainDocPtr& inoutDocument,
82  Dtk_ComponentPtr& outRootComponent);
83  Dtk_ErrorStatus PopulateComponentsTree(const Dtk_tab< Dtk_StreamPtr >& inArrayStream, Dtk_MainDocPtr& inoutDocument, Dtk_ComponentPtr& outRootComponent );
85 
86 
88  const Dtk_ComponentPtr& inComponent,
89  Dtk_NodePtr& outRootNode);
90  //Dtk_ErrorStatus ReadEntity(const Dtk_ID& inEntityID, Dtk_EntityPtr& outEntity);
91  // Dtk_ErrorStatus ReadAdditionalInfos(const Dtk_ID &inEntityID,const Dtk_string &inEntityName,Dtk_ObjectPtr &outEntity);
98 
99 
101  void initRead();
102 
104 
106  void pushEntity(const unsigned long& thisMiptr,Dtk_EntityPtr& ent);
107  void storeCallbackResult(const unsigned long& thisMiptr,Dtk_EntityPtr outent);
108  void addExtractEntity(void* ThisEnt);
115 
117 
118  Dtk_EntityPtr readMiptr_val(const unsigned long& index);
119 
120  void acknowledge(const unsigned long& thisMiptr);
121  void isTopologic(const unsigned long& thisMiptr);
122 
123  Dtk_bool alreadyDone(const unsigned long& thisMiptr);
124 
131 
134 
136  const Dtk_string& datakitDirectory() const;
140  void ClearBodies();
143  void initDumpFile();
144  FILE* getDumpFile();
146 };
147 #endif
148 
CaddsReader::processTopology
Dtk_bool processTopology()
CaddsReader::DesactivateReader
Dtk_ErrorStatus DesactivateReader()
CaddsReader::errorValue
Dtk_ErrorStatus & errorValue()
CaddsReader::_ProcessSuccessorAssemblyJoints
void _ProcessSuccessorAssemblyJoints(Dtk_MainDocPtr &inoutDocument, Dtk_ComponentPtr &outJointComponent, Dtk_string &outAssemblyJointsName, Dtk_Int32 inPosCurrentTree, Dtk_Int32 inIdJoints, const Dtk_string &inComponentId, Dtk_Int32 inBlanked)
CaddsReader::EndPopulateComponentsTree
Dtk_ErrorStatus EndPopulateComponentsTree()
CaddsReader::_ReadDrawingInComponent
Dtk_ErrorStatus _ReadDrawingInComponent(const Dtk_ComponentPtr &inComponent, const Dtk_string &inAsmId, Dtk_NodePtr &outRootNode)
Dtk_transfo
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
CaddsReader::CADDSUnitScale
Dtk_Double64 & CADDSUnitScale()
CaddsReader::datakitDirectory
const Dtk_string & datakitDirectory() const
CaddsReader::initRead
void initRead()
CaddsReader::ActivateReader
Dtk_ErrorStatus ActivateReader()
CaddsReader::CAMUComponents
Dtk_ComponentPtr & CAMUComponents(const Dtk_string &)
CaddsReader::ReadEntity
Dtk_ErrorStatus ReadEntity(Dtk_Node &inNode, Dtk_EntityPtr &outEntity)
CaddsReader::_ProcessCaddsComponentJoints
Dtk_ErrorStatus _ProcessCaddsComponentJoints(Dtk_MainDocPtr &inoutDocument, Dtk_ComponentPtr &outJointComponent, const Dtk_string &inComponentId, Dtk_Int32 inBlanked)
CaddsReader::pushEntity
void pushEntity(const unsigned long &thisMiptr, Dtk_EntityPtr &ent)
CaddsReader::_ReadBodiesInComponent
Dtk_ErrorStatus _ReadBodiesInComponent(const Dtk_ComponentPtr &inComponent, const Dtk_string &inAsmId, Dtk_NodePtr &outRootNode)
Dtk_Reader
Definition: dtk_reader.hpp:15
CaddsReader::Cadds_EndPart
Dtk_ErrorStatus Cadds_EndPart()
Dtk_UInt32
uint32_t Dtk_UInt32
Definition: define.h:688
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:58
CaddsReader::processTopologyAsmComponent
Dtk_bool processTopologyAsmComponent()
CaddsReader::entityIsRead
Dtk_bool entityIsRead()
CaddsReader::EndComponent
Dtk_ErrorStatus EndComponent(Dtk_ComponentPtr &inComponent)
Dtk_UUID
Definition: dtk_uuid.hpp:8
CaddsReader::readMiptr_val
Dtk_EntityPtr readMiptr_val(const unsigned long &index)
CaddsReader::nbExtracted
Dtk_UInt32 nbExtracted()
CaddsReader::_InitComponent
Dtk_ErrorStatus _InitComponent(const Dtk_ComponentPtr &inComponent, const Dtk_string &inAsmId, Dtk_NodePtr &outRootNode)
CaddsReader::CreateDocument
Dtk_ErrorStatus CreateDocument(const Dtk_string &inInputFile, Dtk_MainDocPtr &outDocument)
Dtk_bool
char Dtk_bool
Definition: define.h:725
CaddsReader::getOtherEntities
void getOtherEntities()
CaddsReader::pushEntity
void pushEntity(Dtk_EntityPtr &ent)
CaddsReader::currentFileName
Dtk_string & currentFileName()
CaddsReader::resultBodies
Dtk_tab< Dtk_EntityPtr > resultBodies()
CaddsReader::Enable
static Dtk_bool Enable()
CaddsReader::ReadComponent
Dtk_ErrorStatus ReadComponent(const Dtk_ComponentPtr &inComponent, Dtk_NodePtr &outRootNode)
Dtk_Double64
double Dtk_Double64
Definition: define.h:699
CaddsReader::isTopologic
void isTopologic(const unsigned long &thisMiptr)
CaddsReader::initDumpFile
void initDumpFile()
CaddsReader::readAllEntities
void readAllEntities()
CaddsReader::_EndFile
void _EndFile()
dtk_uuid.hpp
CaddsReader::extractReadBody
void extractReadBody(Dtk_tab< Dtk_EntityPtr > &outBody)
CaddsReader::ClearBodies
void ClearBodies()
CaddsReader::GetVersion
Dtk_Int32 GetVersion()
CaddsReader::readVisibility
Dtk_Short16 & readVisibility()
CaddsReader::_ReadFdtInComponent
Dtk_ErrorStatus _ReadFdtInComponent(const Dtk_ComponentPtr &inComponent, const Dtk_string &inAsmId, Dtk_NodePtr &outRootNode)
Dtk_Node
This is the Node Class The Dtk_Node object is used to retrieve informations in a Dtk_ComponentPtr obj...
Definition: dtk_maindoc.hpp:230
CaddsReader::PopulateComponentsTree
Dtk_ErrorStatus PopulateComponentsTree(const Dtk_tab< Dtk_StreamPtr > &inArrayStream, Dtk_MainDocPtr &inoutDocument, Dtk_ComponentPtr &outRootComponent)
Dtk_Int32
int32_t Dtk_Int32
Definition: define.h:687
CaddsReader::GetInstance
static CaddsReader * GetInstance()
Definition: dtk_CaddsReader.hpp:70
dtk_maindoc_ptr.hpp
CaddsReader::CaddsReader
CaddsReader()
CaddsReader::datakitDirectory
Dtk_string & datakitDirectory()
CaddsReader::_IsItFromAsm
Dtk_bool _IsItFromAsm(const Dtk_string &inAsmId)
CaddsReader::readOnlyWireFrame
Dtk_bool & readOnlyWireFrame()
CaddsReader::readOnlyGeometry
Dtk_bool & readOnlyGeometry()
error_dtk.hpp
Dtk_ErrorStatus
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
CaddsReader::extractEntityIsRead
Dtk_bool extractEntityIsRead()
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
CaddsReader::setReadBody
void setReadBody(Dtk_tab< Dtk_EntityPtr > &thisBody)
CaddsReader::_Init
void _Init()
CaddsReader::_ReaderInstance
static CaddsReader * _ReaderInstance
Definition: dtk_CaddsReader.hpp:25
dtk_transfo.hpp
CaddsReader::Cadds_InitPart
Dtk_ErrorStatus Cadds_InitPart(const Dtk_string &inInputFile, const Dtk_UUID &inUuid)
CaddsReader::isCAMU
Dtk_bool & isCAMU()
CaddsReader::~CaddsReader
virtual ~CaddsReader()
CaddsReader::alreadyDone
Dtk_bool alreadyDone(const unsigned long &thisMiptr)
CaddsReader::_ProcessCaddsComponent
Dtk_ErrorStatus _ProcessCaddsComponent(const Dtk_string &InIdFile, Dtk_transfo father_matrix, Dtk_MainDocPtr &inoutDocument, Dtk_ComponentPtr &outComponent)
CaddsReader::addExtractEntity
void addExtractEntity(void *ThisEnt)
Dtk_Short16
int16_t Dtk_Short16
Definition: define.h:690
define.h
CaddsReader::filterDrawing
Dtk_bool & filterDrawing()
CaddsReader::PopulateComponentsTree
Dtk_ErrorStatus PopulateComponentsTree(const Dtk_string &inInputFile, Dtk_MainDocPtr &inoutDocument, Dtk_ComponentPtr &outRootComponent)
Dtk_tab
This is a high level array class.
Definition: util_stl_dtk.hpp:85
CaddsReader::_GetAsmInfos
Dtk_string _GetAsmInfos(const Dtk_ComponentPtr &inComponent)
CaddsReader::storeCallbackResult
void storeCallbackResult(const unsigned long &thisMiptr, Dtk_EntityPtr outent)
CaddsReader::ReadAdditionalInfos
Dtk_ErrorStatus ReadAdditionalInfos(Dtk_Node &inNode, Dtk_ObjectPtr &outEntity)
CaddsReader::_StartFile
Dtk_ErrorStatus _StartFile(const Dtk_string &inInputFile, const Dtk_UUID &inUuid, int &outFileType)
CaddsReader::_SetAsmInfos
void _SetAsmInfos(const Dtk_string &inAsmIdCounter, Dtk_ComponentPtr &inoutComponent)
CaddsReader::_Reset
void _Reset()
CaddsReader
Definition: dtk_CaddsReader.hpp:17
dtk_string.hpp
dtk_reader.hpp
CaddsReader::readCamuAllowed
Dtk_bool & readCamuAllowed()
CaddsReader::acknowledge
void acknowledge(const unsigned long &thisMiptr)
CaddsReader::extractedEntity
void * extractedEntity()
CaddsReader::getDumpFile
FILE * getDumpFile()
CaddsReader::GetFileVersion
Dtk_ErrorStatus GetFileVersion(const Dtk_string &inInputFile, Dtk_string &outVersion)
CaddsReader::_ReadComponentWithCst
Dtk_ErrorStatus _ReadComponentWithCst(const Dtk_ComponentPtr &inComponent, Dtk_NodePtr &outRootNode)
CaddsReader::_private
CaddsReader::caddsReader_Handle * _private
Definition: dtk_CaddsReader.hpp:18
CaddsReader::_ReadComponentWithCstRecursive
Dtk_ErrorStatus _ReadComponentWithCstRecursive(const Dtk_ComponentPtr &inComponent, Dtk_NodePtr &outFatherNode)
CaddsReader::readParametricAllowed
Dtk_bool & readParametricAllowed()
CaddsReader::getOtherEntitiesAsmComponent
void getOtherEntitiesAsmComponent()