MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
Boundary.h
1 /********************************************************************/
2 /* Copyright (c) 2015 DG Technologies Inc. and Yuzi Mizuno */
3 /* All rights reserved. */
4 /********************************************************************/
5 #ifndef _MGBoundarynD_HH_
6 #define _MGBoundarynD_HH_
7 
8 #include <list>
9 #include <vector>
10 #include "topo/Complex.h"
11 
12 class MGUnit_vector;
13 class MGCellNB;
14 class MGLoop;
15 class MGCell;
16 
17 //
18 //Define MGBoundary Class.
19 
24 
35 class MG_DLL_DECLR MGBoundary: public MGComplex{
36 
37 public:
38 
40 
42 MGBoundary();
43 
45 explicit MGBoundary(MGCellNB* pcell);
46 
48 explicit MGBoundary(
49  std::list<MGCellNB*>& pcells);
50 
52 MGBoundary(const MGBoundary& boundary);
53 
55 virtual ~MGBoundary();
56 
58 
62 virtual MGBoundary& operator=(const MGBoundary& gel2);
63 
65 virtual MGBoundary& operator+=(const MGVector& v){MGComplex::operator+=(v);return *this;};
66 virtual MGBoundary& operator-=(const MGVector& v){MGComplex::operator-=(v);return *this;};
67 virtual MGBoundary& operator*=(double scale){MGComplex::operator*=(scale);return *this;};
68 virtual MGBoundary& operator*=(const MGMatrix& mat){MGComplex::operator*=(mat);return *this;};
69 virtual MGBoundary& operator*=(const MGTransf& tr){MGComplex::operator*=(tr);return *this;};
70 
72 
74 virtual bool active() const=0;
75 
77 //const MGBox& box() const{return MGComplex::box();};
78 
82 virtual MGBoundary* clone(MGCell& parent) const=0;
83 virtual MGBoundary* clone()const=0;
84 
86 virtual MGBoundary* clone_without_binders(MGCell& parent) const=0;
87 virtual MGBoundary* clone_without_binders() const=0;
88 
90 virtual bool closed() const=0;
91 
94 MGUnit_vector direction_star(int i) const;
95 
98 bool empty();
99 
104 bool equal_direction(int i, const MGBoundary& bound2, int j) const;
105 
107 virtual long identify_type()const=0;
108 
110 virtual int manifold_dimension() const=0;
111 
114 virtual void negate();
115 
124 //(*****Does not negate the binders*****)
125 virtual void negate_as_boundary(const MGCellNB* parent=0);
126 
128 int number_of_pcells() const;
129 
131 virtual std::ostream& out(std::ostream&) const;
132 
136 void set_binder(int i, MGCellNB& binder)const;
137 
141 MGCell* set_parent(MGCell& new_parent) const;
142 
144 const MGCellNB* star() const;
145 MGCellNB* star();
146 
147 virtual std::string whoami()const{return "Boundary";};
148 
150 protected:
151 
152  mutable MGCell* m_parent_cell;
153 
156 MGBoundary(
157  const MGBoundary& boundary,
158  MGCellMap& cmap
159 );
160 
166 virtual MGBoundary* clone(MGCell& parent, MGCellMap& cmap) const=0;
167 virtual MGBoundary* clone(MGCellMap& cmap) const=0;
168 
174 void connect_bound(int i, MGBoundary* bound2, int j);
175 
178 virtual void copy_boundary(const MGBoundary& bnd);
179 
182 virtual void copy_boundary_without_binders(const MGBoundary& bnd);
183 
187 void disconnect(int i);
188 
194 void free_binders();
195 
197 virtual void ReadMembers(MGIfstream& buf);
198 
201 MGBoundary& set_boundary(const MGBoundary& gel2);
202 
204 virtual void WriteMembers(MGOfstream& buf) const;
205 
206 private:
207 
208 friend MGCell;
209 
210 };
211  // end of TOPO group
213 #endif
virtual MGComplex & operator-=(const MGVector &v)
CellNB is a cell without boundaries(No Boundaries).
Definition: CellNB.h:38
virtual std::string whoami() const
Definition: Boundary.h:147
MGTransf represents a transformation of a space dimension.
Definition: Transf.h:35
virtual std::ostream & out(std::ostream &) const
Output virtual function.
virtual void WriteMembers(MGOfstream &buf) const
Write Object's Member Data.
virtual MGBoundary & operator*=(const MGTransf &tr)
Definition: Boundary.h:69
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
MGCell is a general cell that has bound.
Definition: Cell.h:35
virtual MGBoundary & operator*=(double scale)
Definition: Boundary.h:67
virtual MGComplex * clone() const
int number_of_pcells() const
count number of pcells of the complex
Definition: Complex.h:206
friend class MGCell
Definition: Complex.h:348
virtual void ReadMembers(MGIfstream &buf)
Read Object's member data.
MGLoop is a boundary of a face, a boundary of 2D manifold cell.
Definition: Loop.h:44
virtual int manifold_dimension() const
Get manifold dimension.
virtual MGBoundary & operator+=(const MGVector &v)
Object transformation.
Definition: Boundary.h:65
MGBoundary is a boundary of more than 1 manifold dimension.
Definition: Boundary.h:35
MGOfstream is a class to serialize all of the subclasses of MGGel.
Definition: Ofstream.h:31
virtual MGComplex & operator=(const MGGel &gel2)
virtual long identify_type() const
Return Object's type ID (TID)
MGComplex is a container of parameter cells and binder cells.
Definition: Complex.h:25
virtual MGBoundary & operator*=(const MGMatrix &mat)
Definition: Boundary.h:68
virtual MGComplex & operator+=(const MGVector &v)
Object transformation.
const MGCellNB * star() const
virtual MGBoundary & operator-=(const MGVector &v)
Definition: Boundary.h:66
virtual MGComplex & operator*=(double scale)
Define a unit vector, is a MGVector.
Definition: Unit_vector.h:17
MGMatrix is a matix of m by m, where m is the space dimension.
Definition: Matrix.h:30