CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
OdBrepBuilder Class Reference

#include <BrepBuilder.h>

Public Types

enum  EntityDirection { kForward , kReversed }
 

Public Member Functions

 OdBrepBuilder ()
 
 ~OdBrepBuilder ()
 
BrepType getType ()
 
void set (const void *pFile)
 
BRepBuilderGeometryId addCoedge (const BRepBuilderGeometryId &loopId, const BRepBuilderGeometryId &edgeId, EntityDirection codgeDirection=kForward, const OdGeCurve2d *pParCur=NULL)
 
BRepBuilderGeometryId addEdge (const OdGeCurve3d *pCurveForEdge)
 
BRepBuilderGeometryId addEdge (const OdGeCurve3d *pCurveForEdge, const BRepBuilderGeometryId &vertex1Id, const BRepBuilderGeometryId &vertex2Id)
 
BRepBuilderGeometryId addVertex (const OdGePoint3d &point)
 
BRepBuilderGeometryId addFace (const OdGeSurface *pSurf, EntityDirection faceDirection, const BRepBuilderGeometryId &shellId=kDefaultShellId)
 
BRepBuilderGeometryId addLoop (const BRepBuilderGeometryId &faceId)
 
BRepBuilderGeometryId addShell (const BRepBuilderGeometryId &complexId)
 
BRepBuilderGeometryId addComplex ()
 
void allowRemovalOfProblematicFaces ()
 
bool canAddGeometry ()
 
void finishComplex (const BRepBuilderGeometryId &complexId)
 
void finishShell (const BRepBuilderGeometryId &shellId)
 
void finishFace (const BRepBuilderGeometryId &faceId)
 
void finishLoop (const BRepBuilderGeometryId &loopId)
 
OdRxObjectPtr getResult ()
 
bool isPermittedSurfaceType (const OdGeSurface *pSurf)
 
bool isResultAvailable ()
 
bool isValidEdgeId (const BRepBuilderGeometryId &edgeId)
 
bool isValidComplexId (const BRepBuilderGeometryId &complexId)
 
bool isValidShellId (const BRepBuilderGeometryId &shellId)
 
bool isValidFaceId (const BRepBuilderGeometryId &faceId)
 
bool isValidLoopId (const BRepBuilderGeometryId &loopId)
 
bool removedSomeFaces ()
 
void setAllowShortEdges ()
 
void setFlag (const BRepBuilderGeometryId &id, OdUInt32 flag, bool enable)
 
void setFacesMaterial (const BRepBuilderGeometryId &faceId, OdDbStub &materialId)
 
OdResult setFaceMaterialMapping (const BRepBuilderGeometryId &faceId, const OdGiMapper &materialMapper)
 
OdResult setEdgeColor (const BRepBuilderGeometryId &edgeId, const OdCmEntityColor &edgeColor)
 
OdResult setFaceColor (const BRepBuilderGeometryId &faceId, const OdCmEntityColor &faceColor)
 
OdRxObjectPtr finish ()
 
void setTag (const BRepBuilderGeometryId &id, OdUInt32 tag)
 
void enableValidator (bool bEnable=true)
 
const ValidationErrorsgetValidationErrors () const
 
bool isValid () const
 

Static Public Attributes

static BREPBUILDEREXPORT_STATIC const BRepBuilderGeometryId kDefaultShellId
 
static BREPBUILDEREXPORT_STATIC const BRepBuilderGeometryId kDefaultVertexId
 

Protected Attributes

voidm_pImpl
 

Detailed Description

This is the class that allows direct construction of geometry objects (solids, surfaces or open shells).

<group OdBrepBuilder_Classes>

Definition at line 141 of file BrepBuilder.h.

Member Enumeration Documentation

◆ EntityDirection

Defines the entity direction in relation to the parent entity.

Enumerator
kForward 

The direction of the entity is the same as the direction of the parent entity.

kReversed 

The direction of the entity is opposite to the direction of the parent entity.

Definition at line 162 of file BrepBuilder.h.

Constructor & Destructor Documentation

◆ OdBrepBuilder()

OdBrepBuilder::OdBrepBuilder ( )

Creates a new instance of the OdBrepBuilder object with default parameters.

◆ ~OdBrepBuilder()

