MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
Shell.h
1 /********************************************************************/
2 /* Copyright (c) 2015 DG Technologies Inc. and Yuzi Mizuno */
3 /* All rights reserved. */
4 /********************************************************************/
5 #ifndef _MGShell_HH_
6 #define _MGShell_HH_
7 
8 #include <vector>
9 #include "mg/MGCL.h"
10 #include "mg/Default.h"
11 #include "mg/drawParam.h"
12 #include "mg/Pvector.h"
13 #include "mg/Position_list.h"
14 #include "mg/FPoint.h"
15 #include "topo/Complex.h"
16 #include "topo/Boundary.h"
17 #include "topo/CFisect_vector.h"
18 #include "topo/Face.h"
19 #include "topo/HHisect.h"
20 #include "topo/HHisect_vector.h"
21 
22 class MGFSurface;
23 class MGIgesOfstream;
29 
32 class MG_DLL_DECLR MGShell: public MGBoundary{
33 
34 public:
35 
37 
39 MGShell(){;};
40 
43 MGShell(const MGFace& face);
44 
48 explicit MGShell(MGFace* face);
49 
52 MGShell(const MGFSurface& face);
53 
57 explicit MGShell(MGFSurface* face);
58 
62 MGShell(
63  std::list<MGCellNB*> boundaries
65 );
66 
68 
70 
74 MGShell& operator=(const MGGel& gel2);
75 MGShell& operator=(const MGShell& gel2);
76 
78 MGShell& operator+=(const MGVector& v){MGBoundary::operator+=(v);return *this;};
79 MGShell& operator-=(const MGVector& v){MGBoundary::operator-=(v);return *this;};
80 MGShell& operator*=(double scale){MGBoundary::operator*=(scale);return *this;};
81 MGShell& operator*=(const MGMatrix& mat){MGBoundary::operator*=(mat);return *this;};
82 MGShell& operator*=(const MGTransf& tr){MGBoundary::operator*=(tr);return *this;};
83 
85 bool operator<(const MGShell& gel2)const;
86 bool operator<(const MGGel& gel2)const;
87 
89 
90 std::ostream& out(std::ostream& ostrm) const;
91 
94 int out_to_IGES(
95  MGIgesOfstream& igesfile,
96  int SubordinateEntitySwitch=0
97 )const;
98 
100 
102 bool active() const{return false;};
103 
108 
112 MGShell* clone(MGCell& parent) const;
113 MGShell* clone() const;
114 
116 MGShell* clone_without_binders(MGCell& parent) const;
118 
120 bool closed() const{return false;};
121 
123 MGFPoint closest(const MGPosition& point) const;
124 
126 //virtual bool displayList_is_made(MGCL::VIEWMODE vmode)const;
127 
129 virtual void display_arrows(mgSysGL& sgl)const;
130 virtual void display_control_polygon(mgSysGL& sgl)const;
131 
132 //Ensure this shell has binder vertices of all the model edges.
133 //The binder vertices are stored in bcells of this shell(in MGComplex).
134 void ensure_BVertices_of_ModelEdges()const;
135 
137 MGFace* face(pcellItr i);
138 const MGFace* face(const_pcellItr i)const;
139 
141 MGFace* face(int i);
142 const MGFace* face(int i)const;
143 
145 long identify_type() const;
146 
156 MGisects intersection(const MGObject& obj2)const;
157 MGisects intersection(const MGCurve& obj2)const;
158 MGisects intersection(const MGFSurface& obj2)const;
159 MGisects intersection(const MGSurface& obj2)const;
160 MGisects intersection(const MGFace& obj2)const;
161 MGisects intersection(const MGShell& obj2)const;
162 
164 MGCFisect_vector isect(const MGCurve& curve) const;
165 
167 MGHHisect_vector isect(const MGShell& shell2)const;
168 
171 MGHHisect_vector isect(const MGSurface& surf) const;
172 
175 MGHHisect_vector isect(const MGFace& face) const;
176 
179 MGHHisect_vector isect(const MGFSurface& face) const;
180 
182 void make_display_list(
184 )const;
185 
187 int manifold_dimension() const{return 2;};
188 
206 bool merge_at_common_edge(const MGFace& face);
207 bool merge_at_common_edge(MGFace* face);
208 bool merge_at_common_edge(const MGFSurface& face);
209 bool merge_at_common_edge(MGFSurface* face);
210 
212 int number_of_faces()const{return number_of_pcells();};
213 
218 bool on(
219  const MGPosition& point,
220  MGFPoint& fp
221 ) const;
222 
224 std::vector<MGFPoint> perps(const MGPosition& point) const;
225 
237 int project(
238  const MGCurve& crv,
239  MGHHisect_vector& lines,
242  const MGVector& vec=mgNULL_VEC
243 )const;
245 
247 void shade(
248  mgVBO& vbo,
249  const MGDrawParam& para,
251 )const;
252 
254 virtual void triangulate(
255  const MGDrawParam& para,
256  MGCL::TL_DATA_KIND dkind,
257  std::vector<mgTL2Triangles>& trisVec
258 )const;
259 
260 
262 MGShell* shell(){return this;};
263 const MGShell* shell()const{return this;};
264 
269 MGPvector<MGCurve> skeleton(int density=1)const;
270 
272 MGPvector<MGCurve> skeleton_at_knots()const;
273 
274 virtual std::string whoami()const{return "Shell";};
275 
276 protected:
277 
279 void ReadMembers(MGIfstream& buf);
280 
282 void WriteMembers(MGOfstream& buf) const;
283 
284 private:
285 
288 MGShell(
289  const MGShell& shell,
290  MGCellMap& cmap
291 );
292 
298 MGShell* clone(MGCell& parent, MGCellMap& cmap) const;
299 MGShell* clone(MGCellMap& cmap) const;
300 
305 bool isect_partner(
306  const MGPosition& uvuv,
307  MGPosition_list* uvuv_list,
308  int& j,
311 )const;
312 
316 bool isect_partner(
317  const MGPosition& uvuv,
318  MGPosition_list* uvuv_list,
319  int& i,
320  int& j,
323 )const;
324 
325 };
326 
329 void MG_DLL_DECLR set_up_shell_shade(
330  const MGShell& shell,
331  MGDrawParam& para,
332  MGPvector<MGLBRep>& boudaries,
335  std::vector< std::vector<SHLL_COM_EDGES> >& polylines
337 );
339  // end of TOPO group
341 #endif
int number_of_pcells() const
Obtain how many parameter cells are included in the boundary.
virtual long identify_type() const =0
Return Object's type ID (TID)
MGCurve is an abstract class which represents a whole curve.
Definition: Curve.h:63
MGTransf represents a transformation of a space dimension.
Definition: Transf.h:35
virtual MGFace * face()
Return MGFace pointer if this MGGel is an MGFace, else return null.
Definition: Gel.h:151
Definition: MGCL.h:272
virtual int out_to_IGES(MGIgesOfstream &igesfile, int SubordinateEntitySwitch=0) const
Definition: Gel.h:93
MGShell()
Default constructor.
Definition: Shell.h:39
TL_DATA_KIND
Triangles' data kind.
Definition: MGCL.h:280
bool closed() const
Test if this is closed boundary.
Definition: Shell.h:120
MGCFisect_vector defines a vector of MGCFisect.
Definition: CFisect_vector.h:25
virtual void ReadMembers(MGIfstream &buf)
Read Object's member data.
MGIfstream is a class to read the serialized data generated by MGOfstream.
Definition: Ifstream.h:30
const MGShell * shell() const
Definition: Shell.h:263
Definition: VBO.h:86
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
Vector of a general n space dimension.
Definition: Vector.h:26
MGShell * shell()
Return MGShell pointer if this MGGel is an MGShell, else return null.
Definition: Shell.h:262
MGShell & operator*=(const MGTransf &tr)
Definition: Shell.h:82
MGCell is a general cell that has bound.
Definition: Cell.h:35
virtual MGBoundary * clone() const =0
Defines parameters to draw MGObject, maily to approximate by lines and facets.
Definition: drawParam.h:53
MGFace is a trimmed surface.
Definition: Face.h:51
virtual MGBoundary & operator*=(double scale)
Definition: Boundary.h:67
MGShell & operator+=(const MGVector &v)
Object transformation.
Definition: Shell.h:78
MGGel is an abstract class which represents a group element.
Definition: Gel.h:53
virtual void WriteMembers(MGOfstream &buf) const
Write Object's Member Data.
virtual MGBoundary * clone_without_binders() const =0
cellItr append_pcell(MGCellNB *cell)
Append a PCell to the end of pcell sequence.
Represent a positional data.
Definition: Position.h:28
MGSurface is an abstract class of 3D surface.
Definition: Surface.h:54
MGShell & operator-=(const MGVector &v)
Definition: Shell.h:79
ELEMENT_TARGET
Definition: VBO.h:84
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
VIEWMODE
Definition: MGCL.h:271
virtual MGisects intersection(const MGObject &obj2) const
void append_face(MGFace *f)
Definition: Shell.h:107
virtual bool operator<(const MGComplex &gel2) const
comparison
MGFSurface is an abstract class to provide the comman interfaces to MGFace and MGSurface.
Definition: FSurface.h:33
MGOfstream is a class to serialize all of the subclasses of MGGel.
Definition: Ofstream.h:31
int number_of_faces() const
Get the number of faces included in this shell.
Definition: Shell.h:212
MGPosition_list provides a list of Positions.
Definition: Position_list.h:27
MGHHisect_vector defines a vector of MGHHisect.
Definition: HHisect_vector.h:28
MGOgesIfstream write out to *.iges file, transforming MGCL objects to IGES objects.
Definition: IgesOfstream.h:26
container_type::iterator iterator
Definition: Position_list.h:33
void triangulate(const MGLoop &polygon, mgTL2Triangles &triangles)
virtual void shade(mgVBO &vbo, const MGDrawParam &para, mgVBO::ELEMENT_TARGET target=mgVBO::SHADING) const
Shade the object in world coordinates.
Definition: Object.h:101
MGShell & operator*=(const MGMatrix &mat)
Definition: Shell.h:81
MGFPoint is to represent a Face or Surface point.
Definition: FPoint.h:20
virtual std::string whoami() const
Definition: Shell.h:274
virtual std::ostream & out(std::ostream &) const
Output virtual function.
void MG_DLL_DECLR set_up_shell_shade(const MGShell &shell, MGDrawParam &para, MGPvector< MGLBRep > &boudaries, std::vector< std::vector< SHLL_COM_EDGES > > &polylines)
bool active() const
Test if this is an active boundary.
Definition: Shell.h:102
virtual MGBoundary & operator-=(const MGVector &v)
Definition: Boundary.h:66
MGisects defines a vector of MGisect.
Definition: isects.h:44
mgSysGL is a class to provide a facility to draw temporal pictures.
Definition: sysGL.h:26
int manifold_dimension() const
Get manifold dimension.
Definition: Shell.h:187
OpenGL 4 用描画のためのクラス, in other words, display list.
Definition: VBO.h:76
virtual void make_display_list(MGCL::VIEWMODE vmode=MGCL::DONTCARE) const
Make a display list of this gel.
virtual void display_control_polygon(mgSysGL &sgl) const
Definition: Gel.h:194
virtual MGBoundary & operator=(const MGBoundary &gel2)
MGShell & operator*=(double scale)
Definition: Shell.h:80
virtual void display_arrows(mgSysGL &sgl) const
Definition: Gel.h:192
MGMatrix is a matix of m by m, where m is the space dimension.
Definition: Matrix.h:30