/////////////////////////////////////////////////////////////////////////////// // 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 _IFC_REPRESENTATION_BUILDER_H #define _IFC_REPRESENTATION_BUILDER_H #include "Ge/GeMatrix3d.h" #include "IfcBuilder.h" #include "IfcProfileBuilder.h" #include "IfcIndexedPolycurveBuilder.h" class OdGeKnotVector; class IfcRepresentationAdapter; class OdIfcModelFiller; /** \details */ class IfcRepresentationBuilder : public IfcBuilder { protected: OdIfc::OdIfcInstancePtr m_product; static OdSmartPtr createObject(OdIfcModelFiller *filler, OdIfc::OdIfcInstancePtr product); public: ODRX_DECLARE_MEMBERS(IfcRepresentationBuilder); OdIfc::OdIfcInstancePtr getProduct() { return m_product; }; OdIfc::OdIfcInstancePtr appendRepresentation(OdIfc::OdIfcInstance *representation, OdIfc::OdIfcInstance *ctx, const OdAnsiString &identifier, const OdAnsiString &type); bool process(IfcRepresentationAdapter *adapter); OdIfc::OdIfcInstancePtr createIfcBooleanResult(OdIfc::OdIfcInstancePtr blank, OdIfc::OdIfcInstancePtr tool, const char *op); OdIfc::OdIfcInstancePtr createIfcBooleanClippingResult(OdIfc::OdIfcInstancePtr blank, OdIfc::OdIfcInstancePtr tool); OdIfc::OdIfcInstancePtr createExtrudedAreaSolid(OdIfc::OdIfcInstancePtr profileDef, double elevation, const OdGeVector3d &extrudeDirection = OdGeVector3d::kZAxis); OdIfc::OdIfcInstancePtr createExtrudedAreaSolid(OdIfc::OdIfcInstancePtr profileDef, double elevation, const OdDAIObjectId &extrudeDirection); OdIfc::OdIfcInstancePtr createSweptDiskSolid(OdIfc::OdIfcInstancePtr profileDef, double radiusOuter, double radiusInner = 0., double startParam = OdDAI::Consts::OdNan, double endParam = OdDAI::Consts::OdNan); OdIfc::OdIfcInstancePtr createFixedReferenceSweptAreaSolid(OdIfc::OdIfcInstancePtr profileDef, const OdGeMatrix3d &position, OdIfc::OdIfcInstancePtr directrix, double startParam = OdDAI::Consts::OdNan, double endParam = OdDAI::Consts::OdNan, const OdGeVector3d &fixedReference = OdGeVector3d::kXAxis); OdIfc::OdIfcInstancePtr createFixedReferenceSweptAreaSolid(OdIfc::OdIfcInstancePtr profileDef, OdIfc::OdIfcInstancePtr position, OdIfc::OdIfcInstancePtr directrix, double startParam, double endParam, const OdDAIObjectId &fixedReference); OdDAIObjectIds createPoints(const OdGePoint3dArray& points); OdIfc::OdIfcInstancePtr createLine2d(const OdGePoint2d &position, const OdGeVector2d &direction); OdIfc::OdIfcInstancePtr createPolyline(const OdGePoint3dArray& points); OdIfc::OdIfcInstancePtr createBSpline(int degree, const OdGePoint3dArray& points, bool isClosed, const OdGeKnotVector& knots, bool isSelfIntersected = false); OdIfc::OdIfcInstancePtr createBlock(const OdGeMatrix3d &position, double xLength, double yLength, double zLength); OdIfc::OdIfcInstancePtr createBlock(OdIfc::OdIfcInstancePtr position, double xLength, double yLength, double zLength); OdIfc::OdIfcInstancePtr createRectangularPyramid(const OdGeMatrix3d &position, double xLength, double yLength, double height); OdIfc::OdIfcInstancePtr createRectangularPyramid(OdIfc::OdIfcInstancePtr position, double xLength, double yLength, double height); OdIfc::OdIfcInstancePtr createRightCircularCone(const OdGeMatrix3d &position, double height, double bottomRadius); OdIfc::OdIfcInstancePtr createRightCircularCone(OdIfc::OdIfcInstancePtr position, double height, double bottomRadius); OdIfc::OdIfcInstancePtr createRightCircularCylinder(const OdGeMatrix3d &position, double height, double radius); OdIfc::OdIfcInstancePtr createRightCircularCylinder(OdIfc::OdIfcInstancePtr position, double height, double radius); OdIfc::OdIfcInstancePtr createSphere(const OdGeMatrix3d &position, double radius); OdIfc::OdIfcInstancePtr createSphere(OdIfc::OdIfcInstancePtr position, double radius); OdIfc::OdIfcInstancePtr createInclinedReferenceSweptAreaSolid( OdIfc::OdIfcInstancePtr profileDef, OdIfc::OdIfcInstancePtr position, OdIfc::OdIfcInstancePtr directrix, double startDistance, double endDistance, bool fixedAxisVertical, OdIfc::OdIfcInstancePtr inclinating ); IfcIndexedPolycurveBuilderPtr createIndexedPolycurveBuilder(); IfcProfileBuilderPtr createProfileBuilder(); friend class ExIfcModelFiller; }; typedef OdSmartPtr IfcRepresentationBuilderPtr; /** \details */ class ExIfcModelFiller; class IfcRepresentationAdapter { protected: OdGeMatrix3d m_objectPlacement; IfcRepresentationBuilderPtr m_b; void init(IfcRepresentationBuilderPtr representationBuilder) { m_b = representationBuilder; } void uninit() { m_b.release(); } IfcRepresentationAdapter(const OdGeMatrix3d &objectPlacement) { m_objectPlacement = objectPlacement; }; IfcRepresentationAdapter() {}; virtual OdIfc::OdIfcInstancePtr subProcess() = 0; void processPlacement(); bool setStyledItem(OdIfc::OdIfcInstancePtr pInst, const OdAnsiString &styleName); public: virtual ~IfcRepresentationAdapter() {}; bool process(); void setObjectPlacement(const OdGeMatrix3d &objectPlacement) { m_objectPlacement = objectPlacement; } const OdGeMatrix3d& getObjectPlacement() const { return m_objectPlacement; } friend class IfcRepresentationBuilder; }; #endif // _IFC_REPRESENTATION_BUILDER_H