mirror of https://github.com/CGAL/cgal
Fix trisegment print
This commit is contained in:
parent
cc26b71886
commit
f635c61475
|
|
@ -189,49 +189,44 @@ public:
|
||||||
return c == TRISEGMENT_COLLINEARITY_01 ? LEFT : c == TRISEGMENT_COLLINEARITY_12 ? RIGHT : THIRD ;
|
return c == TRISEGMENT_COLLINEARITY_01 ? LEFT : c == TRISEGMENT_COLLINEARITY_12 ? RIGHT : THIRD ;
|
||||||
}
|
}
|
||||||
|
|
||||||
friend std::ostream& operator << ( std::ostream& os, Self const& aTrisegment )
|
static void print ( std::ostream& os, Self const& aTri, int aDepth )
|
||||||
{
|
{
|
||||||
return os << "["
|
const std::string lPadding = std::string(2 * aDepth, ' ');
|
||||||
<< "\n\tE" << aTrisegment.e0().mID << " E" << aTrisegment.e1().mID << " E" << aTrisegment.e2().mID
|
|
||||||
<< "\n\t" << s2str(aTrisegment.e0()) << " w = " << n2str(aTrisegment.w0()) << ";"
|
|
||||||
<< "\n\t" << s2str(aTrisegment.e1()) << " w = " << n2str(aTrisegment.w1()) << ";"
|
|
||||||
<< "\n\t" << s2str(aTrisegment.e2()) << " w = " << n2str(aTrisegment.w2()) << ";"
|
|
||||||
<< "\n\tCollinearity: " << trisegment_collinearity_to_string(aTrisegment.collinearity())
|
|
||||||
<< "\n]";
|
|
||||||
}
|
|
||||||
|
|
||||||
friend std::ostream& operator << ( std::ostream& os, Self_ptr const& aPtr )
|
os << lPadding << "[ ID: " << aTri.id() << "\n"
|
||||||
{
|
<< lPadding << "\tE" << aTri.e0().mID << " E" << aTri.e1().mID << " E" << aTri.e2().mID << "\n"
|
||||||
recursive_print(os,aPtr,0);
|
<< lPadding << "\t" << s2str(aTri.e0()) << " w = " << n2str(aTri.w0()) << ";" << "\n"
|
||||||
return os ;
|
<< lPadding << "\t" << s2str(aTri.e1()) << " w = " << n2str(aTri.w1()) << ";" << "\n"
|
||||||
|
<< lPadding << "\t" << s2str(aTri.e2()) << " w = " << n2str(aTri.w2()) << ";" << "\n"
|
||||||
|
<< lPadding << "\tCollinearity: " << trisegment_collinearity_to_string(aTri.collinearity()) << "\n"
|
||||||
|
<< lPadding << "]\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
static void recursive_print ( std::ostream& os, Self_ptr const& aTriPtr, int aDepth )
|
static void recursive_print ( std::ostream& os, Self_ptr const& aTriPtr, int aDepth )
|
||||||
{
|
{
|
||||||
os << "\n" ;
|
const std::string lPadding = std::string(2 * aDepth, ' ');
|
||||||
|
|
||||||
for ( int i = 0 ; i < aDepth ; ++ i )
|
os << "\n" ;
|
||||||
os << " " ;
|
|
||||||
|
|
||||||
if ( aTriPtr )
|
if ( aTriPtr )
|
||||||
{
|
{
|
||||||
os << *aTriPtr ;
|
print(os, *aTriPtr, aDepth);
|
||||||
|
|
||||||
if ( aTriPtr->child_l() )
|
if ( aTriPtr->child_l() )
|
||||||
{
|
{
|
||||||
os << " \nleft child:" ;
|
os << lPadding << "left child:" ;
|
||||||
recursive_print(os,aTriPtr->child_l(),aDepth+1);
|
recursive_print(os,aTriPtr->child_l(),aDepth+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( aTriPtr->child_r() )
|
if ( aTriPtr->child_r() )
|
||||||
{
|
{
|
||||||
os << " \nright child:" ;
|
os << lPadding << "right child:" ;
|
||||||
recursive_print(os,aTriPtr->child_r(),aDepth+1);
|
recursive_print(os,aTriPtr->child_r(),aDepth+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( aTriPtr->child_t() )
|
if ( aTriPtr->child_t() )
|
||||||
{
|
{
|
||||||
os << " \nthird child:" ;
|
os << lPadding << "third child:" ;
|
||||||
recursive_print(os,aTriPtr->child_t(),aDepth+1);
|
recursive_print(os,aTriPtr->child_t(),aDepth+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -241,6 +236,18 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
friend std::ostream& operator << ( std::ostream& os, Self const& aTrisegment )
|
||||||
|
{
|
||||||
|
print(os, aTrisegment, 0);
|
||||||
|
return os ;
|
||||||
|
}
|
||||||
|
|
||||||
|
friend std::ostream& operator << ( std::ostream& os, Self_ptr const& aPtr )
|
||||||
|
{
|
||||||
|
recursive_print(os,aPtr,0);
|
||||||
|
return os ;
|
||||||
|
}
|
||||||
|
|
||||||
private :
|
private :
|
||||||
std::size_t mID;
|
std::size_t mID;
|
||||||
Segment mE[3];
|
Segment mE[3];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue