SHAPER  9.12.0
XAO::BrepGeometry Class Reference

Representation of a BRep Geometry. More...

Inheritance diagram for XAO::BrepGeometry:
Inheritance graph

Public Member Functions

 BrepGeometry ()
 Default Constructor. More...
 
 BrepGeometry (const std::string &name)
 Constructor. More...
 
virtual XAO::Format getFormat ()
 Gets the format of the geometry. More...
 
virtual const std::string getShapeString ()
 Gets the shape as a string. More...
 
virtual void setShapeString (const std::string &shape)
 Sets the shape from a string. More...
 
virtual void writeShapeFile (const std::string &fileName)
 Writes shape to a file. More...
 
virtual void readShapeFile (const std::string &fileName)
 Reads shape from a file. More...
 
TopoDS_Shape getTopoDS_Shape ()
 Gets the shape as a TopoDS_Shape. More...
 
void setTopoDS_Shape (const TopoDS_Shape &shape)
 Sets the shape from a TopoDS_Shape. More...
 
void getEdgeVertices (int edgeIndex, int &vertexA, int &vertexB)
 Gives the two extrimities of an edge. More...
 
int countFaceWires (int faceIndex)
 Gets the number of wires of a face (including holes). More...
 
std::vector< int > getFaceEdges (int faceIndex, int wireIndex)
 Gets the indices of the wires of the face. More...
 
int countSolidShells (int solidIndex)
 Gets the number of shells of a solid (including cavities). More...
 
std::vector< int > getSolidFaces (int solidIndex, int shellIndex)
 Gets the indices of the shells of the solids. More...
 
void getVertexXYZ (int vertexIndex, double &xCoord, double &yCoord, double &zCoord)
 Gets the coordinates of a vertex. More...
 
double getEdgeLength (int index)
 Gets the length of an edge. More...
 
double getFaceArea (int index)
 Gets the are of a face. More...
 
double getSolidVolume (int index)
 Gets the volume of a solid. More...
 
int getVertexID (int index)
 Gets the ID of a vertex. More...
 
int getEdgeID (int index)
 Gets the ID of an edge. More...
 
int getFaceID (int index)
 Gets the ID of a face. More...
 
int getSolidID (int index)
 Gets the ID of a solid. More...
 
void setVertexID (int index, int id)
 Sets the ID of a vertex. More...
 
void setEdgeID (int index, int id)
 Sets the ID of an edge. More...
 
void setFaceID (int index, int id)
 Sets the ID of a face. More...
 
void setSolidID (int index, int id)
 Sets the ID of a solid. More...
 
int findVertex (int id)
 Finds a vertex with its ID. More...
 
int findEdge (int id)
 Finds an edge with its ID. More...
 
int findFace (int id)
 Finds a face with its ID. More...
 
int findSolid (int id)
 Finds a solid with its ID. More...
 
const std::string findVertexName (int id)
 Finds the name of a vertex with its ID. More...
 
const std::string findEdgeName (int id)
 Finds the name of an edge with its ID. More...
 
const std::string findFaceName (int id)
 Finds the name of a face with its ID. More...
 
const std::string findSolidName (int id)
 Finds the name of a solid with its ID. More...
 
void changeVertexName (int id, const std::string &name)
 Changes the name of a vertex. More...
 
void changeEdgeName (int id, const std::string &name)
 Changes the name of an edge. More...
 
void changeFaceName (int id, const std::string &name)
 Changes the name of a face. More...
 
void changeSolidName (int id, const std::string &name)
 Changes the name of a solid. More...
 

Static Public Member Functions

static GeometrycreateGeometry (XAO::Format format)
 Creates a geometry. More...
 

name the name of the geometry.

Constructor.

Creates a geometry.

Returns
the created geometry.
const std::string getName ()
 Gets the name of the geometry. More...
 
void setName (const std::string &name)
 Sets the name of the geometry. More...
 
int countElements (XAO::Dimension dim) const
 
int countVertices () const
 
int countEdges () const
 
int countFaces () const
 
int countSolids () const
 
void setCountVertices (int nb)
 
void setCountEdges (int nb)
 
void setCountFaces (int nb)
 
void setCountSolids (int nb)
 
const std::string getVertexName (int index)
 
const std::string getEdgeName (int index)
 
const std::string getFaceName (int index)
 
const std::string getSolidName (int index)
 
void setVertexName (int index, const std::string &name)
 
void setEdgeName (int index, const std::string &name)
 
void setFaceName (int index, const std::string &name)
 
void setSolidName (int index, const std::string &name)
 
bool hasVertexName (int index)
 
bool hasEdgeName (int index)
 
bool hasFaceName (int index)
 
bool hasSolidName (int index)
 
const std::string getVertexReference (int index)
 
const std::string getEdgeReference (int index)
 
const std::string getFaceReference (int index)
 
const std::string getSolidReference (int index)
 
const std::string getElementReference (XAO::Dimension dim, int index)
 
void setVertexReference (int index, const std::string &reference)
 
