2004-10-04 17:32:16 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* VCGLib o o *
|
|
|
|
* Visual and Computer Graphics Library o o *
|
|
|
|
* _ O _ *
|
|
|
|
* Copyright(C) 2004 \/)\/ *
|
|
|
|
* Visual Computing Lab /\/| *
|
|
|
|
* ISTI - Italian National Research Council | *
|
|
|
|
* \ *
|
|
|
|
* All rights reserved. *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) *
|
|
|
|
* for more details. *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
|
|
|
/****************************************************************************
|
|
|
|
History
|
|
|
|
|
|
|
|
$Log: not supported by cvs2svn $
|
2006-01-10 14:31:54 +01:00
|
|
|
Revision 1.18 2005/12/02 00:13:34 cignoni
|
|
|
|
Added and removed typenames for gcc compiling.
|
|
|
|
removed also some template arguments specifcation that gcc disliked...
|
|
|
|
commented out GetInSphereFace and SetMesh that are probably never used and i didnt succeed in compile
|
|
|
|
|
2005-12-02 01:13:34 +01:00
|
|
|
Revision 1.17 2005/10/05 17:02:52 pietroni
|
|
|
|
corrected bugs on GEtKClosestVert and GetInSphereVert
|
|
|
|
|
2005-10-05 19:02:52 +02:00
|
|
|
Revision 1.16 2005/10/03 16:19:07 spinelli
|
|
|
|
fixed some bugs
|
|
|
|
|
2005-10-03 18:19:07 +02:00
|
|
|
Revision 1.15 2005/10/03 13:59:39 pietroni
|
|
|
|
added GetInSphere and GetInBox functions
|
|
|
|
rensmed Functions respectively with Face suffix or Vertex suffix for query on vertex or faces
|
|
|
|
|
2005-10-03 15:59:39 +02:00
|
|
|
Revision 1.14 2005/09/30 13:10:37 pietroni
|
|
|
|
used functor defined in face/distance.h for distance point-face
|
|
|
|
used functor defined in intersection3.h for ray-triangle intersection
|
|
|
|
added GetKClosest and DoRay Functions
|
|
|
|
|
2005-09-30 15:10:37 +02:00
|
|
|
Revision 1.13 2005/09/28 08:30:48 cignoni
|
|
|
|
changed name of include, removed use of an undefined type (scalar instead of Scalar)
|
|
|
|
removed unused code portions (the old closest code)
|
|
|
|
|
2005-09-28 10:30:48 +02:00
|
|
|
Revision 1.12 2005/09/21 09:24:30 pietroni
|
|
|
|
Added RayIterators.
|
|
|
|
Added ClosestIterators on Triangles and Vertices.
|
|
|
|
Added Closest Functions on triangles and Vertices.
|
|
|
|
|
2005-09-21 11:24:30 +02:00
|
|
|
Revision 1.11 2005/09/19 13:36:24 pietroni
|
|
|
|
added ray iterator of faces
|
|
|
|
|
2005-09-19 15:36:24 +02:00
|
|
|
Revision 1.10 2005/09/16 11:53:51 cignoni
|
|
|
|
Small gcc compliling issues
|
|
|
|
|
2005-09-16 13:53:51 +02:00
|
|
|
Revision 1.9 2005/09/15 13:16:10 spinelli
|
|
|
|
fixed bugs
|
|
|
|
|
2005-09-15 15:16:42 +02:00
|
|
|
Revision 1.8 2005/09/15 11:15:00 pietroni
|
|
|
|
minor changes
|
|
|
|
|
2005-09-15 13:15:00 +02:00
|
|
|
Revision 1.7 2005/09/14 12:56:47 pietroni
|
|
|
|
used closest function from grid
|
|
|
|
|
2005-09-14 14:56:47 +02:00
|
|
|
Revision 1.6 2005/08/26 09:12:48 cignoni
|
|
|
|
changed typedef A2UGridLink da 'GridStaticPtr<MESH::FaceContainer,double>::Link' a typedef 'GRID::Link'
|
|
|
|
|
2005-08-26 11:12:48 +02:00
|
|
|
Revision 1.5 2005/02/08 17:49:38 pietroni
|
|
|
|
added if (!l->Elem()->IsD()) test on each element
|
|
|
|
|
2005-02-08 18:49:38 +01:00
|
|
|
Revision 1.4 2005/01/28 12:00:33 cignoni
|
|
|
|
small gcc compiling issues for namespaces
|
|
|
|
|
2005-01-28 13:00:33 +01:00
|
|
|
Revision 1.3 2005/01/24 11:47:23 cignoni
|
|
|
|
Now used also by the official Metro
|
|
|
|
Removed using namespace (NEVER IN HEADERS!)
|
|
|
|
Made the computation of barycentric coords only when necessary
|
|
|
|
Renamed Mindistpoint to Closest
|
|
|
|
|
2005-01-24 12:47:23 +01:00
|
|
|
Revision 1.2 2005/01/21 17:13:09 pietroni
|
|
|
|
included distance.h changed Dist to vcg::face::PointDistance
|
|
|
|
|
2005-01-21 18:13:09 +01:00
|
|
|
Revision 1.1 2004/10/04 15:32:16 ganovelli
|
|
|
|
moved from metro core
|
|
|
|
|
2004-10-04 17:32:16 +02:00
|
|
|
Revision 1.6 2004/05/14 00:34:36 ganovelli
|
|
|
|
header added
|
|
|
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
2005-01-24 12:47:23 +01:00
|
|
|
#ifndef __VCG_TRIMESH_CLOSEST
|
|
|
|
#define __VCG_TRIMESH_CLOSEST
|
2004-10-04 17:32:16 +02:00
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
#include <vcg/space/point3.h>
|
|
|
|
#include <vcg/space/box3.h>
|
|
|
|
#include <vcg/space/point4.h>
|
|
|
|
#include <vcg/math/base.h>
|
2005-01-21 18:13:09 +01:00
|
|
|
#include <vcg/simplex/face/distance.h>
|
2005-10-03 15:59:39 +02:00
|
|
|
#include <vcg/simplex/vertex/distance.h>
|
2005-09-30 15:10:37 +02:00
|
|
|
#include <vcg/space/intersection3.h>
|
2005-09-19 15:36:24 +02:00
|
|
|
#include <vcg/space/index/space_iterators.h>
|
2004-10-04 17:32:16 +02:00
|
|
|
|
2005-01-24 12:47:23 +01:00
|
|
|
namespace vcg {
|
2005-09-30 15:10:37 +02:00
|
|
|
namespace trimesh {
|
|
|
|
|
|
|
|
//**MARKER CLASSES**//
|
|
|
|
template <class MESH_TYPE,class OBJ_TYPE>
|
|
|
|
class Tmark
|
|
|
|
{
|
|
|
|
MESH_TYPE *m;
|
|
|
|
public:
|
|
|
|
Tmark(){}
|
|
|
|
void UnMarkAll(){m->UnMarkAll();}
|
|
|
|
bool IsMarked(OBJ_TYPE* obj){return (m->IsMarked(obj));}
|
|
|
|
void Mark(OBJ_TYPE* obj){m->Mark(obj);}
|
|
|
|
void SetMesh(MESH_TYPE *_m)
|
|
|
|
{m=_m;}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class MESH_TYPE>
|
|
|
|
class FaceTmark:public Tmark<MESH_TYPE,typename MESH_TYPE::FaceType>
|
|
|
|
{};
|
|
|
|
|
|
|
|
template <class MESH_TYPE>
|
|
|
|
class VertTmark:public Tmark<MESH_TYPE,typename MESH_TYPE::VertexType>
|
|
|
|
{};
|
|
|
|
|
|
|
|
//**CLOSEST FUNCTION DEFINITION**//
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
aka MetroCore
|
|
|
|
data una mesh m e una ug sulle sue facce trova il punto di m piu' vicino ad
|
|
|
|
un punto dato.
|
|
|
|
*/
|
|
|
|
|
|
|
|
// input: mesh, punto, griglia (gr), distanza limite (mdist)
|
|
|
|
// output: normale (interpolata) alla faccia e punto piu' vicino su di essa, e coord baricentriche del punto trovato
|
|
|
|
|
|
|
|
// Nota che il parametro template GRID non ci dovrebbe essere, visto che deve essere
|
|
|
|
// UGrid<MESH::FaceContainer >, ma non sono riuscito a definirlo implicitamente
|
|
|
|
|
|
|
|
template <class MESH, class GRID>
|
2005-12-02 01:13:34 +01:00
|
|
|
typename MESH::FaceType * GetClosestFace( MESH & mesh, GRID & gr, const typename GRID::CoordType & _p,
|
|
|
|
const typename GRID::ScalarType & _maxDist, typename GRID::ScalarType & _minDist,
|
2006-01-10 14:31:54 +01:00
|
|
|
typename GRID::CoordType &_closestPt, typename GRID::CoordType & _normf,
|
2005-09-30 15:10:37 +02:00
|
|
|
typename GRID::CoordType & _ip)
|
|
|
|
{
|
2005-12-02 01:13:34 +01:00
|
|
|
typedef typename GRID::ScalarType ScalarType;
|
2005-09-30 15:10:37 +02:00
|
|
|
typedef Point3<ScalarType> Point3x;
|
|
|
|
|
|
|
|
typedef FaceTmark<MESH> MarkerFace;
|
|
|
|
MarkerFace mf;
|
|
|
|
mf.SetMesh(&mesh);
|
2005-12-02 01:13:34 +01:00
|
|
|
vcg::face::PointDistanceFunctor FDistFunct;
|
2005-09-30 15:10:37 +02:00
|
|
|
_minDist=_maxDist;
|
2005-12-02 01:13:34 +01:00
|
|
|
typename MESH::FaceType* bestf= gr.GetClosest(FDistFunct, mf, _p, _maxDist, _minDist, _closestPt);
|
2005-09-30 15:10:37 +02:00
|
|
|
|
|
|
|
if(_maxDist> ScalarType(fabs(_minDist)))
|
2005-10-03 15:59:39 +02:00
|
|
|
{
|
|
|
|
// f=bestf;
|
|
|
|
typename MESH::ScalarType alfa, beta, gamma;
|
|
|
|
//calcolo normale con interpolazione trilineare
|
|
|
|
bestf->InterpolationParameters(_closestPt, alfa, beta, gamma);
|
|
|
|
_normf = (bestf->V(0)->cN())*alfa+
|
|
|
|
(bestf->V(1)->cN())*beta+
|
|
|
|
(bestf->V(2)->cN())*gamma ;
|
|
|
|
_ip=Point3x(alfa,beta,gamma);
|
|
|
|
//normf.Normalize(); inutile si assume le normali ai vertici benfatte
|
|
|
|
|
|
|
|
_minDist = fabs(_minDist);
|
|
|
|
return(bestf);
|
|
|
|
}
|
|
|
|
return (0);
|
2005-09-30 15:10:37 +02:00
|
|
|
}
|
|
|
|
|
2005-10-03 15:59:39 +02:00
|
|
|
template <class MESH, class GRID>
|
|
|
|
typename MESH::FaceType * GetClosestFace( MESH & mesh,GRID & gr,const typename GRID::CoordType & _p,
|
|
|
|
const typename GRID::ScalarType & _maxDist,typename GRID::ScalarType & _minDist,
|
2006-01-10 14:31:54 +01:00
|
|
|
typename GRID::CoordType &_closestPt,typename GRID::CoordType & _normf)
|
2005-09-30 15:10:37 +02:00
|
|
|
{
|
2005-12-02 01:13:34 +01:00
|
|
|
Point3<typename GRID::ScalarType> _ip;
|
2005-10-03 18:19:07 +02:00
|
|
|
typedef FaceTmark<MESH> MarkerFace;
|
|
|
|
MarkerFace mf;
|
|
|
|
mf.SetMesh(&mesh);
|
2005-12-02 01:13:34 +01:00
|
|
|
vcg::face::PointDistanceFunctor FDistFunct;
|
|
|
|
return ( gr.GetClosest(FDistFunct,mf,_p,_maxDist,_minDist,_closestPt) );
|
2005-10-03 15:59:39 +02:00
|
|
|
}
|
2005-09-30 15:10:37 +02:00
|
|
|
|
2005-10-03 15:59:39 +02:00
|
|
|
template <class MESH, class GRID>
|
|
|
|
typename MESH::FaceType * GetClosestFace( MESH & mesh,GRID & gr,const typename GRID::CoordType & _p,
|
|
|
|
const typename GRID::ScalarType & _maxDist,typename GRID::ScalarType & _minDist,
|
2006-01-10 14:31:54 +01:00
|
|
|
typename GRID::CoordType &_closestPt)
|
2005-09-30 15:10:37 +02:00
|
|
|
{
|
2005-12-02 01:13:34 +01:00
|
|
|
typedef typename GRID::ScalarType ScalarType;
|
2005-10-03 15:59:39 +02:00
|
|
|
typedef Point3<ScalarType> Point3x;
|
|
|
|
typedef FaceTmark<MESH> MarkerFace;
|
|
|
|
MarkerFace mf;
|
|
|
|
mf.SetMesh(&mesh);
|
2005-12-02 01:13:34 +01:00
|
|
|
vcg::face::PointDistanceFunctor PDistFunct;
|
2005-10-03 15:59:39 +02:00
|
|
|
_minDist=_maxDist;
|
2005-12-02 01:13:34 +01:00
|
|
|
return (gr.GetClosest(PDistFunct,mf,_p,_maxDist,_minDist,_closestPt));
|
2005-10-03 15:59:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class MESH, class GRID>
|
|
|
|
typename MESH::VertexType * GetClosestVertex( MESH & mesh,GRID & gr,const typename GRID::CoordType & _p,
|
2005-10-03 18:19:07 +02:00
|
|
|
const typename GRID::ScalarType & _maxDist,typename GRID::ScalarType & _minDist )
|
2005-10-03 15:59:39 +02:00
|
|
|
{
|
2005-12-02 01:13:34 +01:00
|
|
|
typedef typename GRID::ScalarType ScalarType;
|
2005-10-03 15:59:39 +02:00
|
|
|
typedef Point3<ScalarType> Point3x;
|
2005-09-30 15:10:37 +02:00
|
|
|
typedef VertTmark<MESH> MarkerVert;
|
2005-10-03 15:59:39 +02:00
|
|
|
MarkerVert mv;
|
|
|
|
mv.SetMesh(&mesh);
|
|
|
|
typedef vcg::vertex::PointDistanceFunctor VDistFunct;
|
|
|
|
_minDist=_maxDist;
|
2005-10-03 18:19:07 +02:00
|
|
|
Point3x _closestPt;
|
2005-12-02 01:13:34 +01:00
|
|
|
return (gr.GetClosest/*<VDistFunct,MarkerVert>*/(VDistFunct(),mv,_p,_maxDist,_minDist,_closestPt));
|
2005-10-03 15:59:39 +02:00
|
|
|
}
|
2005-09-30 15:10:37 +02:00
|
|
|
|
|
|
|
template <class MESH, class GRID, class OBJPTRCONTAINER,class DISTCONTAINER, class POINTCONTAINER>
|
2005-10-03 15:59:39 +02:00
|
|
|
unsigned int GetKClosestFace(MESH & mesh,GRID & gr, const unsigned int _k,
|
2005-09-30 15:10:37 +02:00
|
|
|
const typename GRID::CoordType & _p, const typename GRID::ScalarType & _maxDist,
|
|
|
|
OBJPTRCONTAINER & _objectPtrs,DISTCONTAINER & _distances, POINTCONTAINER & _points)
|
|
|
|
{
|
|
|
|
typedef FaceTmark<MESH> MarkerFace;
|
|
|
|
MarkerFace mf;
|
|
|
|
mf.SetMesh(&mesh);
|
2005-12-02 01:13:34 +01:00
|
|
|
vcg::face::PointDistanceFunctor FDistFunct;
|
|
|
|
return (gr.GetKClosest /*<vcg::face::PointDistanceFunctor, MarkerFace,OBJPTRCONTAINER,DISTCONTAINER,POINTCONTAINER>*/
|
|
|
|
(FDistFunct,mf,_k,_p,_maxDist,_objectPtrs,_distances,_points));
|
2005-09-30 15:10:37 +02:00
|
|
|
}
|
|
|
|
|
2005-10-03 15:59:39 +02:00
|
|
|
template <class MESH, class GRID, class OBJPTRCONTAINER,class DISTCONTAINER, class POINTCONTAINER>
|
|
|
|
unsigned int GetKClosestVertex(MESH & mesh,GRID & gr, const unsigned int _k,
|
|
|
|
const typename GRID::CoordType & _p, const typename GRID::ScalarType & _maxDist,
|
|
|
|
OBJPTRCONTAINER & _objectPtrs,DISTCONTAINER & _distances, POINTCONTAINER & _points)
|
|
|
|
{
|
|
|
|
typedef VertTmark<MESH> MarkerVert;
|
|
|
|
MarkerVert mv;
|
|
|
|
mv.SetMesh(&mesh);
|
|
|
|
typedef vcg::vertex::PointDistanceFunctor VDistFunct;
|
2005-12-02 01:13:34 +01:00
|
|
|
return (gr.GetKClosest/* <VDistFunct,MarkerVert,OBJPTRCONTAINER,DISTCONTAINER,POINTCONTAINER>*/
|
2005-10-03 15:59:39 +02:00
|
|
|
(VDistFunct(),mv,_k,_p,_maxDist,_objectPtrs,_distances,_points));
|
|
|
|
}
|
|
|
|
|
2005-12-02 01:13:34 +01:00
|
|
|
//template <class MESH, class GRID, class OBJPTRCONTAINER, class DISTCONTAINER, class POINTCONTAINER>
|
|
|
|
// unsigned int GetInSphereFace(MESH & mesh,
|
|
|
|
// GRID & gr,
|
|
|
|
// const typename GRID::CoordType & _p,
|
|
|
|
// const typename GRID::ScalarType & _r,
|
|
|
|
// OBJPTRCONTAINER & _objectPtrs,
|
|
|
|
// DISTCONTAINER & _distances,
|
|
|
|
// POINTCONTAINER & _points)
|
|
|
|
//{
|
|
|
|
// typedef FaceTmark<MESH> MarkerFace;
|
|
|
|
// MarkerFace mf;
|
|
|
|
// mf.SetMesh(&mesh);
|
|
|
|
// typedef vcg::face::PointDistanceFunctor F DistFunct;
|
|
|
|
// return (gr.GetInSphere/*<FDistFunct,MarkerFace,OBJPTRCONTAINER,DISTCONTAINER,POINTCONTAINER>*/
|
|
|
|
// (FDistFunct(),mf,_p,_r,_maxDist,_objectPtrs,_distances,_points));
|
|
|
|
//}
|
2005-10-03 15:59:39 +02:00
|
|
|
|
|
|
|
template <class MESH, class GRID, class OBJPTRCONTAINER, class DISTCONTAINER, class POINTCONTAINER>
|
|
|
|
unsigned int GetInSphereVertex(MESH & mesh,
|
|
|
|
GRID & gr,
|
|
|
|
const typename GRID::CoordType & _p,
|
|
|
|
const typename GRID::ScalarType & _r,
|
|
|
|
OBJPTRCONTAINER & _objectPtrs,
|
|
|
|
DISTCONTAINER & _distances,
|
|
|
|
POINTCONTAINER & _points)
|
|
|
|
{
|
|
|
|
typedef VertTmark<MESH> MarkerVert;
|
|
|
|
MarkerVert mv;
|
|
|
|
mv.SetMesh(&mesh);
|
|
|
|
typedef vcg::vertex::PointDistanceFunctor VDistFunct;
|
2005-12-02 01:13:34 +01:00
|
|
|
return (gr.GetInSphere/*<VDistFunct,MarkerVert,OBJPTRCONTAINER,DISTCONTAINER,POINTCONTAINER>*/
|
2005-10-03 15:59:39 +02:00
|
|
|
(VDistFunct(),mv,_p,_r,_objectPtrs,_distances,_points));
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class MESH, class GRID, class OBJPTRCONTAINER>
|
|
|
|
unsigned int GetInBoxFace(MESH & mesh,
|
|
|
|
GRID & gr,
|
|
|
|
const vcg::Box3<typename GRID::ScalarType> _bbox,
|
|
|
|
OBJPTRCONTAINER & _objectPtrs)
|
|
|
|
{
|
|
|
|
typedef FaceTmark<MESH> MarkerFace;
|
|
|
|
MarkerFace mf;
|
|
|
|
mf.SetMesh(&mesh);
|
2005-12-02 01:13:34 +01:00
|
|
|
return(gr.GetInBox/*<MarkerFace,OBJPTRCONTAINER>*/(mf,_bbox,_objectPtrs));
|
2005-10-03 15:59:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class MESH, class GRID, class OBJPTRCONTAINER>
|
|
|
|
unsigned int GetInBoxVertex(MESH & mesh,
|
|
|
|
GRID & gr,
|
|
|
|
const vcg::Box3<typename GRID::ScalarType> _bbox,
|
|
|
|
OBJPTRCONTAINER & _objectPtrs)
|
|
|
|
{
|
|
|
|
typedef VertTmark<MESH> MarkerVert;
|
|
|
|
MarkerVert mv;
|
|
|
|
mv.SetMesh(&mesh);
|
2005-12-02 01:13:34 +01:00
|
|
|
return(gr.GetInBox/*<MarkerVert,OBJPTRCONTAINER>*/(mv,_bbox,_objectPtrs));
|
2005-10-03 15:59:39 +02:00
|
|
|
}
|
|
|
|
|
2005-09-30 15:10:37 +02:00
|
|
|
template <class MESH, class GRID>
|
2005-10-03 15:59:39 +02:00
|
|
|
typename GRID::ObjPtr DoRay(MESH & mesh,GRID & gr, const Ray3<typename GRID::ScalarType> & _ray,
|
|
|
|
const typename GRID::ScalarType & _maxDist, typename GRID::ScalarType & _t)
|
2005-09-30 15:10:37 +02:00
|
|
|
{
|
2005-12-02 01:13:34 +01:00
|
|
|
typedef typename MESH::FaceType FaceType;
|
|
|
|
typedef typename MESH::ScalarType ScalarType;
|
2005-09-30 15:10:37 +02:00
|
|
|
typedef FaceTmark<MESH> MarkerFace;
|
|
|
|
MarkerFace mf;
|
|
|
|
mf.SetMesh(&mesh);
|
|
|
|
typedef vcg::RayTriangleIntersectionFunctor<true> FintFunct;
|
|
|
|
return(gr.DoRay(FintFunct(),mf,_ray,_maxDist,_t));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//**ITERATORS DEFINITION**//
|
|
|
|
|
|
|
|
template <class GRID,class MESH>
|
|
|
|
class ClosestFaceIterator:public vcg::ClosestIterator<GRID,
|
2005-12-02 01:13:34 +01:00
|
|
|
vcg::face::PointDistanceFunctor, FaceTmark<MESH> >
|
2005-09-30 15:10:37 +02:00
|
|
|
{
|
|
|
|
public:
|
2005-12-02 01:13:34 +01:00
|
|
|
typedef GRID GridType;
|
|
|
|
typedef MESH MeshType;
|
|
|
|
typedef FaceTmark<MESH> MarkerFace;
|
|
|
|
typedef vcg::face::PointDistanceFunctor PDistFunct;
|
|
|
|
typedef vcg::ClosestIterator<GRID,PDistFunct, FaceTmark<MESH> > ClosestBaseType;
|
2005-09-30 15:10:37 +02:00
|
|
|
typedef typename MESH::FaceType FaceType;
|
|
|
|
typedef typename MESH::ScalarType ScalarType;
|
|
|
|
|
|
|
|
//ClosestFaceIterator(GridType &_Si):ClosestBaseType(_Si,PDistFunct<FaceType,ScalarType>()){}
|
|
|
|
ClosestFaceIterator(GridType &_Si):ClosestBaseType(_Si,PDistFunct()){}
|
|
|
|
|
2005-12-02 01:13:34 +01:00
|
|
|
// Commented out: it seems unuseful and make gcc complain. p.
|
|
|
|
// void SetMesh(MeshType *m)
|
|
|
|
// {tm.SetMesh(m);}
|
2005-09-30 15:10:37 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
template <class GRID,class MESH>
|
2005-12-02 01:13:34 +01:00
|
|
|
class ClosestVertexIterator:public vcg::ClosestIterator<GRID, vcg::vertex::PointDistanceFunctor, VertTmark<MESH> >
|
2005-09-30 15:10:37 +02:00
|
|
|
{
|
|
|
|
public:
|
2005-12-02 01:13:34 +01:00
|
|
|
typedef GRID GridType;
|
|
|
|
typedef MESH MeshType;
|
|
|
|
typedef VertTmark<MESH> MarkerVert;
|
|
|
|
typedef vcg::vertex::PointDistanceFunctor VDistFunct;
|
|
|
|
typedef vcg::ClosestIterator<GRID, VDistFunct, VertTmark<MESH> > ClosestBaseType;
|
2005-09-30 15:10:37 +02:00
|
|
|
|
|
|
|
ClosestVertexIterator(GridType &_Si):ClosestBaseType(_Si,VDistFunct()){}
|
|
|
|
|
2005-12-02 01:13:34 +01:00
|
|
|
// Commented out: it seems unuseful and make gcc complain. p.
|
2006-01-10 14:31:54 +01:00
|
|
|
/* void SetMesh(MeshType *m)
|
|
|
|
{tm.SetMesh(m);}*/
|
2005-09-30 15:10:37 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
template <class GRID,class MESH>
|
2005-12-02 01:13:34 +01:00
|
|
|
class TriRayIterator:public vcg::RayIterator<GRID,vcg::RayTriangleIntersectionFunctor<true>,FaceTmark<MESH> >
|
2005-09-30 15:10:37 +02:00
|
|
|
{
|
|
|
|
public:
|
2005-12-02 01:13:34 +01:00
|
|
|
typedef GRID GridType;
|
|
|
|
typedef MESH MeshType;
|
|
|
|
typedef FaceTmark<MESH> MarkerFace;
|
|
|
|
typedef vcg::RayTriangleIntersectionFunctor<true> FintFunct;
|
|
|
|
typedef vcg::RayIterator<GRID,FintFunct, FaceTmark<MESH> > RayBaseType;
|
2005-09-30 15:10:37 +02:00
|
|
|
typedef typename MESH::FaceType FaceType;
|
|
|
|
typedef typename MESH::ScalarType ScalarType;
|
|
|
|
|
|
|
|
TriRayIterator(GridType &_Si):RayBaseType(_Si,FintFunct()){}
|
|
|
|
|
2005-12-02 01:13:34 +01:00
|
|
|
// Commented out: it seems unuseful and make gcc complain. p.
|
2006-01-10 14:31:54 +01:00
|
|
|
/* void SetMesh(MeshType *m)
|
|
|
|
{tm.SetMesh(m);}*/
|
2005-09-30 15:10:37 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace trimesh
|
2005-01-24 12:47:23 +01:00
|
|
|
} // end namespace vcg
|
|
|
|
|
2004-10-04 17:32:16 +02:00
|
|
|
#endif
|