/////////////////////////////////////////////////////////////////////////////// // 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_CORE_H #define _STEP_CORE_H #include "daiModule.h" #include "StepBuildOptions.h" #include "daiHostModule.h" /** \details Defines available modeler types. */ enum ModelerType { /**ODA Brep Modeler.*/ kBrepModeler, /**ODA Facet Modeler. (This option is deprecated for STEP SDK.)*/ kFacetModeler, /**Spatial ACIS Modeler.*/ kSpaModeler, /**Default type of the modeler.*/ kDefaultModeler = kBrepModeler, }; /** \details Initializes STEP SDK functionality. \param initCDA [in] A flag that determines whether Common Data Access (CDA) functionality should be provided for STEP data. \param initStepGeomResource [in] A flag that determines whether geometry resources are initialized as well (if equal to true) or not (if equal to false). \param modelerType [in] A type of modeler that should be used for geometry creation. \returns Returns eOk if STEP SDK was successfully initialized; otherwise, the function returns an appropriate error code. \remarks The function checks whether all needed modules are loaded and loads them if they are not. If at least one of the necessary modules is not loaded, the function returns the eNullPtr error code. It the bInitStepGeomResource parameter value is equal to false, the STEP geometry library is unavailable, therefore the model cannot be visualized. In this mode only data management functionality is available. */ STEPCORE_EXPORT OdResult odStepInitialize(bool initCDA = true, bool initStepGeomResource = true, ModelerType modelerType = kDefaultModeler); /** \details Retrieves whether STEP SDK functionality is already initialized or not. \returns Returns true if STEP SDK is already initialized; otherwise, the function returns false. */ STEPCORE_EXPORT bool odStepIsInitialized(); /** \details De-initializes STEP SDK functionality. \returns Returns eOk if STEP SDK was successfully de-initialized; otherwise, the function returns an appropriate error code. \remarks The function checks whether the needed modules are loaded and decreases the reference counters for them. If a reference counter for any appropriate module becomes equal to zero, the function unloads the module. If no STEP-related modules are loaded, the function returns the eNullPtr error code. */ STEPCORE_EXPORT OdResult odStepUninitialize(); /** \details Initializes STEP SDK Modeler functionality. \param modelerType[in] Modeler type which will be used to create geometry. \returns Returns eOk if STEP SDK Modeler was successfully initialized; otherwise, the function returns an appropriate error code. */ STEPCORE_EXPORT OdResult odStepInitModelerGeometry(ModelerType modelerType = kDefaultModeler); /**\details Retrieves whether the STEP geometry module is loaded and initialized. \returns The function returns true if the STEP geometry module is initialized; otherwise, the function returns false. */ STEPCORE_EXPORT bool odStepIsGeomResourceInitialized(); /**\details Retrieves whether the Common Data Access functionality is initialized for ODA STEP SDK. \returns The function returns true if the CDA is initialized and can be used for STEP data. */ STEPCORE_EXPORT bool odStepIsCDAInitialized(); /** \details Output representation data for getDrawableShapeRepresentation function. */ struct STEPCORE_EXPORT ConversionOptions { /** \details Defines available generated objects types. */ enum class GeneratedObjectType { /** Sets generated representation_item as geometric_curve_set with polylines inside entity.*/ kPolylineType, /** Sets generated representation_item as triangulated_surface_set entity.*/ kTriangulatedSurface, /** Sets generated representation_item as faceted_brep entity.*/ kFacetedBrep, /** Sets generated representation_item as tessellated_solid entity.*/ kTessellatedSolid, }; /** \details Generated object type. By default is GeneratedObjectType::kFacetedBrep. */ GeneratedObjectType generatedType = GeneratedObjectType::kFacetedBrep; /** \details Specifies the type of object to be returned. If True returned object is representation_item, otherwise returned object is shape_representation with representation_item's array inside. By default is False. */ bool returnAsRepresentationItem = false; }; /** \details Creates a shape representation of a specified GiDrawable entity inside a specified model and associates it with a specified representation context. \param pEnt [in] A smart pointer to an entity, that should be converted into a shape representation. \param subContextId [in] An identifier of the sub-context object to which the shape representation should be added. \param geometricUnitContextId [in] An identifier of the global units context. \param pModel [in] A smart pointer to an OdStepCoreModule object. */ typedef OdSmartPtr OdStepCoreModulePtr; #endif // _STEP_CORE_H