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

Remove unused stuff

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18889 383ad7c9-94d9-4d36-a494-682f7c89f535
parent e28e4796
//=============================================================================
//
// CLASS TriangleBSPTreeT - IMPLEMENTATION
//
//=============================================================================
#define ACG_TRIANGLEBSPTREET_C
//== INCLUDES =================================================================
#include "TriangleBSPTreeT.hh"
//== NAMESPACES ===============================================================
namespace ACG
{
//== IMPLEMENTATION ==========================================================
template< class MeshT >
TriangleBSPTreeT<MeshT>::
TriangleBSPTreeT( const MeshT &_mesh, unsigned int _max_handles, unsigned int _max_depth ) : mesh_( _mesh )
{
// create Triangle BSP
triangle_bsp_ = new OpenMeshTriangleBSPT<MeshT>( mesh_ );
// build Triangle BSP
triangle_bsp_->reserve( mesh_.n_faces() );
typename MeshT::ConstFaceIter f_it = mesh_.faces_begin();
typename MeshT::ConstFaceIter f_end = mesh_.faces_end();
for ( ; f_it!=f_end; ++f_it )
triangle_bsp_->push_back( f_it.handle() );
triangle_bsp_->build( _max_handles, _max_depth );
}
//-----------------------------------------------------------------------------
template< class MeshT >
typename MeshT::Point
TriangleBSPTreeT<MeshT>::
closest_point( const typename MeshT::Point &_p, typename MeshT::FaceHandle &_fh )
{
typename MeshT::FaceHandle fh = triangle_bsp_->nearest( _p ).handle;
typename MeshT::CFVIter fv_it = mesh_.cfv_iter( fh );
const typename MeshT::Point& pt0 = mesh_.point( fv_it );
const typename MeshT::Point& pt1 = mesh_.point( ++fv_it );
const typename MeshT::Point& pt2 = mesh_.point( ++fv_it );
// project
typename MeshT::Point p_best;
Geometry::distPointTriangleSquared( _p, pt0, pt1, pt2, p_best );
// return facehandle
_fh = fh;
return p_best;
}
//-----------------------------------------------------------------------------
template< class MeshT >
typename MeshT::Point
TriangleBSPTreeT<MeshT>::
closest_point( const typename MeshT::Point &_p )
{
typename MeshT::FaceHandle fh;
return closest_point( _p, fh );
}
//-----------------------------------------------------------------------------
template< class MeshT >
typename MeshT::FaceHandle
TriangleBSPTreeT<MeshT>::
closest_face( const typename MeshT::Point &_p )
{
return triangle_bsp_->nearest( _p ).handle;
}
//=============================================================================
} // namespace ACG
//=============================================================================
//=============================================================================
//
// CLASS TriangleBSPTreeT
//
// Author: Dominik Sibbing <sibbing@cs.rwth-aachen.de>
//
// Version: $Revision: 1$
// Date: $Date: 2008$
//
//=============================================================================
#ifndef ACG_TRIANGLEBSPTREET_HH
#define ACG_TRIANGLEBSPTREET_HH
//== INCLUDES =================================================================
#include "../TriangleTreeBaseT.hh"
#include "TriangleBSPT.hh"
#include <ACG/Geometry/Algorithms.hh>
//== FORWARDDECLARATIONS ======================================================
//== NAMESPACES ===============================================================
namespace ACG
{
//== CLASS DEFINITION =========================================================
/** \class TriangleBSPTreeT TriangleBSPTreeT.hh <ACG/.../TriangleBSPTreeT.hh>
Brief Description.
A more elaborate description follows.
*/
template <class MeshT>
class TriangleBSPTreeT : public TriangleTreeBaseT<MeshT>
{
public:
/// Constructor
TriangleBSPTreeT( const MeshT &_mesh, unsigned int _max_handles = 10, unsigned int _max_depth = 100 );
/// Destructor
virtual ~TriangleBSPTreeT() {delete triangle_bsp_;}
/// closest point and face handle
typename MeshT::Point closest_point( const typename MeshT::Point &_p, typename MeshT::FaceHandle &_fh );
/// closest point
typename MeshT::Point closest_point( const typename MeshT::Point &_p );
/// closest face
typename MeshT::FaceHandle closest_face( const typename MeshT::Point &_p );
private:
// triangle bsp
OpenMeshTriangleBSPT<MeshT> *triangle_bsp_;
const MeshT &mesh_;
};
//=============================================================================
} // namespace ACG
//=============================================================================
#if defined(INCLUDE_TEMPLATES) && !defined(ACG_TRIANGLEBSPTREET_C)
#define ACG_TRIANGLEBSPTREET_TEMPLATES
#include "TriangleBSPTreeT.cc"
#endif
//=============================================================================
#endif // ACG_TRIANGLEBSPTREET_HH defined
//=============================================================================
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