/********************************************************************/ /* Copyright (c) 2017 System fugen G.K. and Yuzi Mizuno */ /* All rights reserved. */ /********************************************************************/ #ifndef _MGBSumCurve_HH_ #define _MGBSumCurve_HH_ #include "mg/MGCL.h" #include "mg/Curve.h" class MGStraight; class MGRLBRep; class MGEllipse; class MGLBRep; class MGSurfCurve; class MGBSumCurve; /** @file */ /** @addtogroup GEO * @{ */ ///Define MGBSumCurve Class(Boolean sum curve of three curves). ///MGBSumCurve is a curve to support the class MGBSumSurf, is boolean sum of ///three curves, m_g1, m_g2, and m_g12 whose parameter ranges are exactly the same. ///MGBSumCurve(t) is defined as m_g1(t)+m_g2(t)-m_g12(t). class MG_DLL_DECLR MGBSumCurve:public MGCurve{ MG_DLL_DECLR friend MGBSumCurve operator+ (const MGVector& v, const MGBSumCurve& lb); MG_DLL_DECLR friend MGBSumCurve operator* (double scale, const MGBSumCurve&); public: /////////////Constructor/////////////// ///Void constructor(初期化なしでオブジェクトを作成する。) MGBSumCurve(); ///Copy constructor. MGBSumCurve(const MGBSumCurve& curve); ///constructor of three curves. ///The ownership of g1, g2, and g12 will be transfered to this MGBSumCurve. MGBSumCurve(MGCurve* g1, MGCurve* g2, MGCurve* g12); ///constructor of three curves. MGBSumCurve(const MGCurve& g1, const MGCurve& g2, const MGCurve& g12); //////////// Virtual Destructor //////////// ~MGBSumCurve(); //////////// Operator overload(演算子多重定義) //////////// ///Assignment. ///When the leaf object of this and geo2 are not equal, this assignment ///does nothing. MGBSumCurve& operator=(const MGGel& gel2); MGBSumCurve& operator=(const MGBSumCurve& el2); ///Object transformation. MGBSumCurve& operator+=(const MGVector& v); MGBSumCurve& operator-=(const MGVector& v); MGBSumCurve& operator*=(double scale); MGBSumCurve& operator*=(const MGMatrix& mat); MGBSumCurve& operator*=(const MGTransf& tr); ///Transformation object construction MGBSumCurve operator+ (const MGVector& v) const; MGBSumCurve operator- (const MGVector& v) const; MGBSumCurve operator* (double scale) const; MGBSumCurve operator* (const MGMatrix& mat) const; MGBSumCurve operator* (const MGTransf& tr) const; ///Comparison of two curves. bool operator==(const MGBSumCurve& gel2)const; bool operator==(const MGGel& gel2)const; bool operator<(const MGBSumCurve& gel2)const; bool operator<(const MGGel& gel2)const; //////////// Member Function ///////////// ///Returns B-Rep Dimension. int bdim() const; ///Return minimum box that includes the curve of parameter interval. /// 入力のパラメータ範囲の曲線部分を囲むボックスを返す。 MGBox box_limitted( const MGInterval& rang///< Parameter Range of the curve. )const; ///Changing this object's space dimension. MGBSumCurve& change_dimension( int sdim, ///< new space dimension int start1=0,///< Destination order of new object. int start2=0 ///< Source order of this object. ); ///Change parameter range, be able to change the direction by providing ///t1 greater than t2. void change_range( double t1, ///param_e();}; ///Normalize parameter value t to the nearest knot if their distance is ///within tolerance. double param_normalize(double t) const; /// Return starting parameter value. double param_s() const{return m_g1->param_s();}; ///Compute part of this curve from parameter t1 to t2. ///Returned is the pointer to the newed object, and should be deleted ///by calling program, or memory leaked. MGBSumCurve* part( double t1,///sdim();}; ///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] ///