Each edge has two next pointers and two previous pointers to the OdBmGEdge
object; it also has two pointers to the faces that are bound by the edge. To
work with edges, you need to call the face, loop, then edge. Find the "active"
face in the array of faces of the edge. After, select pointers and points at
the same position in the arrays. Next, in the edge, find the correct next/prev
pointer for continuing the loop or select the correct points. For example:
getFacesItem()
method of the edge (returns array of faces that are connected
with the edge).getNextItem()
and getPrevItem()
methods of the edge.getFirstAndLastEdgeGePnts()
and
getInteriorEdgeGePnts()
methods.Edge points must be used in a forward direction if using the forward direction is used for the loop, and edge points must be reversed if a reversed loop is in use. There are two exceptions:
OdBmGeometry
class:
getEdges()
method — Returns array of edges through its argument.getFaces()
method — Returns array of faces through its argument.getGInfo()
method — Returns geometry information as an object of
the OdBmGInfo
class.OdBmFace
class:
getSurface()
method — Returns an OdBmSurfacePtr
object,
which can be an object of one of the inherited classes:
Plane
,
ConeSurf
,
CylSurf
,
HermiteSurf
,
OffsetSurf
,
RuledSurf
,
SharedSurface
,
SurfRev
, or
TempImportNurbsSurf
.getFirstLoop()
method — Returns the face's first loop of edges as
a pointer to an object of the OdBmGEdgeLoop
class.OdBmGEdgeLoop
class:
getNextLoop()
method — Returns a pointer to the next edge loop on
the surface.getFace()
method — Returns a pointer to the face connected with the
loop.getNext()
method — Returns a pointer to the start edge of the loop.
Forward loop direction.getPrev()
method — Returns a pointer to the start edge of the loop.
Reverse loop direction.OdBmGEdge
class:
getFacesItem()
method — Returns array of pointers to faces connected
with the edge.getNextItem()
method — Returns array of pointers to the next edges
in a loop. If it is the last edge in a loop, next will be a pointer to the loop.getPrevItem()
method — Returns array of pointers to the previous
edges in a loop. If it is the last edge in a loop, prev will be a pointer to the loop.getInteriorEdgeGePnts()
method — Returns points of the edge on the
surface, except for the start and and points.getFirstAndLastEdgeGePntsItem()
method — Returns start and end points
of the edge on the surface.The following example describes working with B-Rep objects by getting an object using its ID, passing through its faces and loops of edges, and displaying exterior points of each edge.
// Get object
OdBmElementPtr pElem = pDb->getObjectId(OdDbHandle(OdUInt64(iHandle))).safeOpenObject();
// Get object's geometry
OdBmObjectPtr pGeom = pElem->getGeometry();
if (pGeom->isA() == OdBmGElement::desc())
{
OdBmGElement* pGElem = dynamic_cast<OdBmGElement*>(pGeom.get());
//Get nodes
OdBmGNodePtrArray nodes;
pGElem->getAllSubNodes(nodes);
//Test all nodes until OdBmGeometry found or all nodes verified
dumpGGroup(pIO, nodes);
}//if (pGeom->isA() == OdBmGElement::desc())
To see the full sample find Examples/TB_Commands/Dump/BmBrepCmd
sample command
inside your ODA BimRv SDK installation folder.
Copyright © 2002 – 2022. Open Design Alliance. All rights reserved.
|