void setEdgeReference (int index, const std::string &reference)
 
void setFaceReference (int index, const std::string &reference)
 
void setSolidReference (int index, const std::string &reference)
 
void setVertex (int index, const std::string &name, const std::string &reference)
 
void setEdge (int index, const std::string &name, const std::string &reference)
 
void setFace (int index, const std::string &name, const std::string &reference)
 
void setSolid (int index, const std::string &name, const std::string &reference)
 
int getVertexIndexByReference (const std::string &reference)
 
int getEdgeIndexByReference (const std::string &reference)
 
int getFaceIndexByReference (const std::string &reference)
 
int getSolidIndexByReference (const std::string &reference)
 
int getElementIndexByReference (XAO::Dimension dim, const std::string &reference)
 
GeometricElementList::iterator begin (XAO::Dimension dim)
 
GeometricElementList::iterator end (XAO::Dimension dim)
 
bool isReadOnly ()
 Verifies if the geometry is read only. More...
 
void setReadOnly ()
 Sets the geometry read only. More...
 
std::string m_name
 
GeometricElementList m_vertices
 
GeometricElementList m_edges
 
GeometricElementList m_faces
 
GeometricElementList m_solids
 
bool m_readOnly
 
static GeometrycreateGeometry (XAO::Format format, const std::string &name)
 
void checkReadOnly ()
 

Detailed Description

Representation of a BRep Geometry.

Constructor & Destructor Documentation

◆ BrepGeometry() [1/2]

BrepGeometry::BrepGeometry ( )

Default Constructor.

◆ BrepGeometry() [2/2]

BrepGeometry::BrepGeometry ( const std::string &  name)

Constructor.

Parameters
namethe name of the geometry.

Member Function Documentation

◆ getFormat()

virtual XAO::Format XAO::BrepGeometry::getFormat ( )
inlinevirtual

Gets the format of the geometry.

Returns
the format of the geometry.

Implements XAO::Geometry.

◆ getShapeString()

const std::string BrepGeometry::getShapeString ( )
virtual

Gets the shape as a string.

Returns
the shape as a string.

Implements XAO::Geometry.

◆ setShapeString()

void BrepGeometry::setShapeString ( const std::string &  shape)
virtual

Sets the shape from a string.

Parameters
shapethe shape as a string.

Implements XAO::Geometry.

◆ writeShapeFile()

void BrepGeometry::writeShapeFile ( const std::string &  fileName)
virtual

Writes shape to a file.

Parameters
fileNamethe path to the file

Implements XAO::Geometry.

◆ readShapeFile()

void BrepGeometry::readShapeFile ( const std::string &  fileName)
virtual

Reads shape from a file.

Parameters
fileNamethe path to the file

Implements XAO::Geometry.

◆ getTopoDS_Shape()

TopoDS_Shape BrepGeometry::getTopoDS_Shape ( )

Gets the shape as a TopoDS_Shape.

Returns
the TopoDS_Shape.

◆ setTopoDS_Shape()

void BrepGeometry::setTopoDS_Shape ( const TopoDS_Shape &  shape)

Sets the shape from a TopoDS_Shape.

Parameters
shapethe TopoDS_Shape to set.

◆ getEdgeVertices()

void BrepGeometry::getEdgeVertices ( int  edgeIndex,
int &  vertexA,
int &  vertexB 
)

Gives the two extrimities of an edge.

Parameters
edgeIndexthe index of the edge.
vertexA
vertexB

◆ countFaceWires()

int BrepGeometry::countFaceWires ( int  faceIndex)

Gets the number of wires of a face (including holes).

Parameters
faceIndexthe index of the face.
Returns
the number of wires.

◆ getFaceEdges()

std::vector< int > BrepGeometry::getFaceEdges ( int  faceIndex,
int  wireIndex 
)

Gets the indices of the wires of the face.

Parameters
faceIndexthe index of the face.
wireIndexthe index of the wire.
Returns
the list of wires for the given face.

◆ countSolidShells()

int BrepGeometry::countSolidShells ( int  solidIndex)

Gets the number of shells of a solid (including cavities).

Parameters
solidIndexthe index of the solid.
Returns
the number of shells.

◆ getSolidFaces()

std::vector< int > BrepGeometry::getSolidFaces ( int  solidIndex,
int  shellIndex 
)

Gets the indices of the shells of the solids.

Parameters
solidIndexthe index of the solid.
shellIndexthe index of the shell (for the given solid).
Returns
the list of shells for the given solid.

◆ getVertexXYZ()

void BrepGeometry::getVertexXYZ ( int  vertexIndex,
double &  xCoord,
double &  yCoord,
double &  zCoord 
)

Gets the coordinates of a vertex.

Parameters
vertexIndexthe index of the vertex.
xCoordthe X coordinate.
yCoordthe Y coordinate.
zCoordthe Z coordinate.

◆ getEdgeLength()

double BrepGeometry::getEdgeLength ( int  index)

Gets the length of an edge.

