/********************************************************************/ /* Copyright (c) 2017 System fugen G.K. and Yuzi Mizuno */ /* All rights reserved. */ /********************************************************************/ #ifndef _MGPVertex_HH_ #define _MGPVertex_HH_ #include "mg/Default.h" #include "topo/CellBase.h" class MGBox; class MGOfstream; class MGIfstream; class MGCellNB; class MGBVertex; class MGEdge; /** @addtogroup TOPO * @{ */ // //Define MGPVertex Class. ///MGPVertex is a parameter cell of the manifold dimension 0. ///MGPVertex is a boundary of an Edge(start or end) to hold edge's parameter data. ///Logically PVertex has characters of both a parameter cell and a boundary. ///MGPVertex cannot be a binder cell, and so does not have partner cells. ///MGPvertex can be only partners of a binder. ///This is the reason that MGPVertex is a subclass of MGCellBase. ///Since MGPVertex's manifold dimension is 0, MGPVertex does not have ///boundaries. class MG_DLL_DECLR MGPVertex: public MGCellBase{ public: ///////// Constructor ///////// ///Void constructor. MGPVertex():m_edge(0){;}; ///Copy constructor. ///Parent edge will be cleared. MGPVertex(const MGPVertex& v):m_edge(0), m_t(v.m_t){;}; ///Copy constructor with parent edge. ///e is set as the parent edge. MGPVertex(const MGPVertex& v, MGEdge* e):m_edge(e), m_t(v.m_t){;}; ///Fundamental constructor. ///Construct from the parameter value t of edge. ///e is set as the parent edge. explicit MGPVertex(double t, MGEdge* e=0):m_edge(e), m_t(t){;}; ///////// operator overload///////// ///Assignment. ///does not change binder and partner relation. ///edge pointer will be cleared. MGPVertex& operator=(const MGGel& gel2); MGPVertex& operator=(const MGPVertex& gel2); ///Object transformation. MGPVertex& operator+=(const MGVector& v); MGPVertex& operator-=(const MGVector& v); MGPVertex& operator*=(double scale); MGPVertex& operator*=(const MGMatrix& mat); MGPVertex& operator*=(const MGTransf& tr); ///Comparison of two objects. bool operator<(const MGPVertex& gel2)const; bool operator<(const MGGel& gel2)const; /////////Member Function///////// ///Get binder. MGBVertex* binder_vertex()const; ///Obtain the box into which the topology is included. const MGBox& box() const{return mgNULL_BOX;}; ///Make a clone of the cell. ///clone(), clone_without_boundaries() does not copy the binder cell relation. MGPVertex* clone() const; MGCellBase* clone_without_boundaries() const{ return static_cast(clone());}; ///Draw 3D curve in world coordinates. ///The object is converted to curve(s) and is drawn. void drawWire( mgVBO& vbo,///