/********************************************************************/ /* Copyright (c) 2017 System fugen G.K. and Yuzi Mizuno */ /* All rights reserved. */ /********************************************************************/ #ifndef _MGSurfCurve_HH_ #define _MGSurfCurve_HH_ #include "mg/Default.h" #include "mg/Curve.h" #include "mg/Surface.h" #include "mg/TrimmedCurve.h" // //Define MGSurfCurve Class. class MGInterval; class MGBox; class MGVector; class MGUnit_vector; class MGPosition; class MGPosition_list; class MGTransf; class MGCParam_list; class MGStraight; class MGEllipse; class MGRLBRep; class MGRSBRep; class MGCCisect_list; class MGCSisect_list; class MGIfstream; class MGOfstream; /** @file */ /** @addtogroup GEO * @{ */ ///MGSurfCurve is a curve on a surface. ///Defined by a surface and its parameter space line ///represented by (u,v). Let the surface S(u,v), and the parameter space ///curve of 2D be f(t). Then MGSurfCurve is defined as S(f(t)). ///MGSurfCurve is a TEMPORAL curve, and does not have update functions. class MG_DLL_DECLR MGSurfCurve:public MGCurve{ public: MG_DLL_DECLR friend MGSurfCurve operator+ (const MGVector& v, const MGSurfCurve& cv2); MG_DLL_DECLR friend MGSurfCurve operator* (double scale, const MGSurfCurve& cv2); ////////Constructor///////// ///Void constructor(初期化なしでオブジェクトを作成する。) MGSurfCurve():MGCurve(),m_surface(0){;}; ///Copy constructor MGSurfCurve(const MGSurfCurve& sc); ///Default constructor MGSurfCurve( const MGSurface& srf, ///< Surface const MGCurve& crv ///< Original uv-curve ); ///Default constructor MGSurfCurve( const MGFSurface& srf, ///< Surface const MGCurve& crv ///< Original uv-curve ); ////////////Operator overload(演算子多重定義)//////////// public: ///Assignment. ///When the leaf object of this and crv2 are not equal, this assignment ///does nothing. MGSurfCurve& operator=(const MGGel& gel2); MGSurfCurve& operator=(const MGSurfCurve& el2); ///Comparison of two curves. bool operator==(const MGSurfCurve& gel2)const; bool operator==(const MGGel& gel2)const; bool operator<(const MGSurfCurve& gel2)const; bool operator<(const MGGel& gel2)const; ////////Member Function///////// ///Approximate this curve as a MGLBRep curve ///within the tolerance MGTolerance::line_zero(). ///When parameter_normalization=0, reparameterization will not done, and ///the evaluation at the same parameter has the same values before and after ///of approximate_as_LBRep. void approximate_as_LBRep( MGLBRep& lb, ///& crv_list, ///=order(), order() is assumed. )const; /// Evaluate n'th derivative data. n=0 means positional data evaluation. MGVector eval( double, ///< Parameter value. int nderiv=0, ///< Order of Derivative. int left=0 ///=0: number of curves obtained, <0 : Some error detected. int project( const MGFSurface& surf, //given surface. MGPvector& vec_crv_uv, //uv projection curve will be appended. MGPvector& vec_crv, //3d projection curve will be appended. const MGVector& vec //projection vector. //if vec = NULL then calculate perpendicular project. )const; ///Round t into curve's parameter range. /// 入力パラメータをパラメータ範囲でまるめて返却する。 double range(double t) const; ///Return space dimension int sdim() const ; ///Return sweep surface from crv ///Returned is a newed MGSurface, must be deleted. ///The sweep surface is defined as: ///This curve(say c(t)) is the rail and the straight line segments from ///C(t)+start_dist*uvec to C(t)+end_dist*uvec are the generatrix. MGSurface* sweep( const MGUnit_vector& uvec, /// oneD( const double g[4] /// tmpPtr; return tmpPtr;} ///メンバデータを読み出す関数 /// 戻り値boolは正常に読み出しが出来ればtrue、失敗すればfalseになる /// ここでは処理対象となるデータメンバが無いので何も処理をしない。 void ReadMembers(MGIfstream& buf); ///メンバデータを書き込む関数 /// 戻り値boolは正常に書き込みが出来ればtrue、失敗すればfalseになる /// ここでは処理対象となるデータメンバが無いので何も処理をしない。 void WriteMembers(MGOfstream& buf) const; std::string whoami()const{return "SurfCurve";}; protected: ///Get data points for approximate_as_LBRep2. void data_points_for_approximate_as_LBRep2( int is,///