/********************************************************************/ /* Copyright (c) 2017 System fugen G.K. and Yuzi Mizuno */ /* All rights reserved. */ /********************************************************************/ #ifndef _MGGeometry_HH_ #define _MGGeometry_HH_ #include "mg/Object.h" #include "mg/Box.h" #include "mg/Unit_vector.h" //Define MGGeometry Class. class MGIfstream; class MGOfstream; class MGInterval; class MGBox; class MGVector; class MGPosition; class MGPosition_list; class MGMatrix; class MGTransf; class MGCurve; class MGSurface; class MGPoint; /** @defgroup GEO Geometry (sub) classes * MGGeometry is top abstract class for MGPoint, MGCurve, and MGSurface. * @{ */ ///MGGeometry is an abstract class which represents a whole geometry. ///Geometry represents point(MGPoint), curve(MGCurve), and surface ///(MGSurface). class MG_DLL_DECLR MGGeometry: public MGObject{ public: ////////////Constructor//////////// ///Void constructor(初期化なしでオブジェクトを作成する。) MGGeometry(); ///Copy constructor. MGGeometry(const MGGeometry& geo2); ///Virtual Destructor virtual ~MGGeometry(); ////////////Operator overload(演算子多重定義)//////////// ///Assignment. ///When the leaf object of this and obj2 are not equal, this assignment ///does nothing. virtual MGGeometry& operator=(const MGGeometry& gel2){return set_geometry(gel2);}; /// Output virtual function. virtual std::ostream& out(std::ostream&) const; ///Return MGGeometry pointer if this MGGel is an MGGeometry, else return null. virtual MGGeometry* geometry(){return this;}; virtual const MGGeometry* geometry()const{return this;}; ////////////Member Function//////////// ///Return minimum box that includes whole of the geometry. const MGBox& box() const; ///Obtain ceter coordinate of the geometry. virtual MGPosition center() const=0; ///Obtain ceter parameter value of the geometry. virtual MGPosition center_param() const=0; ///Changing this object's space dimension. virtual MGGeometry& change_dimension( int sdim, ///< new space dimension int start1=0, ///< Destination order of new object. int start2=0 ///< Source order of this object. )=0; ///Construct new geometry object by copying to newed area. ///User must delete this copied object by "delete". virtual MGGeometry* clone()const=0; ///Construct new geometry object by changing ///the original object's space dimension. ///User must delete this copied object by "delete". virtual MGGeometry* copy_change_dimension( int sdim, ///< new space dimension int start1=0, ///< Destination order of new object. int start2=0 ///< Source order of this object. )const=0; ///Compute direction unit vector of the geometry. virtual MGUnit_vector direction(const MGPosition& param) const; ///Draw 3D point(vertex) in world coordinates. ///The object is converted to point(s) and is drawn. ///This is valid only for topology objects or MGPoint. virtual void draw3DVertex(mgVBO& vbo)const; /// Evaluate n'th derivative data. n=0 means positional data evaluation. virtual MGVector evaluate( const MGPosition& t, ///< Parameter value, ///