DATAKIT API  V2025.1
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 
9 /*#include "header_dtk.hpp"
10 #include "util/dtk_maindoc.hpp"
11 #include "util/dtk_Reader.hpp"*/
12 
13 class CaddsReader : public Dtk_Reader
14 {
15  class caddsReader_Handle;
16 
17 protected:
18  //int _MainFileType;
19 
20  CaddsReader::caddsReader_Handle * _private;
21 
23 
24  void _Init();
25  void _Reset();
26 
28  Dtk_transfo father_matrix,
29  Dtk_MainDocPtr& inoutDocument,
30  Dtk_ComponentPtr& outComponent);
31  void _SetAsmInfos(const Dtk_string& inAsmIdCounter, Dtk_ComponentPtr& inoutComponent);
33  Dtk_bool _IsItFromAsm(const Dtk_string& inAsmId);
35  const Dtk_ComponentPtr& inComponent,
36  const Dtk_string& inAsmId,
37  Dtk_NodePtr& outRootNode);
39  const Dtk_ComponentPtr& inComponent,
40  const Dtk_string& inAsmId,
41  Dtk_NodePtr& outRootNode);
43  const Dtk_ComponentPtr& inComponent,
44  const Dtk_string& inAsmId,
45  Dtk_NodePtr& outRootNode);
47  const Dtk_ComponentPtr& inComponent,
48  const Dtk_string& inAsmId,
49  Dtk_NodePtr& outRootNode);
51  const Dtk_ComponentPtr& inComponent,
52  Dtk_NodePtr& outRootNode);
54  const Dtk_ComponentPtr& inComponent,
55  Dtk_NodePtr& outFatherNode);
56 
57  void _ProcessSuccessorAssemblyJoints(Dtk_MainDocPtr& inoutDocument,Dtk_ComponentPtr & outJointComponent,Dtk_string & outAssemblyJointsName ,Dtk_Int32 inPosCurrentTree,Dtk_Int32 inIdJoints, const Dtk_string & inComponentId,Dtk_Int32 inBlanked);
58  Dtk_ErrorStatus _ProcessCaddsComponentJoints(Dtk_MainDocPtr& inoutDocument,Dtk_ComponentPtr & outJointComponent,const Dtk_string & inComponentId,Dtk_Int32 inBlanked);
60  Dtk_ErrorStatus Cadds_InitPart(const Dtk_string& inInputFile,const Dtk_UUID & inUuid);
61  Dtk_ErrorStatus _StartFile( const Dtk_string& inInputFile,const Dtk_UUID & inUuid,int & outFileType);
62  void _EndFile();
64  //Mandatory
65 public:
66 
68 
69  virtual ~CaddsReader();
70 
71  static Dtk_bool Enable();
72 
73  Dtk_ErrorStatus CreateDocument(const Dtk_string& inInputFile, Dtk_MainDocPtr& outDocument);
74  Dtk_ErrorStatus GetFileVersion(const Dtk_string &inInputFile, Dtk_string& outVersion);
75 
77  const Dtk_string& inInputFile,
78  Dtk_MainDocPtr& inoutDocument,
79  Dtk_ComponentPtr& outRootComponent);
80  Dtk_ErrorStatus PopulateComponentsTree(const Dtk_tab< Dtk_StreamPtr >& inArrayStream, Dtk_MainDocPtr& inoutDocument, Dtk_ComponentPtr& outRootComponent );
82 
83 
85  const Dtk_ComponentPtr& inComponent,
86  Dtk_NodePtr& outRootNode);
87  //Dtk_ErrorStatus ReadEntity(const Dtk_ID& inEntityID, Dtk_EntityPtr& outEntity);
88  // Dtk_ErrorStatus ReadAdditionalInfos(const Dtk_ID &inEntityID,const Dtk_string &inEntityName,Dtk_ObjectPtr &outEntity);
95 
96 
98  void initRead();
99 
101 
103  void pushEntity(const unsigned long& thisMiptr,Dtk_EntityPtr& ent);
104  void storeCallbackResult(const unsigned long& thisMiptr,Dtk_EntityPtr outent);
105  void addExtractEntity(void* ThisEnt);
112 
114 
115  Dtk_EntityPtr readMiptr_val(const unsigned long& index);
116 
117  void acknowledge(const unsigned long& thisMiptr);
118  void isTopologic(const unsigned long& thisMiptr);
119 
120  Dtk_bool alreadyDone(const unsigned long& thisMiptr);
121 
128 
131 
133  const Dtk_string& datakitDirectory() const;
137  void ClearBodies();
140  void initDumpFile();
141  FILE* getDumpFile();
143 };
144 #endif
145 
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()
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:67
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()
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:22
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
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:14
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:15
CaddsReader::_ReadComponentWithCstRecursive
Dtk_ErrorStatus _ReadComponentWithCstRecursive(const Dtk_ComponentPtr &inComponent, Dtk_NodePtr &outFatherNode)
CaddsReader::readParametricAllowed
Dtk_bool & readParametricAllowed()
CaddsReader::getOtherEntitiesAsmComponent
void getOtherEntitiesAsmComponent()