CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
BrepBuilder.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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 Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 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 "CmColorBase.h"
31#include "OdResult.h"
32#include "TD_PackPush.h"
33
34class OdDbStub;
35class OdGiMapper;
36
43{
49 kVoid
50};
51
53
61{
62public:
63 static const BRepBuilderGeometryId kInvalidId = BRepBuilderGeometryId(-1);
64
70 : m_errorCode(::eOk)
71 , m_complexId(kInvalidId)
72 , m_shellId(kInvalidId)
73 , m_faceId(kInvalidId)
74 , m_loopId(kInvalidId)
75 , m_edgeId(kInvalidId)
76 , m_coedgeId(kInvalidId)
77 , m_errorMessage("")
78 {};
79
93 explicit BrepBuilderErrorsHolder(OdResult errCode, const OdString& errMsg = "",
94 BRepBuilderGeometryId complexId = kInvalidId,
95 BRepBuilderGeometryId shellId = kInvalidId,
96 BRepBuilderGeometryId faceId = kInvalidId,
97 BRepBuilderGeometryId loopId = kInvalidId,
98 BRepBuilderGeometryId edgeId = kInvalidId,
99 BRepBuilderGeometryId coedgeId = kInvalidId)
100 : m_errorCode(errCode)
101 , m_complexId(complexId)
102 , m_shellId(shellId)
103 , m_faceId(faceId)
104 , m_loopId(loopId)
105 , m_edgeId(edgeId)
106 , m_coedgeId(coedgeId)
107 , m_errorMessage(errMsg)
108 {};
109
126};
127
132typedef OdArray <BrepBuilderErrorsHolder> ValidationErrors;
133
134
142{
143public:
148
153
158
163 {
167 kReversed
168 };
169
175
181 void set(const void* pFile);
182
197 BRepBuilderGeometryId addCoedge(const BRepBuilderGeometryId& loopId, const BRepBuilderGeometryId& edgeId, EntityDirection codgeDirection = kForward, const OdGeCurve2d* pParCur = NULL);
198
206
215 BRepBuilderGeometryId addEdge(const OdGeCurve3d* pCurveForEdge, const BRepBuilderGeometryId& vertex1Id, const BRepBuilderGeometryId& vertex2Id);
216
224
233 BRepBuilderGeometryId addFace(const OdGeSurface* pSurf, EntityDirection faceDirection, const BRepBuilderGeometryId& shellId = kDefaultShellId);
234
242
250
257
268
278
284 void finishComplex(const BRepBuilderGeometryId& complexId);
285
291 void finishShell(const BRepBuilderGeometryId& shellId);
292
299
306
320
334
344
354
364
374
384
394
407
416
427 void setFlag(const BRepBuilderGeometryId& id, OdUInt32 flag, bool enable);
428
435 void setFacesMaterial(const BRepBuilderGeometryId& faceId, OdDbStub& materialId);
436
447 const OdGiMapper& materialMapper);
448
459
470
479
491
497 void enableValidator(bool bEnable = true);
498
506
512 bool isValid() const;
513
514protected:
515 //DOM-IGNORE-BEGIN
516 void* m_pImpl;
517 //DOM-IGNORE-END
518};
519
520#include "TD_PackPop.h"
521
522#endif //_BREPBUILDER_H_
OdUInt32 BRepBuilderGeometryId
Definition: BrepBuilder.h:52
BrepType
Definition: BrepBuilder.h:43
@ kVoid
Definition: BrepBuilder.h:49
@ kSolid
Definition: BrepBuilder.h:47
@ kOpenShell
Definition: BrepBuilder.h:45
OdArray< BrepBuilderErrorsHolder > ValidationErrors
Definition: BrepBuilder.h:132
#define BREPBUILDEREXPORT_STATIC
#define BREPBUILDEREXPORT
unsigned int OdUInt32
OdResult
Definition: OdResult.h:29
void setTag(const BRepBuilderGeometryId &id, OdUInt32 tag)
const ValidationErrors * getValidationErrors() const
BRepBuilderGeometryId addVertex(const OdGePoint3d &point)
bool isResultAvailable()
static BREPBUILDEREXPORT_STATIC const BRepBuilderGeometryId kDefaultVertexId
Definition: BrepBuilder.h:147
void setFlag(const BRepBuilderGeometryId &id, OdUInt32 flag, bool enable)
void setAllowShortEdges()
void enableValidator(bool bEnable=true)
BrepType getType()
BRepBuilderGeometryId addComplex()
BRepBuilderGeometryId addShell(const BRepBuilderGeometryId &complexId)
OdRxObjectPtr finish()
bool isValidEdgeId(const BRepBuilderGeometryId &edgeId)
OdResult setFaceColor(const BRepBuilderGeometryId &faceId, const OdCmEntityColor &faceColor)
OdResult setFaceMaterialMapping(const BRepBuilderGeometryId &faceId, const OdGiMapper &materialMapper)
void finishLoop(const BRepBuilderGeometryId &loopId)
BRepBuilderGeometryId addEdge(const OdGeCurve3d *pCurveForEdge)
void finishComplex(const BRepBuilderGeometryId &complexId)
bool isValidFaceId(const BRepBuilderGeometryId &faceId)
bool canAddGeometry()
void set(const void *pFile)
void * m_pImpl
Definition: BrepBuilder.h:516
void setFacesMaterial(const BRepBuilderGeometryId &faceId, OdDbStub &materialId)
bool isPermittedSurfaceType(const OdGeSurface *pSurf)
static BREPBUILDEREXPORT_STATIC const BRepBuilderGeometryId kDefaultShellId
Definition: BrepBuilder.h:145
BRepBuilderGeometryId addCoedge(const BRepBuilderGeometryId &loopId, const BRepBuilderGeometryId &edgeId, EntityDirection codgeDirection=kForward, const OdGeCurve2d *pParCur=NULL)
void allowRemovalOfProblematicFaces()
void finishShell(const BRepBuilderGeometryId &shellId)
OdRxObjectPtr getResult()
void finishFace(const BRepBuilderGeometryId &faceId)
bool isValidShellId(const BRepBuilderGeometryId &shellId)
BRepBuilderGeometryId addLoop(const BRepBuilderGeometryId &faceId)
OdResult setEdgeColor(const BRepBuilderGeometryId &edgeId, const OdCmEntityColor &edgeColor)
BRepBuilderGeometryId addEdge(const OdGeCurve3d *pCurveForEdge, const BRepBuilderGeometryId &vertex1Id, const BRepBuilderGeometryId &vertex2Id)
bool isValidLoopId(const BRepBuilderGeometryId &loopId)
BRepBuilderGeometryId addFace(const OdGeSurface *pSurf, EntityDirection faceDirection, const BRepBuilderGeometryId &shellId=kDefaultShellId)
bool isValidComplexId(const BRepBuilderGeometryId &complexId)
bool removedSomeFaces()
bool isValid() const
BRepBuilderGeometryId m_shellId
Definition: BrepBuilder.h:115
BRepBuilderGeometryId m_edgeId
Definition: BrepBuilder.h:121
BRepBuilderGeometryId m_loopId
Definition: BrepBuilder.h:119
BrepBuilderErrorsHolder(OdResult errCode, const OdString &errMsg="", BRepBuilderGeometryId complexId=kInvalidId, BRepBuilderGeometryId shellId=kInvalidId, BRepBuilderGeometryId faceId=kInvalidId, BRepBuilderGeometryId loopId=kInvalidId, BRepBuilderGeometryId edgeId=kInvalidId, BRepBuilderGeometryId coedgeId=kInvalidId)
Definition: BrepBuilder.h:93
BRepBuilderGeometryId m_complexId
Definition: BrepBuilder.h:113
BRepBuilderGeometryId m_coedgeId
Definition: BrepBuilder.h:123
BRepBuilderGeometryId m_faceId
Definition: BrepBuilder.h:117