Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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 const 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) throw (XAO_Exception)
 Writes shape to a file. More...
 
virtual void readShapeFile (const std::string &fileName) throw (XAO_Exception)
 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 (const int &edgeIndex, int &vertexA, int &vertexB)
 Gives the two extrimities of an edge. More...
 
const int countFaceWires (const int &faceIndex)
 Gets the number of wires of a face (including holes). More...
 
std::vector< int > getFaceEdges (const int &faceIndex, const int &wireIndex)
 Gets the indices of the wires of the face. More...
 
const int countSolidShells (const int &solidIndex)
 Gets the number of shells of a solid (including cavities). More...
 
std::vector< int > getSolidFaces (const int &solidIndex, const int &shellIndex)
 Gets the indices of the shells of the solids. More...
 
void getVertexXYZ (const int &vertexIndex, double &xCoord, double &yCoord, double &zCoord) throw (XAO_Exception)
 Gets the coordinates of a vertex. More...
 
const double getEdgeLength (const int &index)
 Gets the length of an edge. More...
 
const double getFaceArea (const int &index)
 Gets the are of a face. More...
 
const double getSolidVolume (const int &index)
 Gets the volume of a solid. More...
 
const int getVertexID (const int &index)
 Gets the ID of a vertex. More...
 
const int getEdgeID (const int &index)
 Gets the ID of an edge. More...
 
const int getFaceID (const int &index)
 Gets the ID of a face. More...
 
const int getSolidID (const int &index)
 Gets the ID of a solid. More...
 
void setVertexID (const int &index, const int &id)
 Sets the ID of a vertex. More...
 
void setEdgeID (const int &index, const int &id)
 Sets the ID of an edge. More...
 
void setFaceID (const int &index, const int &id)
 Sets the ID of a face. More...
 
void setSolidID (const int &index, const int &id)
 Sets the ID of a solid. More...
 
const int findVertex (const int &id)
 Finds a vertex with its ID. More...
 
const int findEdge (const int &id)
 Finds an edge with its ID. More...
 
const int findFace (const int &id)
 Finds a face with its ID. More...
 
const int findSolid (const int &id)
 Finds a solid with its ID. More...
 
const std::string findVertexName (const int &id)
 Finds the name of a vertex with its ID. More...
 
const std::string findEdgeName (const int &id)
 Finds the name of an edge with its ID. More...
 
const std::string findFaceName (const int &id)
 Finds the name of a face with its ID. More...
 
const std::string findSolidName (const int &id)
 Finds the name of a solid with its ID. More...
 
void changeVertexName (const int &id, const std::string &name) throw (XAO_Exception)
 Changes the name of a vertex. More...
 
void changeEdgeName (const int &id, const std::string &name) throw (XAO_Exception)
 Changes the name of an edge. More...
 
void changeFaceName (const int &id, const std::string &name) throw (XAO_Exception)
 Changes the name of a face. More...
 
void changeSolidName (const int &id, const std::string &name) throw (XAO_Exception)
 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...
 
const int countElements (const XAO::Dimension &dim) const throw (XAO_Exception)
 
const int countVertices () const
 
const int countEdges () const
 
const int countFaces () const
 
const int countSolids () const
 
void setCountVertices (const int &nb) throw (XAO_Exception)
 
void setCountEdges (const int &nb) throw (XAO_Exception)
 
void setCountFaces (const int &nb) throw (XAO_Exception)
 
void setCountSolids (const int &nb) throw (XAO_Exception)
 
const std::string getVertexName (const int &index) throw (XAO_Exception)
 
const std::string getEdgeName (const int &index) throw (XAO_Exception)
 
const std::string getFaceName (const int &index) throw (XAO_Exception)
 
const std::string getSolidName (const int &index) throw (XAO_Exception)
 
void setVertexName (const int &index, const std::string &name) throw (XAO_Exception)
 
void setEdgeName (const int &index, const std::string &name) throw (XAO_Exception)
 
void setFaceName (const int &index, const std::string &name) throw (XAO_Exception)
 
void setSolidName (const int &index, const std::string &name) throw (XAO_Exception)
 
const bool hasVertexName (const int &index) throw (XAO_Exception)
 
const bool hasEdgeName (const int &index) throw (XAO_Exception)
 
const bool hasFaceName (const int &index) throw (XAO_Exception)
 
const bool hasSolidName (const int &index) throw (XAO_Exception)
 
const std::string getVertexReference (const int &index) throw (XAO_Exception)
 
const std::string getEdgeReference (const int &index) throw (XAO_Exception)
 
const std::string getFaceReference (const int &index) throw (XAO_Exception)
 
const std::string getSolidReference (const int &index) throw (XAO_Exception)
 
const std::string getElementReference (const XAO::Dimension &dim, const int &index) throw (XAO_Exception)
 
void setVertexReference (const int &index, const std::string &reference) throw (XAO_Exception)
 
void setEdgeReference (const int &index, const std::string &reference) throw (XAO_Exception)
 
void setFaceReference (const int &index, const std::string &reference) throw (XAO_Exception)
 
void setSolidReference (const int &index, const std::string &reference) throw (XAO_Exception)
 
void setVertex (const int &index, const std::string &name, const std::string &reference) throw (XAO_Exception)
 