OdBrepBuilder::~OdBrepBuilder ( )

Destructor. Destroys the OdBrepBuilder object.

Member Function Documentation

◆ addCoedge()

BRepBuilderGeometryId OdBrepBuilder::addCoedge ( const BRepBuilderGeometryId loopId,
const BRepBuilderGeometryId edgeId,
EntityDirection  codgeDirection = kForward,
const OdGeCurve2d pParCur = NULL 
)

Adds a coedge associated to a previously added edge. A coedge represents the use of an edge on one of the edge's faces.

Parameters
loopId[in] ID of the loop which the added code belongs to.
edgeId[in] ID of the edge.
codgeDirection[in] Coedge direction in relation to the edge.
pParCur[in] Pointer to a paramectic curve. Optional parameter.
Returns
BRepBuilderGeometryId of the added coedge.
Remarks
OdError(eInvalidInput) exception is thrown if the type of the parametric curve (pParCur) is not supported by the BrepBuilder implementation.

◆ addComplex()

BRepBuilderGeometryId OdBrepBuilder::addComplex ( )

Creates an empty complex — the upper topology element.

Returns
BRepBuilderGeometryId of the added complex.

◆ addEdge() [1/2]

BRepBuilderGeometryId OdBrepBuilder::addEdge ( const OdGeCurve3d pCurveForEdge)

Adds a new edge to the geometry being built.

Parameters
pCurveForEdge[in] Pointer to the edge geometry (object-space curve).
Returns
BRepBuilderGeometryId of the added edge.

◆ addEdge() [2/2]

BRepBuilderGeometryId OdBrepBuilder::addEdge ( const OdGeCurve3d pCurveForEdge,
const BRepBuilderGeometryId vertex1Id,
const BRepBuilderGeometryId vertex2Id 
)

Adds a new edge to the geometry being built.

Parameters
pCurveForEdge[in] Pointer to the edge geometry (object-space curve).
vertex1Id[in] ID of the first vertex.
vertex2Id[in] ID of the second vertex.
Returns
BRepBuilderGeometryId of the added edge.

◆ addFace()

BRepBuilderGeometryId OdBrepBuilder::addFace ( const OdGeSurface pSurf,
EntityDirection  faceDirection,
const BRepBuilderGeometryId shellId = kDefaultShellId 
)

Creates an empty face in the geometry being built.

Parameters
pSurf[in] Pointer to the underlying surface.
faceDirection[in] Face's orientation in relation to the underlying surface.
shellId[in] Shell ID.
Returns
BRepBuilderGeometryId of the added face.

◆ addLoop()

BRepBuilderGeometryId OdBrepBuilder::addLoop ( const BRepBuilderGeometryId faceId)

Creates an empty loop in a given face of the geometry being built.

Parameters
faceId[in] Face ID.
Returns
BRepBuilderGeometryId of the added face.

◆ addShell()

BRepBuilderGeometryId OdBrepBuilder::addShell ( const BRepBuilderGeometryId complexId)

Creates an empty shell.

Parameters
complexId[in] Complex ID.
Returns
BRepBuilderGeometryId of the added face.

◆ addVertex()

BRepBuilderGeometryId OdBrepBuilder::addVertex ( const OdGePoint3d point)

Adds a new vertex to the geometry being built.

Parameters
point[in] 3D point.
Returns
BRepBuilderGeometryId of the added vertex.

◆ allowRemovalOfProblematicFaces()

void OdBrepBuilder::allowRemovalOfProblematicFaces ( )

Allows BRepBuilder to remove problematic faces (e.g. due to inaccurate edge geometry). If this option is enabled and BRepBuilder removes some faces, the output geometry's type will be OpenShell regardless of the expected type, specified when the BRepBuilder was created.

Remarks
Currently not implemented.

◆ canAddGeometry()

bool OdBrepBuilder::canAddGeometry ( )

A validator function that checks the state of this BRepBuilder object.

Returns
True if this BRepBuilder object is accepting B-Rep data, false otherwise.
Remarks
Currently not implemented.

◆ enableValidator()

void OdBrepBuilder::enableValidator ( bool  bEnable = true)

Enables or disables validation in BRepBuilder.

