CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
OdIfcHostAppServices Class Reference

#include <IfcHostAppServices.h>

Inheritance diagram for OdIfcHostAppServices:

Public Types

enum  TexturesType { kNoTextures , kImageTextures , kBlobTextures , kPixelTextures }
 

Public Member Functions

 ODRX_DECLARE_MEMBERS (OdIfcHostAppServices)
 
 OdIfcHostAppServices ()
 
virtual OdRxClassdatabaseClass () const override
 
virtual OdRxClassdatabaseClass (const OdAnsiString &schemaName) const override
 
virtual OdIfcFilePtr createDatabase (IfcSchema initialSchema=kScmUndefined) const
 
virtual OdIfcFilePtr createDatabase (const OdAnsiString &schemaName) const
 
virtual OdString findFile (const OdString &filename, OdDbBaseDatabase *pDb=0, FindFileHint hint=kDefault)
 
virtual const OdString program ()
 
virtual const OdString product ()
 
virtual const OdString companyName ()
 
virtual OdString formatMessage (unsigned int errorCode,...)
 
virtual OdString getAlternateFontName () const
 
virtual OdString getFontMapFileName () const
 
virtual OdString getPreferableFont (const OdString &fontName, OdFontType fontType)
 
virtual OdString getSubstituteFont (const OdString &fontName, OdFontType fontType)
 
virtual OdString getSubstituteFontByChar (const OdFont &pFont, OdChar unicodeChar, OdDbBaseDatabase *pDb)
 
virtual OdGsDevicePtr gsBitmapDevice (OdRxObject *pViewObj=NULL, OdDbBaseDatabase *pDb=NULL, OdUInt32 flags=0)
 
virtual OdIfcFilePtr readFile (OdStreamBuf *pFileBuff)
 
virtual OdIfcFilePtr readFile (const OdString &file)
 
virtual OdResult brepBuilder (OdBrepBuilder &bbuilder, BrepType bbType)
 
virtual bool getUseVectAuxData () const
 
virtual void setTexturesVisibility (bool isTexturesVisible)
 
virtual bool getTexturesVisibility ()
 
virtual void setTexturesCreationType (TexturesType texturesType)
 
virtual TexturesType getTexturesCreationType ()
 

Protected Attributes

bool m_texturesVisibility = false
 
TexturesType m_texturesCreationType = kNoTextures
 

Detailed Description

The class that implements for platform-specific operations within the IFC SDK.

Definition at line 39 of file IfcHostAppServices.h.

Member Enumeration Documentation

◆ TexturesType

Types of textures.

Enumerator
kNoTextures 

Textures are not created.

kImageTextures 

Textures are made as an image.

kBlobTextures 

Textures are made as a blob.

kPixelTextures 

Textures are made as a pixel map.

Definition at line 320 of file IfcHostAppServices.h.

Constructor & Destructor Documentation

◆ OdIfcHostAppServices()

OdIfcHostAppServices::OdIfcHostAppServices ( )

Creates a platform-specific operation services object for IFC functionality.

Member Function Documentation

◆ brepBuilder()

virtual OdResult OdIfcHostAppServices::brepBuilder ( OdBrepBuilder & bbuilder,
BrepType bbType )
virtual

Global setting of B-Rep triangulation.

Global setting of B-Rep triangulation.

Initializes the boundary representation builder with a product-specific implementation.

Parameters
bbuilder[out] A reference to an instance of the boundary representation builder class to be initialized.
bbType[in] A <exref target="https://docs.opendesign.com/tkernel_api_cpp/BrepType.html">type of boundary representation</exref>.
Returns
eOk if the B-Rep builder was successfully initialized; otherwise the method returns an appropriate error code.
Remarks
The method returns eNotImplementedYet value by default.

◆ companyName()

virtual const OdString OdIfcHostAppServices::companyName ( )
virtual

Retrieves the current name of the client company.

Returns
A string object containing the current name of the client company.
Remarks
The default implementation of this method returns the result returned by the oddgGetLibraryInfo()->getCompanyName(). This method is typically used for populating information about the client's company.

