MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
Geometry.h
1 /********************************************************************/
2 /* Copyright (c) 2015 DG Technologies Inc. and Yuzi Mizuno */
3 /* All rights reserved. */
4 /********************************************************************/
5 
6 #ifndef _MGGeometry_HH_
7 #define _MGGeometry_HH_
8 
9 #include "mg/Object.h"
10 #include "mg/Box.h"
11 #include "mg/Unit_vector.h"
12 
13 //Define MGGeometry Class.
14 class MGIfstream;
15 class MGOfstream;
16 class MGInterval;
17 class MGBox;
18 class MGVector;
19 class MGPosition;
20 class MGPosition_list;
21 class MGMatrix;
22 class MGTransf;
23 class MGCurve;
24 class MGSurface;
25 class MGPoint;
26 
32 
36 class MG_DLL_DECLR MGGeometry: public MGObject{
37 
38 public:
39 
41 
43 MGGeometry();
44 
46 MGGeometry(const MGGeometry& geo2);
47 
49 virtual ~MGGeometry();
50 
52 
56 virtual MGGeometry& operator=(const MGGeometry& gel2){return set_geometry(gel2);};
57 
59 virtual std::ostream& out(std::ostream&) const;
60 
62 virtual MGGeometry* geometry(){return this;};
63 virtual const MGGeometry* geometry()const{return this;};
64 
66 
68 const MGBox& box() const;
69 
71 virtual MGPosition center() const=0;
72 
74 virtual MGPosition center_param() const=0;
75 
77 virtual MGGeometry& change_dimension(
78  int sdim,
79  int start1=0,
80  int start2=0
81 )=0;
82 
85 virtual MGGeometry* clone()const=0;
86 
90 virtual MGGeometry* copy_change_dimension(
91  int sdim,
92  int start1=0,
93  int start2=0
94 )const=0;
95 
97 virtual MGUnit_vector direction(const MGPosition& param) const;
98 
102 virtual void draw3DVertex(mgVBO& vbo)const;
103 
105 virtual MGVector evaluate(
106  const MGPosition& t,
107  const int* nderiv=0
109 ) const=0;
111 
114 virtual bool in_range(const MGPosition& t)const{return false;}
115 
117 bool is_null()const{return sdim()==0;};
118 
120 virtual void negate(){return;};
121 
126 virtual void negate_transform(MGGeometry& boundary)const=0;
127 
129 double parameter_error() const;
130 
133 virtual MGBox parameter_range() const=0;
134 
136 virtual int sdim() const=0;
137 
138 virtual std::string whoami()const{return "Geometry";};
139 
140 protected:
141 
142 mutable MGBox* m_box;
143 
146 virtual MGBox* compute_box() const=0;
147 
150 virtual void ReadMembers(MGIfstream& buf);
151 
153 MGGeometry& set_geometry(const MGGeometry& geo2);
154 
156 virtual void update_mark(){if(m_box){delete m_box;m_box=0;}};
157 
160 virtual void WriteMembers(MGOfstream& buf)const;
161 
162 private:
163 
164 };
165  // end of GEO group
167 #endif
virtual MGGeometry & operator=(const MGGeometry &gel2)
Definition: Geometry.h:56
virtual void negate()
Negate direction of this geometry.
Definition: Geometry.h:120
MGCurve is an abstract class which represents a whole curve.
Definition: Curve.h:63
virtual void update_mark()
Mark this as updated.
Definition: Geometry.h:156
MGTransf represents a transformation of a space dimension.
Definition: Transf.h:35
MGPoint represents one dimensional manifold, a point in a space.
Definition: Point.h:28
virtual std::string whoami() const
Definition: Geometry.h:138
MGIfstream is a class to read the serialized data generated by MGOfstream.
Definition: Ifstream.h:30
virtual void WriteMembers(MGOfstream &buf) const
Write all member data.
Is an abstract class which represents a whole geometry and a topology.
Definition: Object.h:42
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
Interval of 1 dimension, i.e. MGInterval is a real line.
Definition: Interval.h:22
virtual MGObject * clone() const =0
Represent a positional data.
Definition: Position.h:28
MGSurface is an abstract class of 3D surface.
Definition: Surface.h:54
virtual void ReadMembers(MGIfstream &buf)
general transformation.
virtual bool in_range(const MGPosition &t) const
Definition: Geometry.h:114
MGOfstream is a class to serialize all of the subclasses of MGGel.
Definition: Ofstream.h:31
MGPosition_list provides a list of Positions.
Definition: Position_list.h:27
virtual MGGeometry * geometry()
Return MGGeometry pointer if this MGGel is an MGGeometry, else return null.
Definition: Geometry.h:62
virtual const MGGeometry * geometry() const
Definition: Geometry.h:63
virtual std::ostream & out(std::ostream &) const
Output virtual function.
virtual void draw3DVertex(mgVBO &vbo) const =0
virtual const MGBox & box() const =0
Get the box of the object.
OpenGL 4 用描画のためのクラス, in other words, display list.
Definition: VBO.h:76
bool is_null() const
Test if this is null.
Definition: Geometry.h:117
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