SHAPER  9.12.0
Model_Application Class Reference

Realization of Open CASCADE application abstraction. More...

Inheritance diagram for Model_Application:
Inheritance graph

Public Member Functions

 DEFINE_STANDARD_RTTIEXT (Model_Application, TDocStd_Application) MODEL_EXPORT static HandleggetApplication()
 Definition of "Handles" usage. More...
 
MODEL_EXPORT std::shared_ptr< Model_Documentdocument (const int theDocID)
 Returns the document by the identifier. More...
 
MODEL_EXPORT bool hasDocument (const int theDocID)
 Returns true if document has been created. More...
 
MODEL_EXPORT bool hasRoot ()
 Returns true if root document has been created. More...
 
MODEL_EXPORT std::shared_ptr< Model_DocumentrootDocument ()
 Returns root document, if created (or null otherwise) More...
 
MODEL_EXPORT void deleteDocument (const int theDocID)
 Deletes the document from the application. More...
 
MODEL_EXPORT void deleteAllDocuments ()
 Deletes all documents existing in the application. More...
 
MODEL_EXPORT void createDocument (const int theDocID)
 Creates a new document an returns an id of this document. More...
 
MODEL_EXPORT bool loadDocument (const std::wstring theDocName, const int theDocID)
 Loads document by the file name (if it is registered as load by demand) More...
 
void setLoadPath (std::string thePath)
 Set path for the loaded by demand documents. More...
 
const std::string & loadPath () const
 Returns the path for the loaded by demand documents. More...
 
void setLoadByDemand (std::wstring theID, const int theDocID)
 Defines that specified document must be loaded by demand. More...
 
bool isLoadByDemand (std::wstring theID, const int theDocIndex)
 Returns true if specified document must be loaded by demand. More...
 
int generateDocumentId ()
 produces new unique identifier of the document More...
 
Standard_CString ResourcesName ()
 Return name of resource (i.e. "Standard") More...
 
virtual void Formats (TColStd_SequenceOfExtendedString &theFormats)
 Return format (i.e "MDTV-Standard") More...
 
 Model_Application ()
 Constructor Use method GetInstance() method to obtain the static instance of the object (or derive your own application) More...
 

Detailed Description

Realization of Open CASCADE application abstraction.

Class for internal use only.

Application supports the formats and document management. It is uses OCAF-lke architecture and just implements specific features of the module.

Constructor & Destructor Documentation

◆ Model_Application()

Model_Application::Model_Application ( )

Constructor Use method GetInstance() method to obtain the static instance of the object (or derive your own application)

Member Function Documentation

◆ DEFINE_STANDARD_RTTIEXT()

Model_Application::DEFINE_STANDARD_RTTIEXT ( Model_Application  ,
TDocStd_Application   
)

Definition of "Handles" usage.

Parameters
Model_Applicationis the class name that is covered by the OCCT Handle Retuns the application: one per process

◆ document()

std::shared_ptr< Model_Document > Model_Application::document ( const int  theDocID)

Returns the document by the identifier.

Returns
false of document is not yet created/not loaded

◆ hasDocument()

bool Model_Application::hasDocument ( const int  theDocID)

Returns true if document has been created.

◆ hasRoot()

bool Model_Application::hasRoot ( )

Returns true if root document has been created.

◆ rootDocument()

std::shared_ptr< Model_Document > Model_Application::rootDocument ( )

Returns root document, if created (or null otherwise)

◆ deleteDocument()

void Model_Application::deleteDocument ( const int  theDocID)

Deletes the document from the application.

◆ deleteAllDocuments()

void Model_Application::deleteAllDocuments ( )

Deletes all documents existing in the application.

◆ createDocument()

void Model_Application::createDocument ( const int  theDocID)

Creates a new document an returns an id of this document.

Parameters
theDocIDif it is zero, the root document is created

◆ loadDocument()

bool Model_Application::loadDocument ( const std::wstring  theDocName,
const int  theDocID 
)

Loads document by the file name (if it is registered as load by demand)

Parameters
theDocNamename of the document file
theDocIDthe identifier of the loaded document (to be created)
Returns
true if load is ok

◆ setLoadPath()

void Model_Application::setLoadPath ( std::string  thePath)

Set path for the loaded by demand documents.

◆ loadPath()

const std::string & Model_Application::loadPath ( ) const

Returns the path for the loaded by demand documents.

◆ setLoadByDemand()

void Model_Application::setLoadByDemand ( std::wstring  theID,
const int  theDocID 
)

Defines that specified document must be loaded by demand.

◆ isLoadByDemand()

bool Model_Application::isLoadByDemand ( std::wstring  theID,
const int  theDocIndex 
)

Returns true if specified document must be loaded by demand.

◆ generateDocumentId()

int Model_Application::generateDocumentId ( )

produces new unique identifier of the document

◆ ResourcesName()

Standard_CString Model_Application::ResourcesName ( )

Return name of resource (i.e. "Standard")

◆ Formats()

void Model_Application::Formats ( TColStd_SequenceOfExtendedString &  theFormats)
virtual

Return format (i.e "MDTV-Standard")

Parameters
theFormatssequence of allowed formats for input/output