/********************************************************************/ /* Copyright (c) 2017 System fugen G.K. and Yuzi Mizuno */ /* All rights reserved. */ /********************************************************************/ #ifndef _MGCellBase_HH_ #define _MGCellBase_HH_ #include #include "topo/Topology.h" // //Define MGCellBase Class. class MGBox; class MGVector; class MGMatrix; class MGTransf; class MGGeometry; class MGCellNB; class MGCellMap; class MGComplex; class MGPVertex; /** @addtogroup TOPO * @{ */ ///Is an abstract class and the super class of MGPVertex and MGCellNB. ///A CellBase includes only a binder cell pointer if exists. ///There are two types of cells. One is parameter cell(pcell) and ///the other is binder cell(bcell). They are exclusive, that is, if ///a cell is a parameter cell, the cell cannot be binder cell and ///vice versa. ///Parameter cell is a constituent of a complex. ///Binder cell is a binder of parameter cells. Plural cells are connected ///through a binder. class MG_DLL_DECLR MGCellBase: public MGTopology{ public: ///////Constructor///////// ///Void constructor. Constructor of pcell. MGCellBase():m_binder(0){;}; ///Copy constructor. ///The binder will not be copied even if cell had one. MGCellBase(const MGCellBase& cell):MGTopology(cell),m_binder(0){;}; ////////////Virtual Destructor//////////// virtual ~MGCellBase(); ///////operator overload////// ///Assignment. ///When the leaf object of this and topo2 are not equal, this assignment ///does nothing. virtual MGCellBase& operator=(const MGCellBase& gel2); ///Object transformation. virtual MGCellBase& operator+=(const MGVector& v)=0; virtual MGCellBase& operator-=(const MGVector& v)=0; virtual MGCellBase& operator*=(double scale)=0; virtual MGCellBase& operator*=(const MGMatrix& mat)=0; virtual MGCellBase& operator*=(const MGTransf& tr)=0; /////////////Member Function/////////////// ///Obtain binder. MGCellNB* binder()const{return m_binder;}; ///Obtain the box of the cell. const MGBox& box()const=0; ///Make a clone of the cell. ///clone(), clone_without_boundaries() does not copy the binder cell relation. virtual MGCellBase* clone()const=0; virtual MGCellBase* clone_without_boundaries()const=0; ///Connect this cell to cell2. ///This cell is a pcell of a boundary of a higher manifold dimension's cell A, ///and cell2 is also is a pcell of a boundary of another cell B. ///That is, this cell is a part of a boundary of cell A, ///and cell2 is a part of a boundary of cell B. ///If cell A's manifold dimension is n, then this cell's manifold dimension is n-1. ///B's manifold dimension is same as A's. and cell2's manifold dimension is n-1. virtual void connect(MGCellBase& cell2); ///Draw 3D curve in the topology's star cell world coordinates. ///The object is converted to curve(s) and is drawn. virtual void drawWire_in_star( mgVBO& vbo,/// partners() const; ///Set binder cell relation to this parameter cell. ///***The binder must be newed object and the owenership is transfered ///to this parameter cell. void set_binder(MGCellNB& binder)const; ///Obtain star cells. virtual const MGCellNB* star() const=0; virtual MGCellNB* star()=0; /// Output virtual function. virtual std::ostream& out(std::ostream&) const; virtual std::string whoami()const{return "CellBase";}; protected: mutable MGCellNB* m_binder; ///