Commit 235c12d8 authored by Pierre Kraemer's avatar Pierre Kraemer

suite feature detection

parent 13003306
......@@ -164,8 +164,8 @@ std::vector<typename PFP::VEC3> featureLinesDetection(typename PFP::MAP& map, co
{
mf.mark(d) ;
Dart v1 = d ;
Dart v2 = myMap.phi1(d) ;
Dart v3 = myMap.phi_1(d) ;
Dart v2 = map.phi1(d) ;
Dart v3 = map.phi_1(d) ;
VEC3 v3v2 = position[v3] - position[v2] ;
VEC3 v1v3 = position[v1] - position[v3] ;
VEC3 v2v1 = position[v2] - position[v1] ;
......@@ -178,6 +178,31 @@ std::vector<typename PFP::VEC3> featureLinesDetection(typename PFP::MAP& map, co
kminGrad[d] = g2 ;
}
}
AttributeHandler<VEC3> Ekmax = map.template addAttribute<VEC3>(VERTEX, "kmaxGradV") ;
AttributeHandler<VEC3> Ekmin = map.template addAttribute<VEC3>(VERTEX, "kminGradV") ;
CellMarker mv(map, VERTEX) ;
for(Dart d = map.begin(); d != map.end(); map.next(d))
{
if(!mv.isMarked(d))
{
mv.mark(d) ;
REAL res = 0 ;
REAL sumArea = 0 ;
Dart it = d ;
do
{
REAL area = Algo::Geometry::triangleArea<PFP>(map, it, position) ;
res += area * (kmaxGrad[it] * Kmax[d]) ;
sumArea += area ;
it = map.alpha1(it) ;
} while(it != d) ;
res /= sumArea ;
}
}
return featureLines ;
}
} // namespace Geometry
......
......@@ -63,7 +63,7 @@ template <typename PFP>
typename PFP::REAL computeAngleBetweenNormalsOnEdge(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position) ;
template <typename PFP>
void computeAnglesBetweenNormalsOnEdges(typename PFP::MAP& map, typename PFP::TVEC3& position, typename PFP::TREAL& angles, const FunctorSelect& select = SelectorTrue(), unsigned int thread = 0) ;
void computeAnglesBetweenNormalsOnEdges(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TREAL& angles, const FunctorSelect& select = SelectorTrue(), unsigned int thread = 0) ;
} // namespace Geometry
......
......@@ -145,7 +145,7 @@ void computeNormalVertices(typename PFP::MAP& map, const typename PFP::TVEC3& po
}
template <typename PFP>
typename PFP::REAL computeAngleBetweenNormalsOnEdge(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position)
typename PFP::REAL computeAngleBetweenNormalsOnEdge(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
{
typedef typename PFP::VEC3 VEC3 ;
......@@ -175,7 +175,7 @@ typename PFP::REAL computeAngleBetweenNormalsOnEdge(typename PFP::MAP& map, Dart
}
template <typename PFP>
void computeAnglesBetweenNormalsOnEdges(typename PFP::MAP& map, typename PFP::TVEC3& position, typename PFP::TREAL& angles, const FunctorSelect& select, unsigned int thread)
void computeAnglesBetweenNormalsOnEdges(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TREAL& angles, const FunctorSelect& select, unsigned int thread)
{
CellMarker me(map, EDGE, thread) ;
for(Dart d = map.begin(); d != map.end(); map.next(d))
......
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