CFx SDK Documentation  2020SP3
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
OdDAI::Model Class Referenceabstract

#include <daiModel.h>

Inheritance diagram for OdDAI::Model:
OdDAI::SessionInstance OdRxObject OdIfc::OdIfcModel

Public Member Functions

 ODRX_DECLARE_MEMBERS (Model)
 
 Model ()
 
void initialize (const OdAnsiString &schemaName)
 
void initialize (OdDAI::SchemaPtr schema)
 
OdAnsiString name () const
 
Repositoryrepository () const
 
void RenameModel (const OdAnsiString &modelName)
 
const OdDAI::Entity * getEntityDefinition (const char *entityName) const
 
const OdDAI::SchemaPtr underlyingSchema () const
 
const OdAnsiString & underlyingSchemaName () const
 
OdDAIObjectId getEntityInstance (const OdDbHandle &h)
 
EntityInstancePtr createEntityInstance (const OdDAI::EntityPtr &entityDef)
 
EntityInstancePtr createEntityInstance (const char *entityTypeName)
 
OdDAIObjectId appendEntityInstance (EntityInstancePtr pInst)
 
OdDAIObjectId insertEntityInstance (EntityInstancePtr pInstanceToInsert, const OdDbHandle &insertHandle)
 
OdDAI::InstanceIteratorPtr newIterator ()
 
OdDAIObjectIdAggrgetEntityExtent (EntityPtr entityDef) const
 
OdDAIObjectIds getEntityExtent (const char *entityName) const
 
SdaiAccessMode mode () const
 
void closeModel ()
 
void closeModel () const
 
void PromoteModelToReadWrite () const
 
- Public Member Functions inherited from OdDAI::SessionInstance
 ODRX_DECLARE_MEMBERS (SessionInstance)
 
- Public Member Functions inherited from OdRxObject
 ODRX_HEAP_OPERATORS ()
 
 OdRxObject ()
 
virtual ~OdRxObject ()
 
virtual OdRxObjectqueryX (const OdRxClass *pClass) const
 
virtual OdRxObjectx (const OdRxClass *pClass) const
 
virtual OdRxClassisA () const
 
virtual void addRef ()=0
 
virtual void release ()=0
 
virtual long numRefs () const
 
bool isKindOf (const OdRxClass *pClass) const
 
virtual OdRxObjectPtr clone () const
 
virtual void copyFrom (const OdRxObject *pSource)
 
virtual OdRx::Ordering comparedTo (const OdRxObject *pOther) const
 
virtual bool isEqualTo (const OdRxObject *pOther) const
 

Protected Member Functions

OdResult in (OdDAI::OdSpfFilerBasePtr &rdFiler)
 
void out (OdDAI::OdSpfFilerBasePtr &wrFiler)
 
void name (const OdAnsiString &name)
 
void repository (Repository *repo)
 
ModelContentsPtr createModelContents (const OdAnsiString &schemaName)
 
OdDAI::SchemaPtr getSchemaDef (const OdAnsiString &schemaName)
 
virtual void subInitialize ()=0
 

Protected Attributes

OdAnsiString m_name
 
SchemaPtr m_underlyingSchema
 
SchemaModulePtr m_schemaModule
 
ModelContentsPtr m_contents
 
Repositorym_repository
 

Friends

class Repository
 

Additional Inherited Members

- Static Public Member Functions inherited from OdRxObject
static OdRxObjectPtr cast (const OdRxObject *pointer)
 
static OdRxClassdesc ()
 

Detailed Description

A class that implements functionality for working with models.

Definition at line 62 of file daiModel.h.

Constructor & Destructor Documentation

◆ Model()

OdDAI::Model::Model ( )

Member Function Documentation

◆ appendEntityInstance()

OdDAIObjectId OdDAI::Model::appendEntityInstance ( EntityInstancePtr  pInst)

Appends a newly created entity instance to the model.

Parameters
pInst[in] A smart pointer to the entity instance to be appended.
Returns
Returns an <link OdDAIObjectId, OdDAI object identifier> of the appended entity instance.
Remarks
If the specified entity has been already appended to the model, the method returns the existing entity's identifier; if the specified entity belongs to another model, the method returns a null identifier (the isNull() method of the identifier object returns true).

