/********************************************************************/ /* Copyright (c) 2017 System fugen G.K. and Yuzi Mizuno */ /* All rights reserved. */ /********************************************************************/ #ifndef _MGPlane_HH_ #define _MGPlane_HH_ #include "mg/drawParam.h" #include "mg/Position.h" #include "mg/Unit_vector.h" #include "mg/Surface.h" #include "mgGL/VBO.h" // MGPlane.h // Header for class MGPlane class MGBPointSeq; class MGCCisect; class MGCSisect; class MGTransf; class MGStraight; class MGSBRep; class MGIfstream; class MGOfstream; class MGFace; /** @file */ /** @addtogroup GEO * @{ */ ///MGPlane is infinite plane in 3D space. ///Using orthonormal two vector m_uderiv and m_vderiv in 3D space, ///plane function f(u,v)= m_root_point + u*m_uderiv + v*m_vderiv, ///where u and v are two parameter of surface representation. /// MGPlaneクラスは3次元空間における平面を表すクラスである。 /// MGPlaneクラスでは以下のようなパラメータ表現を使用します。 /// Point(u,v) = m_root_point + u * m_uderiv + v * m_vderiv class MG_DLL_DECLR MGPlane :public MGSurface{ public: MG_DLL_DECLR friend MGPlane operator+ (const MGVector& v, const MGPlane& pl); MG_DLL_DECLR friend MGPlane operator* (double scale, const MGPlane& pl); ///////////////Constructor コンストラクタ////////////// ///Void constructor 初期化なしで平面を生成する。 MGPlane(void); ///Copy constructor. MGPlane(const MGPlane& pl); /// Construct a plane by changing this space dimension or ordering the coordinates. MGPlane( int dim, ///< New space dimension. const MGPlane& plane,///< Original Plane. int start1=0, ///< Destination order of new Surface. int start2=0 ///< Source order of original Surface. ); /// Construct a plane from the coefficients of the plane equation. /// a*x+b*y+c*z=d. /// Coefficients a,b,c,d are provided by double array g[4]. MGPlane( const double g[4], /// offset_c1( double ofs_value, ///<オフセット量. int& error ///<エラーコード 0:成功 -1:面におれがある ///< -2:曲率半径以上のオフセット不可 -3:面生成コンストラクタエラー. ) const; ///Test if a point is on the plane. If on the plane, return true. /// 指定点が面上にあるか調べる。(面上ならばtrue). bool on(const MGPosition& point) const; bool on( const MGPosition& point, ///& vec_crv_uv, ( /O) uv projection curve. /// MGPvector& vec_crv, ( /O) 3d projection curve. /// const MGVector& vec=mgNULL_VEC (I/ ) projection vector. ///戻り値: /// 投影曲線の数: 投影曲線が求まった /// 0: 投影曲線が求まらなかった /// -1: 内部処理エラー /// -2: 収束処理エラー(収束しなかった) ///追記:引数vecが与えられない(null)とき、面直投影する。 ///Obtain the projected curve of a curve onto the surface. ///The direction of the projection is along the vector vec if the vec is not ///NULL, and normal to the surface if the vec is NULL. ///Output of 'project' is two kind of curves: ///one is general world coordinate curves('vec_crv'), and the other is (u,v) curves of ///the parameter space of the surfaces(vec_crv_uv). ///vec_crv_uv.size() is equal to vec_crv.size(). Let the size be n, then /// (vec_crv_uv[i], vec_crv[i]) is one pair for 0<=i=0: number of curves obtained, <0 : Some error detected. int project( const MGStraight& sl, ///& vec_crv_uv, ///& vec_crv, ///<3d projection curve will be appended. const MGVector& vec= mgNULL_VEC ///& vec_crv, ( /O) 3d projection curve. /// const MGVector& vec=mgNULL_VEC (I/ ) projection vector. ///戻り値: /// 投影曲線の数: 投影曲線が求まった /// 0: 投影曲線が求まらなかった /// -1: 内部処理エラー /// -2: 収束処理エラー(収束しなかった) ///追記:引数vecが与えられない(null)とき、面直投影する。 ///Obtain the projected curve of a curve onto the surface. ///The direction of the projection is along the vector vec if the vec is not ///NULL, and normal to the surface if the vec is NULL. ///Output of 'project' is general world coordinate curves('vec_crv') ///Function's return value is: /// >=0: number of curves obtained, <0 : Some error detected. int project( const MGCurve& crv, ///& vec_crv, ///<3d projection curve will be appended. const MGVector& vec = mgNULL_VEC/// skeleton(int density=1)const; ///Obtain all the parameter curves at knots of u and v knot vector. MGPvector skeleton_at_knots()const; ///split this fsurface at the parameter param. void split( double param,///& surfaces///