/////////////////////////////////////////////////////////////////////////////// // 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_MODELERGEOMETRY_H_ #define _STEP_MODELERGEOMETRY_H_ #include "daiBaseModelerGeometry/BaseModelerGeometry.h" #include "Ge/GeVector3d.h" #include "Ge/GeCurve3d.h" #include "Ge/GeCurve2dPtrArray.h" #include "StepCommon.h" #include "StepBuildOptions.h" #include "StepSimpleTypes.h" class OdIBrFile; /** \details Provides a set of classes and enumerations for working with OdStep objects. */ namespace OdStep { class OdStepVisualData; /** \details Defines supported boolean operations. */ enum StepBooleanOperator { /** \details Union operator. */ kStepBooleanOperator_UNION, /** \details Intersection operator. */ kStepBooleanOperator_INTERSECTION, /** \details Difference operator. */ kStepBooleanOperator_DIFFERENCE }; /** \details Defines which operands of boolean operation should stay unchanged. */ enum StepModelerKeep { /** \details All operands will be destroyed. */ kNeither, /** \details First operand will stay unchanged. */ kTool, /** \details Second operand will stay unchanged. */ kBlank, /** \details All operands will stay unchanged. */ kBoth }; //DOM-IGNORE-BEGIN class OdStepHalfSpaceSolid; typedef OdSmartPtr OdStepHalfSpaceSolidPtr; class OdStepConnectedFaceSet; typedef OdSmartPtr OdStepConnectedFaceSetPtr; class OdStepConnectedEdgeSet; typedef OdSmartPtr OdStepConnectedEdgeSetPtr; class OdStepManifoldSolidBrep; typedef OdSmartPtr OdStepManifoldSolidBrepPtr; class OdStepModelerGeometry; typedef OdSmartPtr OdStepModelerGeometryPtr; class OdStepSweptDiskSolid; typedef OdSmartPtr OdStepSweptDiskSolidPtr; //DOM-IGNORE-END /** \details A data type of an array of continuous curves. */ typedef OdArray CurvesContour3d; /** \details A data type of an array of closed outer and inner contours. */ typedef OdArray ContourArray3d; /** \details The class provides geometry modeler functionality for Step SDK. It keeps a body for the visualization and other operations in the format of appropriate modeler implementation. */ class STEPGEOM_EXPORT OdStepModelerGeometry : public OdDAI::OdBaseModelerGeometry { public: ODRX_DECLARE_MEMBERS(OdStepModelerGeometry); /** \details Draws wireframe body to OdGiWorldDraw. \param pWd [in] Object for entity-level vectorization. \returns true if the drawing was successful; otherwise, the method returns false. */ virtual bool drawWireframe(OdGiWorldDraw* pWd) const = 0; /** \details Creates half space solid and stores it in StepModelerGeometry. \param tool [in] Tool operand. \returns Returns result code, eOk if all right, eNullEntityPointer if tool has illegal type, StepModelerGeometry body is NULL or surface defining side of half space is NULL. Returns eGeneralModelingFailure in other cases. */ virtual OdResult boolean(OdStepHalfSpaceSolidPtr tool) = 0; /** \details Creates half space by the plane and stores it in StepModelerGeometry. \param pPlane [in] The half space plane. \returns Returns result code, eOk if all right, eNullEntityPointer if tool has illegal type, StepModelerGeometry body is NULL or surface defining side of half space is NULL. Returns eGeneralModelingFailure in other cases. */ virtual OdResult boolean(OdGePlane* pPlane) = 0; /** \details Performs boolean operation between currently stored body and tool and stores the result body in this StepModelerGeometry instead of currently stored body. \param tool [in] Tool operand. \param op [in] Boolean operation type. \param keep [in] Determines which operands should stay unchanged. \returns Returns result code, eOk if all right, eIllegalEntityType if operands have illegal type or eGeneralModelingFailure in other cases. */ virtual OdResult boolean(OdStepModelerGeometryPtr tool, StepBooleanOperator op, StepModelerKeep keep = kBoth) = 0; /** \details Performs boolean operation and stores it into StepModelerGeometry. \param tool [in] Tool operand. \param blank [in] Blank operand. \param op [in] Boolean operation type. \param keep [in] Determines which operands should stay unchanged. \returns Returns result code, eOk if all right, eIllegalEntityType if operands have illegal type or eGeneralModelingFailure in other cases. */ virtual OdResult boolean(OdStepModelerGeometryPtr tool, OdStepModelerGeometryPtr blank, StepBooleanOperator op, StepModelerKeep keep = kBoth) = 0; /** \details Creates an extrusion body and stores it in the geometry modeler object. \param profile [in] An array of curves which are the base profile for the extrusion. \param dir [in] A vector object that represents the length and the direction of the extrusion. \returns Returns the operation result code: * eOk if the extrusion was performed successfully. * eNullEntityPointer if array of curves is empty. * eEmptySet if the base profile has no contours. * eGeneralModelingFailure in other cases. */ virtual OdResult extrude(const OdArray& profile, const OdGeVector3d& dir) = 0; /** \details Sweeps along path body and stores it in StepModelerGeometry. \param pSolid [in] Swept disk solid entity. \returns Returns result code, eOk if all right, eNullPtr if pSolid is NULL, or eGeneralModelingFailure in other cases. */ virtual OdResult sweep(OdStepSweptDiskSolidPtr pSolid) = 0; /** \details Sweeps along path body and stores it in StepModelerGeometry. \param contour [in] Body contour which stores along path. \param path [in] Array of curves that represents the sweep path of the body. \returns Returns result code, eOk if all right, eNullPtr if pSolid is NULL, or eGeneralModelingFailure in other cases. */ virtual OdResult sweep(const ContourArray3d& contour, const CurvesContour3d& path) = 0; /** \details Sweeps along path body and stores it in StepModelerGeometry. \param contour [in] Body contour which stores along path. \param path [in] Array of curves that represents the sweep path of the body. \param rotationAngle [in] Contour rotation angle. \returns Returns result code, eOk if all right, eNullPtr if pSolid is NULL, or eGeneralModelingFailure in other cases. */ virtual OdResult sweep(const OdArray& contour, const CurvesContour3d& path, double rotationAngle = 0.) = 0; /** \details Creates a type of swept area solid which is the result of sweeping an area along a Directrix. The swept area is provided by a subtype of StepProfileDef. The profile is placed by an implicit Cartesian transformation operator at the start point of the sweep, where the profile normal agrees to the tangent of the directrix at this point, and the profile's x-axis agrees to the FixedReference direction. The orientation of the curve during the sweeping operation is controlled by the FixedReference direction. \param pSolid [in] StepFixedReferenceSweptAreaSolid entity. \returns Returns result code, eOk if all right, eNullPtr if pSolid is NULL, or eGeneralModelingFailure in other cases. */ // virtual OdResult sweep(OdStepFixedReferenceSweptAreaSolidPtr pSolid) = 0; /** \details Creates faceted body and stores it in StepModelerGeometry. \param pFaceSet [in] Set of faces for body. \returns Returns result code, eOk if all right, eInvalidInput in other cases. */ virtual OdResult createConnectedFaceSet(OdStepConnectedFaceSetPtr pFaceSet) = 0; /** \details Creates wireframe body and stores it in StepModelerGeometry. \param pEdgeSet [in] Set of edges for body. \returns Returns result code, eOk if all right, eInvalidInput in other cases. */ virtual OdResult createConnectedEdgeSet(OdStepConnectedEdgeSetPtr pEdgeSet) = 0; /** \details Creates tessellated body and stores it in StepModelerGeometry. \param vertices [in] An ordered list of points used by the faces. \param faces [in] Two-dimensional list for the indexed-based faces. \param isClosed [in] Indication whether the tessellated body is a closed shell or not. \param faces [in] Two-dimensional list for the indexed-based faces. \param normals [in] An ordered list of vectors for normals. \returns Returns result code, eOk if all right, eInvalidInput in other cases. */ virtual OdResult createTessellation(const OdGePoint3dArray& vertices, const OdArray >& faces, OdDAI::Boolean isClosed, const OdGeVector3dArray& normals, const OdStep::OdStepVisualData* pData = nullptr/*, const OdArray& flags = OdArray() */ ) = 0; /** \details Creates tessellated body and stores it in StepModelerGeometry. \param vertices [in] An ordered list of points used by the faces. \param faces [in] Two-dimensional list for the indexed-based faces. \param isClosed [in] Indication whether the tessellated body is a closed shell or not. \param faces [in] Two-dimensional list for the indexed-based faces. \param pData [in] Additional visual data(faces' colours and textures) \returns Returns result code, eOk if all right, eInvalidInput in other cases. */ virtual OdResult createTessellation(const OdGePoint3dArray& vertices, const OdDAIObjectIds& faces, OdDAI::Boolean isClosed, const OdStep::OdStepVisualData* pData) = 0; /** \details Creates OdBrFile from StepAdvnacedBrep and stores it into StepModelerGeometry. \param pBrep [in] StepManifoldSolidBrep entity. \returns Returns result code: - eOk if all right; - eWrongObjectType if getting attribute is failed; - eNullObjectPointer if StepManifoldSolidBrep or sub entity has unsupported type; - eEmptySet if StepManifoldSolidBrep or sub entity has empty set; - eGeneralModelingFailure in other cases. */ virtual OdResult createAdvancedBrep(OdStepManifoldSolidBrepPtr pBrep) = 0; /** \details Creates box body in StepModelerGeometry. \param ptOrigin [in] Position of box. \param vSizes [in] Three box sizes. \returns Returns result code, eOk if all right. */ virtual OdResult box(const OdGePoint3d& ptOrigin, const OdGeVector3d& vSizes) = 0; /** \details Creates block body in StepModelerGeometry. \param position [in] Position of block. \param xLength [in] X length of block. \param yLength [in] Y length of block. \param zLength [in] Z length of block. \returns Returns result code, eOk if all right. */ virtual OdResult block(const OdGeMatrix3d& position, double xLength, double yLength, double zLength) = 0; /** \details Creates rectangular pyramid body in StepModelerGeometry. \param position [in] Position of pyramid. \param xLength [in] X length of pyramid. \param yLength [in] Y length of pyramid. \param height [in] Height of pyramid. \returns Returns result code, eOk if all right. */ virtual OdResult rectangularPyramid(const OdGeMatrix3d& position, double xLength, double yLength, double height) = 0; /** \details Creates right circular cone body in StepModelerGeometry. \param position [in] Position of cone. \param height [in] Height of cone. \param bottomRadius [in] Radius of cone. \returns Returns result code, eOk if all right. */ virtual OdResult rightCircularCone(const OdGeMatrix3d& position, double height, double bottomRadius) = 0; /** \details Creates right circular cylinder body in StepModelerGeometry. \param position [in] Position of cylinder. \param height [in] Height of cylinder. \param radius [in] Radius of cylinder. \returns Returns result code, eOk if all right. */ virtual OdResult rightCircularCylinder(const OdGeMatrix3d& position, double height, double radius) = 0; /** \details Creates sphere body in StepModelerGeometry. \param ptOrigin [in] Position of sphere. \param radius [in] Radius of sphere. \returns Returns result code, eOk if all right. */ virtual OdResult sphere(const OdGePoint3d& ptOrigin, double radius) = 0; /** \details Creates torus body in StepModelerGeometry. \param ptOrigin [in] Position of torus. \param axis [in] Orientation of torus. \param majorRadius [in] Major radius of torus. \param minorRadius [in] Minor radius of torus. \returns Returns result code, eOk if all right. */ virtual OdResult torus(const OdGePoint3d& ptOrigin, const OdGeVector3d& axis, double majorRadius, double minorRadius) = 0; /** \details Creates tetrahedron body in StepModelerGeometry. \param points [in] Tetrahedron vertices. \returns Returns result code, eOk if all right. */ virtual OdResult tetrahedron(const OdArray& points) = 0; /** \details Creates hexahedron body in StepModelerGeometry. \param points [in] Hexahedron vertices. \returns Returns result code, eOk if all right. */ virtual OdResult convexHexahedron(const OdArray& points) = 0; /** \details Creates right angular wedge body in StepModelerGeometry. \param position [in] The location and orientation of the placement axis system for the primitive. \param xLength [in] The size of the wedge along the placement X axis. \param yLength [in] The size of the wedge along the placement Y axis. \param zLength [in] The size of the wedge along the placement Z axis. \param ltx [in] The length in the positive X direction of the smaller surface of the wedge. \returns Returns result code, eOk if all right. */ virtual OdResult rightAngularWedge(const OdGeMatrix3d& position, double xLength, double yLength, double zLength, double ltx) = 0; /** \details Creates ellipsoid body in StepModelerGeometry. \param position [in] The location and orientation of the ellipsoid. \param semiAxis1 [in] The length of the semi-axis of the ellipsoid in the direction position.p[1]. \param semiAxis2 [in] The length of the semi-axis of the ellipsoid in the direction position.p[2]. \param semiAxis3 [in] The length of the semi-axis of the ellipsoid in the direction position.p[3]. \returns Returns result code, eOk if all right. */ virtual OdResult ellipsoid(const OdGeMatrix3d& position, double semiAxis1, double semiAxis2, double semiAxis3) = 0; /** \details Creates ellipsoid body in StepModelerGeometry. \param position [in] The location and orientation of the solid. \param radius1 [in] The radius of the first circular end face of the solid. \param radius2 [in] The radius of the second circular end face of the solid. \param coneAngel1 [in] The semi-vertex angle of the cone tangent to the curved surface around the first circular end face of the solid, taken as positive if the cone vertex lies in the direction of the outward-facing normal from that face. \param coneAngel2 [in] The semi-vertex angle of the cone tangent to the curved surface around the second circular end face of the solid, taken as positive if the cone vertex lies in the direction of the outward-facing normal from the centre of that face. \param turnAngle [in] The angle between the planes of the two circular faces of the solid, measured in the sector containing the solid. \returns Returns result code, eOk if all right. */ virtual OdResult cyclideSegmentSolid(const OdGeMatrix3d& position, double radius1, double radius2, double coneAngel1, double coneAngel2, double turnAngle) = 0; /** \details Creates ellipsoid body in StepModelerGeometry. \param position [in] The location of the central point on the axis and the direction of semi_axis_1. \param semiAxis1 [in] The length of the first radius of the base of the cone in the direction of position.p[1]. \param semiAxis2 [in] The length of the first radius of the base of the cone in the direction of position.p[2]. \param height [in] The height of the cone above the base measured in the direction of position.p[3]. \param xOffset [in] The distance, in the direction of position.p[1], to the central point of the top face of the cone from the point in the plane of this face directly above the central point of the base. \param yOffset [in] The distance, in the direction of position.p[2], to the central point of the top face of the cone from the point in the plane of this face directly above the central point of the base. \param ratio [in] The ratio of a radius of the top face to the corresponding radius of the base of the cone. \returns Returns result code, eOk if all right. */ virtual OdResult eccentricCone(const OdGeMatrix3d& position, double semiAxis1, double semiAxis2, double height, double xOffset, double yOffset, double ratio) = 0; /** \details Creates body in StepModelerGeometry. \param points [in] Surface vertices. \returns Returns result code, eOk if all right. */ virtual OdResult surfaceFromPoints(const OdArray& points) = 0; /** \details Creates 2D region in StepModelerGeometry. \param curve [in] Region curve. \returns Returns result code, eOk if all right. */ virtual OdResult curve(const OdGeCurve2d& curve) = 0; /** \details Creates 2D region in StepModelerGeometry. \param points [in] Region vertices. \returns Returns result code, eOk if all right. */ virtual OdResult curve(const OdArray& points) = 0; /** \details Creates 2D region in StepModelerGeometry. \param curves [in] Region borders. \returns Returns result code, eOk if all right. */ virtual OdResult curve(const OdGeCurve3dPtrArray& curves) = 0; /** \details Creates 2D region in StepModelerGeometry. \param curves [in] Region borders. \returns Returns result code, eOk if all right. */ virtual OdResult faceWithLoops(const OdGeCurve2dPtrArray& curves) = 0; /** \details Creates extruded region on surface in StepModelerGeometry. \param pSurface [in] Pointer to the surface. \param bounds [in] Bounds of the region on surface. \param extrudeVector [in] Pointer to the extrusion vector. If pointer is NULL, extrusion is off. \returns Returns result code, eOk if all right. */ virtual OdResult curveBoundedSurface(OdGeSurfacePtr pSurface, const OdGeCurve3dPtrArray& bounds, const OdGeVector3d* extrudeVector = nullptr) = 0; /** \details Creates extruded region on surface in StepModelerGeometry. \param pSurface [in] Pointer to the surface. \param bounds [in] Bounds of the region on surface. \param extrudeVector [in] Pointer to the extrusion vector. If pointer is NULL, extrusion is off. \returns Returns result code, eOk if all right. */ virtual OdResult curveBoundedSurface(OdGeSurfacePtr pSurface, const OdGePoint3dArray& bounds, const OdGeVector3d* extrudeVector = nullptr) = 0; /** \details Creates surface body in StepModelerGeometry. \param pSurface [in] Pointer to the surface. \returns Returns result code, eOk if all right. */ virtual OdResult surface(OdGeSurfacePtr pSurface) = 0; /** \details Creates bolt body in StepModelerGeometry. \param position [in] The location of the central point of bolt head and direction of the bolt. \param diameter [in] Bolt diameter. \param length [in] Bolt length. \returns Returns result code, eOk if all right. */ virtual OdResult fastenerBolt(const OdGeMatrix3d& position, double diameter, double length) = 0; /** \details Creates bolt body in StepModelerGeometry. \param position [in] The location of the center of washer and it direction. \param diameter [in] Washer diameter. \param length [in] Washer length. \returns Returns result code, eOk if all right. */ virtual OdResult fastenerWasher(const OdGeMatrix3d& position, double diameter, double length) = 0; //DOM-IGNORE-BEGIN virtual void setSolidAsMdBody(bool /*asMdBody*/) {} //DOM-IGNORE-END }; } #endif // _STEP_MODELERGEOMETRY_H_