12#include "toolbox/hashSet.hh"
36 friend std::ostream& operator<< (std::ostream& os,
const VertexInfo& v);
43 index_(
index), coord_(coord) {}
46 void addEdge(uint edge) { edges_.insert(edge); }
49 void addFace(uint face) { faces_.insert(face); }
52 void addVolume(uint volume) { volumes_.insert(volume); }
55 uint&
index() {
return index_; }
57 uint
index()
const {
return index_; }
73 std::unordered_set<uint> edges_;
76 std::unordered_set<uint> faces_;
79 std::unordered_set<uint> volumes_;
99 typedef std::unordered_map<uint, VertexInfo>::iterator iterator;
100 typedef std::unordered_map<uint, VertexInfo>::const_iterator
109 enum vtxInfo { COORD = 0, EDGES = 1, FACES = 2, VOLUMES = 4, ALL = 7 };
134 uint
size()
const {
return vertices_.size(); }
137 iterator
begin() {
return vertices_.begin(); }
138 const_iterator
begin()
const {
return vertices_.begin(); }
141 iterator
end() {
return vertices_.end(); }
142 const_iterator
end()
const {
return vertices_.end(); }
145 iterator
find(uint k) {
return vertices_.find(k); }
146 const_iterator
find(uint k)
const {
return vertices_.find(k); }
165 virtual std::ostream&
info(std::ostream& os)
const;
168 std::unordered_map<uint, VertexInfo> vertices_;
uint & index()
Sets the index of the vertex.
void addVolume(uint volume)
Adds a volume to the list of volumes.
concepts::Real3d coordinates() const
Returns the coordinates.
void addFace(uint face)
Adds a face to the list of faces.
VertexInfo(concepts::Real3d coord, uint index=0)
uint index() const
Returns the index of the vertex.
void addEdge(uint edge)
Adds an edge to the list of edges.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
VertexList(enum vtxInfo info=ALL)
iterator find(uint k)
Finds a vertex in the list.
iterator begin()
Beginning of the list.
VertexList(const VertexList &vl)
Copy constructor.
VertexInfo * vertex(uint v)
virtual void operator()(const concepts::Cell &cell)
uint size() const
Returns the size of the list.
VertexInfo * addVertex(uint v, concepts::Real3d coord)
enum vtxInfo vertexInfo() const
Returns vtxInfo_.
iterator end()
End of the list.