MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
Point.h
1 /********************************************************************/
2 /* Copyright (c) 2015 DG Technologies Inc. and Yuzi Mizuno */
3 /* All rights reserved. */
4 /********************************************************************/
5 #ifndef _MGPoint_HH_
6 #define _MGPoint_HH_
7 
8 #include "mg/Geometry.h"
9 #include "mg/Position.h"
10 #include "mg/isects.h"
11 
12 class MGIfstream;
13 class MGOfstream;
14 class MGInterval;
15 class MGBox;
16 class MGVector;
17 class MGPosition_list;
18 class MGMatrix;
19 class MGTransf;
20 
25 
28 class MG_DLL_DECLR MGPoint:public MGGeometry{
29 
30 public:
31 
33 
35 MGPoint();
36 
38 MGPoint(const MGPosition& P);
39 
42 MGPoint(
43  int sdim,
44  const MGPoint& P
45  , int start1=0
46  , int start2=0
47 );
48 
50 ~MGPoint();
51 
53 
57 MGPoint& operator=(const MGGel& gel2);
58 MGPoint& operator=(const MGPoint& gel2);
59 
61 double operator[] (int i) const{return m_point.ref(i);}
62 double operator() (int i) const{return m_point.ref(i);}
63 
65 double& operator()(int i){return m_point(i);};
66 
68 MGPoint& operator+=(const MGVector& v);
69 MGPoint& operator-=(const MGVector& v);
70 MGPoint& operator*=(double scale);
71 MGPoint& operator*=(const MGMatrix& mat);
72 MGPoint& operator*=(const MGTransf& tr);
73 
75 
77 bool operator==(const MGPoint& point)const;
78 bool operator<(const MGPoint& gel2)const;
79 bool operator==(const MGGel& gel2)const{return gel2==(*this);};
80 bool operator!=(const MGGel& gel2)const{return !(gel2==(*this));};
81 bool operator!=(const MGPoint& gel2)const{return !(gel2==(*this));};
82 bool operator<(const MGGel& gel2)const{return gel2>(*this);};
83 
85 
88 /*MGBox box(
89  const MGBox& bx /// Parameter Range of the geometry.
92 ) const;
93 */
94 
96 MGPosition center() const{return m_point;};
97 
99 MGPosition center_param() const{ return MGPosition();};
100 
103  int sdim,
104  int start1=0,
105  int start2=0
106 );
107 
110 MGPoint* clone() const;
111 
116  int sdim,
117  int start1=0,
118  int start2=0
119 )const;
120 
123 MGUnit_vector direction(const MGPosition& param) const;
124 
127 void drawWire(
128  mgVBO& vbo,
129  double span_length,
130  int line_density=1
131 )const;
132 
136 void draw3DVertex(
137  mgVBO& vbo
138 )const;
139 
142  const MGPosition& t,
143  const int* nderiv=0
145 )const{return m_point;}
148 
150 long identify_type()const;
151 
153 bool in_range(const MGPosition& t)const;
154 
164 MGisects intersection(const MGObject& obj2)const{return MGisects();};
165 MGisects intersection(const MGCurve& obj2)const{return MGisects();};
166 MGisects intersection(const MGFSurface& obj2)const{return MGisects();};
167 MGisects intersection(const MGSurface& obj2)const{return MGisects();};
168 MGisects intersection(const MGFace& obj2)const{return MGisects();};
169 MGisects intersection(const MGShell& obj2)const{return MGisects();};
170 
172 int manifold_dimension() const{return 0;};
173 
175 void negate(){;};
176 
181 void negate_transform(MGGeometry& boundary)const{;};
182 
189 bool on(
190  const MGPosition& P,
191  MGPosition& param
192 ) const;
193 
198 MGPosition parameter(
199  const MGPosition& P
200 ) const;
201 
203 MGBox parameter_range() const;
204 
206 MGPoint* point(){return this;};
207 const MGPoint* point()const{return this;};
208 
209 const MGPosition& position()const{return m_point;}
210 MGPosition& position(){return m_point;}
211 
214 MGPosition range(const MGPosition& t) const;
215 
217 double ref(int i) const{return m_point.ref(i);};
218 
220 int sdim() const;
221 
223 int out_to_IGES(
224  MGIgesOfstream& igesfile,
225  int SubordinateEntitySwitch=0
226 )const;
227 
229 std::ostream& out(std::ostream&) const;
230 
231 std::string whoami()const{return "Point";};
232 
233 protected:
234 
238 void ReadMembers(MGIfstream& buf);
239 
243 void WriteMembers(MGOfstream& buf) const;
244 
245 private:
246  MGPosition m_point;
247 
250 MGBox* compute_box() const;
251 
252 };
253  // end of GEO group
255 #endif
MGisects intersection(const MGFace &obj2) const
Definition: Point.h:168
virtual MGGeometry & operator=(const MGGeometry &gel2)
Definition: Geometry.h:56
bool operator==(const MGGel &gel2) const
Comparison.
Definition: Point.h:79
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 std::ostream & out(std::ostream &) const
Output virtual function.
const MGPosition & position() const
Definition: Point.h:209
virtual int out_to_IGES(MGIgesOfstream &igesfile, int SubordinateEntitySwitch=0) const
Definition: Gel.h:93
virtual int sdim() const =0
Return space dimension.
virtual bool operator<(const MGGel &gel2) const
virtual long identify_type() const =0
Return This object's typeID.
MGPoint represents one dimensional manifold, a point in a space.
Definition: Point.h:28
bool operator!=(const MGPoint &gel2) const
Definition: Point.h:81
virtual MGGeometry * copy_change_dimension(int sdim, int start1=0, int start2=0) const =0
virtual MGBox * compute_box() const =0
MGIfstream is a class to read the serialized data generated by MGOfstream.
Definition: Ifstream.h:30
virtual void drawWire(mgVBO &vbo, double span_length, int line_density=1) const =0
void negate()
Negate direction of this geometry.
Definition: Point.h:175
int manifold_dimension() const
Return manifold dimension, i.e. 0:point, 1:curve, 2:surface.
Definition: Point.h:172
void negate_transform(MGGeometry &boundary) const
Definition: Point.h:181
Is an abstract class which represents a whole geometry and a topology.
Definition: Object.h:42
std::string whoami() const
Definition: Point.h:231
virtual MGUnit_vector direction(const MGPosition &param) const
Compute direction unit vector of the geometry.
MGShell is a composition of MGFace's(trimmed surface).
Definition: Shell.h:32
Vector of a general n space dimension.
Definition: Vector.h:26
MGisects intersection(const MGSurface &obj2) const
Definition: Point.h:167
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
virtual void ReadMembers(MGIfstream &buf)
MGFace is a trimmed surface.
Definition: Face.h:51
MGVector evaluate(const MGPosition &t, const int *nderiv=0) const
Evaluate n'th derivative data. n=0 means positional data evaluation.
Definition: Point.h:141
MGisects intersection(const MGShell &obj2) const
Definition: Point.h:169
virtual void WriteMembers(MGOfstream &buf) const
MGGel is an abstract class which represents a group element.
Definition: Gel.h:53
MGPosition center_param() const
Obtain ceter parameter value of the geometry.
Definition: Point.h:99
Interval of 1 dimension, i.e. MGInterval is a real line.
Definition: Interval.h:22
Represent a positional data.
Definition: Position.h:28
MGSurface is an abstract class of 3D surface.
Definition: Surface.h:54
virtual bool in_range(const MGPosition &t) const
Definition: Geometry.h:114
virtual MGObject & operator-=(const MGVector &v)=0
virtual MGGeometry & change_dimension(int sdim, int start1=0, int start2=0)=0
Changing this object's space dimension.
MGisects intersection(const MGCurve &obj2) const
Definition: Point.h:165
double & operator()(int i)
Access to i-th element.
Definition: Point.h:65
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
MGisects intersection(const MGFSurface &obj2) const
Definition: Point.h:166
const MGPoint * point() const
Definition: Point.h:207
MGPosition_list provides a list of Positions.
Definition: Position_list.h:27
MGPoint * point()
Return point pointer if this MGGel is an MGPoint, else return null.
Definition: Point.h:206
bool operator!=(const MGGel &gel2) const
Definition: Point.h:80
virtual MGBox parameter_range() const =0
MGOgesIfstream write out to *.iges file, transforming MGCL objects to IGES objects.
Definition: IgesOfstream.h:26
virtual MGGeometry * clone() const =0
MGPosition center() const
Obtain ceter coordinate of the geometry.
Definition: Point.h:96
MGisects intersection(const MGObject &obj2) const
Definition: Point.h:164
MGisects defines a vector of MGisect.
Definition: isects.h:44
virtual MGObject & operator+=(const MGVector &v)=0
Object transformation.
virtual MGObject & operator*=(double scale)=0
virtual bool operator==(const MGGel &gel2) const
Comparison.
Definition: Gel.h:80
virtual void draw3DVertex(mgVBO &vbo) const
OpenGL 4 用描画のためのクラス, in other words, display list.
Definition: VBO.h:76
MGPosition & position()
Definition: Point.h:210
double ref(int i) const
Return i-th element of the point.
Definition: Point.h:217
bool operator<(const MGGel &gel2) const
Definition: Point.h:82
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