#include "MGCLStdAfx.h" #include "mg/Position.h" #include "Tl2/TL2LPline.h" #include "Tl2/TL2Triangles.h" #include "Tl2/TL2Fans.h" #if defined(_DEBUG) #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif //Constructor. mgTL2Triangles::mgTL2Triangles( MGCL::TL_DATA_KIND dkind, const MGSurface* surf ):m_kind(dkind),m_surface(surf),m_triangles(){ } ///Copy constructor. mgTL2Triangles::mgTL2Triangles( const mgTL2Triangles& tris ):m_kind(tris.m_kind),m_surface(tris.m_surface){ mgTL2Triangles& tris2=const_cast(tris); m_triangles.push_back(tris2.m_triangles); } //Return the i-th mgTL2Triangle. const mgTL2Triangle& mgTL2Triangles::operator[](int i)const{ return *(m_triangles[i]); } mgTL2Triangle& mgTL2Triangles::operator[](int i){ return *(m_triangles[i]); } static const std::string kind_string[3]={"(u,v)", "(x,y,z)", "(x,y,z) with normal"}; std::ostream& operator<< (std::ostream& out, const mgTL2Triangles& tris){ out<<"TLTriangles="<<(&tris)<<", surface="<<"tris.m_surface"<<",num of triangles=" <