DATAKIT API  V2025.1
RevitReader Class Referenceabstract
+ Inheritance diagram for RevitReader:

Public Types

enum  LevelOfDetail { ReaderGuessed = 0, Coarse = 1, Medium = 2, Detailed = 3 }
 

Public Member Functions

virtual Dtk_ErrorStatus _ReadConnectedEntity (const Dtk_NodeConnectorPtr &inConnector, Dtk_tab< Dtk_EntityPtr > &outEntity)
 
virtual Dtk_ErrorStatus ActivateReader ()=0
 
virtual Dtk_ErrorStatus CreateDocument (const Dtk_string &inInputFile, Dtk_MainDocPtr &outDocument)=0
 
virtual Dtk_ErrorStatus CreateDocumentGraphical (const Dtk_string &inInputFile, Dtk_MainDocPtr &outDocument)
 
virtual Dtk_ErrorStatus DesactivateReader ()=0
 
virtual Dtk_ErrorStatus EndComponent (Dtk_ComponentPtr &inComponent)=0
 
virtual Dtk_ErrorStatus EndPopulateComponentsTree ()=0
 
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)
 
virtual Dtk_ErrorStatus GetFileVersion (const Dtk_string &inInputFile, Dtk_string &outVersion)=0
 
virtual Dtk_Int32 GetVersion ()=0
 
virtual Dtk_ErrorStatus PopulateComponentsTree (const Dtk_string &inInputFile, Dtk_MainDocPtr &inoutDocument, Dtk_ComponentPtr &outRootComponent)=0
 
virtual Dtk_ErrorStatus PopulateComponentsTree (const Dtk_tab< Dtk_StreamPtr > &inArrayStream, Dtk_MainDocPtr &inoutDocument, Dtk_ComponentPtr &outRootComponent)=0
 
virtual Dtk_ErrorStatus ReadAdditionalInfos (Dtk_Node &inNode, Dtk_ObjectPtr &outEntity)=0
 
virtual Dtk_ErrorStatus ReadAdvancedFeature (Dtk_Node &inNode, Dtk_ObjectPtr &outEntity)
 
virtual Dtk_ErrorStatus ReadComponent (const Dtk_ComponentPtr &inComponent, Dtk_NodePtr &outRootNode)=0
 
virtual Dtk_ErrorStatus ReadComponentGraphic (const Dtk_ComponentPtr &inComponent, Dtk_GraphicalDataPtr &outGraphicalData)
 
virtual Dtk_ErrorStatus ReadEntity (Dtk_Node &inNode, Dtk_EntityPtr &outEntity)=0
 
virtual ~RevitReader ()=0
 

Static Public Member Functions

static Dtk_bool Enable ()
 
static void SetConfigLevelOfDetail (LevelOfDetail)
 Use to retrieve only geometry corresponding to a specific level of detail. By default, level of detail retrieved is the one set in default view ({3D}) or "Detailed" if no default view exists. More...
 
static void SetConfigReadLinkedModel (Dtk_bool)
 Use to enables reading of Revit Linked Models, which file should be located in the same folder as the main project. More...
 
static void SetConfigRevitOrderCompo (Dtk_Int32)
 Use to provide the same component organization as IFC or a flat one. By default, components are organized as in IFC. More...
 
static void SetConfigRevitReadMetadata (Dtk_bool)
 Use to able/disable reading of Revit properties. By default, properties reading is enabled. More...
 
static void SetConfigRevitReadViews (Dtk_bool)
 Use to able/disable reading of Revit 3d views. By default, view reading is enabled. More...
 
static void SetConfigRevitRealisticView (Dtk_bool)
 Use to render as in revit "Realistic" and "Texture" visual style for views (with textures). By default, texture reading is disabled (as in "Shaded" style). More...
 

Protected Member Functions

void _Init ()
 
void _Reset ()
 
Dtk_ErrorStatus _WriteInventoryInLogFile (Dtk_ID inID, int inNum, int *inCount, char **inEntitiesName)
 

Protected Attributes

Dtk_string _InputFile
 
FILE * _InputFilePtr
 

Member Enumeration Documentation

◆ LevelOfDetail