◆ createDatabase() [1/2]

virtual OdIfcFilePtr OdIfcHostAppServices::createDatabase ( const OdAnsiString & schemaName) const
virtual

Creates a new instance of the <exref target="https://docs.opendesign.com/tifc_api_cpp/OdIfcFile.html>OdIfcFile</exref> class. @param schemaName [in] An initial schema name to be used for the new instance creation. \returns A smart pointer to the <exref target="https://docs.opendesign.com/tifc_api_cpp/OdIfcFile.html>OdIfcFile</exref> object that represents the created database instance.

Remarks
If the parameter string is empty, the created .ifc file doesn't have underlying <<exref target="https://docs.opendesign.com/tifc_api_cpp/OdDAI__Model.html>Model</exref> OdDAI::Model> object. This way of initialization is used for the file open operation when the underlying model should be created during the file loading process. The host application services object is associated with the newly created database.

◆ createDatabase() [2/2]

virtual OdIfcFilePtr OdIfcHostAppServices::createDatabase ( IfcSchema initialSchema = kScmUndefined) const
virtual

Creates a new instance of the <exref target="https://docs.opendesign.com/tifc_api_cpp/OdIfcFile.html>OdIfcFile</exref> class. @param initialSchema [in] An initial schema to be used for the new instance creation. \returns A smart pointer to the <exref target="https://docs.opendesign.com/tifc_api_cpp/OdIfcFile.html>OdIfcFile</exref> object that represents the created database instance.

Remarks
If the parameter is equal to the kScmUndefined value, the created .ifc file doesn't have underlying <<exref target="https://docs.opendesign.com/tifc_api_cpp/OdDAI__Model.html>Model</exref> OdDAI::Model> object. This way of initialization is used for the file open operation when the underlying model should be created during the file loading process. The host application services object is associated with the newly created database.

◆ databaseClass() [1/2]

virtual OdRxClass * OdIfcHostAppServices::databaseClass ( ) const
overridevirtual

Retrieves the IFC database class description.

Returns
The desc() method's result of the <exref target="https://docs.opendesign.com/tifc_api_cpp/OdIfcFile.html>OdIfcFile</exref> object.

◆ databaseClass() [2/2]

virtual OdRxClass * OdIfcHostAppServices::databaseClass ( const OdAnsiString & schemaName) const
overridevirtual

Retrieves the IFC database class description.

Parameters
schemaName[in] A string that contains schema name for wich needs database class description.
Returns
Returns the desc() method's result of the <exref target="https://docs.opendesign.com/tifc_api_cpp/OdIfcFile.html>OdIfcFile</exref> object.

◆ findFile()

virtual OdString OdIfcHostAppServices::findFile ( const OdString & filename,
OdDbBaseDatabase * pDb = 0,
FindFileHint hint = kDefault )
virtual

Searches for a specified file.

Parameters
filename[in] A name of the file to find.
pDb[in] A pointer to the database context. If the parameter value is equal to NULL, the file search is not related to a database.
hint[in] A hint that indicates the type of file that is required.
Returns
The full path to the found file; if the file was not found, the method returns an empty string.
Remarks
This method is called by IFC SDK when it needs to get access to a file, such as a font file, a template file, etc. If the pointer to the database context is not equal to NULL, it is possible to call the getFilename() method of the database instance to determine the full path to the IFC file associated with the database. The typical search order is the following:

The file name itself.

The current directory.

The drawing directory (for SHX font, image, and xref files).

The Windows fonts directory (only for TTF fonts on Windows platforms).

The hint parameter's value must be one of the following:

Value Description Extension kDefault 0 Any file. any kFontFile 1 Can be either SHX or TTF file. SHX or TTF kCompiledShapeFile 2 SHX file. SHX kTrueTypeFontFile 3 TTF file. TTF kEmbeddedImageFile 4 Image file. ISM kXRefDrawing 5 External reference file. kPatternFile 6 Pattern file (PAT). PAT kDRXApplication 7 DRX application file. DRX kFontMapFile 8 FontMap file. FMP

