MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
GelPosition.h
1 /********************************************************************/
2 /* Copyright (c) 2015 DG Technologies Inc. and Yuzi Mizuno */
3 /* All rights reserved. */
4 /********************************************************************/
5 #ifndef _MGGelPosition_HH_
6 #define _MGGelPosition_HH_
7 
8 #include <iosfwd>
9 #include <vector>
10 #include "mg/MGCL.h"
11 #include "mg/Group.h"
12 #include "mg/AttribedGel.h"
13 class MGShell;
14 
15 //
16 //Define MGGelPosition Class.
17 
23 
39 class MG_DLL_DECLR MGGelPosition{
40 
41 public:
42 
44 MG_DLL_DECLR friend std::ostream& operator<< (std::ostream&, const MGGelPosition&);
45 
47 
50 
52 explicit MGGelPosition(MGGroup* group, MGObject* obj=0);
53 
55 MGGelPosition(const MGGelPosition& obj2);
56 
58 virtual ~MGGelPosition(){;};
59 
61 virtual MGGelPosition& operator= (const MGGelPosition& GelPosition2);
62 
64 bool operator== (const MGGelPosition& gelp2) const;
65 bool operator!= (const MGGelPosition& gelp2) const{return !(*this==gelp2);}
66 
67 bool operator<(const MGGelPosition& gp2)const;
68 bool operator>(const MGGelPosition& gp2)const{return gp2<(*this);};
69 bool operator<=(const MGGelPosition& gp2)const{return !((*this)>gp2);};
70 bool operator>=(const MGGelPosition& gp2)const{return !(gp2>(*this));};
71 
73 
75 void append_lower_gel(MGGel* gel);
76 
78 const MGGel* gel(int i)const{return m_Ghierarcy[i];};
79 MGGel* gel(int i){return m_Ghierarcy[i];};
80 
82 virtual MGGelPosition* clone()const;
83 
86 void do_add();
87 
91 void do_remove();
92 
94 const MGGroup* bottom_group()const;
95 MGGroup* bottom_group();
96 
98 const MGGroup* top_group()const{return m_group;};
99 MGGroup* top_group(){return m_group;};
100 
101 //Get the shell pointer when this is_shell_face() is true.
102 //When is_shell_face() is false, behavior is undefined.
103 MGShell* get_shell_of_shell_face()const;
104 
110 const MGGroup* is_a_member_of(const MGGroup* grp)const;
111 
113 bool is_null() const;
114 
117 bool is_shell_face()const;
118 
119 //Test if this is this is one of the type of types.
120 bool is_type(const MGAbstractGels& types)const;
121 
122 //Test if this leaf is MGGroup.
123 bool leaf_is_group()const;
124 
128 const MGObject* top_object()const;
129 MGObject* top_object();
130 
133 const MGObject* leaf_object()const{return m_object;};
134 MGObject* leaf_object(){return m_object;};
135 
138 const MGAttribedGel* leafAttribedGel()const{return m_agel;};
139 MGAttribedGel* leafAttribedGel(){return m_agel;};
140 
142 void set_attribedGel(MGAttribedGel* agel);
143 
145 void set_leaf_object(MGObject* obj);
146 
148 void set_top_group(MGGroup* group){m_group=group;};
149 
151 void set_null();
152 
156 bool symmetric(const MGGelPosition& gp2)const;
157 
161 MGAttribedGel* targetGel();
162 
163 protected:
165  std::vector<MGGel*> m_Ghierarcy;//The group hierarcy. Let n=m_Ghierarcy.size(),
174  MGObject* m_object;
176 
179 private:
180  //Get the object pointer of this.
181  const MGObject* top_object_sub()const;
182 
183  //Get the lowerest level of group pointer of this.
184  const MGGroup* bottom_group_sub()const;
185 };
186  // end of GelRelated group
188 #endif
virtual ~MGGelPosition()
Destructor.
Definition: GelPosition.h:58
const MGAttribedGel * leafAttribedGel() const
Definition: GelPosition.h:138
bool operator>=(const MGGelPosition &gp2) const
Definition: GelPosition.h:70
Is a container of MGAbstractGel, to specify what kind of gels are required.
Definition: AbstractGels.h:25
std::ostream & operator<<(std::ostream &ostrm, const MGisect &is)
Debug Function.
Definition: isect.h:95
const MGObject * leaf_object() const
Definition: GelPosition.h:133
bool operator<=(const MGGelPosition &gp2) const
Definition: GelPosition.h:69
Is an abstract class which represents a whole geometry and a topology.
Definition: Object.h:42
MGShell is a composition of MGFace's(trimmed surface).
Definition: Shell.h:32
void set_top_group(MGGroup *group)
Set the group data.
Definition: GelPosition.h:148
MGGel is an abstract class which represents a group element.
Definition: Gel.h:53
Is an abstract class which provides interfaces of MGGel that has MGAppearance.
Definition: AttribedGel.h:32
MGGelPosition is a class to locate where a gel is in a group hierarchy.
Definition: GelPosition.h:39
MGGroup * m_group
Definition: GelPosition.h:164
MGAttribedGel * leafAttribedGel()
Definition: GelPosition.h:139
const MGGroup * top_group() const
Get the top group pointer.
Definition: GelPosition.h:98
MGGel * gel(int i)
Definition: GelPosition.h:79
MGGroup * top_group()
Definition: GelPosition.h:99
MGGroup is a class which constains MGGel elements.
Definition: Group.h:35
MGObject * leaf_object()
Definition: GelPosition.h:134
const MGGel * gel(int i) const
Return the MGGel i;.
Definition: GelPosition.h:78
MGAttribedGel * m_agel
Definition: GelPosition.h:173
bool operator>(const MGGelPosition &gp2) const
Definition: GelPosition.h:68