Commit 54ba1948 authored by graham's avatar graham
Browse files

ENH: Improved bound box obj output.

parent 3a51a821
...@@ -2282,7 +2282,7 @@ void Foam::indexedOctree<Type>::writeOBJ ...@@ -2282,7 +2282,7 @@ void Foam::indexedOctree<Type>::writeOBJ
{ {
subBb = nodes_[getNode(index)].bb_; subBb = nodes_[getNode(index)].bb_;
} }
else if (isContent(index)) else if (isContent(index) || isEmpty(index))
{ {
subBb = nodes_[nodeI].bb_.subBbox(octant); subBb = nodes_[nodeI].bb_.subBbox(octant);
} }
...@@ -2290,17 +2290,21 @@ void Foam::indexedOctree<Type>::writeOBJ ...@@ -2290,17 +2290,21 @@ void Foam::indexedOctree<Type>::writeOBJ
Pout<< "dumpContentNode : writing node:" << nodeI << " octant:" << octant Pout<< "dumpContentNode : writing node:" << nodeI << " octant:" << octant
<< " to " << str.name() << endl; << " to " << str.name() << endl;
label vertI = 0;
// Dump bounding box // Dump bounding box
pointField bbPoints(subBb.points()); pointField bbPoints(subBb.points());
label pointVertI = vertI; forAll(bbPoints, i)
{
const point& pt = bbPoints[i];
str<< "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
}
forAll(treeBoundBox::edges, i) forAll(treeBoundBox::edges, i)
{ {
const edge& e = treeBoundBox::edges[i]; const edge& e = treeBoundBox::edges[i];
str<< "l " << e[0]+pointVertI+1 << ' ' << e[1]+pointVertI+1 << nl; str<< "l " << e[0] + 1 << ' ' << e[1] + 1 << nl;
} }
} }
...@@ -2852,6 +2856,11 @@ void Foam::indexedOctree<Type>::print ...@@ -2852,6 +2856,11 @@ void Foam::indexedOctree<Type>::print
{ {
const labelList& indices = contents_[getContent(index)]; const labelList& indices = contents_[getContent(index)];
if (debug)
{
writeOBJ(nodeI, octant);
}
os << "octant:" << octant os << "octant:" << octant
<< " content: n:" << indices.size() << " content: n:" << indices.size()
<< " bb:" << subBb; << " bb:" << subBb;
...@@ -2868,6 +2877,11 @@ void Foam::indexedOctree<Type>::print ...@@ -2868,6 +2877,11 @@ void Foam::indexedOctree<Type>::print
} }
else else
{ {
if (debug)
{
writeOBJ(nodeI, octant);
}
os << "octant:" << octant << " empty:" << subBb << endl; os << "octant:" << octant << " empty:" << subBb << endl;
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment