MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
PVertex.h
1 /********************************************************************/
2 /* Copyright (c) 2015 DG Technologies Inc. and Yuzi Mizuno */
3 /* All rights reserved. */
4 /********************************************************************/
5 #ifndef _MGPVertex_HH_
6 #define _MGPVertex_HH_
7 
8 #include "mg/Default.h"
9 #include "topo/CellBase.h"
10 
11 class MGBox;
12 class MGOfstream;
13 class MGIfstream;
14 class MGCellNB;
15 class MGBVertex;
16 class MGEdge;
17 
22 //
23 //Define MGPVertex Class.
24 
26 
34 class MG_DLL_DECLR MGPVertex: public MGCellBase{
35 
36 public:
37 
39 
41 MGPVertex():m_edge(0){;};
42 
45 MGPVertex(const MGPVertex& v):m_edge(0), m_t(v.m_t){;};
46 
49 MGPVertex(const MGPVertex& v, MGEdge* e):m_edge(e), m_t(v.m_t){;};
50 
54 explicit MGPVertex(double t, MGEdge* e=0):m_edge(e), m_t(t){;};
55 
57 
61 MGPVertex& operator=(const MGGel& gel2);
62 MGPVertex& operator=(const MGPVertex& gel2);
63 
65 MGPVertex& operator+=(const MGVector& v);
66 MGPVertex& operator-=(const MGVector& v);
67 MGPVertex& operator*=(double scale);
68 MGPVertex& operator*=(const MGMatrix& mat);
69 MGPVertex& operator*=(const MGTransf& tr);
70 
72 bool operator<(const MGPVertex& gel2)const;
73 bool operator<(const MGGel& gel2)const;
74 
76 
78 MGBVertex* binder_vertex()const;
79 
81 const MGBox& box() const{return mgNULL_BOX;};
82 
85 MGPVertex* clone() const;
87  return static_cast<MGCellBase*>(clone());};
88 
91 void drawWire(
92  mgVBO& vbo,
93  double span_length,
94  int line_density=1
95 )const;
96 
100 void draw3DVertex(
101  mgVBO& vbo
102 ) const;
103 
105 long identify_type()const;
106 
108 bool is_bcell() const{return false;};
109 
111 bool is_start_vertex()const;
112 
117 MGCellNB* make_binder() const;
118 
120 int manifold_dimension() const{return 0;};
121 
123 void negate(){;};
124 
126 std::ostream& out(std::ostream&) const;
127 
134 
136 void set_t(double t){m_t=t;};
137 
139 void set_edge(MGEdge* e){m_edge=e;};
140 
142 const MGCellNB* star() const;
143 MGCellNB* star();
144 
146 const MGEdge* edge() const{return m_edge;};
147 
149 MGEdge* edge(){return m_edge;};
150 
152 double t() const{return m_t;};
153 std::string whoami()const{return "PVertex";};
154 
155 protected:
156 
158 void ReadMembers(MGIfstream& buf);
159 
161 void WriteMembers(MGOfstream& buf) const;
162 
163 private:
164 
165  MGEdge* m_edge;
166  double m_t;
167 
169 void copy_all_boundaries(const MGCellBase& cell2){;};
170 
174 void copy_all_boundaries(const MGCellBase& cell2, MGCellMap& cmap){;};
175 void copy_box(const MGCellBase& cb)const{;};
176 void copy_perror(const MGCellBase& cb)const{;};
177 
184 MGPVertex* clone(MGCellMap& cmap) const{
185  return clone();
186 };
187 
191 MGGeometry* make_binder_extent() const;
192 
193 };
194  // end of TOPO group
196 #endif
CellNB is a cell without boundaries(No Boundaries).
Definition: CellNB.h:38
MG_DLL_DECLR const MGBox mgNULL_BOX
MGBVertex is 0 manifold dimension binder cell, is an point.
Definition: BVertex.h:30
Is an abstract class and the super class of MGPVertex and MGCellNB.
Definition: CellBase.h:38
MGCellBase * clone_without_boundaries() const
Definition: PVertex.h:86
MGPVertex(const MGPVertex &v, MGEdge *e)
Definition: PVertex.h:49
MGTransf represents a transformation of a space dimension.
Definition: Transf.h:35
virtual MGCellBase & operator+=(const MGVector &v)=0
Object transformation.
virtual bool operator<(const MGGel &gel2) const
virtual long identify_type() const =0
Return This object's typeID.
virtual void ReadMembers(MGIfstream &buf)
Read Object's member data.
void set_t(double t)
Set the parameter value.
Definition: PVertex.h:136
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
const MGEdge * edge() const
Return the edge pointer.
Definition: PVertex.h:146
std::string whoami() const
Definition: PVertex.h:153
bool is_bcell() const
Ask if this is binder cell.
Definition: PVertex.h:108
double t() const
Return the parameter value.
Definition: PVertex.h:152
Vector of a general n space dimension.
Definition: Vector.h:26
virtual std::ostream & out(std::ostream &) const
Output virtual function.
MGGeometry is an abstract class which represents a whole geometry.
Definition: Geometry.h:36
void set_edge(MGEdge *e)
Set the edge pointer.
Definition: PVertex.h:139
virtual MGCellBase * clone() const =0
Defines a Box of any space dimendion.
Definition: Box.h:34
virtual void draw3DVertex(mgVBO &vbo) const =0
const MGBox & box() const
Obtain the box into which the topology is included.
Definition: PVertex.h:81
virtual void WriteMembers(MGOfstream &buf) const
Write Object's Member Data.
static const MGPosition & null_position()
Return null position.
Definition: Default.h:142
MGGel is an abstract class which represents a group element.
Definition: Gel.h:53
MGEdge is an instance of MGCellNB, represents a boundary element of 2D manifold.
Definition: Edge.h:33
MGStraight is a curve of any space dimension, represent a straight line.
Definition: Straight.h:49
MGPVertex(double t, MGEdge *e=0)
Definition: PVertex.h:54
virtual MGCellNB * make_binder() const =0
Represent a positional data.
Definition: Position.h:28
virtual MGCellBase & operator=(const MGCellBase &gel2)
MGEdge * edge()
Return the edge pointer.
Definition: PVertex.h:149
void negate()
Negate the direction of the cell.
Definition: PVertex.h:123
MGPVertex(const MGPVertex &v)
Definition: PVertex.h:45
MGOfstream is a class to serialize all of the subclasses of MGGel.
Definition: Ofstream.h:31
MGPosition pick_closest(const MGStraight &sl) const
Definition: PVertex.h:133
MGPVertex()
Void constructor.
Definition: PVertex.h:41
virtual MGCellBase & operator*=(double scale)=0
virtual MGCellBase & operator-=(const MGVector &v)=0
virtual const MGCellNB * star() const =0
Obtain star cells.
OpenGL 4 用描画のためのクラス, in other words, display list.
Definition: VBO.h:76
MGPVertex is a parameter cell of the manifold dimension 0.
Definition: PVertex.h:34
int manifold_dimension() const
Get manifold dimension.
Definition: PVertex.h:120
MGMatrix is a matix of m by m, where m is the space dimension.
Definition: Matrix.h:30