Representation of a BRep Geometry.
#include <XAO_BrepGeometry.hxx>
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 Geometry * | createGeometry (const XAO::Format &format) throw (XAO_Exception) |
Creates a geometry. More... | |
static Geometry * | createGeometry (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 |
BrepGeometry::BrepGeometry | ( | ) |
BrepGeometry::BrepGeometry | ( | const std::string & | name | ) |
name | the name of the geometry. |
|
inlinevirtual |
void BrepGeometry::changeEdgeName | ( | const int & | id, |
const std::string & | name | ||
) | throw (XAO_Exception) |
id | the ID of the edge |
name | the name to set. |
void BrepGeometry::changeFaceName | ( | const int & | id, |
const std::string & | name | ||
) | throw (XAO_Exception) |
id | the ID of the face. |
name | the name to set. |
void BrepGeometry::changeSolidName | ( | const int & | id, |
const std::string & | name | ||
) | throw (XAO_Exception) |
id | the ID of the solid. |
name | the name to set. |
void BrepGeometry::changeVertexName | ( | const int & | id, |
const std::string & | name | ||
) | throw (XAO_Exception) |
id | the ID of the vertex. |
name | the name to set. |
const int BrepGeometry::countFaceWires | ( | const int & | faceIndex | ) |
faceIndex | the index of the face. |
References countGeometricalElements(), getSubShape(), and m_shape.
|
private |
const int BrepGeometry::countSolidShells | ( | const int & | solidIndex | ) |
solidIndex | the index of the solid. |
References countGeometricalElements(), getSubShape(), and m_shape.
const int BrepGeometry::findEdge | ( | const int & | id | ) |
id | the ID of the edge. |
References XAO::Geometry::getEdgeIndexByReference(), and XAO::XaoUtils::intToString().
const std::string BrepGeometry::findEdgeName | ( | const int & | id | ) |
id | the ID of the edge. |
References findEdge(), and XAO::Geometry::getEdgeName().
|
private |
References XAO::EDGE, XAO::FACE, XAO::SOLID, and XAO::VERTEX.
const int BrepGeometry::findFace | ( | const int & | id | ) |
id | the ID of the face. |
References XAO::Geometry::getFaceIndexByReference(), and XAO::XaoUtils::intToString().
const std::string BrepGeometry::findFaceName | ( | const int & | id | ) |
id | the ID of the face. |
References findFace(), and XAO::Geometry::getFaceName().
const int BrepGeometry::findSolid | ( | const int & | id | ) |
id | the ID of the solid. |
References XAO::Geometry::getSolidIndexByReference(), and XAO::XaoUtils::intToString().
const std::string BrepGeometry::findSolidName | ( | const int & | id | ) |
id | the ID of the solid. |
References findSolid(), and XAO::Geometry::getSolidName().
const int BrepGeometry::findVertex | ( | const int & | id | ) |
id | the ID of the vertex. |
References XAO::Geometry::getVertexIndexByReference(), and XAO::XaoUtils::intToString().
const std::string BrepGeometry::findVertexName | ( | const int & | id | ) |
id | the ID of the vertex. |
References findVertex(), and XAO::Geometry::getVertexName().
const int BrepGeometry::getEdgeID | ( | const int & | index | ) |
index | the index of the edge. |
References XAO::Geometry::getEdgeReference(), and XAO::XaoUtils::stringToInt().
const double BrepGeometry::getEdgeLength | ( | const int & | index | ) |
index | the index of the edge. |
References getSubShape(), and m_shape.
void BrepGeometry::getEdgeVertices | ( | const int & | edgeIndex, |
int & | vertexA, | ||
int & | vertexB | ||
) |
edgeIndex | the index of the edge. |
vertexA | |
vertexB |
References getGeometricalElements(), getSubShape(), m_shape, and XAO::VERTEX.
const double BrepGeometry::getFaceArea | ( | const int & | index | ) |
index | the index of a face. |
References getSubShape(), and m_shape.
std::vector< int > BrepGeometry::getFaceEdges | ( | const int & | faceIndex, |
const int & | wireIndex | ||
) |
faceIndex | the index of the face. |
wireIndex | the index of the wire. |
References XAO::EDGE, getGeometricalElements(), getSubShape(), and m_shape.
const int BrepGeometry::getFaceID | ( | const int & | index | ) |
index | the index of the face. |
References XAO::Geometry::getFaceReference(), and XAO::XaoUtils::stringToInt().
|
inlinevirtual |
|
private |
References findElement(), itSub(), and m_shape.
|
virtual |
std::vector< int > BrepGeometry::getSolidFaces | ( | const int & | solidIndex, |
const int & | shellIndex | ||
) |
solidIndex | the index of the solid. |
shellIndex | the index of the shell (for the given solid). |
References XAO::FACE, getGeometricalElements(), getSubShape(), and m_shape.
const int BrepGeometry::getSolidID | ( | const int & | index | ) |
index | the index of the solid. |
References XAO::Geometry::getSolidReference(), and XAO::XaoUtils::stringToInt().
const double BrepGeometry::getSolidVolume | ( | const int & | index | ) |
index | the index of the solid. |
References getSubShape(), and m_shape.
|
private |
References itSub().
TopoDS_Shape BrepGeometry::getTopoDS_Shape | ( | ) |
References m_shape.
const int BrepGeometry::getVertexID | ( | const int & | index | ) |
index | the index 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) |
vertexIndex | the index of the vertex. |
xCoord | the X coordinate. |
yCoord | the Y coordinate. |
zCoord | the Z coordinate. |
|
private |
|
private |
|
virtual |
fileName | the path to the file |
Implements XAO::Geometry.
void BrepGeometry::setEdgeID | ( | const int & | index, |
const int & | id | ||
) |
index | the index of the edge to set. |
id | the id to set. |
References XAO::XaoUtils::intToString(), and XAO::Geometry::setEdgeReference().
void BrepGeometry::setFaceID | ( | const int & | index, |
const int & | id | ||
) |
index | the index of the face to set. |
id | the id to set. |
References XAO::XaoUtils::intToString(), and XAO::Geometry::setEdgeReference().
|
virtual |
void BrepGeometry::setSolidID | ( | const int & | index, |
const int & | id | ||
) |
index | the index of the solid to set. |
id | the id to set. |
References XAO::XaoUtils::intToString(), and XAO::Geometry::setEdgeReference().
void BrepGeometry::setTopoDS_Shape | ( | const TopoDS_Shape & | shape | ) |
void BrepGeometry::setVertexID | ( | const int & | index, |
const int & | id | ||
) |
index | the index of the vertex to set. |
id | the id to set. |
References XAO::XaoUtils::intToString(), and XAO::Geometry::setVertexReference().
|
virtual |
|
private |