◆ closeModel() [1/2]

void OdDAI::Model::closeModel ( )

Function shall end access to the specified SDAI-model.

◆ closeModel() [2/2]

void OdDAI::Model::closeModel ( ) const

Function shall end access to the specified SDAI-model.

◆ createEntityInstance() [1/2]

EntityInstancePtr OdDAI::Model::createEntityInstance ( const char *  entityTypeName)

Creates a new instance of a specified entity type.

Parameters
entityTypeName[in] A string that contains the type name of the new entity to be created.
Returns
Returns a smart pointer to the created entity instance.
Remarks
If the current schema does not support the specified type, the method returns a NULL smart pointer. In this case the isNull() method of the smart pointer object returns true. The created entity is not attached to the model.

◆ createEntityInstance() [2/2]

EntityInstancePtr OdDAI::Model::createEntityInstance ( const OdDAI::EntityPtr &  entityDef)

Creates a new instance of a specified entity type.

Parameters
entityDef[in] entity definition that contains the type name of the new entity to be created.
Returns
Returns a smart pointer to the created entity instance.
Remarks
If the current schema does not support the specified type, the method returns a NULL smart pointer. In this case the isNull() method of the smart pointer object returns true. The created entity is not attached to the model.

◆ createModelContents()

ModelContentsPtr OdDAI::Model::createModelContents ( const OdAnsiString &  schemaName)
protected

◆ getEntityDefinition()

const OdDAI::Entity* OdDAI::Model::getEntityDefinition ( const char *  entityName) const

Retrieves an entity definition by its name.

Parameters
entityName[in] The name of an entity definition.
Returns
Returns a raw pointer to the entity definition.
Remarks
If there is no entity definition with the specified name, the method returns a NULL pointer.

◆ getEntityExtent() [1/2]

OdDAIObjectIds OdDAI::Model::getEntityExtent ( const char *  entityName) const

