/********************************************************************/ /* Copyright (c) 2017 System fugen G.K. and Yuzi Mizuno */ /* All rights reserved. */ /********************************************************************/ #ifndef _MGBSumSurf_HH_ #define _MGBSumSurf_HH_ class MGIfstream; class MGOfstream; #include #include "mg/MGCL.h" #include "mg/CSisect_list.h" #include "mg/Surface.h" // MGBSumSurf.h /** @addtogroup GEO * @{ */ ///Defines Boolean sum surface. ///Boolean sum surface is defined by three surfaces g1, g2, and g12 whose parameter ///ranges are exactly the same, as f(u,v)=g1+g2-g12. Typically Gordon surface is ///a boolean sum surface. See "Curves and Srufaces for CAGD" by Gerald Farin. class MG_DLL_DECLR MGBSumSurf: public MGSurface{ public: //////////// Constructor //////////// ///Default constructor. MGBSumSurf():MGSurface(),m_g1(0), m_g2(0), m_g12(0){;}; ///construct from newed MGSurface. The ownership of g1, g2, and g12 will be ///transfered to this MGBSumSurf. MGBSumSurf( MGSurface* g1, MGSurface* g2, MGSurface* g12 ); ///construct from three MGSurface. MGBSumSurf( const MGSurface& g1, const MGSurface& g2, const MGSurface& g12 ); ///Copy constructor. MGBSumSurf(const MGBSumSurf& rhs); ////////////Destructor///////// ~MGBSumSurf(); //////////// Operator overload. 演算子多重定義 //////////// ///Assignment. ///When the leaf object of this and srf2 are not equal, this assignment ///does nothing. MGBSumSurf& operator=(const MGGel& gel2); MGBSumSurf& operator=(const MGBSumSurf& gel2); ///Object transformation. MGBSumSurf& operator+=(const MGVector& v); MGBSumSurf& operator-=(const MGVector& v); MGBSumSurf& operator*=(double scale); MGBSumSurf& operator*=(const MGMatrix& mat); MGBSumSurf& operator*=(const MGTransf& tr); ///Comparison of two curves. bool operator==(const MGBSumSurf& gel2)const; bool operator==(const MGGel& gel2)const; bool operator<(const MGBSumSurf& gel2)const; bool operator<(const MGGel& gel2)const; bool operator!=(const MGGel& gel2)const{return !(gel2==(*this));}; bool operator!=(const MGBSumSurf& gel2)const{return !(gel2==(*this));}; //////////// Member Function //////////// int bdim_u() const; ///Returns B-Rep Dimension of u. int bdim_v() const; ///Returns B-Rep Dimension of v. /// 入力のパラメータ範囲の曲線部分を囲むボックスを返す。 ///Return minimum box that includes limitted surface by uvrange. MGBox box_limitted( const MGBox& uvrange ///< Parameter Range of the curve. )const; ///Changing this object's space dimension. MGBSumSurf& 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. MGBSumSurf& change_range( int is_u, ///less_than(i,uv1,uv2);}; ///Negate direction of surface. void negate( int is_u///< Negate along u-direction if is_u is ture, ///< else along v-direction. ); ///Returns the order of u. int order_u() const; ///Returns the order of v. int order_v() const; ///Output to IGES stream file. ///MGBSumCurve is approximated as MGSBRep and output as PD128. ///int out_to_IGES(MGIgesOfstream& igesfile)const; ///Debug Function /// Output function. std::ostream& out(std::ostream& ostrm) const; /// Compute parameter curve. ///Returned is newed area pointer, and must be freed by delete. MGCurve* parameter_curve( int is_u ///sdim();}; ///Shrink this surface to the part limitted by the parameter range of uvbx. ///New parameter range uvbx2 is so determined that uvbx2 is the smallest ///box tha includes uvbx, and all of the u or v values of uvbx2 is one of ///the values of u or v knots of the surface knotvector. ///uvbx(0) is the parameter (us,ue) and uvbx(1) is (vs,ve). ///That is u range is from us to ue , and so on. void shrink_to_knot( const MGBox& uvbx,///