Commit 417b16fb authored by Jan Möbius's avatar Jan Möbius
Browse files

Removed the visualize function from the tree to avoid getting all rendering...

Removed the visualize function from the tree to avoid getting all rendering stuff integrated on windows when building the unit tests

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15165 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 61647c4e
......@@ -56,7 +56,6 @@
#include <ACG/Geometry/Types/PlaneT.hh>
#include <ACG/Geometry/Algorithms.hh>
#include <ObjectTypes/PolyMesh/PolyMeshTypes.hh>
#include <ostream>
//== CLASS DEFINITION =========================================================
......@@ -106,77 +105,77 @@ struct TreeNode
Plane plane_;
Point bb_min, bb_max;
/// This visualizes the bounding boxes
void visualizeTree(PolyMesh *_object, int _max_depth)
{
if (_max_depth > 0 && (left_child_ || right_child_) )
{
if (left_child_)
left_child_->visualizeTree(_object, _max_depth-1);
if (right_child_)
right_child_->visualizeTree(_object, _max_depth-1);
}
else
{
Point size_ = bb_max - bb_min;
std::vector<VertexHandle> vhandle(8);
vhandle[0] = _object->add_vertex(bb_min+Point(0.0,0.0,size_[2]));
vhandle[1] = _object->add_vertex(bb_min+Point(size_[0],0.0,size_[2]));
vhandle[2] = _object->add_vertex(bb_min+Point(size_[0],size_[1],size_[2]));
vhandle[3] = _object->add_vertex(bb_min+Point(0.0,size_[1],size_[2]));
vhandle[4] = _object->add_vertex(bb_min+Point(0.0,0.0,0.0));
vhandle[5] = _object->add_vertex(bb_min+Point(size_[0],0.0,0.0));
vhandle[6] = _object->add_vertex(bb_min+Point(size_[0],size_[1],0.0));
vhandle[7] = _object->add_vertex(bb_min+Point(0.0,size_[1],0.0));
// generate (quadrilateral) faces
std::vector<VertexHandle> face_vhandles;
face_vhandles.clear();
face_vhandles.push_back(vhandle[0]);
face_vhandles.push_back(vhandle[1]);
face_vhandles.push_back(vhandle[2]);
face_vhandles.push_back(vhandle[3]);
_object->add_face(face_vhandles);
face_vhandles.clear();
face_vhandles.push_back(vhandle[7]);
face_vhandles.push_back(vhandle[6]);
face_vhandles.push_back(vhandle[5]);
face_vhandles.push_back(vhandle[4]);
_object->add_face(face_vhandles);
face_vhandles.clear();
face_vhandles.push_back(vhandle[1]);
face_vhandles.push_back(vhandle[0]);
face_vhandles.push_back(vhandle[4]);
face_vhandles.push_back(vhandle[5]);
_object->add_face(face_vhandles);
face_vhandles.clear();
face_vhandles.push_back(vhandle[2]);
face_vhandles.push_back(vhandle[1]);
face_vhandles.push_back(vhandle[5]);
face_vhandles.push_back(vhandle[6]);
_object->add_face(face_vhandles);
face_vhandles.clear();
face_vhandles.push_back(vhandle[3]);
face_vhandles.push_back(vhandle[2]);
face_vhandles.push_back(vhandle[6]);
face_vhandles.push_back(vhandle[7]);
_object->add_face(face_vhandles);
face_vhandles.clear();
face_vhandles.push_back(vhandle[0]);
face_vhandles.push_back(vhandle[3]);
face_vhandles.push_back(vhandle[7]);
face_vhandles.push_back(vhandle[4]);
_object->add_face(face_vhandles);
}
}
// /// This visualizes the bounding boxes
// void visualizeTree(PolyMesh *_object, int _max_depth)
// {
// if (_max_depth > 0 && (left_child_ || right_child_) )
// {
// if (left_child_)
// left_child_->visualizeTree(_object, _max_depth-1);
// if (right_child_)
// right_child_->visualizeTree(_object, _max_depth-1);
// }
// else
// {
// Point size_ = bb_max - bb_min;
//
// std::vector<VertexHandle> vhandle(8);
// vhandle[0] = _object->add_vertex(bb_min+Point(0.0,0.0,size_[2]));
// vhandle[1] = _object->add_vertex(bb_min+Point(size_[0],0.0,size_[2]));
// vhandle[2] = _object->add_vertex(bb_min+Point(size_[0],size_[1],size_[2]));
// vhandle[3] = _object->add_vertex(bb_min+Point(0.0,size_[1],size_[2]));
// vhandle[4] = _object->add_vertex(bb_min+Point(0.0,0.0,0.0));
// vhandle[5] = _object->add_vertex(bb_min+Point(size_[0],0.0,0.0));
// vhandle[6] = _object->add_vertex(bb_min+Point(size_[0],size_[1],0.0));
// vhandle[7] = _object->add_vertex(bb_min+Point(0.0,size_[1],0.0));
//
//
// // generate (quadrilateral) faces
// std::vector<VertexHandle> face_vhandles;
//
// face_vhandles.clear();
// face_vhandles.push_back(vhandle[0]);
// face_vhandles.push_back(vhandle[1]);
// face_vhandles.push_back(vhandle[2]);
// face_vhandles.push_back(vhandle[3]);
// _object->add_face(face_vhandles);
//
// face_vhandles.clear();
// face_vhandles.push_back(vhandle[7]);
// face_vhandles.push_back(vhandle[6]);
// face_vhandles.push_back(vhandle[5]);
// face_vhandles.push_back(vhandle[4]);
// _object->add_face(face_vhandles);
//
// face_vhandles.clear();
// face_vhandles.push_back(vhandle[1]);
// face_vhandles.push_back(vhandle[0]);
// face_vhandles.push_back(vhandle[4]);
// face_vhandles.push_back(vhandle[5]);
// _object->add_face(face_vhandles);
//
// face_vhandles.clear();
// face_vhandles.push_back(vhandle[2]);
// face_vhandles.push_back(vhandle[1]);
// face_vhandles.push_back(vhandle[5]);
// face_vhandles.push_back(vhandle[6]);
// _object->add_face(face_vhandles);
//
// face_vhandles.clear();
// face_vhandles.push_back(vhandle[3]);
// face_vhandles.push_back(vhandle[2]);
// face_vhandles.push_back(vhandle[6]);
// face_vhandles.push_back(vhandle[7]);
// _object->add_face(face_vhandles);
//
// face_vhandles.clear();
// face_vhandles.push_back(vhandle[0]);
// face_vhandles.push_back(vhandle[3]);
// face_vhandles.push_back(vhandle[7]);
// face_vhandles.push_back(vhandle[4]);
// _object->add_face(face_vhandles);
// }
// }
private:
/*
......
......@@ -162,18 +162,4 @@ _build(Node* _node,
_build(_node->right_child_, _max_handles, _depth-1);
}
//=============================================================================
template <class BSPTraits>
void
TriangleBSPCoreT<BSPTraits>::
visualizeTree(PolyMesh *_object, int _max_depth)
{
root_->visualizeTree(_object, _max_depth-1);
_object->update_normals();
}
//=============================================================================
......@@ -116,12 +116,12 @@ public: //---------------------------------------------------------------------
*/
void build(unsigned int _max_handles, unsigned int _max_depth);
/** \brief Create a PolyMesh object that visualizes the bounding boxes of the BSP tree
*
* @param _object The output mesh which the tree will be written into
* @param _max_depth The maximal depth that will be visualized
*/
void visualizeTree(PolyMesh *_object, int _max_depth);
// /** \brief Create a PolyMesh object that visualizes the bounding boxes of the BSP tree
// *
// * @param _object The output mesh which the tree will be written into
// * @param _max_depth The maximal depth that will be visualized
// */
//void visualizeTree(PolyMesh *_object, int _max_depth);
private:
/*
......
Markdown is supported
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