Version: 9.12.0
XAO::BrepGeometry Class Reference

Representation of a BRep Geometry.

#include <XAO_BrepGeometry.hxx>

Inheritance diagram for XAO::BrepGeometry:
Inheritance graph

Public Member Functions

 BrepGeometry ()
 Default Constructor. More...
 
 BrepGeometry (const std::string &name)
 Constructor. More...
 
virtual ~BrepGeometry ()
 
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...
 
- Public Member Functions inherited from XAO::Geometry
virtual ~Geometry ()
 Destructor. More...
 
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...
 

Private Member Functions

void initIds ()
 
void initListIds (const TopAbs_ShapeEnum &shapeType, GeometricElementList &eltList)
 
TopoDS_Shape getSubShape (const TopoDS_Shape &mainShape, const TopAbs_ShapeEnum &shapeType, int shapeIndex)
 
int countGeometricalElements (const TopoDS_Shape &shape, const TopAbs_ShapeEnum &shapeType)
 
std::vector< int > getGeometricalElements (const TopoDS_Shape &shape, const TopAbs_ShapeEnum &shapeType, XAO::Dimension dim)
 
int findElement (XAO::Dimension dim, int id)
 

Private Attributes

TopoDS_Shape m_shape
 

Additional Inherited Members

- Static Public Member Functions inherited from XAO::Geometry
static GeometrycreateGeometry (XAO::Format format)
 Creates a geometry. More...
 
static GeometrycreateGeometry (XAO::Format format, const std::string &name)
 
- Protected Member Functions inherited from XAO::Geometry
 Geometry (const std::string &name)
 Constructor. More...
 
void checkReadOnly ()
 
- Protected Attributes inherited from XAO::Geometry
std::string m_name
 
GeometricElementList m_vertices
 
GeometricElementList m_edges
 
GeometricElementList m_faces
 
GeometricElementList m_solids
 
bool m_readOnly
 

Constructor & Destructor Documentation

◆ BrepGeometry() [1/2]

BrepGeometry::BrepGeometry ( )

◆ BrepGeometry() [2/2]

BrepGeometry::BrepGeometry ( const std::string &  name)
Parameters
namethe name of the geometry.

◆ ~BrepGeometry()

virtual XAO::BrepGeometry::~BrepGeometry ( )
inlinevirtual

Member Function Documentation

◆ changeEdgeName()

void BrepGeometry::changeEdgeName ( int  id,
const std::string &  name 
)
Parameters
idthe ID of the edge
namethe name to set.

References findEdge(), and XAO::Geometry::setEdgeName().

◆ changeFaceName()

void BrepGeometry::changeFaceName ( int  id,
const std::string &  name 
)
Parameters
idthe ID of the face.
namethe name to set.

References findFace(), and XAO::Geometry::setFaceName().

◆ changeSolidName()

void BrepGeometry::changeSolidName ( int  id,
const std::string &  name 
)
Parameters
idthe ID of the solid.
namethe name to set.

References findSolid(), and XAO::Geometry::setSolidName().

◆ changeVertexName()

void BrepGeometry::changeVertexName ( int  id,
const std::string &  name 
)
Parameters
idthe ID of the vertex.
namethe name to set.

References findVertex(), and XAO::Geometry::setVertexName().

◆ countFaceWires()

int BrepGeometry::countFaceWires ( int  faceIndex)
Parameters
faceIndexthe index of the face.
Returns
the number of wires.

References countGeometricalElements(), getSubShape(), and m_shape.

◆ countGeometricalElements()

int BrepGeometry::countGeometricalElements ( const TopoDS_Shape &  shape,
const TopAbs_ShapeEnum &  shapeType 
)
private

◆ countSolidShells()

int BrepGeometry::countSolidShells ( int  solidIndex)
Parameters
solidIndexthe index of the solid.
Returns
the number of shells.

References countGeometricalElements(), getSubShape(), and m_shape.

◆ findEdge()

int BrepGeometry::findEdge ( int  id)
Parameters
idthe ID of the edge.
Returns
the index of the edge.

