DATAKIT API  V2025.1
StlReader Class Reference
+ Inheritance diagram for StlReader:

Public Member Functions

virtual Dtk_ErrorStatus _ReadConnectedEntity (const Dtk_NodeConnectorPtr &inConnector, Dtk_tab< Dtk_EntityPtr > &outEntity)
 
Dtk_ErrorStatus ActivateReader ()
 
Dtk_ErrorStatus CreateDocument (const Dtk_string &inInputFile, Dtk_MainDocPtr &outDocument)
 
virtual Dtk_ErrorStatus CreateDocumentGraphical (const Dtk_string &inInputFile, Dtk_MainDocPtr &outDocument)
 
Dtk_ErrorStatus DesactivateReader ()
 
Dtk_ErrorStatus EndComponent (Dtk_ComponentPtr &inComponent)
 
Dtk_ErrorStatus EndPopulateComponentsTree ()
 
virtual Dtk_ErrorStatus GetAssociatedEntities (Dtk_Node &inNode, Dtk_tab< Dtk_NodeConnectorPtr > &outAssociatedEntities)
 
virtual Dtk_ErrorStatus GetConnectorsPointingToThisComponent (Dtk_Component &inCompo, Dtk_tab< Dtk_NodeConnectorPtr > &outConnectedEntities)
 
virtual Dtk_ErrorStatus GetFilePreview (const Dtk_string &inInputFile, Dtk_PreviewPtr &outPreview)
 
Dtk_ErrorStatus GetFileVersion (const Dtk_string &inInputFile, Dtk_string &outVersion)
 
Dtk_Int32 GetVersion ()
 
void Inventory ()
 
Dtk_ErrorStatus PopulateComponentsTree (const Dtk_string &inInputFile, Dtk_MainDocPtr &inoutDocument, Dtk_ComponentPtr &outRootComponent)
 
Dtk_ErrorStatus PopulateComponentsTree (const Dtk_tab< Dtk_StreamPtr > &inArrayStream, Dtk_MainDocPtr &inoutDocument, Dtk_ComponentPtr &outRootComponent)
 
virtual Dtk_ErrorStatus ReadAdvancedFeature (Dtk_Node &inNode, Dtk_ObjectPtr &outEntity)
 
Dtk_ErrorStatus ReadComponent (const Dtk_ComponentPtr &inComponent, Dtk_NodePtr &outRootNode)
 
Dtk_ErrorStatus ReadComponentGraphic (const Dtk_ComponentPtr &inComponent, Dtk_GraphicalDataPtr &outGraphicalData)
 
Dtk_ErrorStatus ReadEntity (Dtk_Node &inNode, Dtk_EntityPtr &outEntity)
 
 StlReader ()
 
virtual ~StlReader ()
 

Static Public Member Functions

static Dtk_bool Enable ()
 
static StlReaderGetStlReader ()
 
static Dtk_bool OptimizeVertexStorage ()
 return status of vertice array optimization More...
 
static void OptimizeVertexStorage (const Dtk_bool inBval)
 Use to optimize size of vertice array. More...
 
static Dtk_bool ReadNormal ()
 return status of facet Normal from the STL file More...
 
static void ReadNormal (const Dtk_bool inBval)
 Use to read the facet Normal from the STL file. More...
 

Protected Member Functions

void _Init ()
 
void _Reset ()
 
Dtk_ErrorStatus _WriteInventoryInLogFile (Dtk_ID inID, int inNum, int *inCount, char **inEntitiesName)
 
Dtk_ErrorStatus ReadAdditionalInfos (Dtk_Node &inNode, Dtk_ObjectPtr &outEntity)
 

Protected Attributes

Dtk_string _InputFile
 
FILE * _InputFilePtr
 
Dtk_Handle * _Private
 

Static Protected Attributes

static StlReader_UniqueReader
 

Constructor & Destructor Documentation

◆ ~StlReader()

virtual StlReader::~StlReader ( )
virtual

◆ StlReader()

StlReader::StlReader ( )

Member Function Documentation

◆ _Init()

void Dtk_Reader::_Init ( )
protectedinherited