Parameters
bEnable[in] True to enable validation; false to disable validation.

◆ finish()

OdRxObjectPtr OdBrepBuilder::finish ( )

Completes construction of the geometry. The geometry is validated and if valid, stored in this Builder.

Returns
Pointer to the built entity, that is specific for each product-dependent implementation.

◆ finishComplex()

void OdBrepBuilder::finishComplex ( const BRepBuilderGeometryId complexId)

Indicates that the caller has finished defining the given complex.

Parameters
complexId[in] Complex ID.

◆ finishFace()

void OdBrepBuilder::finishFace ( const BRepBuilderGeometryId faceId)

Indicates that the caller has finished defining the given face.

Parameters
faceId[in] Face ID.

◆ finishLoop()

void OdBrepBuilder::finishLoop ( const BRepBuilderGeometryId loopId)

Indicates that the caller has finished defining the given loop.

Parameters
loopId[in] Loop ID.

◆ finishShell()

void OdBrepBuilder::finishShell ( const BRepBuilderGeometryId shellId)

Indicates that the caller has finished defining the given shell.

Parameters
shellId[in] Shell ID.

◆ getResult()

OdRxObjectPtr OdBrepBuilder::getResult ( )

Gets the geometry object built by this BRepBuilder. This method clears the built geometry stored in the BRepBuilder. This function will throw an error if this BRepBuilderGeometryId hasn't completed building the B-Rep. Use IsResultAvailable() to verify whether this BRepBuilder contains a valid result. Built entity is specific for each product-dependent implementation.

Returns
Pointer to the built geometry object.
Remarks
Currently not implemented.

◆ getType()

BrepType OdBrepBuilder::getType ( )

Returns the type of the output geometry.

Returns
Type of the output geometry.

◆ getValidationErrors()

const ValidationErrors * OdBrepBuilder::getValidationErrors ( ) const

Returns errors found during validation.

Returns
Pointer to the ValidationErrors object that stores errors encountered during the validation process.

◆ isPermittedSurfaceType()

bool OdBrepBuilder::isPermittedSurfaceType ( const OdGeSurface pSurf)

A validator function that checks whether the surface object is of the type that is supported as a face surface by BRepBuilder.

Parameters
pSurf[in] Pointer to the surface object.
Returns
True if the product-dependent implementation of the B-Rep builder can use this surface; false otherwise.
Remarks
Not implemented by default, but the product-dependent implementation of the B-Rep builder can have their own implemetnations of this method.

◆ isResultAvailable()

bool OdBrepBuilder::isResultAvailable ( )

A validator function that checks the state of this BRepBuilder object.

Returns
True if this BRepBuilder object has successfully built a B-Rep; false otherwise.
Remarks
Currently not implemented.

◆ isValid()

bool OdBrepBuilder::isValid ( ) const

Checks the state of the product-dependent implementation.

Returns
True if the product-dependent implementation isn't NULL.

◆ isValidComplexId()

bool OdBrepBuilder::isValidComplexId ( const BRepBuilderGeometryId complexId)

A validator function that checks whether the complex ID corresponds to the complex previously added to this BRepBuilder object.

Parameters
complexId[in] Complex ID.
Returns
True if the complex with the specified ID has been already added; false otherwise.

◆ isValidEdgeId()

bool OdBrepBuilder::isValidEdgeId ( const BRepBuilderGeometryId edgeId)

A validator function that checks whether the edge ID corresponds to the edge previously added to this BRepBuilder object.

Parameters
edgeId[in] Edge ID.
Returns
True if the edge with the specified ID has been already added; false otherwise.

◆ isValidFaceId()

bool OdBrepBuilder::isValidFaceId ( const BRepBuilderGeometryId faceId)

A validator function that checks whether the face ID corresponds to the face previously added to this BRepBuilder object.

Parameters
faceId[in] Face ID.
Returns
True if the face with the specified ID has been already added; false otherwise.

◆ isValidLoopId()

bool OdBrepBuilder::isValidLoopId ( const BRepBuilderGeometryId loopId)

A validator function that checks whether the loop ID corresponds to the loop previously added to this BRepBuilder object.

Parameters
loopId[in] Loop ID.
Returns
True if the loop with the specified ID has been already added; false otherwise.