Parameters
indexthe index of the edge.
Returns
the length of the edge.

◆ getFaceArea()

double BrepGeometry::getFaceArea ( int  index)

Gets the are of a face.

Parameters
indexthe index of a face.
Returns
the area of the face.

◆ getSolidVolume()

double BrepGeometry::getSolidVolume ( int  index)

Gets the volume of a solid.

Parameters
indexthe index of the solid.
Returns
the volume of the solid.

◆ getVertexID()

int BrepGeometry::getVertexID ( int  index)

Gets the ID of a vertex.

Parameters
indexthe index of the vertex.
Returns
the ID of the vertex.

◆ getEdgeID()

int BrepGeometry::getEdgeID ( int  index)

Gets the ID of an edge.

Parameters
indexthe index of the edge.
Returns
the ID of the edge.

◆ getFaceID()

int BrepGeometry::getFaceID ( int  index)

Gets the ID of a face.

Parameters
indexthe index of the face.
Returns
the ID of the face.

◆ getSolidID()

int BrepGeometry::getSolidID ( int  index)

Gets the ID of a solid.

Parameters
indexthe index of the solid.
Returns
the ID of the solid.

◆ setVertexID()

void BrepGeometry::setVertexID ( int  index,
int  id 
)

Sets the ID of a vertex.

Parameters
indexthe index of the vertex to set.
idthe id to set.

◆ setEdgeID()

void BrepGeometry::setEdgeID ( int  index,
int  id 
)

Sets the ID of an edge.

Parameters
indexthe index of the edge to set.
idthe id to set.

◆ setFaceID()

void BrepGeometry::setFaceID ( int  index,
int  id 
)

Sets the ID of a face.

Parameters
indexthe index of the face to set.
idthe id to set.

◆ setSolidID()

void BrepGeometry::setSolidID ( int  index,
int  id 
)

Sets the ID of a solid.

Parameters
indexthe index of the solid to set.
idthe id to set.

◆ findVertex()

int BrepGeometry::findVertex ( int  id)

Finds a vertex with its ID.

Parameters
idthe ID of the vertex.
Returns
the index of the vertex.

◆ findEdge()

int BrepGeometry::findEdge ( int  id)

Finds an edge with its ID.

Parameters
idthe ID of the edge.
Returns
the index of the edge.

◆ findFace()

int BrepGeometry::findFace ( int  id)

Finds a face with its ID.

Parameters
idthe ID of the face.
Returns
the index of the face.

◆ findSolid()

int BrepGeometry::findSolid ( int  id)

Finds a solid with its ID.

Parameters
idthe ID of the solid.
Returns
th index of the solid.

◆ findVertexName()

const std::string BrepGeometry::findVertexName ( int  id)

Finds the name of a vertex with its ID.

Parameters
idthe ID of the vertex.
Returns
the name of the vertex.

◆ findEdgeName()

const std::string BrepGeometry::findEdgeName ( int  id)

Finds the name of an edge with its ID.

Parameters
idthe ID of the edge.
Returns
the name of the edge.

◆ findFaceName()

const std::string BrepGeometry::findFaceName ( int  id)

Finds the name of a face with its ID.

Parameters
idthe ID of the face.
Returns
the name of the face.

◆ findSolidName()

const std::string BrepGeometry::findSolidName ( int  id)

Finds the name of a solid with its ID.

Parameters
idthe ID of the solid.
Returns
the name of the solid.

◆ changeVertexName()

void BrepGeometry::changeVertexName ( int  id,
const std::string &  name 
)

Changes the name of a vertex.

Parameters
idthe ID of the vertex.
namethe name to set.

◆ changeEdgeName()

void BrepGeometry::changeEdgeName ( int  id,
const std::string &  name 
)

Changes the name of an edge.

Parameters
idthe ID of the edge
namethe name to set.

◆ changeFaceName()

void BrepGeometry::changeFaceName ( int  id,
const std::string &  name 
)

Changes the name of a face.

Parameters
idthe ID of the face.
namethe name to set.

◆ changeSolidName()

void BrepGeometry::changeSolidName ( int  id,
const std::string &  name 
)

Changes the name of a solid.

Parameters
idthe ID of the solid.
namethe name to set.

◆ createGeometry()

Geometry * Geometry::createGeometry ( XAO::Format  format)
staticinherited

Creates a geometry.

Parameters
formatthe format of the geometry.
Returns
the created geometry.

◆ getName()

const std::string XAO::Geometry::getName ( )
inlineinherited

Gets the name of the geometry.

Returns
the name of the geometry.

◆ setName()

void XAO::Geometry::setName ( const std::string &  name)
inlineinherited

Sets the name of the geometry.

Parameters
namethe name to set.

◆ isReadOnly()

bool XAO::Geometry::isReadOnly ( )
inlineinherited

Verifies if the geometry is read only.

Returns
true if the geometry is read only.

◆ setReadOnly()

void XAO::Geometry::setReadOnly ( )
inlineinherited

Sets the geometry read only.