◆ formatMessage()

virtual OdString OdIfcHostAppServices::formatMessage ( unsigned int errorCode,
... )
virtual

details Formats an error message string corresponding to the specified error code(s).

Parameters
errorCode[in] An error code.
Returns
A string with a formatted error message.

◆ getAlternateFontName()

virtual OdString OdIfcHostAppServices::getAlternateFontName ( ) const
virtual

Retrieves the current default font name.

Returns
the path to the font file to be used when a given font file can not be found by IFC SDK.
Remarks
The default implementation of the method returns an empty string.
See also
<exref target="https://docs.opendesign.com/td/FontHandling.html">Font Handling</exref>

◆ getFontMapFileName()

virtual OdString OdIfcHostAppServices::getFontMapFileName ( ) const
virtual

Retrieves the current font mapping file. This font mapping file is used by the <exref target="https://docs.opendesign.com/tifc_api_cpp/OdIfcHostAppServices__getPreferableFont@const_OdString&@OdFontType.html>getPreferableFont()</exref> method. \returns the name of the font mapping file. \remarks The default implementation of this method returns an empty string. \sa <exref target="https://docs.opendesign.com/td/FontHandling.html">Font Handling</exref>

◆ getPreferableFont()

virtual OdString OdIfcHostAppServices::getPreferableFont ( const OdString & fontName,
OdFontType fontType )
virtual

Retrieves the current preferable font name for a specified font name and type.

Parameters
fontName[in] A font name.
fontType[in] A font type.
Returns
a string object containing the preferable font name.
Remarks
The default implementation of this method returns an empty string.

The fontType parameter value must be one of the following:

Value Description kFontTypeUnknown 0 Unknown. kFontTypeShx 1 SHX font. kFontTypeTrueType 2 TrueType font. kFontTypeShape 3 Shape file. kFontTypeBig 4 BigFont file.

See also
<exref target="https://docs.opendesign.com/td/FontHandling.html">Font Handling</exref>

◆ getSubstituteFont()

virtual OdString OdIfcHostAppServices::getSubstituteFont ( const OdString & fontName,
OdFontType fontType )
virtual

Retrieves the current substitute font name. The substitute font is used in cases when a specified font is not found.

Parameters
fontName[in] A font name.
fontType[in] A font type.
Returns
a string object that contains the substitute font name.
Remarks
The default implementation of this method returns an empty string. The fontType parameter value must be one of the following:

Value Description kFontTypeUnknown 0 Unknown. kFontTypeShx 1 SHX font. kFontTypeTrueType 2 TrueType font. kFontTypeShape 3 Shape file. kFontTypeBig 4 BigFont file.

See also
<exref target="https://docs.opendesign.com/td/FontHandling.html">Font Handling</exref>

◆ getSubstituteFontByChar()

virtual OdString OdIfcHostAppServices::getSubstituteFontByChar ( const OdFont & pFont,
OdChar unicodeChar,
OdDbBaseDatabase * pDb )
virtual

Retrieves the typeface name of the TTF font that has the specified character.

Parameters
pFont[in] A TTF font object.
unicodeChar[in] A symbol to find in the substitute font name.
pDb[in] A raw pointer to the database context.
Returns
a string object that contains the substitute font name.
Remarks
The default method implementation uses the Windows API for getting the font.
See also
<exref target="https://docs.opendesign.com/td/FontHandling.html">Font Handling</exref>

◆ getTexturesCreationType()

virtual TexturesType OdIfcHostAppServices::getTexturesCreationType ( )
virtual

Retrieves textures make method.

Returns
Returns textures make method.
Remarks
This experimental functionality is turned off by default.

◆ getTexturesVisibility()

virtual bool OdIfcHostAppServices::getTexturesVisibility ( )
virtual

Retrieves textures visibility option.

Returns
Returns true if textures are visible; otherwise false.
Remarks
This experimental functionality is turned off by default.

◆ getUseVectAuxData()

