/////////////////////////////////////////////////////////////////////////////// // 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. /////////////////////////////////////////////////////////////////////////////// #pragma once #include "BrepBuilder/BrepBuilder.h" #include "Ge/GeCurve2dPtrArray.h" #include "Ge/GeCurve3dPtrArray.h" #include "CmColorBase.h" #include "Gi/GiMaterial.h" class OdBrEdge; class OdBrFace; class OdIMaterialAndColorHelper; /** \details Helper structure to initialize OdBrepBuilder. Corresponding C++ library: TD_BrepBuilderFiller */ struct BrepBuilderInitialCoedge { OdGeCurve2dPtr curve; OdBrepBuilder::EntityDirection direction; typedef OdUInt32 EdgeIndex; EdgeIndex edgeIndex; /** \details Creates a new instance of coedge data with default parameters. */ BrepBuilderInitialCoedge() : curve(nullptr) , direction(OdBrepBuilder::kForward) , edgeIndex(0) {} /** \details Creates a new instance of coedge data. \param curve [in] Parametric curve. \param direction [in] Direction relative edge. \param edgeIndex [in] Edge index. */ BrepBuilderInitialCoedge( OdGeCurve2dPtr curve, OdBrepBuilder::EntityDirection direction, BrepBuilderInitialCoedge::EdgeIndex edgeIndex ) : curve(curve) , direction(direction) , edgeIndex(edgeIndex) {} }; typedef OdArray BrepBuilderInitialCoedgeArray; /** \details Helper structure to initialize OdBrepBuilder. Corresponding C++ library: TD_BrepBuilderFiller */ struct BrepBuilderInitialLoop { BrepBuilderInitialCoedgeArray coedges; /** \details Creates a new instance of loop data with default parameters. */ BrepBuilderInitialLoop() {} /** \details Creates a new instance of loop data with single coedge. \param curve [in] Parametric curve. \param edgeIndex [in] Edge index. \param direction [in] Direction relative edge. */ BrepBuilderInitialLoop(OdGeCurve2dPtr curve, BrepBuilderInitialCoedge::EdgeIndex edgeIndex, OdBrepBuilder::EntityDirection direction ) : coedges(1) { coedges.append(BrepBuilderInitialCoedge(curve, direction, edgeIndex)); } }; typedef OdArray BrepBuilderInitialLoopArray; /** \details Helper structure to initialize OdBrepBuilder. Corresponding C++ library: TD_BrepBuilderFiller */ struct BrepBuilderInitialSurface { OdGeSurfacePtr pSurf; OdBrepBuilder::EntityDirection direction; BrepBuilderInitialLoopArray loops; OdDbStub* material; bool hasMaterialMapping; OdGiMapper materialMapper; bool hasColor; OdCmEntityColor color; std::pair marker; OdUInt32 parentFaceIdx; //BimRv specific /** \details Creates a new instance of face data with default parameters. */ BrepBuilderInitialSurface() : pSurf(NULL) , direction(OdBrepBuilder::kForward) , material(NULL) , hasMaterialMapping(false) , hasColor(false) , color(OdCmEntityColor::kNone) , marker(false, 0) , parentFaceIdx(OdUInt32(-1)) {} /** \details Copy face data except loops. \param other [in] Face to copy. */ void copyFaceExceptLoops(const BrepBuilderInitialSurface& other) { pSurf = other.pSurf; direction = other.direction; material = other.material; hasMaterialMapping = other.hasMaterialMapping; materialMapper = other.materialMapper; hasColor = other.hasColor; color = other.color; marker = other.marker; parentFaceIdx = other.parentFaceIdx; } //DOM-IGNORE-BEGIN OdResult setupVisualInfo(const OdBrFace& face, OdIMaterialAndColorHelper* pMaterialHelper); //DOM-IGNORE-END }; typedef OdArray BrepBuilderInitialSurfaceArray; typedef OdArray BrepBuilderShellsArray; typedef OdArray BrepBuilderComplexArray; /** \details Helper structure to initialize OdBrepBuilder. Corresponding C++ library: TD_BrepBuilderFiller */ struct BrepBuilderInitialVertex { /** \details Creates a new instance of vertex data with default parameters. */ BrepBuilderInitialVertex() : marker(false, 0) {} OdGePoint3d point; std::pair marker; }; typedef OdArray BrepBuilderInitialVertexArray; /** \details Helper structure to initialize OdBrepBuilder. Corresponding C++ library: TD_BrepBuilderFiller */ struct BrepBuilderInitialEdge { OdGeCurve3dPtr curve; typedef OdUInt32 VertexIndex; static const VertexIndex kInvalidIndex = VertexIndex(-1); VertexIndex vertexIndex[2]; std::pair marker; bool hasColor; OdCmEntityColor color; private: double m_approxLength; public: BrepBuilderInitialEdge(OdGeCurve3dPtr edgeCurve = nullptr, BrepBuilderInitialEdge::VertexIndex vertex1Index = kInvalidIndex, BrepBuilderInitialEdge::VertexIndex vertex2Index = kInvalidIndex) : curve(edgeCurve) , marker(false, 0) , hasColor(false) , color(OdCmEntityColor::kNone) , m_approxLength(0.) { vertexIndex[0] = vertex1Index; vertexIndex[1] = vertex2Index; } //DOM-IGNORE-BEGIN OdResult setupVisualInfo(const OdBrEdge& edge, OdIMaterialAndColorHelper* pMaterialHelper); double approxLength(); void resetApproxLength() { m_approxLength = 0.; } //DOM-IGNORE-END }; typedef OdArray BrepBuilderInitialEdgeArray; /** \details Helper structure to initialize OdBrepBuilder. Corresponding C++ library: TD_BrepBuilderFiller */ struct BrepBuilderInitialData { BrepBuilderInitialVertexArray vertices; BrepBuilderInitialEdgeArray edges; BrepBuilderComplexArray complexes; OdSharedPtr transformation; };