Enumerator
ReaderGuessed 
Coarse 
Medium 
Detailed 
12  {
13  ReaderGuessed = 0,
14  Coarse = 1,
15  Medium = 2,
16  Detailed = 3
17  };

Constructor & Destructor Documentation

◆ ~RevitReader()

virtual RevitReader::~RevitReader ( )
pure virtual

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()

◆ CreateDocument()

◆ CreateDocumentGraphical()

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

Reimplemented in ProeReader, and GltfReader.

◆ DesactivateReader()

◆ Enable()

static Dtk_bool RevitReader::Enable ( )
static

◆ EndComponent()

◆ EndPopulateComponentsTree()

◆ 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()

◆ GetVersion()

◆ PopulateComponentsTree() [1/2]

◆ PopulateComponentsTree() [2/2]

◆ ReadAdditionalInfos()

◆ ReadAdvancedFeature()

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

◆ ReadComponent()

◆ ReadComponentGraphic()

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

◆ ReadEntity()

◆ SetConfigLevelOfDetail()

static void RevitReader::SetConfigLevelOfDetail ( LevelOfDetail  )
static

Use to retrieve only geometry corresponding to a specific level of detail. By default, level of detail retrieved is the one set in default view ({3D}) or "Detailed" if no default view exists.

Parameters
Thedesired level of detail to be retrieved for geometry.
Warning
If no geometry is assigned to the level of detail chosen, the Body/Mesh contained in the node converted will be empty.

◆ SetConfigReadLinkedModel()

static void RevitReader::SetConfigReadLinkedModel ( Dtk_bool  )
static

Use to enables reading of Revit Linked Models, which file should be located in the same folder as the main project.

Parameters
DTK_TRUEto enables the feature, DTK_FALSE to only process the main model.

◆ SetConfigRevitOrderCompo()

static void RevitReader::SetConfigRevitOrderCompo ( Dtk_Int32  )
static

Use to provide the same component organization as IFC or a flat one. By default, components are organized as in IFC.

Parameters
DTK_TRUEto organize component as IFC (by Building, Level and element Category) or DTK_FALSE for flat organization.
Warning
please call it after Dtk_API initialization and before the Dtk_API::OpenDocument call.

◆ SetConfigRevitReadMetadata()

static void RevitReader::SetConfigRevitReadMetadata ( Dtk_bool  )
static

Use to able/disable reading of Revit properties. By default, properties reading is enabled.

Parameters
DTK_TRUEto read Revit properties or DTK_FALSE otherwise.
Warning
please call it after Dtk_API initialization and before the Dtk_API::OpenDocument call.

◆ SetConfigRevitReadViews()

static void RevitReader::SetConfigRevitReadViews ( Dtk_bool  )
static

Use to able/disable reading of Revit 3d views. By default, view reading is enabled.

Parameters
DTK_TRUEto read Revit views or DTK_FALSE otherwise.
Warning
please call it after Dtk_API initialization and before the Dtk_API::OpenDocument call.

◆ SetConfigRevitRealisticView()

static void RevitReader::SetConfigRevitRealisticView ( Dtk_bool  )
static

Use to render as in revit "Realistic" and "Texture" visual style for views (with textures). By default, texture reading is disabled (as in "Shaded" style).

Parameters
DTK_TRUEto render texture or DTK_FALSE otherwise.
Warning
please call it after Dtk_API initialization and before the Dtk_API::OpenDocument call.
Remarks
Texture files are searched in current folder and default Autodesk installation folder

Field Documentation

◆ _InputFile

Dtk_string Dtk_Reader::_InputFile
protectedinherited

◆ _InputFilePtr

FILE* Dtk_Reader::_InputFilePtr
protectedinherited
RevitReader::Detailed
@ Detailed
Definition: dtk_RevitReader.hpp:16
RevitReader::Medium
@ Medium
Definition: dtk_RevitReader.hpp:15
dtkErrorNotYetImplemented
@ dtkErrorNotYetImplemented
Definition: error_dtk.hpp:32
RevitReader::Coarse
@ Coarse
Definition: dtk_RevitReader.hpp:14
Dtk_DocElement::GetID
Dtk_ID GetID() const
Retrieves the Dtk_DocElement ID - read only -.
RevitReader::ReaderGuessed
@ ReaderGuessed
Definition: dtk_RevitReader.hpp:13
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