References XAO::Geometry::getEdgeIndexByReference(), and XAO::XaoUtils::intToString().

◆ findEdgeName()

const std::string BrepGeometry::findEdgeName ( int  id)
Parameters
idthe ID of the edge.
Returns
the name of the edge.

References findEdge(), and XAO::Geometry::getEdgeName().

◆ findElement()

int BrepGeometry::findElement ( XAO::Dimension  dim,
int  id 
)
private

◆ findFace()

int BrepGeometry::findFace ( int  id)
Parameters
idthe ID of the face.
Returns
the index of the face.

References XAO::Geometry::getFaceIndexByReference(), and XAO::XaoUtils::intToString().

◆ findFaceName()

const std::string BrepGeometry::findFaceName ( int  id)
Parameters
idthe ID of the face.
Returns
the name of the face.

References findFace(), and XAO::Geometry::getFaceName().

◆ findSolid()

int BrepGeometry::findSolid ( int  id)
Parameters
idthe ID of the solid.
Returns
th index of the solid.

References XAO::Geometry::getSolidIndexByReference(), and XAO::XaoUtils::intToString().

◆ findSolidName()

const std::string BrepGeometry::findSolidName ( int  id)
Parameters
idthe ID of the solid.
Returns
the name of the solid.

References findSolid(), and XAO::Geometry::getSolidName().

◆ findVertex()

int BrepGeometry::findVertex ( int  id)
Parameters
idthe ID of the vertex.
Returns
the index of the vertex.

References XAO::Geometry::getVertexIndexByReference(), and XAO::XaoUtils::intToString().

◆ findVertexName()

const std::string BrepGeometry::findVertexName ( int  id)
Parameters
idthe ID of the vertex.
Returns
the name of the vertex.

References findVertex(), and XAO::Geometry::getVertexName().

◆ getEdgeID()

int BrepGeometry::getEdgeID ( int  index)
Parameters
indexthe index of the edge.
Returns
the ID of the edge.

References XAO::Geometry::getEdgeReference(), and XAO::XaoUtils::stringToInt().

◆ getEdgeLength()

double BrepGeometry::getEdgeLength ( int  index)
Parameters
indexthe index of the edge.
Returns
the length of the edge.

References getSubShape(), and m_shape.

◆ getEdgeVertices()

void BrepGeometry::getEdgeVertices ( int  edgeIndex,
int &  vertexA,
int &  vertexB 
)
Parameters
edgeIndexthe index of the edge.
vertexA
vertexB

References getGeometricalElements(), getSubShape(), m_shape, and XAO::VERTEX.

◆ getFaceArea()

double BrepGeometry::getFaceArea ( int  index)
Parameters
indexthe index of a face.
Returns
the area of the face.

References getSubShape(), and m_shape.

◆ getFaceEdges()

std::vector< int > BrepGeometry::getFaceEdges ( int  faceIndex,
int  wireIndex 
)
Parameters
faceIndexthe index of the face.
wireIndexthe index of the wire.
Returns
the list of wires for the given face.

References XAO::EDGE, getGeometricalElements(), getSubShape(), and m_shape.

◆ getFaceID()

int BrepGeometry::getFaceID ( int  index)
Parameters
indexthe index of the face.
Returns
the ID of the face.

References XAO::Geometry::getFaceReference(), and XAO::XaoUtils::stringToInt().

◆ getFormat()

virtual XAO::Format XAO::BrepGeometry::getFormat ( )
inlinevirtual
Returns
the format of the geometry.

Implements XAO::Geometry.

References XAO::BREP.

◆ getGeometricalElements()

std::vector< int > BrepGeometry::getGeometricalElements ( const TopoDS_Shape &  shape,
const TopAbs_ShapeEnum &  shapeType,
XAO::Dimension  dim 
)
private

References findElement(), and m_shape.

◆ getShapeString()

const std::string BrepGeometry::getShapeString ( )
virtual
Returns
the shape as a string.

Implements XAO::Geometry.

