Class documentation of Concepts

Loading...
Searching...
No Matches
mutableMesh.hh
Go to the documentation of this file.
1
7#ifndef mutableMesh_hh
8#define mutableMesh_hh
9
10#include "toolbox/multiArray.hh"
11#include "toolbox/sequence.hh"
12#include "toolbox/set.hh"
13#include "mesh.hh"
14
15namespace concepts {
16
17 // ******************************************************* MutableMeshBase **
18
23 public:
25 virtual ~MutableMeshBase();
26
27 virtual void addCell(Cell* cell, bool holding = true) = 0;
28
35
36 const Sequence<Connector0*>& ownConnectors0() const {
37 return ownConnectors0_; }
38 const Sequence<Connector1*>& ownConnectors1() const {
39 return ownConnectors1_; }
40 const Sequence<Connector2*>& ownConnectors2() const {
41 return ownConnectors2_; }
42 const Sequence<Connector3*>& ownConnectors3() const {
43 return ownConnectors3_; }
44 protected:
49 Sequence<Connector1*> ownConnectors1_;
50 Sequence<Connector2*> ownConnectors2_;
51 Sequence<Connector3*> ownConnectors3_;
54
55 void addCell_(Cell* cell, bool holding = true);
56
61 void replaceCell_(Cell* cell, bool holding = true);
62 };
63
64 // ********************************************************** MutableMesh1 **
65
74 class MutableMesh1 : public Mesh1, public MutableMeshBase {
75 public:
76 MutableMesh1() : ncell_(0) {}
77 virtual ~MutableMesh1();
78 inline uint ncell() const { return ncell_; }
79 inline Scan1* scan() { return new PStlVectorScan<Cell1>(cells_); }
80
84 virtual void addCell(Cell* cell, bool holding = true);
85
90 void replaceCell(Cell1* cell, bool holding = true);
91
92 inline const Sequence<Cell1*>& cells() const { return cells_; }
93
94 protected:
95 virtual std::ostream& info(std::ostream& os) const;
96
97 private:
99 uint ncell_;
101 Sequence<Cell1*> cells_;
102 };
103
104 // ********************************************************* buildEdgeMesh **
105
134
135 // ********************************************************** MutableMesh2 **
136
142 class MutableMesh2 : public Mesh2, public MutableMeshBase {
143 public:
144 MutableMesh2() : ncell_(0) {}
145 virtual ~MutableMesh2();
146 inline uint ncell() const { return ncell_; }
147 inline Scan2* scan() { return new PStlVectorScan<Cell2>(cells_); }
148
152 virtual void addCell(Cell* cell, bool holding = true);
153
158 void replaceCell(Cell2* cell, bool holding = true);
159
161 Cell2* lastCell() const {
162 if (ncell_)
163 return cells_[ncell_-1];
164 return 0;
165 }
166
171
178 const Attribute attrib = Attribute(),
179 const Quad2dSubdivision* strategy = 0);
180
194 const Attribute attrib = Attribute(),
195 const Quad2dSubdivision* strategy = 0);
196
197 protected:
198 virtual std::ostream& info(std::ostream& os) const;
199 private:
201 uint ncell_;
203 Sequence<Cell2*> cells_;
204 };
205
206 // ******************************************************* ConnectTwoMeshes2 **
207
230
231} // namespace concepts
232
233#endif // mutableMesh_hh
One dimensional cell.
Definition cell.hh:75
Two dimensional cell.
Definition cell.hh:89
ConnectTwoMeshes(Mesh2withBoundary &mesh1, const Sequence< uint > edges1, Mesh2withBoundary &mesh2, const Sequence< uint > edges2, const Attribute attrib=Attribute())
void replaceCell(Cell1 *cell, bool holding=true)
virtual void addCell(Cell *cell, bool holding=true)
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
uint ncell() const
Returns the number of cells in the mesh.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
void replaceCell(Cell2 *cell, bool holding=true)
Cell2 * lastCell() const
Return the latest added cell.
void addMesh(Mesh2 &msh)
void connectOppositeEdges(const Edge2d *edge1, const Edge2d *edge2, const Attribute attrib=Attribute(), const Quad2dSubdivision *strategy=0)
virtual void addCell(Cell *cell, bool holding=true)
void connectOppositeEdges(const Sequence< Edge2d * > edges1, const Sequence< Edge2d * > edges2, const Attribute attrib=Attribute(), const Quad2dSubdivision *strategy=0)
uint ncell() const
Returns the number of cells in the mesh.
Sequence< Connector0 * > ownConnectors0_
Stored connectors.
Sequence< const Cell * > ownCells_
Stored cells.
void replaceCell_(Cell *cell, bool holding=true)
MultiArray< 2, Edge * > mapEdges_
Maps from vertices to connectors.
Edge * ownEdge(Vertex *vtx1, Vertex *vtx2)
A scanner for a 1D mesh.
Definition mesh.hh:36
A scanner for a 2D mesh.
Definition mesh.hh:44
void buildEdgeMesh(Scan2 *sc, const concepts::Set< uint > attrib, MutableMeshBase &emsh)
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320