/********************************************************************/ /* Copyright (c) 2017 System fugen G.K. and Yuzi Mizuno */ /* All rights reserved. */ /********************************************************************/ #ifndef _MGSBRepVecTP_HH_ #define _MGSBRepVecTP_HH_ #include #include "mg/Pvector.h" #include "mg/LBRep.h" #include "mg/SBRepTP.h" // MGSBRepVecTP.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 a surface perimeter. ///MGSBRepVecTP has a vector of 4 newed object pointer ofMGLBRep representing the normal vetor ///B-rep along the 4 perimeter of surface. And regarding to their ownership ///MGSBRepVecTP acts just like std::auto_ptr. That is, all of the ownership will be ///transfered to the copied, or assigned object. ///See the copy oroperator=() below. class MG_DLL_DECLR MGSBRepVecTP{ public: ///String stream Function. MG_DLL_DECLR friend std::ostream& operator<< (std::ostream& ostrm, const MGSBRepVecTP& vectp); //////////// Constructor //////////// ///Default Constructor, will be set as no TPs' are specified. MGSBRepVecTP(){;}; ///Copy Constructor. ///all of the ownership of m_TP of tp2 will be ///transfered to this object. MGSBRepVecTP(const MGSBRepVecTP& vectp2); ///Conversion constructor from ordinary MGSBRepTP. MGSBRepVecTP(const MGSBRepTP& tp2); //////////// Destructor //////////// //~MGSBRepVecTP(); //////////// Operator overload. //////////// ///Assignment. ///all of the ownership of m_TP of tp2 will be ///transfered to this object. MGSBRepVecTP& operator=(const MGSBRepVecTP& vectp2); //////////// Member Function //////////// ///change the parameter range to (t0,t1). void change_range( bool along_u, ///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 ///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). ///vectp[i] must be newed objects, and all of the ownership will be transferer to ///this instance. void set_TP( int i, ///& vectp,///& vectp,///& vecTP(int i) const{assert(i<4);return m_TP[i];} MGPvector& vecTP(int i) {assert(i<4);return m_TP[i];} MGPvector* vecTP(){return m_TP;}; private: //////////// Member Data //////////// MGPvector m_TP[4]; ///