/********************************************************************/ /* Copyright (c) 2017 System fugen G.K. and Yuzi Mizuno */ /* All rights reserved. */ /********************************************************************/ #ifndef _MGSBRepTP_HH_ #define _MGSBRepTP_HH_ #include #include #include "mg/LBRep.h" // MGSBRepTP.h // class MGSurface; class MGLBRep; class MGOfstream; class MGIfstream; /** @file */ /** @addtogroup GEORelated * @{ */ ///Defines Tangent Plane Line B-Representation Class. ///Tangent plane is a line b-representation of (unit)normal vector of ///tangent plane along surface perimeter. class MG_DLL_DECLR MGSBRepTP{ public: ///String stream Function. MG_DLL_DECLR friend std::ostream& operator<< (std::ostream&, const MGSBRepTP& ); //////////// Constructor //////////// ///Default Constructor, will be set as no TPs' are specified. MGSBRepTP(); ///Copy Constructor. MGSBRepTP(const MGSBRepTP&); ///Compute TP of four boundaries of a Surface B-Rep. MGSBRepTP(const MGSurface& srf); //////////// Destructor //////////// ~MGSBRepTP(); //////////// Operator overload. //////////// ///Assignment. MGSBRepTP& operator=(const MGSBRepTP&); //////////// Member Function //////////// /// Compute the maximum (absolute) cos value of between vector deris[i](t) /// and vector this->TP(i)(t) for i=0,1,2,3, where t is a common /// parameter of the data point obtained from deris[i]'s knot vector. ///Function's return value is the max out of cosmax[.]. double get_perimeters_max_cos( const MGPvector& deris, ///< the size must be 4. double taumax[4], ///< parameter on which the maximum value attains will be stored. double cosmax[4] ///< the maximum value will be stored. )const; /// Compute the maximum (absolute) sin value of between vector srf.normal(uv(t)) /// and vector this->TP(i)(t) for i=0,1,2,3, where perim[i] is /// the same as srf.perimeter_curve(i), and t is a common parameter /// of deris[i] and TP(i). ///Function's return value is the max out of sinmax[.]. double get_perimeters_max_sin( const MGSurface& srf, ///< surface which must corresponds to this object. double taumax[4],///< parameters on which the maximum value attains will be stored. double sinmax[4],///< the maximum value will be stored. bool* eval=0 ///& perimeters///<境界線リスト(vmin,umax,vmax,uminの順,辺番号0,1,2,3の順) )const; ///Return if i-th perimeter's TP specified(true) or not. ///i=0, 2 are v=min and max u-parameter line. ///i=1, 3 are u=max and min v-parameter line. bool specified(int i) const{assert(i<4); return m_TP[i]!=0;}; ///Set i-th perimeter's TP as a null, as an unspecified one. void set_TP_null(int i); ///Set i-th perimeter's TP(copy version). void set_TP(int i, const MGLBRep& tp); ///Set i-th perimeter's TP(unique_ptr version). void set_TP(int i, std::unique_ptr& tp); ///Return i-th perimeter's TP. const MGLBRep& TP(int i) const{assert(i<4);return *(m_TP[i]);} MGLBRep& TP(int i) {assert(i<4);return *(m_TP[i]);} MGLBRep** TP(){return m_TP;}; private: //////////// Member Data //////////// MGLBRep* m_TP[4]; ///