◆ isValidShellId()

bool OdBrepBuilder::isValidShellId ( const BRepBuilderGeometryId shellId)

A validator function that checks whether the shell ID corresponds to the shell previously added to this BRepBuilder object.

Parameters
shellId[in] Shell ID.
Returns
True if the shell with the specified ID has been already added; false otherwise.

◆ removedSomeFaces()

bool OdBrepBuilder::removedSomeFaces ( )

This function removes some problematic faces from the output geometry.

Returns
True if BRepBuilder removed some problematic faces, false if not.
Remarks
If allowRemovalOfProblematicFaces() was not called to enable removal of problematic faces, this function will return 'false'. Note that if some faces were removed, the output geometry's type will be OpenShell regardless of the expected type that was specified when the BRepBuilder was created. Currently not implemented.

◆ set()

void OdBrepBuilder::set ( const void pFile)

Sets the product-dependent implementation.

Parameters
pFile[in] Pointer to the product-dependent implementation.

◆ setAllowShortEdges()

void OdBrepBuilder::setAllowShortEdges ( )

Makes BRepBuilder allow edges that it would normally disallow as being too short for geometry.

Remarks
Currently not implemented.

◆ setEdgeColor()

OdResult OdBrepBuilder::setEdgeColor ( const BRepBuilderGeometryId edgeId,
const OdCmEntityColor edgeColor 
)

Sets the edge color.

Parameters
edgeId[in] Edge ID.
edgeColor[in] Edge color.
Returns
eOk if the operation is successful; eNotApplicable if this function is not supported by the current implementation; eInvalidInput if the color method is not supported by the current implementation.

◆ setFaceColor()

OdResult OdBrepBuilder::setFaceColor ( const BRepBuilderGeometryId faceId,
const OdCmEntityColor faceColor 
)

Sets the face color.

Parameters
faceId[in] Face ID.
faceColor[in] Face color.
Returns
eOk if the operation is successful; eNotApplicable if this function is not supported by the current implementation or the face color is part of the material.

◆ setFaceMaterialMapping()

OdResult OdBrepBuilder::setFaceMaterialMapping ( const BRepBuilderGeometryId faceId,
const OdGiMapper materialMapper 
)

Sets the material mapper for the face.

Parameters
faceId[in] Face ID.
materialMapper[in] Material mapper.
Returns
eOk if the operation is successful; eNotApplicable if it is not supported by the current implementation or the material mapping is part of the material.

◆ setFacesMaterial()

void OdBrepBuilder::setFacesMaterial ( const BRepBuilderGeometryId faceId,
OdDbStub &  materialId 
)

Sets the material ID to the specified face.

Parameters
faceId[in] Face ID.
materialId[in] Material ID.

◆ setFlag()

void OdBrepBuilder::setFlag ( const BRepBuilderGeometryId id,
OdUInt32  flag,
bool  enable 
)

Sets a specified bit flag on an object.

Parameters
id[in] Entity ID.
flag[in] Bit flag from the BrEntityFlags enumeration.
enable[in] True to enable/set the flag, false to disable/remove the flag.
See also
BrEntityFlags enumeration.

◆ setTag()

void OdBrepBuilder::setTag ( const BRepBuilderGeometryId id,
OdUInt32  tag 
)

Sets the tag value that is used for faces and edges. Use setTag() just after addFace(), addEdge() or addVertex() calls.

Parameters
id[in] B-Rep builder entity ID.
tag[in] Tag value.
Remarks
setTag() should be used for either all or none topologies of the same type.

Member Data Documentation

◆ kDefaultShellId

BREPBUILDEREXPORT_STATIC const BRepBuilderGeometryId OdBrepBuilder::kDefaultShellId
static

Default Shell ID.

Definition at line 145 of file BrepBuilder.h.

◆ kDefaultVertexId

BREPBUILDEREXPORT_STATIC const BRepBuilderGeometryId OdBrepBuilder::kDefaultVertexId
static

Default Vertex ID.

Definition at line 147 of file BrepBuilder.h.

◆ m_pImpl

void* OdBrepBuilder::m_pImpl
protected

Definition at line 516 of file BrepBuilder.h.


The documentation for this class was generated from the following file: