MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
Gel.h
1 /********************************************************************/
2 /* Copyright (c) 2015 DG Technologies Inc. and Yuzi Mizuno */
3 /* All rights reserved. */
4 /********************************************************************/
5 #ifndef _MGGel_HH_
6 #define _MGGel_HH_
7 
8 #include "MGCLStdAfx.h"
9 #include "mg/MGCL.h"
10 #include "mg/AbstractGels.h"
11 #include "mg/Vector.h"
12 #include "mg/Matrix.h"
13 #include "mg/Pvector.h"
14 #include "mg/Transf.h"
15 
16 class MGDrawParam;
17 class MGAttribedGel;
18 class MGAttrib;
19 class MGIfstream;
20 class MGOfstream;
21 class MGAttrib;
22 class MGGroup;
23 class MGObject;
24 class MGGeometry;
25 class MGPoint;
26 class MGCurve;
27 class MGSurface;
28 class MGTopology;
29 class MGFace;
30 class MGShell;
31 class MGOpenGLView;
32 class MGIgesOfstream;
33 class mgSysGL;
34 class mgVBO;
35 ;
36 
42 //Define MGGel Class.
43 
45 
53 class MG_DLL_DECLR MGGel{
54 
56 MG_DLL_DECLR friend std::ostream& operator<< (std::ostream& ostrm, const MGGel& gel);
57 #ifdef FALSE__UNICODE
58 MG_DLL_DECLR friend std::wostream& operator<< (std::wostream& ostrm, const MGGel& gel);
59 #endif
60 
61 public:
62 
64 
65 //Void constructor(初期化なしでオブジェクトを作成する。)
66 //MGGel();
67 
68 //Copy constructor.
69 //MGGel(const MGGel& obj2);
70 
72 virtual ~MGGel();
73 
77 virtual MGGel& operator=(const MGGel& gel2){return *this;};
78 
80 virtual bool operator==(const MGGel& gel2)const{return false;};
81 virtual bool operator!=(const MGGel& gel2)const{return !(operator==(gel2));};
82 virtual bool operator<(const MGGel& gel2)const;
83 virtual bool operator>(const MGGel& gel2)const{return gel2<(*this);};
84 
86 
88 virtual std::ostream& out(std::ostream&) const=0;
89 
93 virtual int out_to_IGES(
94  MGIgesOfstream& igesfile,
95  int SubordinateEntitySwitch=0
96 )const{return 0;};
97 
100 virtual MGGel* clone()const=0;
101 
103 virtual mgVBO* dlist_name()const{return 0;};
104 
106 virtual void drawAttrib(
107  mgVBO& vbo,
108  bool no_color=false
109 )const{;};
110 
112 virtual void make_display_list(MGCL::VIEWMODE vmode=MGCL::DONTCARE)const{;};
113 
116 virtual int manifold_dimension() const{return -1;};
117 
119 virtual MGAttrib* attrib(){return 0;};
120 virtual const MGAttrib* attrib()const{return 0;};
121 
123 virtual MGGroup* group(){return 0;};
124 virtual const MGGroup* group()const{return 0;};
125 
127 virtual MGObject* object(){return 0;};
128 virtual const MGObject* object()const{return 0;};
129 
131 virtual MGGeometry* geometry(){return 0;};
132 virtual const MGGeometry* geometry()const{return 0;};
133 
135 virtual MGPoint* point(){return 0;};
136 virtual const MGPoint* point()const{return 0;};
137 
139 virtual MGCurve* curve(){return 0;};
140 virtual const MGCurve* curve()const{return 0;};
141 
143 virtual MGSurface* surf(){return 0;};
144 virtual const MGSurface* surf()const{return 0;};
145 
147 virtual MGTopology* topology(){return 0;};
148 virtual const MGTopology* topology()const{return 0;};
149 
151 virtual MGFace* face(){return 0;};
152 virtual const MGFace* face()const{return 0;};
153 
155 virtual MGShell* shell(){return 0;};
156 virtual const MGShell* shell()const{return 0;};
157 
159 virtual long identify_type() const = 0;
160 
162 virtual const MGObject* includes_object()const=0;
163 virtual MGObject* includes_object()=0;
164 
167 virtual bool no_display()const{return false;};
168 
171 std::string string_content()const;
172 
174 
176 virtual void transform(const MGVector& v){;};
177 
179 virtual void transform(double scale){;};
180 
182 virtual void transform(const MGMatrix& mat){;};
183 
185 virtual void transform(const MGTransf& tr){;};
186 
189 bool type_is(const MGAbstractGels& types)const;
190 
192 virtual void display_arrows(mgSysGL& sgl)const{;};
193 virtual void display_break_points(mgSysGL& sgl)const{;};
194 virtual void display_control_polygon(mgSysGL& sgl)const{;};
195 virtual void display_curvatures(
196  mgSysGL& sgl,
197  double scale,
198  int density,
199  bool use_radius
200 )const{;};
201 
202 virtual std::string whoami()const=0;
203 
204 protected:
205 
207 virtual void ReadMembers(MGIfstream& buf);
208 
210 virtual void WriteMembers(MGOfstream& buf)const;
211 
212 private:
213 
214 friend class MGIfstream;
215 friend class MGOfstream;
216 
217 };
218 
221 MG_DLL_DECLR MGGel* MGNullGel(long TID);
222  // end of GelRelated group
224 #endif
virtual MGGel & operator=(const MGGel &gel2)
Definition: Gel.h:77
virtual bool operator>(const MGGel &gel2) const
Definition: Gel.h:83
MGCurve is an abstract class which represents a whole curve.
Definition: Curve.h:63
virtual const MGAttrib * attrib() const
Definition: Gel.h:120
MGTransf represents a transformation of a space dimension.
Definition: Transf.h:35
virtual const MGCurve * curve() const
Definition: Gel.h:140
virtual MGTopology * topology()
Return MGTopology pointer if this MGGel is an MGTopology, else return null.
Definition: Gel.h:147
virtual MGGroup * group()
Return MGGroup pointer if this MGGel is an MGGroup, else return null.
Definition: Gel.h:123
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
MGPoint represents one dimensional manifold, a point in a space.
Definition: Point.h:28
virtual void display_curvatures(mgSysGL &sgl, double scale, int density, bool use_radius) const
Definition: Gel.h:195
virtual MGSurface * surf()
Return MGSurface pointer if this MGGel is an MGSurface, else return null.
Definition: Gel.h:143
virtual const MGFace * face() const
Definition: Gel.h:152
MGTopology is an abstract class which represents a whole Topology.
Definition: Topology.h:33
Is a container of MGAbstractGel, to specify what kind of gels are required.
Definition: AbstractGels.h:25
virtual bool operator!=(const MGGel &gel2) const
Definition: Gel.h:81
MGIfstream is a class to read the serialized data generated by MGOfstream.
Definition: Ifstream.h:30
virtual const MGTopology * topology() const
Definition: Gel.h:148
virtual const MGGeometry * geometry() const
Definition: Gel.h:132
std::ostream & operator<<(std::ostream &ostrm, const MGisect &is)
Debug Function.
Definition: isect.h:95
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
MGGeometry is an abstract class which represents a whole geometry.
Definition: Geometry.h:36
virtual const MGShell * shell() const
Definition: Gel.h:156
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 void display_break_points(mgSysGL &sgl) const
Definition: Gel.h:193
virtual void transform(const MGMatrix &mat)
matrix transformation.
Definition: Gel.h:182
virtual MGPoint * point()
Return point pointer if this MGGel is an MGPoint, else return null.
Definition: Gel.h:135
MGGel is an abstract class which represents a group element.
Definition: Gel.h:53
virtual const MGObject * object() const
Definition: Gel.h:128
virtual void transform(const MGTransf &tr)
general transformation.
Definition: Gel.h:185
Is an abstract class which provides interfaces of MGGel that has MGAppearance.
Definition: AttribedGel.h:32
virtual void transform(const MGVector &v)
Transform the gel by the argument.
Definition: Gel.h:176
MGSurface is an abstract class of 3D surface.
Definition: Surface.h:54
virtual const MGSurface * surf() const
Definition: Gel.h:144
Defines OpenGL display class for MGCL objects.
Definition: openglView.h:43
VIEWMODE
Definition: MGCL.h:271
MGOfstream is a class to serialize all of the subclasses of MGGel.
Definition: Ofstream.h:31
virtual MGObject * object()
Return MGObject pointer if this MGGel is an MGObject, else return null.
Definition: Gel.h:127
virtual void transform(double scale)
scaling.
Definition: Gel.h:179
virtual mgVBO * dlist_name() const
Obtain display list name. 0(null) means this gel need not to be displayed.
Definition: Gel.h:103
virtual bool no_display() const
Definition: Gel.h:167
MGOgesIfstream write out to *.iges file, transforming MGCL objects to IGES objects.
Definition: IgesOfstream.h:26
virtual int manifold_dimension() const
Definition: Gel.h:116
MGGroup is a class which constains MGGel elements.
Definition: Group.h:35
virtual const MGPoint * point() const
Definition: Gel.h:136
virtual MGShell * shell()
Return MGShell pointer if this MGGel is an MGShell, else return null.
Definition: Gel.h:155
virtual bool operator==(const MGGel &gel2) const
Comparison.
Definition: Gel.h:80
mgSysGL is a class to provide a facility to draw temporal pictures.
Definition: sysGL.h:26
virtual MGAttrib * attrib()
Return MGAttrib pointer if this MGGel is an MGAttrib, else return null.
Definition: Gel.h:119
OpenGL 4 用描画のためのクラス, in other words, display list.
Definition: VBO.h:76
virtual void display_control_polygon(mgSysGL &sgl) const
Definition: Gel.h:194
virtual const MGGroup * group() const
Definition: Gel.h:124
virtual MGGeometry * geometry()
Return MGGeometry pointer if this MGGel is an MGGeometry, else return null.
Definition: Gel.h:131
virtual void make_display_list(MGCL::VIEWMODE vmode=MGCL::DONTCARE) const
Make a display list of this gel.
Definition: Gel.h:112
virtual void drawAttrib(mgVBO &vbo, bool no_color=false) const
draw attribute data.
Definition: Gel.h:106
MGAttrib is an abstract class that defines attribute elements of MGGel.
Definition: Attrib.h:28
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
virtual MGCurve * curve()
Return curve pointer if this MGGel is an MGCurve, else return null.
Definition: Gel.h:139