CFx SDK Documentation  2020SP3
BrepBuilder.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 #ifndef _BREPBUILDER_H_
25 #define _BREPBUILDER_H_
26 
27 #include "OdaCommon.h"
28 #include "BrepBuilderExport.h"
29 #include "Ge/GeCurve3d.h"
30 #include "TD_PackPush.h"
31 
32 class OdDbStub;
33 
35 {
36  //The output geometry is an open shell
38  //The output geometry is an solid
40  //The output geometry is an void (i.e., an inverted solid).
41  kVoid
42 };
43 
45 
47 {
48 public:
51 
53  {
55  kReversed
56  };
57 
58  //Returns type of output geometry
60 
61  //Sets the product-dependent implementation
62  void set(const void* pFile);
63 
64  // Add a co-edge associated to a previously added edge.
65  // A co-edge represents the use of an edge on one of the edge's faces.
66  BRepBuilderGeometryId addCoedge(const BRepBuilderGeometryId& loopId, const BRepBuilderGeometryId& edgeId, EntityDirection codgeDirection = kForward, const OdGeCurve2d* pParCur = NULL);
67  // Add a new edge to the geometry being built.
68  BRepBuilderGeometryId addEdge(const OdGeCurve3d* pCurveForEdge);
69 
70  // Creates an empty face in the geometry being built.
72 
73  // Creates an empty loop in a given face of the geometry being built.
75 
76  //Allow BRepBuilder to remove problematic faces (e.g., due to inaccurate edge geometry).
77  //If this option is enabled and BRepBuilder removes some faces,
78  //the output geometry's type will be OpenShell regardless of the expected type specified when the BRepBuilder was created.
80 
81  //A validator function that checks the state of this BRepBuilder object.Returns true if this BRepBuilder object is accepting b - rep data, false otherwise.
83 
84  //Indicates that the caller has finished defining the given face.
85  void finishFace(const BRepBuilderGeometryId& faceId);
86 
87  //Indicates that the caller has finished defining the given loop.
88  void finishLoop(const BRepBuilderGeometryId& loopId);
89 
90  //Get the Geometry object built by this BRepBuilder. This will clear the built Geometry stored in the BRepBuilder.
91  //This function will throw if this BRepBuilder hasn't completed building the b-rep. Use IsResultAvailable() to verify that this BRepBuilder contains a valid result.
93 
94  //A validator function that checks whether the surface object is of type supported as face surface by BRepBuilder.
95  bool isPermittedSurfaceType(const OdGeSurface* pSurf);
96 
97  //A validator function that checks the state of this BRepBuilder object. Returns true if this BRepBuilder object has successfully built a b-rep.
99 
100  //A validator function that checks whether the edge id corresponds to an edge previously added to this BRepBuilder object.
102 
103  //A validator function that checks whether the face id corresponds to a face previously added to this BRepBuilder object.
105 
106  //A validator function that checks whether the loop id corresponds to a loop previously added to this BRepBuilder object.
108 
109  //Returns 'true' if BRepBuilder removed some problematic faces from the output geometry, 'false' if not.
110  //If allowRemovalOfProblematicFaces was not called to enable removal of problematic faces, this function will return 'false'. Note that if some faces were removed,
111  //the output geometry's type will be OpenShell regardless of the expected type that was specified when the BRepBuilder was created.
113 
114  //Make BRepBuilder allow edges that it would normally disallow as being too short for geometry.
116 
117  //Sets material id to a face.
118  void setFacesMaterial(const BRepBuilderGeometryId &faceId, OdDbStub &materialId);
119 
120  //Complete construction of the geometry. The geometry will be validated and, if valid, stored in this Builder.
122 
123  //Enable/disable validation in BRepBuilder
124  void enableValidator(bool bEnable = true);
125 protected:
126  void* m_pImpl;
127 };
128 
129 #include "TD_PackPop.h"
130 
131 #endif //_BREPBUILDER_H_
OdGeSurface
Definition: GeSurface.h:48
OdBrepBuilder::m_pImpl
void * m_pImpl
Definition: BrepBuilder.h:126
OdBrepBuilder::canAddGeometry
bool canAddGeometry()
NULL
#define NULL
Definition: GsProperties.h:177
OdRxObjectPtr
Definition: RxObject.h:345
OdBrepBuilder::getType
BrepType getType()
GeCurve3d.h
OdGeCurve2d
Definition: GeCurve2d.h:53
OdBrepBuilder::IsValidFaceId
bool IsValidFaceId(const BRepBuilderGeometryId &faceId)
OdBrepBuilder::addLoop
BRepBuilderGeometryId addLoop(const BRepBuilderGeometryId &faceId)
OdBrepBuilder::kForward
@ kForward
Definition: BrepBuilder.h:54
OdBrepBuilder::removedSomeFaces
bool removedSomeFaces()
OdBrepBuilder::allowRemovalOfProblematicFaces
void allowRemovalOfProblematicFaces()
TD_PackPop.h
OdBrepBuilder::finishLoop
void finishLoop(const BRepBuilderGeometryId &loopId)
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdBrepBuilder::OdBrepBuilder
OdBrepBuilder()
kSolid
@ kSolid
Definition: BrepBuilder.h:39
OdBrepBuilder::enableValidator
void enableValidator(bool bEnable=true)
OdBrepBuilder::isResultAvailable
bool isResultAvailable()
OdBrepBuilder::addCoedge
BRepBuilderGeometryId addCoedge(const BRepBuilderGeometryId &loopId, const BRepBuilderGeometryId &edgeId, EntityDirection codgeDirection=kForward, const OdGeCurve2d *pParCur=NULL)
OdBrepBuilder::finishFace
void finishFace(const BRepBuilderGeometryId &faceId)
OdBrepBuilder::isPermittedSurfaceType
bool isPermittedSurfaceType(const OdGeSurface *pSurf)
BrepBuilderExport.h
OdBrepBuilder::~OdBrepBuilder
~OdBrepBuilder()
OdBrepBuilder::set
void set(const void *pFile)
BREPBUILDEREXPORT
#define BREPBUILDEREXPORT
Definition: BrepBuilderExport.h:33
OdaCommon.h
OdBrepBuilder::finish
OdRxObjectPtr finish()
OdBrepBuilder::addEdge
BRepBuilderGeometryId addEdge(const OdGeCurve3d *pCurveForEdge)
TD_PackPush.h
OdBrepBuilder::setAllowShortEdges
void setAllowShortEdges()
OdBrepBuilder::isValidEdgeId
bool isValidEdgeId(const BRepBuilderGeometryId &edgeId)
OdBrepBuilder
Definition: BrepBuilder.h:47
OdGeCurve3d
Definition: GeCurve3d.h:56
BrepType
BrepType
Definition: BrepBuilder.h:35
OdBrepBuilder::addFace
BRepBuilderGeometryId addFace(const OdGeSurface *pSurf, EntityDirection faceDirection)
BRepBuilderGeometryId
OdUInt32 BRepBuilderGeometryId
Definition: BrepBuilder.h:44
kVoid
@ kVoid
Definition: BrepBuilder.h:41
OdBrepBuilder::isValidLoopId
bool isValidLoopId(const BRepBuilderGeometryId &loopId)
OdBrepBuilder::getResult
OdRxObjectPtr getResult()
OdBrepBuilder::EntityDirection
EntityDirection
Definition: BrepBuilder.h:53
OdBrepBuilder::setFacesMaterial
void setFacesMaterial(const BRepBuilderGeometryId &faceId, OdDbStub &materialId)
kOpenShell
@ kOpenShell
Definition: BrepBuilder.h:37