Retrieves the collection of entities with the same type (entity's extent) as the entity with a specified name. The entity collection is represented with an array of OdDAI objects identifiers.

Parameters
entityName[in] An entity's name.
Returns
Returns an array of identifiers of OdDAI objects that represent the extent collection.
Remarks
The method returns identifiers of all entities for which the <link OdIfc::OdIfcEntity::isKindOf@OdIfcEntityType@const, isKindOf()> method returns the same value as for the specified entity.

◆ getEntityExtent() [2/2]

OdDAIObjectIdAggr* OdDAI::Model::getEntityExtent ( EntityPtr  entityDef) const

Retrieves the collection of entity instances with entity type which is kind of entityName.

Parameters
entityName[in] An entity's name.
Returns
Returns a smart pointer to entity extent that keeps the collection of entity instances.

Retrieves the collection of entity instances with entity type which is subtype of entityDef.

Parameters
entityDef[in] An smart pointer to entity definition.
Returns
Returns a smart pointer to entity extent that keeps the collection of entity instances.

◆ getEntityInstance()

OdDAIObjectId OdDAI::Model::getEntityInstance ( const OdDbHandle h)

Searches the entity in the model by its handle.

Parameters
h[in] A handle of the searched entity.
Returns
Returns the <link OdDAIObjectId, identifier of an OdDAI object> if the entity was found; otherwise, the method returns a NULL identifier.

◆ getSchemaDef()

OdDAI::SchemaPtr OdDAI::Model::getSchemaDef ( const OdAnsiString &  schemaName)
protected

◆ in()

OdResult OdDAI::Model::in ( OdDAI::OdSpfFilerBasePtr rdFiler)
protected

Saves the model content and returns an IFC filer object that is created during the save operation.

Parameters
wrFiler[in] A smart pointer to an IFC filer object.

◆ initialize() [1/2]

void OdDAI::Model::initialize ( const OdAnsiString &  schemaName)

Initializes the model object and creates a minimal model hierarchy based on a schema with the specified name.

Parameters
ifcSchema[in] A string that contains the schema's name.

◆ initialize() [2/2]

void OdDAI::Model::initialize ( OdDAI::SchemaPtr  schema)

Initializes the model object and creates a minimal model hierarchy based on a schema with the specified name.

Parameters
ifcSchema[in] A string that contains the schema's name.
pFiler[in] A smart pointer to an IFC filer object that is created during the initialization operation.

◆ insertEntityInstance()

OdDAIObjectId OdDAI::Model::insertEntityInstance ( EntityInstancePtr  pInstanceToInsert,
const OdDbHandle insertHandle 
)

Inserts a newly created entity instance to the model.

Parameters
pInstanceToInsert[in] A smart pointer to the entity instance to be inserted.
insertHandle[in] A handle of the parent object where to insert the entity instance.
Returns
Returns an identifier of the inserted entity instance.
Remarks
If the entity being inserted already belongs to another model or it has been already appended or inserted before, the method returns a NULL object identifier. If the specified database handle already exists in the model, the entity defined with this handle gets a new handle value and the inserted entity (specified with the pInstanceToInsert parameter) takes the passed handle value (the insertHandle parameter value).

◆ mode()

SdaiAccessMode OdDAI::Model::mode ( ) const

Get access mode for an SDAI-model

Returns
Returns current access mode.

◆ name() [1/2]

OdAnsiString OdDAI::Model::name ( ) const
inline

Definition at line 89 of file daiModel.h.

◆ name() [2/2]

void OdDAI::Model::name ( const OdAnsiString &  name)
inlineprotected

Definition at line 244 of file daiModel.h.

◆ newIterator()

OdDAI::InstanceIteratorPtr OdDAI::Model::newIterator ( )

Creates an iterator to get sequential access to all entities of the model.

Returns
Returns a smart pointer to the model's instance iterator.

◆ ODRX_DECLARE_MEMBERS()

OdDAI::Model::ODRX_DECLARE_MEMBERS ( Model  )

◆ out()

void OdDAI::Model::out ( OdDAI::OdSpfFilerBasePtr wrFiler)
protected

Saves the model content and returns an IFC filer object that is created during the save operation.

Parameters
wrFiler[in] A smart pointer to an IFC filer object.

◆ PromoteModelToReadWrite()

void OdDAI::Model::PromoteModelToReadWrite ( ) const

Function shall change the access mode of the specified SDAI-model from readonly to read-write.

◆ RenameModel()

void OdDAI::Model::RenameModel ( const OdAnsiString &  modelName)

Function shall assign a new name to the specified SDAI-model.

Parameters
modelName[in] new name of SDAI-model.

◆ repository() [1/2]

Repository* OdDAI::Model::repository ( ) const
inline

Definition at line 95 of file daiModel.h.

◆ repository() [2/2]

void OdDAI::Model::repository ( Repository repo)
inlineprotected

Definition at line 245 of file daiModel.h.

◆ subInitialize()

virtual void OdDAI::Model::subInitialize ( )
protectedpure virtual

Implemented in OdIfc::OdIfcModel.

◆ underlyingSchema()

const OdDAI::SchemaPtr OdDAI::Model::underlyingSchema ( ) const

Retrieves the underlying schema definition of the model.

Returns
Returns a smart pointer to the model's underlying schema definition.

◆ underlyingSchemaName()

const OdAnsiString& OdDAI::Model::underlyingSchemaName ( ) const

Retrieves the name of the model's underlying schema.

Returns
Returns the name of the model's underlying schema.

Friends And Related Function Documentation

◆ Repository

friend class Repository
friend

Definition at line 259 of file daiModel.h.

Member Data Documentation

◆ m_contents

ModelContentsPtr OdDAI::Model::m_contents
protected

Definition at line 255 of file daiModel.h.

◆ m_name

OdAnsiString OdDAI::Model::m_name
protected

Definition at line 252 of file daiModel.h.

◆ m_repository

Repository* OdDAI::Model::m_repository
protected

Definition at line 256 of file daiModel.h.

◆ m_schemaModule

SchemaModulePtr OdDAI::Model::m_schemaModule
protected

Definition at line 254 of file daiModel.h.

◆ m_underlyingSchema

SchemaPtr OdDAI::Model::m_underlyingSchema
protected

Definition at line 253 of file daiModel.h.


The documentation for this class was generated from the following file: