/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #ifndef _STEP_HOST_APP_SERVICES_H_ #define _STEP_HOST_APP_SERVICES_H_ #include "daiHostAppServicesBase.h" #include "StepCore.h" #include "daiStepFile.h" #include "TD_PackPush.h" class OdStepFile; typedef OdSmartPtr OdStepFilePtr; class OdStepIExternalDBModule; typedef OdSmartPtr OdStepIExternalDBModulePtr; /** \details The class that implements for platform-specific operations within the STEP SDK. */ class /*ODRX_ABSTRACT*/ STEPCORE_EXPORT OdStepHostAppServices : public OdDAIHostAppServicesBase { public: //DOM-IGNORE-BEGIN ODRX_DECLARE_MEMBERS(OdStepHostAppServices); //DOM-IGNORE-END /** \details Creates a platform-specific operation services object for STEP functionality. */ OdStepHostAppServices(); /** \details Retrieves the STEP database class description. \returns The desc() method's result of the OdStepFile object. */ virtual OdRxClass* databaseClass(const OdAnsiString& schemaName) const; /** \details Creates a new instance of the OdStepFile object that represents the created database instance. \remarks If the parameter string is empty, the created .step file doesn't have underlying Font Handling */ virtual OdString getAlternateFontName() const; /** \details Retrieves the current font mapping file. This font mapping file is used by the Font Handling */ virtual OdString getFontMapFileName() const; /** \details Retrieves the current preferable font name for a specified font name and type. \param fontName [in] A font name. \param 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: Name Value Description kFontTypeUnknown 0 Unknown. kFontTypeShx 1 SHX font. kFontTypeTrueType 2 TrueType font. kFontTypeShape 3 Shape file. kFontTypeBig 4 BigFont file.
\sa Font Handling */ virtual OdString getPreferableFont( const OdString& fontName, OdFontType fontType); /** \details Retrieves the current substitute font name. The substitute font is used in cases when a specified font is not found. \param fontName [in] A font name. \param 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: Name Value Description kFontTypeUnknown 0 Unknown. kFontTypeShx 1 SHX font. kFontTypeTrueType 2 TrueType font. kFontTypeShape 3 Shape file. kFontTypeBig 4 BigFont file.
\sa Font Handling */ virtual OdString getSubstituteFont( const OdString& fontName, OdFontType fontType); /** \details Retrieves the typeface name of the TTF font that has the specified character. \param pFont [in] A TTF font object. \param unicodeChar [in] A symbol to find in the substitute font name. \param 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. \sa Font Handling */ virtual OdString getSubstituteFontByChar( const OdFont& pFont, OdChar unicodeChar, OdDbBaseDatabase *pDb); /** \details Retrieves the current bitmap device associated with the host application services object. \param pViewObj [in] A raw pointer to an OdAbstractViewPE compatible object (OdGsView, OdDbViewport, etc). \param pDb [in] A raw pointer to the database context. \param flags [in] Bitmap device flags. \returns a smart pointer to the device object associated with the host application services object. */ virtual OdGsDevicePtr gsBitmapDevice( OdRxObject* pViewObj = NULL, OdDbBaseDatabase* pDb = NULL, OdUInt32 flags = 0); /** \details Reads an STEP file content from a specified stream and creates an instance of the STEP file object. \remarks Header section of STEP file is readed firstly and EXPRESS schema identifier is extracted from it. The second step is to find appropriate schema definition or load it from an appropriate .exp file (found by calling of findSchemaFileName method implementation). If previous steps are finished successfully, then reading of STEP file data is started. */ virtual OdStepFilePtr readFile(OdStreamBuf* pFileBuff); /** \details Reads an STEP file content from a specified stream using passed schema and creates an instance of the STEP file object. */ virtual OdStepFilePtr readFile(OdStreamBuf* pFileBuff, const OdAnsiString& schemaIdentifier); /** \details Reads a STEP file content from a specified file and creates an instance of the STEP file object. */ virtual OdStepFilePtr readFile(const OdString &file); /** \details Reads a STEP file content from a specified file and creates an instance of the STEP file object. */ virtual OdStepFilePtr readFile(const OdString& file, const OdAnsiString& schemaIdentifier); //DOM-IGNORE-BEGIN /** \details Global setting of B-Rep triangulation. */ //virtual OdResult setTriangulationParams(const wrTriangulationParams ¶ms); /** \details Global setting of B-Rep triangulation. */ //virtual OdResult getTriangulationParams(wrTriangulationParams ¶ms); //DOM-IGNORE-END /** \details Initializes the boundary representation builder with a product-specific implementation. \param bbuilder [out] A reference to an instance of the boundary representation builder class to be initialized. \param bbType [in] A type of boundary representation. \returns eOk if the B-Rep builder was successfully initialized; otherwise the method returns an appropriate error code. \remarks Creates boundary representation builder for AP214 schema. \remarks For correct work this method needs already loaded AP214 schema or the correct path to schemas folder established. */ virtual OdResult brepBuilder(OdBrepBuilder& bbuilder, BrepType bbType); /** \details Retrieves whether an OdGiAuxDataForStep object should be used while vectorizing. \returns true if the OdGiAuxDataForStep object should be created inside the OdGiContextForStepDatabase object to use during the vectorization process; otherwise, the method returns false. */ virtual bool getUseVectAuxData() const; /** \details Searches for a specified file. \param fileName [in] A name of the file to find. \param 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. \param 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. */ virtual OdString findFile(const OdString& fileName, OdDbBaseDatabase* pDb = nullptr, FindFileHint hint = kDefault) override; /** \details Sets default directory with working files (schemas, etc). \param filesDir [in] Default files directory. */ void setFilesDir(const OdString& filesDir); /** \details Retrieves The ExternalTableData module for reading external data by it name. \returns A smart pointer to the ExternalTableData module. */ OdStepIExternalDBModulePtr getExternalTableDataModule(); /** \details Sets a symbols dictionary for a font family name. \param fontName [in] A font family name. \param symbolDictionary [in] A symbols dictionary. */ void setFontSpecSymbolMapping(const OdString& fontName, const OdDAISpecSymbolDictionary& symbolDictionary) override; /** \details Retrieves the symbols dictionary for a font family name. \param ntName [in] A font family name. \returns A symbols dictionary. If font is not registered returns default dictionary. */ const OdDAISpecSymbolDictionary& getFontSpecSymbolMapping(const OdString& fontName) override; /** \details Sets an associated file name or registered name for using font family name. \param pseudoName [in] A using font family name. \param realName [in] A associated file name or registered name. */ void setCustomSubstituteFont(const OdString& pseudoName, const OdString& realName) override; private: OdString m_filesDir; OdMutex m_symbolMappingLocker; OdMutex m_fontSubstituteLocker; std::map m_fontSymbolMappingDictionary; std::map m_fontSubstituteDictionary; }; /** \details A data type that represents a smart pointer to an object. */ typedef OdSmartPtr OdStepHostAppServicesPtr; #include "TD_PackPop.h" #endif // _STEP_HOST_APP_SERVICES_H_