/////////////////////////////////////////////////////////////////////////////// // 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 _STPX_MODEL_FILLER_H #define _STPX_MODEL_FILLER_H #include "StepBuildOptions.h" #include "daiModel.h" /** \details Class that provides basic set of model entities creation operations for stpX format database. */ class STEPCORETOOLS_EXPORT OdStpXModelFiller { public: /** \details Creates a new class object. \param pModel [in] Working SDAI model. \returns Returns smart pointer to the created class object or pointer to NULL if model has not correct schema type. */ static OdSharedPtr createObject(OdDAI::ModelPtr pModel); /** \details Retrieves working SDAI model. \returns Returns smart pointer to SDAI model. */ OdDAI::ModelPtr model() { return m_pModel; }; /** \details Creates an instance of Class. \param id [in] OdAnsiString instance that provides a unique identification to the classification. \returns A pointer to the created and appended to the model instance. */ OdDAI::ApplicationInstancePtr createClass(const OdAnsiString& id); /** \details Creates an instance of Organization. \param id [in] OdAnsiString unique identification to the organization or company. \param name [in] OdAnsiString attribute which contains the common nomenclature of the organization. \param organizationTypes [in] Array of OdAnsiString which contains a characterization of the type of the organization. \returns A pointer to the created and appended to the model instance. */ OdDAI::ApplicationInstancePtr createOrganization(const OdAnsiString& id, const OdAnsiString& name, const OdAnsiStringArray& organizationTypes); /** \details Creates an instance of Unit. \param name [in] OdAnsiString type of the unit. \param kind [in] OdAnsiString type of system used. \param prefix [in] OdAnsiString ratio of the unit. \returns A pointer to the created and appended to the model instance. */ OdDAI::ApplicationInstancePtr createUnit(const OdAnsiString& name, const OdAnsiString& kind, const OdAnsiString& prefix); /** \details Creates an instance of FormatProperty. \param characterCode [in] OdAnsiString character encoding or format. \param dataFormat [in] OdAnsiString that was used to structure the information in the characterized object. \returns A pointer to the created and appended to the model instance. */ OdDAI::ApplicationInstancePtr createFormatProperty(const OdAnsiString& characterCode, const OdAnsiString& dataFormat); /** \details Creates an instance of ExchangeContext. \param description [in] OdAnsiString which provides the context of the exchange. \param defaultLanguage [in] OdAnsiString array which sets the default language used in the exchanged file if no specific language information is provided. \param defaultUnit [in] OdDAIObjectId which sets the default length unit to be used for the exchanged file if no specific unit is provided. \param identificationContext [in] OdDAIObjectId which sets the default organization managing the different id and description if no specific organization is provided. \returns A pointer to the created and appended to the model instance. */ OdDAI::ApplicationInstancePtr createExchangeContext(const OdAnsiString& description, const OdAnsiStringArray& defaultLanguage, const OdDAIObjectId& defaultUnit, const OdDAIObjectId& identificationContext); /** \details Creates an instance of ViewContext. \param applicationDomain [in] OdAnsiString which contains the application domain information. \param lifeCycleStage [in] OdAnsiString which contains the life cycle stage information. \returns A pointer to the created and appended to the model instance. */ OdDAI::ApplicationInstancePtr createViewContext(const OdAnsiString& applicationDomain, const OdAnsiString& lifeCycleStage); /** \details Creates an instance of Identifier. \param id [in] OdAnsiString which providing unique identification to the related object. \param classId [in] OdDAIObjectId which refer a Class managing the role of the identification. \param identificationContextId [in] OdDAIObjectId which refer the organization managing the id or refer one of the identifiers of the root object. \returns A pointer to the created and appended to the model instance. */ OdDAI::ApplicationInstancePtr createIdentifier(const OdAnsiString& id, const OdDAIObjectId& classId, const OdDAIObjectId& identificationContextId); /** \details Creates an instance of DigitalFile with it location. \param id [in] OdDAIObjectId identifier for the DigitalFile. \param formatPropertyId [in] OdDAIObjectId with data format of the DigitalFile (i.e. reference to a FormatProperty). \param fileName [in] OdAnsiString with file name. \returns A pointer to the created and appended to the model instance. */ OdDAI::ApplicationInstancePtr createDigitalFile(const OdDAIObjectId& id, const OdDAIObjectId& formatPropertyId, const OdAnsiString& fileName); /** \details Creates an instance of DocumentAssignment. \param role [in] OdAnsiString which contains information about file role. \param assignedDocument [in] OdDAIObjectId to assigned file . \param assignedTo [in] OdDAIObjectId to parent entity. \returns A pointer to the created and appended to the model instance. */ OdDAI::ApplicationInstancePtr createDocumentAssignment(const OdAnsiString& role, const OdDAIObjectId& assignedDocument, const OdDAIObjectId& assignedTo); /** \details Creates an instance of AssemblyDefinition. \param viewContextId [in] OdDAIObjectId which refer the organization managing the id or refer one of the identifiers of the root object. \returns A pointer to the created and appended to the model instance. */ OdDAI::ApplicationInstancePtr createAssemblyDefinition(const OdDAIObjectId& viewContextId); /** \details Creates an instance of Part. \param id [in] OdDAIObjectId identifier for the Part, the part number. \param name [in] OdAnsiString which contains the nomenclature or common name of the Part. \param partType [in] OdAnsiString which contains the category of a Part. \param partVersions [in] OdDAIObjectId array of the related variants of the Part. \returns A pointer to the created and appended to the model instance. */ OdDAI::ApplicationInstancePtr createPart(const OdDAIObjectId& id, const OdAnsiString& name, const OdAnsiString& partType, const OdDAIObjectIds& partVersions); /** \details Creates an instance of PartVersion. \param id [in] OdDAIObjectId identifier for the PartVersion, the part number. \param viewsIds [in] OdDAIObjectId array of PartView objects that are defined for the PartVersion. \returns A pointer to the created and appended to the model instance. */ OdDAI::ApplicationInstancePtr createPartVersion(const OdAnsiString& id, const OdDAIObjectIds& viewsIds); /** \details Creates an instance of PartView. \param viewContextId [in] OdDAIObjectId which refer the organization managing the id or refer one of the identifiers of the root object. \returns A pointer to the created and appended to the model instance. */ OdDAI::ApplicationInstancePtr createPartView(const OdDAIObjectId& viewContextId); /** \details Creates an instance of CartesianTransformation. \param transformMatrix [in] OdGeMatrix3d transformation matrix. \returns A pointer to the created and appended to the model instance. */ OdDAI::ApplicationInstancePtr createCartesianTransformation(const OdGeMatrix3d& transformMatrix); /** \details Creates an instance of NextAssemblyOccurrenceUsage. \param transformationsAndAssociations [in] OdDAIObjectId array that specifies the transformation information which is used to locate and orient the constituents in the coordinate space of the AssemblyDefinition. \param partViewId [in] OdDAIObjectId identifier to a relating object. \param definitionBasedOccurrenceId [in] OdDAIObjectId identifier to a SingleOccurence of the component part built into the assembly part. \returns A pointer to the created and appended to the model instance. */ OdDAI::ApplicationInstancePtr createNextAssemblyOccurrenceUsage(const OdDAIObjectIds& transformationsAndAssociations, const OdDAIObjectId& partViewId, const OdDAIObjectId& definitionBasedOccurrenceId); /** \details Creates an instance of SingleOccurrence. \param id [in] OdAnsiString which stores the Identifier for the SingleOccurrence. \param definitionId [in] OdDAIObjectId which refer to a definition object. \returns A pointer to the created and appended to the model instance. */ OdDAI::ApplicationInstancePtr createSingleOccurrence(OdAnsiString id, const OdDAIObjectId& definitionId); protected: /** \details Creates a new class object. \param pModel [in] Working SDAI model. */ OdStpXModelFiller(OdDAI::ModelPtr pModel); OdDAI::ModelPtr m_pModel; }; /** \details A data type that represents a smart pointer to an