virtual bool OdIfcHostAppServices::getUseVectAuxData ( ) const
virtual

◆ gsBitmapDevice()

virtual OdGsDevicePtr OdIfcHostAppServices::gsBitmapDevice ( OdRxObject * pViewObj = NULL,
OdDbBaseDatabase * pDb = NULL,
OdUInt32 flags = 0 )
virtual

Retrieves the current bitmap <exref target="https://docs.opendesign.com/tv_api_cpp/OdGsDevice.html">device</exref> associated with the host application services object.

Parameters
pViewObj[in] A raw pointer to an <exref target="https://docs.opendesign.com/tkernel_api_cpp/OdAbstractViewPE.html">OdAbstractViewPE</exref> compatible object
(<exref target="https://docs.opendesign.com/tv_api_cpp/OdGsView.html">OdGsView</exref>, <exref target="https://docs.opendesign.com/td_api_cpp/OdDbViewport.html">OdDbViewport</exref>, etc).
pDb[in] A raw pointer to the database context.
flags[in] Bitmap device flags.
Returns
a smart pointer to the <exref target="https://docs.opendesign.com/tv_api_cpp/OdGsDevice.html">device</exref> object associated with the host application services object.

◆ ODRX_DECLARE_MEMBERS()

OdIfcHostAppServices::ODRX_DECLARE_MEMBERS ( OdIfcHostAppServices )

◆ product()

virtual const OdString OdIfcHostAppServices::product ( )
virtual

Retrieves the current name of the client product based on ODA IFC SDK.

Returns
A string object containing the current name of the client product.
Remarks
The default implementation of this method returns the result of the program() method. This method is typically used for populating information about the product.

◆ program()

virtual const OdString OdIfcHostAppServices::program ( )
virtual

Retrieves the current name of the client program based on ODA IFC SDK.

Returns
A string object containing the custom application name.
Remarks
The default implementation of this method returns oddgGetLibraryInfo()->getLibName(). This method is typically used for populating information about the application.

◆ readFile() [1/2]

virtual OdIfcFilePtr OdIfcHostAppServices::readFile ( const OdString & file)
virtual

Reads an IFC file content from a specified file and creates an instance of the <exref target="https://docs.opendesign.com/tifc_api_cpp/OdIfcFile.html>OdIfcFile</exref> class. @param file [in] A full path to the file to read data from. \returns a smart pointer to the created <exref target="https://docs.opendesign.com/tifc_api_cpp/OdIfcFile.html>IFC file object</exref>.

◆ readFile() [2/2]

virtual OdIfcFilePtr OdIfcHostAppServices::readFile ( OdStreamBuf * pFileBuff)
virtual

Reads an IFC file content from a specified stream and creates an instance of the <exref target="https://docs.opendesign.com/tifc_api_cpp/OdIfcFile.html>OdIfcFile</exref> class. @param pFileBuff [in] A raw pointer to a stream to read data from. \returns a smart pointer to the created <exref target="https://docs.opendesign.com/tifc_api_cpp/OdIfcFile.html>IFC file object</exref>.

◆ setTexturesCreationType()

virtual void OdIfcHostAppServices::setTexturesCreationType ( TexturesType texturesType)
virtual

Sets textures make method when ifc file creating.

Parameters
texturesType[in] The type of textures make method.
Remarks
This experimental functionality is turned off by default.

◆ setTexturesVisibility()

virtual void OdIfcHostAppServices::setTexturesVisibility ( bool isTexturesVisible)
virtual

Switch textures visibility.

Parameters
isTexturesVisible[in] If parameter is true textures are visible; otherwise invisible.
Remarks
This experimental functionality is turned off by default.

Member Data Documentation

◆ m_texturesCreationType

TexturesType OdIfcHostAppServices::m_texturesCreationType = kNoTextures
protected

Definition at line 350 of file IfcHostAppServices.h.

◆ m_texturesVisibility

bool OdIfcHostAppServices::m_texturesVisibility = false
protected

Definition at line 349 of file IfcHostAppServices.h.


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