◆ _ReadConnectedEntity()

virtual Dtk_ErrorStatus Dtk_Reader::_ReadConnectedEntity ( const Dtk_NodeConnectorPtr inConnector,
Dtk_tab< Dtk_EntityPtr > &  outEntity 
)
virtualinherited

Reimplemented in GltfReader.

◆ _Reset()

void Dtk_Reader::_Reset ( )
protectedinherited

◆ _WriteInventoryInLogFile()

Dtk_ErrorStatus Dtk_Reader::_WriteInventoryInLogFile ( Dtk_ID  inID,
int  inNum,
int *  inCount,
char **  inEntitiesName 
)
protectedinherited

◆ ActivateReader()

Dtk_ErrorStatus StlReader::ActivateReader ( )
virtual

Implements Dtk_Reader.

◆ CreateDocument()

Dtk_ErrorStatus StlReader::CreateDocument ( const Dtk_string inInputFile,
Dtk_MainDocPtr outDocument 
)
virtual

Implements Dtk_Reader.

◆ CreateDocumentGraphical()

virtual Dtk_ErrorStatus Dtk_Reader::CreateDocumentGraphical ( const Dtk_string inInputFile,
Dtk_MainDocPtr outDocument 
)
virtualinherited

Reimplemented in ProeReader, and GltfReader.

◆ DesactivateReader()

Dtk_ErrorStatus StlReader::DesactivateReader ( )
virtual

Implements Dtk_Reader.

◆ Enable()

static Dtk_bool StlReader::Enable ( )
static

◆ EndComponent()

Dtk_ErrorStatus StlReader::EndComponent ( Dtk_ComponentPtr inComponent)
virtual

Implements Dtk_Reader.

◆ EndPopulateComponentsTree()

Dtk_ErrorStatus StlReader::EndPopulateComponentsTree ( )
virtual

Implements Dtk_Reader.

◆ GetAssociatedEntities()

virtual Dtk_ErrorStatus Dtk_Reader::GetAssociatedEntities ( Dtk_Node inNode,
Dtk_tab< Dtk_NodeConnectorPtr > &  outAssociatedEntities 
)
virtualinherited

Reimplemented in StepReader, SolidEdgeReader, ProeReader, JtReader, GltfReader, CreoviewReader, and BRepOccReader.

51  {
52  outAssociatedEntities.clear(); inNode.GetID(); return dtkErrorNotYetImplemented;};

◆ GetConnectorsPointingToThisComponent()

virtual Dtk_ErrorStatus Dtk_Reader::GetConnectorsPointingToThisComponent ( Dtk_Component inCompo,
Dtk_tab< Dtk_NodeConnectorPtr > &  outConnectedEntities 
)
virtualinherited

Reimplemented in StepReader, SolidEdgeReader, ProeReader, JtReader, GltfReader, CreoviewReader, and BRepOccReader.

53  {
54  outConnectedEntities.clear(); inCompo.GetID(); return dtkErrorNotYetImplemented;};

◆ GetFilePreview()

virtual Dtk_ErrorStatus Dtk_Reader::GetFilePreview ( const Dtk_string inInputFile,
Dtk_PreviewPtr outPreview 
)
virtualinherited

Reimplemented in SolidEdgeReader, ProeReader, and _3dmReader.

34  {DTK_UNUSED(inInputFile); outPreview = NULL; return dtkErrorNotYetImplemented;}

◆ GetFileVersion()

Dtk_ErrorStatus StlReader::GetFileVersion ( const Dtk_string inInputFile,
Dtk_string outVersion 
)
virtual

Implements Dtk_Reader.

◆ GetStlReader()

static StlReader* StlReader::GetStlReader ( )
static

◆ GetVersion()

Dtk_Int32 StlReader::GetVersion ( )
virtual

Implements Dtk_Reader.

◆ Inventory()

void StlReader::Inventory ( )

◆ OptimizeVertexStorage() [1/2]

static Dtk_bool StlReader::OptimizeVertexStorage ( )
static

return status of vertice array optimization

Warning
please call it after Dtk_API initialization and before the Dtk_API::CreateDocument call.
Remarks
This parameter is activ only if ReadNormal is FALSE

