/********************************************************************/ /* Copyright (c) 2017 System fugen G.K. and Yuzi Mizuno */ /* All rights reserved. */ /********************************************************************/ #include "MGCLStdAfx.h" #include "mg/Box.h" #include "topo/LCisect_vector.h" #include "topo/Loop.h" #if defined(_DEBUG) #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif // MGLCisect_vector defines linked list of MGLCisect. // Used to represent Intersection points of Loop and curve. // Constructor MGLCisect_vector::MGLCisect_vector() :m_loop(0){;} MGLCisect_vector::MGLCisect_vector (const MGLoop& loop):m_loop(&loop) { double err=loop.error(); m_error_square=err*err*9.; } //Copy Constructor. // Destructor. // Operator overload. //Assignment. // Member Function. void MGLCisect_vector::append( const MGLCisect& lcis) { if(!m_loop) m_loop=lcis.loop(); // Adds the MGLCisect to the end of the list. LCiterator itr=m_lcisects.begin(), itrend=m_lcisects.end(); for(; itr!=itrend; itr++){ if((*itr).distance_square(lcis)<=m_error_square) return; } m_lcisects.push_back(lcis); } void MGLCisect_vector::append( const MGLEPoint& lp, //loop's parameter with edge id. double t, //Curve's parameter value. const MGPosition& uv) //Face's parameter value(u,v) data. { append(MGLCisect(lp,t,uv)); } void MGLCisect_vector::append(const MGLCisect_vector& list){ // Adds the MGLCisect_vector to the end of the list. const_LCiterator i; for(i=list.m_lcisects.begin(); i!=list.m_lcisects.end(); i++) append(*i); } //Debug Function std::ostream& operator<< (std::ostream& out, const MGLCisect_vector& list){ out<<"MGLCisect_vector::m_loop="<<(list.m_loop) <<" ,m_error_square="<