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