void setEdge (const int &index, const std::string &name, const std::string &reference) throw (XAO_Exception)
 
void setFace (const int &index, const std::string &name, const std::string &reference) throw (XAO_Exception)
 
void setSolid (const int &index, const std::string &name, const std::string &reference) throw (XAO_Exception)
 
const int getVertexIndexByReference (const std::string &reference)
 
const int getEdgeIndexByReference (const std::string &reference)
 
const int getFaceIndexByReference (const std::string &reference)
 
const int getSolidIndexByReference (const std::string &reference)
 
const int getElementIndexByReference (const XAO::Dimension &dim, const std::string &reference) throw (XAO_Exception)
 
GeometricElementList::iterator begin (const XAO::Dimension &dim) throw (XAO_Exception)
 
GeometricElementList::iterator end (const XAO::Dimension &dim) throw (XAO_Exception)
 
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, const int &shapeIndex) throw (XAO_Exception)
 
const int countGeometricalElements (const TopoDS_Shape &shape, const TopAbs_ShapeEnum &shapeType)
 
std::vector< int > getGeometricalElements (const TopoDS_Shape &shape, const TopAbs_ShapeEnum &shapeType, const XAO::Dimension &dim)
 
const int findElement (const XAO::Dimension &dim, const int &id) throw (XAO_Exception)
 

Private Attributes

TopoDS_Shape m_shape
 

Additional Inherited Members

- Static Public Member Functions inherited from XAO::Geometry
static GeometrycreateGeometry (const XAO::Format &format) throw (XAO_Exception)
 Creates a geometry. More...
 
static GeometrycreateGeometry (const XAO::Format &format, const std::string &name) throw (XAO_Exception)
 
- Protected Member Functions inherited from XAO::Geometry
 Geometry (const std::string &name)
 Constructor. More...
 
void checkReadOnly () throw (XAO_Exception)
 
- 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::BrepGeometry ( )
BrepGeometry::BrepGeometry ( const std::string &  name)
Parameters
namethe name of the geometry.
virtual XAO::BrepGeometry::~BrepGeometry ( )
inlinevirtual

Member Function Documentation

void BrepGeometry::changeEdgeName ( const int &  id,
const std::string &  name 
) throw (XAO_Exception)
Parameters
idthe ID of the edge
namethe name to set.
void BrepGeometry::changeFaceName ( const int &  id,
const std::string &  name 
) throw (XAO_Exception)
Parameters
idthe ID of the face.
namethe name to set.
void BrepGeometry::changeSolidName ( const int &  id,
const std::string &  name 
) throw (XAO_Exception)
Parameters
idthe ID of the solid.
namethe name to set.
void BrepGeometry::changeVertexName ( const int &  id,
const std::string &  name 
) throw (XAO_Exception)
Parameters
idthe ID of the vertex.
namethe name to set.
const int BrepGeometry::countFaceWires ( const int &  faceIndex)
Parameters
faceIndexthe index of the face.
Returns
the number of wires.

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

const int BrepGeometry::countGeometricalElements ( const TopoDS_Shape &  shape,
const TopAbs_ShapeEnum &  shapeType 
)
private
const int BrepGeometry::countSolidShells ( const int &  solidIndex)
Parameters
solidIndexthe index of the solid.
Returns
the number of shells.

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

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

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

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

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

const int BrepGeometry::findElement ( const XAO::Dimension dim,
const int &  id 
) throw (XAO_Exception)
private
const int BrepGeometry::findFace ( const int &  id)
Parameters
idthe ID of the face.
Returns
the index of the face.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

References getSubShape(), and m_shape.

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

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

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

References getSubShape(), and m_shape.

std::vector< int > BrepGeometry::getFaceEdges ( const int &  faceIndex,
const 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.

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

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

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

Implements XAO::Geometry.

References XAO::BREP.

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

References findElement(), itSub(), and m_shape.

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

Implements XAO::Geometry.

References m_shape, and Write().

std::vector< int > BrepGeometry::getSolidFaces ( const int &  solidIndex,
const 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.

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

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

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

References getSubShape(), and m_shape.

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

References itSub().

TopoDS_Shape BrepGeometry::getTopoDS_Shape ( )
Returns
the TopoDS_Shape.

References m_shape.

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

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

void BrepGeometry::getVertexXYZ ( const int &  vertexIndex,
double &  xCoord,
double &  yCoord,
double &  zCoord 
) throw (XAO_Exception)
Parameters
vertexIndexthe index of the vertex.
xCoordthe X coordinate.
yCoordthe Y coordinate.
zCoordthe Z coordinate.
void BrepGeometry::initListIds ( const TopAbs_ShapeEnum &  shapeType,
GeometricElementList eltList 
)
private
void BrepGeometry::readShapeFile ( const std::string &  fileName) throw (XAO_Exception)
virtual
Parameters
fileNamethe path to the file

Implements XAO::Geometry.

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

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

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

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

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

Implements XAO::Geometry.

References initIds(), and m_shape.

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

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

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

References initIds(), and m_shape.

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

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

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

Implements XAO::Geometry.

References Write().

Member Data Documentation

TopoDS_Shape XAO::BrepGeometry::m_shape
private

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