/********************************************************************/ /* Copyright (c) 2017 System fugen G.K. and Yuzi Mizuno */ /* All rights reserved. */ /********************************************************************/ #ifndef _MGHHisect_HH_ #define _MGHHisect_HH_ /** @file */ /** @addtogroup IsectContainer * @{ */ #include #include "mg/CompositeCurve.h" #include "mg/FPline.h" class MGSSisect; class MGFSurface; class MGHHisect_vector; ///MGHHisect is to represent one continuous intersection line of shells. ///Intersection lines a shell with a shell, a face, or a surface. ///(MGCompositeCurve* iline, deque uvl1, deque uvl2) ///where iline is a world coordinate rep of the line, uvl1 is a deque of ///1st shell's face parameter rep, uvl2 is a deque of the 2nd shell's or ///face's parameter rep of the intersection line. ///uvl1[i] corresponds to uvl2[i] one by one for all i. ///The parameter ranges of all the uvl1[i] are continuous and the total of them is ///equal to the parameter range of iline. For uvl2, the same. ///Let uvl1[i]'s start parameter be t1, and end parameter t2, then ///uvl2[i]'s parameter range is also from t1 to t2. ///Let sf1 be MGSurfCurve(f1's surface, uvl1[i]), then sf1 is the same curve as ///the iline's part of the parameter range t1 to t2. And sf1 is also equal to ///MGSurfCurve(f2's surface, uvl2[i]). ///MGHHisect uses MGFPline to represent the intersection lines. ///The behavior of MGHHisect(and MGFPline) is like an auto_ptr. Copy or assignment ///of MGHHisect means transfer of the ownership of all the included curves ///to copied or assigned MGHHisect and original MGHHisect does not have the ///ownership of the curves any more. Users should be aware of it. ///MGHHisect is also used to represent a pojection curve. In this case the size of ///uvline2 is zero. ///**** Projection line rep and intersection line rep cannot be mixed. **** class MG_DLL_DECLR MGHHisect{ public: typedef std::deque container_type; typedef container_type::iterator iterator; typedef container_type::const_iterator const_iterator; ///String stream Function MG_DLL_DECLR friend std::ostream& operator<< (std::ostream& ostrm, const MGHHisect& hhi); /////////Constructor///////// MGHHisect():m_iline(0){;}; ///void constructor. ///Copy constructor. MGHHisect(const MGHHisect& hhi); ///Construct from MGSSisect. MGHHisect( const MGFSurface* face1,/// (const MGHHisect& hhi2)const{return hhi2<(*this);}; bool operator<= (const MGHHisect& hhi2)const{return !(hhi2<(*this));}; bool operator>= (const MGHHisect& hhi2)const{return !((*this)param_e();}; double param_s()const{return m_iline->param_s();}; ///Reverse the direction of this intersection line. void reverse_direction(); ///return number of uvlines. int num_of_uvline() const{return int(m_uvlines1.size());}; ///Release the pointer of the last curve. ///Returned will be the released MGCurve pointer. void release_back( MGCurve*& ilineLast, MGFPline uvline1Last, MGFPline uvline2Last ); ///Release the pointer of the 1st curve. ///Returned will be the released MGCurve pointer. void release_front( MGCurve*& iline1st, MGFPline uvline11st, MGFPline uvline21st ); ///Release the pointer of the iline curve. ///Returned will be the released MGCurve pointer. MGCompositeCurve* release_line(){MGCompositeCurve* a=m_iline; m_iline=0; return a;}; ///Return uvline1. const std::deque& uvlines1() const{return m_uvlines1;}; ///Return uvline2. const std::deque& uvlines2() const{return m_uvlines2;}; ///Return i-th uvline. const MGFPline& uvline1(int i)const; const MGFPline& uvline2(int i)const; ///exchange12 1st and 2nd lines. ///This can be used only for intersection line rep. void exchange12(); private: mutable MGCompositeCurve* m_iline; ///