21 #ifndef __XAO_GEOMETRY_HXX__
22 #define __XAO_GEOMETRY_HXX__
27 #include "XAO_XaoUtils.hxx"
28 #include "XAO_Exception.hxx"
29 #include "XAO_GeometricElement.hxx"
32 #pragma warning(disable:4290)
58 static Geometry* createGeometry(XAO::Format format) ;
66 static Geometry* createGeometry(XAO::Format format,
const std::string& name);
94 virtual const std::string getShapeString() = 0;
95 virtual void setShapeString(
const std::string& shape) = 0;
96 virtual void writeShapeFile(
const std::string& fileName) = 0;
97 virtual void readShapeFile(
const std::string& fileName) = 0;
99 int countElements(XAO::Dimension dim)
const ;
100 int countVertices()
const {
return m_vertices.getSize(); }
101 int countEdges()
const {
return m_edges.getSize(); }
102 int countFaces()
const {
return m_faces.getSize(); }
103 int countSolids()
const {
return m_solids.getSize(); }
105 void setCountVertices(
int nb);
106 void setCountEdges(
int nb);
107 void setCountFaces(
int nb);
108 void setCountSolids(
int nb);
110 const std::string getVertexName(
int index) {
return m_vertices.getName(index); }
111 const std::string getEdgeName(
int index) {
return m_edges.getName(index); }
112 const std::string getFaceName(
int index) {
return m_faces.getName(index); }
113 const std::string getSolidName(
int index) {
return m_solids.getName(index); }
115 void setVertexName(
int index,
const std::string& name) { m_vertices.setName(index, name); }
116 void setEdgeName(
int index,
const std::string& name) { m_edges.setName(index, name); }
117 void setFaceName(
int index,
const std::string& name) { m_faces.setName(index, name); }
118 void setSolidName(
int index,
const std::string& name) { m_solids.setName(index, name); }
120 bool hasVertexName(
int index) {
return m_vertices.hasName(index); }
121 bool hasEdgeName(
int index) {
return m_edges.hasName(index); }
122 bool hasFaceName(
int index) {
return m_faces.hasName(index); }
123 bool hasSolidName(
int index) {
return m_solids.hasName(index); }
125 const std::string getVertexReference(
int index) {
return m_vertices.getReference(index); }
126 const std::string getEdgeReference(
int index) {
return m_edges.getReference(index); }
127 const std::string getFaceReference(
int index) {
return m_faces.getReference(index); }
128 const std::string getSolidReference(
int index) {
return m_solids.getReference(index); }
129 const std::string getElementReference(XAO::Dimension dim,
int index) ;
131 void setVertexReference(
int index,
const std::string& reference) ;
132 void setEdgeReference(
int index,
const std::string& reference) ;
133 void setFaceReference(
int index,
const std::string& reference) ;
134 void setSolidReference(
int index,
const std::string& reference) ;
136 void setVertex(
int index,
const std::string& name,
const std::string& reference) ;
137 void setEdge(
int index,
const std::string& name,
const std::string& reference) ;
138 void setFace(
int index,
const std::string& name,
const std::string& reference) ;
139 void setSolid(
int index,
const std::string& name,
const std::string& reference) ;
141 int getVertexIndexByReference(
const std::string& reference) {
return m_vertices.getIndexByReference(reference); }
142 int getEdgeIndexByReference(
const std::string& reference) {
return m_edges.getIndexByReference(reference); }
143 int getFaceIndexByReference(
const std::string& reference) {
return m_faces.getIndexByReference(reference); }
144 int getSolidIndexByReference(
const std::string& reference) {
return m_solids.getIndexByReference(reference); }
145 int getElementIndexByReference(XAO::Dimension dim,
const std::string& reference) ;
162 void checkReadOnly() ;
Generic class to manipulate a list of topologic element.
Definition: XAO_GeometricElement.hxx:112
std::map< int, GeometricElement >::iterator iterator
Iterator on the element of the list.
Definition: XAO_GeometricElement.hxx:198
Base class for geometries.
Definition: XAO_Geometry.hxx:43
const std::string getName()
Gets the name of the geometry.
Definition: XAO_Geometry.hxx:75
virtual XAO::Format getFormat()=0
Gets the format of the geometry.
bool isReadOnly()
Verifies if the geometry is read only.
Definition: XAO_Geometry.hxx:154
void setName(const std::string &name)
Sets the name of the geometry.
Definition: XAO_Geometry.hxx:83
void setReadOnly()
Sets the geometry read only.
Definition: XAO_Geometry.hxx:159