MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
CellBase.h
1 /********************************************************************/
2 /* Copyright (c) 2015 DG Technologies Inc. and Yuzi Mizuno */
3 /* All rights reserved. */
4 /********************************************************************/
5 #ifndef _MGCellBase_HH_
6 #define _MGCellBase_HH_
7 
8 #include <vector>
9 #include "topo/Topology.h"
10 
11 //
12 //Define MGCellBase Class.
13 
14 class MGBox;
15 class MGVector;
16 class MGMatrix;
17 class MGTransf;
18 class MGGeometry;
19 class MGCellNB;
20 class MGCellMap;
21 class MGComplex;
22 class MGPVertex;
23 
28 
38 class MG_DLL_DECLR MGCellBase: public MGTopology{
39 
40 public:
41 
43 
45 MGCellBase():m_binder(0){;};
46 
49 MGCellBase(const MGCellBase& cell):MGTopology(cell),m_binder(0){;};
50 
52 virtual ~MGCellBase();
53 
55 
59 virtual MGCellBase& operator=(const MGCellBase& gel2);
60 
62 virtual MGCellBase& operator+=(const MGVector& v)=0;
63 virtual MGCellBase& operator-=(const MGVector& v)=0;
64 virtual MGCellBase& operator*=(double scale)=0;
65 virtual MGCellBase& operator*=(const MGMatrix& mat)=0;
66 virtual MGCellBase& operator*=(const MGTransf& tr)=0;
67 
69 
71 MGCellNB* binder()const{return m_binder;};
72 
74 const MGBox& box()const=0;
75 
78 virtual MGCellBase* clone()const=0;
79 virtual MGCellBase* clone_without_boundaries()const=0;
80 
88 virtual void connect(MGCellBase& cell2);
89 
92 virtual void drawWire_in_star(
93  mgVBO& vbo,
94  double span_length,
95  int line_density=1
96 )const;
97 
101 virtual void draw3DVertex(mgVBO& vbo)const=0;
102 
105 virtual void draw3DVertex_in_star(mgVBO& vbo)const;
106 
109 void free_partnership();
110 
112 virtual bool is_bcell() const=0;
113 
115 bool is_pcell()const{return !is_bcell();};
116 
120 virtual MGCellNB* make_binder() const=0;
121 
128 const MGCellNB* make_binder_with_extent()const;
129 
131 virtual int manifold_dimension() const=0;
132 
134 virtual void negate()=0;
135 
138 int number_of_partners() const;
139 
149 std::vector<const MGCellBase*> partners() const;
150 
154 void set_binder(MGCellNB& binder)const;
155 
157 virtual const MGCellNB* star() const=0;
158 virtual MGCellNB* star()=0;
159 
161 virtual std::ostream& out(std::ostream&) const;
162 
163 virtual std::string whoami()const{return "CellBase";};
164 
165 protected:
166  mutable MGCellNB* m_binder;
167 
170 virtual void ReadMembers(MGIfstream& buf);
171 
173 virtual void WriteMembers(MGOfstream& buf) const;
174 
178 MGCellBase& set_cellbase(const MGCellBase& cb2);
179 
180 private:
181 
183 virtual void copy_all_boundaries(const MGCellBase& cell2)=0;
184 
188 virtual void copy_all_boundaries(const MGCellBase& cell2, MGCellMap& cmap)=0;
189 
190 virtual void copy_box(const MGCellBase& cb)const=0;
191 virtual void copy_perror(const MGCellBase& cb)const=0;
192 
195 virtual MGCellBase* clone_pcell_with_bcell(
196  MGCellMap& cmap,
197  MGCellMap* cellmap_parent=0
198 )const;
199 
204 virtual MGCellBase* clone(MGCellMap& cmap) const=0;
205 
209 virtual MGGeometry* make_binder_extent() const=0;
210 
211 friend class MGComplex;
212 friend class MGCellNB;
213 friend class MGEdge;
214 
215 };
216  // end of TOPO group
218 #endif
CellNB is a cell without boundaries(No Boundaries).
Definition: CellNB.h:38
Is an abstract class and the super class of MGPVertex and MGCellNB.
Definition: CellBase.h:38
MGCellBase(const MGCellBase &cell)
Definition: CellBase.h:49
MGTransf represents a transformation of a space dimension.
Definition: Transf.h:35
virtual MGTopology & operator=(const MGTopology &gel2)
MGTopology is an abstract class which represents a whole Topology.
Definition: Topology.h:33
MGIfstream is a class to read the serialized data generated by MGOfstream.
Definition: Ifstream.h:30
Vector of a general n space dimension.
Definition: Vector.h:26
MGGeometry is an abstract class which represents a whole geometry.
Definition: Geometry.h:36
Defines a Box of any space dimendion.
Definition: Box.h:34
MGCellBase()
Void constructor. Constructor of pcell.
Definition: CellBase.h:45
MGEdge is an instance of MGCellNB, represents a boundary element of 2D manifold.
Definition: Edge.h:33
virtual MGObject * clone() const =0
virtual MGObject & operator-=(const MGVector &v)=0
virtual void ReadMembers(MGIfstream &buf)
virtual void WriteMembers(MGOfstream &buf) const
MGOfstream is a class to serialize all of the subclasses of MGGel.
Definition: Ofstream.h:31
virtual std::string whoami() const
Definition: CellBase.h:163
MGComplex is a container of parameter cells and binder cells.
Definition: Complex.h:25
virtual std::ostream & out(std::ostream &) const
Output virtual function.
virtual int manifold_dimension() const
Definition: Gel.h:116
virtual void draw3DVertex(mgVBO &vbo) const =0
virtual const MGBox & box() const =0
Get the box of the object.
MGCellNB * binder() const
Obtain binder.
Definition: CellBase.h:71
bool is_pcell() const
Ask if this is parameter cell.
Definition: CellBase.h:115
virtual MGObject & operator+=(const MGVector &v)=0
Object transformation.
virtual MGObject & operator*=(double scale)=0
OpenGL 4 用描画のためのクラス, in other words, display list.
Definition: VBO.h:76
MGPVertex is a parameter cell of the manifold dimension 0.
Definition: PVertex.h:34
MGMatrix is a matix of m by m, where m is the space dimension.
Definition: Matrix.h:30