◆ OptimizeVertexStorage() [2/2]

static void StlReader::OptimizeVertexStorage ( const Dtk_bool  inBval)
static

Use to optimize size of vertice array.

Parameters
inBvalDTK_TRUE to optimize vertice array in a Mesh if 2 vertices are same coordinates they are same ID, if FALSE one VERTEX is one entry
Warning
please call it after Dtk_API initialization and before the Dtk_API::CreateDocument call.
Remarks
with STL ASCII file this parameter is activ only if ReadNormal is FALSE

◆ PopulateComponentsTree() [1/2]

Dtk_ErrorStatus StlReader::PopulateComponentsTree ( const Dtk_string inInputFile,
Dtk_MainDocPtr inoutDocument,
Dtk_ComponentPtr outRootComponent 
)
virtual

Implements Dtk_Reader.

◆ PopulateComponentsTree() [2/2]

Dtk_ErrorStatus StlReader::PopulateComponentsTree ( const Dtk_tab< Dtk_StreamPtr > &  inArrayStream,
Dtk_MainDocPtr inoutDocument,
Dtk_ComponentPtr outRootComponent 
)
virtual

Implements Dtk_Reader.

◆ ReadAdditionalInfos()

Dtk_ErrorStatus StlReader::ReadAdditionalInfos ( Dtk_Node inNode,
Dtk_ObjectPtr outEntity 
)
protectedvirtual

Implements Dtk_Reader.

◆ ReadAdvancedFeature()

virtual Dtk_ErrorStatus Dtk_Reader::ReadAdvancedFeature ( Dtk_Node inNode,
Dtk_ObjectPtr outEntity 
)
virtualinherited

◆ ReadComponent()

Dtk_ErrorStatus StlReader::ReadComponent ( const Dtk_ComponentPtr inComponent,
Dtk_NodePtr outRootNode 
)
virtual

Implements Dtk_Reader.

◆ ReadComponentGraphic()

Dtk_ErrorStatus StlReader::ReadComponentGraphic ( const Dtk_ComponentPtr inComponent,
Dtk_GraphicalDataPtr outGraphicalData 
)
virtual

Reimplemented from Dtk_Reader.

◆ ReadEntity()

Dtk_ErrorStatus StlReader::ReadEntity ( Dtk_Node inNode,
Dtk_EntityPtr outEntity 
)
virtual

Implements Dtk_Reader.

◆ ReadNormal() [1/2]

static Dtk_bool StlReader::ReadNormal ( )
static

return status of facet Normal from the STL file

Warning
please call it after Dtk_API initialization and before the Dtk_API::CreateDocument call.
Remarks
usually this value isn't correct in STL File, many viewers don't use this value and prefer to recompute facet normale from 3 vertices

◆ ReadNormal() [2/2]

static void StlReader::ReadNormal ( const Dtk_bool  inBval)
static

Use to read the facet Normal from the STL file.

Parameters
inBvalDTK_TRUE read the NORMAL value in file if FALSE we dont read this information
Warning
please call it after Dtk_API initialization and before the Dtk_API::CreateDocument call.
Remarks
usually this value isn't correct in STL File, many viewers don't use this value and prefer to recompute facet normale from 3 vertices

Field Documentation

◆ _InputFile

Dtk_string Dtk_Reader::_InputFile
protectedinherited

◆ _InputFilePtr

FILE* Dtk_Reader::_InputFilePtr
protectedinherited

◆ _Private

Dtk_Handle* StlReader::_Private
protected

◆ _UniqueReader

StlReader* StlReader::_UniqueReader
staticprotected
dtkErrorNotYetImplemented
@ dtkErrorNotYetImplemented
Definition: error_dtk.hpp:32
Dtk_DocElement::GetID
Dtk_ID GetID() const
Retrieves the Dtk_DocElement ID - read only -.
Dtk_tab::clear
void clear(int no_delete=0)
Resets the Dtk_tab content.
Definition: util_stl_dtk.hpp:351
DTK_UNUSED
#define DTK_UNUSED(a)
Definition: define.h:730