CFx SDK Documentation  2023 SP0
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_
OdUInt32 BRepBuilderGeometryId
Definition: BrepBuilder.h:44
BrepType
Definition: BrepBuilder.h:35
@ kVoid
Definition: BrepBuilder.h:41
@ kSolid
Definition: BrepBuilder.h:39
@ kOpenShell
Definition: BrepBuilder.h:37
#define BREPBUILDEREXPORT
#define NULL
Definition: GsProperties.h:177
unsigned int OdUInt32
bool isResultAvailable()
void setAllowShortEdges()
void enableValidator(bool bEnable=true)
BrepType getType()
OdRxObjectPtr finish()
bool isValidEdgeId(const BRepBuilderGeometryId &edgeId)
void finishLoop(const BRepBuilderGeometryId &loopId)
BRepBuilderGeometryId addEdge(const OdGeCurve3d *pCurveForEdge)
bool canAddGeometry()
void set(const void *pFile)
void * m_pImpl
Definition: BrepBuilder.h:126
void setFacesMaterial(const BRepBuilderGeometryId &faceId, OdDbStub &materialId)
bool isPermittedSurfaceType(const OdGeSurface *pSurf)
BRepBuilderGeometryId addCoedge(const BRepBuilderGeometryId &loopId, const BRepBuilderGeometryId &edgeId, EntityDirection codgeDirection=kForward, const OdGeCurve2d *pParCur=NULL)
void allowRemovalOfProblematicFaces()
OdRxObjectPtr getResult()
void finishFace(const BRepBuilderGeometryId &faceId)
BRepBuilderGeometryId addLoop(const BRepBuilderGeometryId &faceId)
bool IsValidFaceId(const BRepBuilderGeometryId &faceId)
bool isValidLoopId(const BRepBuilderGeometryId &loopId)
BRepBuilderGeometryId addFace(const OdGeSurface *pSurf, EntityDirection faceDirection)
bool removedSomeFaces()