References m_shape, and Write().

◆ getSolidFaces()

std::vector< int > BrepGeometry::getSolidFaces ( int  solidIndex,
int  shellIndex 
)
Parameters
solidIndexthe index of the solid.
shellIndexthe index of the shell (for the given solid).
Returns
the list of shells for the given solid.

References XAO::FACE, getGeometricalElements(), getSubShape(), and m_shape.

◆ getSolidID()

int BrepGeometry::getSolidID ( int  index)
Parameters
indexthe index of the solid.
Returns
the ID of the solid.

References XAO::Geometry::getSolidReference(), and XAO::XaoUtils::stringToInt().

◆ getSolidVolume()

double BrepGeometry::getSolidVolume ( int  index)
Parameters
indexthe index of the solid.
Returns
the volume of the solid.

References getSubShape(), and m_shape.

◆ getSubShape()

TopoDS_Shape BrepGeometry::getSubShape ( const TopoDS_Shape &  mainShape,
const TopAbs_ShapeEnum &  shapeType,
int  shapeIndex 
)
private

◆ getTopoDS_Shape()

TopoDS_Shape BrepGeometry::getTopoDS_Shape ( )
Returns
the TopoDS_Shape.

References m_shape.

◆ getVertexID()

int BrepGeometry::getVertexID ( int  index)
Parameters
indexthe index of the vertex.
Returns
the ID of the vertex.

References XAO::Geometry::getVertexReference(), and XAO::XaoUtils::stringToInt().

◆ getVertexXYZ()

void BrepGeometry::getVertexXYZ ( int  vertexIndex,
double &  xCoord,
double &  yCoord,
double &  zCoord 
)
Parameters
vertexIndexthe index of the vertex.
xCoordthe X coordinate.
yCoordthe Y coordinate.
zCoordthe Z coordinate.

References getSubShape(), and m_shape.

◆ initIds()

◆ initListIds()

void BrepGeometry::initListIds ( const TopAbs_ShapeEnum &  shapeType,
GeometricElementList eltList 
)
private

◆ readShapeFile()

void BrepGeometry::readShapeFile ( const std::string &  fileName)
virtual
Parameters
fileNamethe path to the file

Implements XAO::Geometry.

References initIds(), and m_shape.

◆ setEdgeID()

void BrepGeometry::setEdgeID ( int  index,
int  id 
)
Parameters
indexthe index of the edge to set.
idthe id to set.

References XAO::XaoUtils::intToString(), and XAO::Geometry::setEdgeReference().

◆ setFaceID()

void BrepGeometry::setFaceID ( int  index,
int  id 
)
Parameters
indexthe index of the face to set.
idthe id to set.

References XAO::XaoUtils::intToString(), and XAO::Geometry::setEdgeReference().

◆ setShapeString()

void BrepGeometry::setShapeString ( const std::string &  shape)
virtual
Parameters
shapethe shape as a string.

Implements XAO::Geometry.

References initIds(), and m_shape.

◆ setSolidID()

void BrepGeometry::setSolidID ( int  index,
int  id 
)
Parameters
indexthe index of the solid to set.
idthe id to set.

References XAO::XaoUtils::intToString(), and XAO::Geometry::setEdgeReference().

◆ setTopoDS_Shape()

void BrepGeometry::setTopoDS_Shape ( const TopoDS_Shape &  shape)
Parameters
shapethe TopoDS_Shape to set.

References initIds(), and m_shape.

◆ setVertexID()

void BrepGeometry::setVertexID ( int  index,
int  id 
)
Parameters
indexthe index of the vertex to set.
idthe id to set.

References XAO::XaoUtils::intToString(), and XAO::Geometry::setVertexReference().

◆ writeShapeFile()

void BrepGeometry::writeShapeFile ( const std::string &  fileName)
virtual
Parameters
fileNamethe path to the file

Implements XAO::Geometry.

References m_shape, and Write().

Member Data Documentation

◆ m_shape

TopoDS_Shape XAO::BrepGeometry::m_shape
private

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