Commit 2f7d4461 authored by Sylvain Thery's avatar Sylvain Thery
Browse files

Merge branch 'master' of cgogn:~jund/CGoGN

parents 61f307e8 73378a04
......@@ -17,7 +17,6 @@ include_directories(
${CGoGN_ROOT_DIR}/ThirdParty/OpenCTM
${CGoGN_ROOT_DIR}/ThirdParty/Assimp/include
${CGoGN_ROOT_DIR}/ThirdParty/glm
)
# define libs path
......
......@@ -9,6 +9,15 @@ SET(CMAKE_BUILD_TYPE Debug)
# define includes path
include_directories(
${CGoGN_ROOT_DIR}/include
/usr/include/libxml2/
${CGoGN_ROOT_DIR}/include
${CGoGN_ROOT_DIR}/ThirdParty/Numerical
${CGoGN_ROOT_DIR}/ThirdParty/Numerical/UFconfig
${CGoGN_ROOT_DIR}/ThirdParty/gzstream
${CGoGN_ROOT_DIR}/ThirdParty/Zinri
${CGoGN_ROOT_DIR}/ThirdParty/AntTweakBar/include
${CGoGN_ROOT_DIR}/ThirdParty/OpenCTM
${CGoGN_ROOT_DIR}/ThirdParty/Assimp/include
)
# define libs path
......@@ -26,3 +35,7 @@ target_link_libraries( Geom_orientationD
add_executable( Geom_inclusionD ./Geom_inclusion.cpp)
target_link_libraries( Geom_inclusionD
${COMMON_LIBS} )
add_executable( Algo_Geom_inclusionD ./Algo_Geom_inclusion.cpp)
target_link_libraries( Algo_Geom_inclusionD
containerD topologyD utilsD algoD ${COMMON_LIBS} )
......@@ -39,6 +39,8 @@ int main()
VEC3 tc(0,5,0);
VEC3 pIn1(1,1,0);
VEC3 pIn2(2,0,0);
VEC3 pIn3 = (tb+tc)/2.0f;
VEC3 pIn4 = (tc+ta)/2.0f;
VEC3 pOut(6,0,0);
if(Geom::isPointInTriangle<VEC3>(pIn1,ta,tb,tc)!=Geom::FACE_INCLUSION)
......@@ -51,6 +53,16 @@ int main()
std::cout << "ERROR : isPointInTriangle : edge inclusion" << std::endl;
}
if(Geom::isPointInTriangle<VEC3>(pIn3,ta,tb,tc)!=Geom::EDGE_INCLUSION)
{
std::cout << "ERROR : isPointInTriangle : edge inclusion" << std::endl;
}
if(Geom::isPointInTriangle<VEC3>(pIn4,ta,tb,tc)!=Geom::EDGE_INCLUSION)
{
std::cout << "ERROR : isPointInTriangle : edge inclusion" << std::endl;
}
if(Geom::isPointInTriangle<VEC3>(ta,ta,tb,tc)!=Geom::VERTEX_INCLUSION)
{
std::cout << "ERROR : isPointInTriangle : vertex inclusion" << std::endl;
......
......@@ -43,7 +43,8 @@
#include "Algo/Geometry/laplacian.h"
#include "Algo/Modelisation/subdivision.h"
#include "Algo/Decimation/decimation.h"
#include "Algo/Filters2D/filters2D.h"
#include "Algo/Remeshing/pliant.h"
#include "Algo/Geometry/feature.h"
using namespace CGoGN ;
......@@ -349,7 +350,7 @@ void MyGlutWin::myRedraw()
glPushMatrix() ;
float sc = 50. / gWidthObj ;
float sc = 50.0f / gWidthObj ;
glScalef(sc, sc, sc) ;
glTranslatef(-gPosObj[0], -gPosObj[1], -gPosObj[2]) ;
......@@ -432,61 +433,102 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
{
case 'l':
{
GLint t1 = glutGet(GLUT_ELAPSED_TIME);
Algo::Modelisation::LoopSubdivision<PFP>(myMap, position);
GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "loop: "<< seconds << "sec" << std::endl;
GLint t1 = glutGet(GLUT_ELAPSED_TIME) ;
Algo::Modelisation::LoopSubdivision<PFP>(myMap, position) ;
GLint t2 = glutGet(GLUT_ELAPSED_TIME) ;
GLfloat seconds = (t2 - t1) / 1000.0f ;
std::cout << "loop: "<< seconds << "sec" << std::endl ;
t1 = glutGet(GLUT_ELAPSED_TIME) ;
t1 = glutGet(GLUT_ELAPSED_TIME);
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME);
seconds = (t2 - t1) / 1000.0f;
std::cout << "display update: "<< seconds << "sec" << std::endl;
glutPostRedisplay() ;
t2 = glutGet(GLUT_ELAPSED_TIME) ;
seconds = (t2 - t1) / 1000.0f ;
std::cout << "display update: "<< seconds << "sec" << std::endl ;
glutPostRedisplay() ;
break ;
}
case 'c':
{
GLint t1 = glutGet(GLUT_ELAPSED_TIME);
Algo::Modelisation::CatmullClarkSubdivision<PFP>(myMap, position);
GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "catmull-clark: "<< seconds << "sec" << std::endl;
GLint t1 = glutGet(GLUT_ELAPSED_TIME) ;
Algo::Modelisation::CatmullClarkSubdivision<PFP>(myMap, position) ;
GLint t2 = glutGet(GLUT_ELAPSED_TIME) ;
GLfloat seconds = (t2 - t1) / 1000.0f ;
std::cout << "catmull-clark: "<< seconds << "sec" << std::endl ;
t1 = glutGet(GLUT_ELAPSED_TIME) ;
t1 = glutGet(GLUT_ELAPSED_TIME);
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME);
seconds = (t2 - t1) / 1000.0f;
std::cout << "display update: "<< seconds << "sec" << std::endl;
t2 = glutGet(GLUT_ELAPSED_TIME) ;
seconds = (t2 - t1) / 1000.0f ;
std::cout << "display update: "<< seconds << "sec" << std::endl ;
glutPostRedisplay() ;
break ;
}
case '3':
{
GLint t1 = glutGet(GLUT_ELAPSED_TIME) ;
Algo::Modelisation::Sqrt3Subdivision<PFP>(myMap, position) ;
GLint t2 = glutGet(GLUT_ELAPSED_TIME) ;
GLfloat seconds = (t2 - t1) / 1000.0f ;
std::cout << "sqrt3: "<< seconds << "sec" << std::endl ;
normal = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, "normal") ;
if(!normal.isValid())
normal = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "normal") ;
laplacian = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, "laplacian") ;
if(!laplacian.isValid())
laplacian = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "laplacian") ;
t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME) ;
seconds = (t2 - t1) / 1000.0f ;
std::cout << "display update: "<< seconds << "sec" << std::endl ;
glutPostRedisplay() ;
break ;
}
case 't':
{
GLint t1 = glutGet(GLUT_ELAPSED_TIME);
GLint t1 = glutGet(GLUT_ELAPSED_TIME) ;
Algo::Modelisation::trianguleFaces<PFP>(myMap, position) ;
GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "triangulation: "<< seconds << "sec" << std::endl;
t1 = glutGet(GLUT_ELAPSED_TIME);
GLint t2 = glutGet(GLUT_ELAPSED_TIME) ;
GLfloat seconds = (t2 - t1) / 1000.0f ;
std::cout << "triangulation: "<< seconds << "sec" << std::endl ;
t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME);
seconds = (t2 - t1) / 1000.0f;
std::cout << "display update: "<< seconds << "sec" << std::endl;
t2 = glutGet(GLUT_ELAPSED_TIME) ;
seconds = (t2 - t1) / 1000.0f ;
std::cout << "display update: "<< seconds << "sec" << std::endl ;
glutPostRedisplay() ;
break ;
......@@ -494,19 +536,23 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
case 'q':
{
GLint t1 = glutGet(GLUT_ELAPSED_TIME);
GLint t1 = glutGet(GLUT_ELAPSED_TIME) ;
Algo::Modelisation::quadranguleFaces<PFP>(myMap, position) ;
GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "quadrangulation: "<< seconds << "sec" << std::endl;
t1 = glutGet(GLUT_ELAPSED_TIME);
GLint t2 = glutGet(GLUT_ELAPSED_TIME) ;
GLfloat seconds = (t2 - t1) / 1000.0f ;
std::cout << "quadrangulation: "<< seconds << "sec" << std::endl ;
t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME);
seconds = (t2 - t1) / 1000.0f;
std::cout << "display update: "<< seconds << "sec" << std::endl;
t2 = glutGet(GLUT_ELAPSED_TIME) ;
seconds = (t2 - t1) / 1000.0f ;
std::cout << "display update: "<< seconds << "sec" << std::endl ;
glutPostRedisplay() ;
break ;
......@@ -516,19 +562,23 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
{
unsigned int nbVertices = myMap.getNbOrbits(VERTEX_ORBIT) ;
GLint t1 = glutGet(GLUT_ELAPSED_TIME);
GLint t1 = glutGet(GLUT_ELAPSED_TIME) ;
Algo::Decimation::decimate<PFP>(myMap, Algo::Decimation::S_QEM, Algo::Decimation::A_QEM, position, nbVertices * 0.75) ;
GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "decimation: "<< seconds << "sec" << std::endl;
t1 = glutGet(GLUT_ELAPSED_TIME);
GLint t2 = glutGet(GLUT_ELAPSED_TIME) ;
GLfloat seconds = (t2 - t1) / 1000.0f ;
std::cout << "decimation: "<< seconds << "sec" << std::endl ;
t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME);
seconds = (t2 - t1) / 1000.0f;
std::cout << "display update: "<< seconds << "sec" << std::endl;
t2 = glutGet(GLUT_ELAPSED_TIME) ;
seconds = (t2 - t1) / 1000.0f ;
std::cout << "display update: "<< seconds << "sec" << std::endl ;
glutPostRedisplay() ;
break ;
......@@ -541,15 +591,15 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
positionF = myMap.addAttribute<PFP::VEC3>(FACE_ORBIT, "position") ;
Algo::Geometry::computeCentroidFaces<PFP>(myMap, position, positionF) ;
GLint t1 = glutGet(GLUT_ELAPSED_TIME);
GLint t1 = glutGet(GLUT_ELAPSED_TIME) ;
Algo::Modelisation::computeDual<PFP>(myMap) ;
GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "dual computation: "<< seconds << "sec" << std::endl;
GLint t2 = glutGet(GLUT_ELAPSED_TIME) ;
GLfloat seconds = (t2 - t1) / 1000.0f ;
std::cout << "dual computation: "<< seconds << "sec" << std::endl ;
position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, "position") ;
position = positionF ;
normal = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, "normal") ;
if(!normal.isValid())
......@@ -558,19 +608,46 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
if(!laplacian.isValid())
laplacian = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "laplacian") ;
t1 = glutGet(GLUT_ELAPSED_TIME);
t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME);
seconds = (t2 - t1) / 1000.0f;
std::cout << "display update: "<< seconds << "sec" << std::endl;
t2 = glutGet(GLUT_ELAPSED_TIME) ;
seconds = (t2 - t1) / 1000.0f ;
std::cout << "display update: "<< seconds << "sec" << std::endl ;
glutPostRedisplay() ;
break ;
}
case '3':
case 'r':
{
GLint t1 = glutGet(GLUT_ELAPSED_TIME) ;
Algo::Remeshing::pliantRemeshing<PFP>(myMap, position, normal) ;
GLint t2 = glutGet(GLUT_ELAPSED_TIME) ;
GLfloat seconds = (t2 - t1) / 1000.0f ;
std::cout << "pliant remeshing: "<< seconds << "sec" << std::endl ;
t1 = glutGet(GLUT_ELAPSED_TIME) ;
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
t2 = glutGet(GLUT_ELAPSED_TIME) ;
seconds = (t2 - t1) / 1000.0f ;
std::cout << "display update: "<< seconds << "sec" << std::endl ;
glutPostRedisplay() ;
break ;
}
case '9':
{
CellMarker markVisit(myMap, VERTEX_CELL) ;
......@@ -624,6 +701,7 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
topo_render->updateData<PFP>(myMap, position, 0.9f, 0.9f) ;
glutPostRedisplay() ;
break ;
}
......
......@@ -46,11 +46,11 @@ typename PFP::REAL totalArea(typename PFP::MAP& map, const typename PFP::TVEC3&
template <typename PFP>
void computeAreaFaces(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TREAL& face_area, const FunctorSelect& select = SelectorTrue()) ;
}
} // namespace Geometry
}
} // namespace Algo
}
} // namespace CGoGN
#include "Algo/Geometry/area.hpp"
......
......@@ -40,7 +40,7 @@ namespace Geometry
* vectorOutOfDart return a dart from the position of vertex attribute of d to the position of vertex attribute of phi1(d)
*/
template <typename PFP>
typename PFP::VEC3 vectorOutOfDart(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
inline typename PFP::VEC3 vectorOutOfDart(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
{
typename PFP::VEC3 vec = position[map.phi1(d)] ;
vec -= position[d] ;
......@@ -48,11 +48,17 @@ typename PFP::VEC3 vectorOutOfDart(typename PFP::MAP& map, Dart d, const typenam
}
template <typename PFP>
float angle(typename PFP::MAP& map, Dart d1, Dart d2, const typename PFP::TVEC3& position)
inline typename PFP::REAL edgeLength(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
{
typename PFP::VEC3 v1, v2 ;
vectorOutOfDart<PFP>(map, d1, position, v1) ;
vectorOutOfDart<PFP>(map, d2, position, v2) ;
typename PFP::VEC3 v = vectorOutOfDart<PFP>(map, d, position) ;
return v.norm() ;
}
template <typename PFP>
inline float angle(typename PFP::MAP& map, Dart d1, Dart d2, const typename PFP::TVEC3& position)
{
typename PFP::VEC3 v1 = vectorOutOfDart<PFP>(map, d1, position) ;
typename PFP::VEC3 v2 = vectorOutOfDart<PFP>(map, d2, position) ;
return Geom::angle(v1, v2) ;
}
......
......@@ -119,9 +119,9 @@ EMB vertexNeighborhoodCentroidGen(typename PFP::MAP& map, Dart d, const EMBV& at
Dart it = d ;
do
{
center += attributs[map.phi2(it)];
center += attributs[map.phi1(it)];
++count ;
it = map.phi1(map.phi2(it)) ;
it = map.alpha1(it) ;
} while(it != d) ;
center /= count ;
return center ;
......
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library 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 Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: https://iggservis.u-strasbg.fr/CGoGN/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef __ALGO_GEOMETRY_FEATURE_H__
#define __ALGO_GEOMETRY_FEATURE_H__
namespace CGoGN
{
namespace Algo
{
namespace Geometry
{
template <typename PFP>
void featureEdgeDetection(typename PFP::MAP& map, const typename PFP::TVEC3& position, DartMarker& feature) ;
} // namespace Geometry
} // namespace Algo
} // namespace CGoGN
#include "Algo/Geometry/feature.hpp"
#endif
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library 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 Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: https://iggservis.u-strasbg.fr/CGoGN/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include "Geometry/basic.h"
#include "Algo/Geometry/normal.h"
namespace CGoGN
{
namespace Algo
{
namespace Geometry
{
template <typename PFP>
void featureEdgeDetection(typename PFP::MAP& map, typename PFP::TVEC3& position, DartMarker& feature)
{
typedef typename PFP::VEC3 VEC3 ;
typedef typename PFP::REAL REAL ;
feature.unmarkAll() ;
AttributeHandler<VEC3> fNormal = map.template addAttribute<VEC3>(FACE_ORBIT, "fNormal") ;
Algo::Geometry::computeNormalFaces<PFP>(map, position, fNormal) ;
DartMarker m(map) ;
for(Dart d = map.begin(); d != map.end(); map.next(d))
{
if(!m.isMarked(d))
{
m.markOrbit(EDGE_ORBIT, d) ;
if(Geom::angle(fNormal[d], fNormal[map.phi2(d)]) > M_PI / REAL(6))
feature.markOrbit(EDGE_ORBIT, d) ;
}
}
map.template removeAttribute<VEC3>(fNormal) ;
}
} // namespace Geometry
} // namespace Algo
} // namespace CGoGN
......@@ -73,7 +73,7 @@ bool isPointInConvexVolume(typename PFP::MAP& map, Dart d, const typename PFP::T
* @param the point
*/
template <typename PFP>
bool isPointInConvexFace2D(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positions, const typename PFP::VEC3& point, bool CCW );
bool isPointInConvexFace2D(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& positions, const typename PFP::VEC3& point, bool CCW=true);
/**
* test if a point is inside a face
......
......@@ -44,8 +44,8 @@ namespace Geometry
template <typename PFP>
void vertexLocalFrame(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position, typename PFP::VEC3& X, typename PFP::VEC3& Y, typename PFP::VEC3& Z)
{
Z = vertexNormal<PFP>(map,d,position) ;
X = vectorOutOfDart<PFP>(map,d,position) ;
Z = vertexNormal<PFP>(map, d, position) ;
X = vectorOutOfDart<PFP>(map, d, position) ;
Y = Z ^ X ;
Y.normalize() ;
X = Y ^ Z ;
......@@ -56,7 +56,7 @@ template <typename PFP>
typename PFP::MATRIX33 vertexLocalFrame(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position)
{
typename PFP::VEC3 X, Y, Z ;
vertexLocalFrame<PFP>(map,d,position,X,Y,Z) ;
vertexLocalFrame<PFP>(map, d, position, X, Y, Z) ;
typename PFP::MATRIX33 frame ;
frame(0,0) = X[0] ; frame(0,1) = X[1] ; frame(0,2) = X[2] ;
frame(1,0) = Y[0] ; frame(1,1) = Y[1] ; frame(1,2) = Y[2] ;
......@@ -70,7 +70,7 @@ template <typename PFP>
void vertexLocalFrame(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position, typename PFP::VEC3& normal, typename PFP::VEC3& X, typename PFP::VEC3& Y, typename PFP::VEC3& Z)
{
Z = normal ;
X = vectorOutOfDart<PFP>(map,d,position) ;
X = vectorOutOfDart<PFP>(map, d, position) ;
Y = Z ^ X ;
Y.normalize() ;
X = Y ^ Z ;
......@@ -81,7 +81,7 @@ template <typename PFP>
typename PFP::MATRIX33 vertexLocalFrame(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position, typename PFP::VEC3& normal)
{
typename PFP::VEC3 X, Y, Z ;
vertexLocalFrame<PFP>(map,d,position,normal,X,Y,Z) ;
vertexLocalFrame<PFP>(map, d, position, normal, X, Y, Z) ;
typename PFP::MATRIX33 frame ;
frame(0,0) = X[0] ; frame(0,1) = X[1] ; frame(0,2) = X[2] ;
frame(1,0) = Y[0] ; frame(1,1) = Y[1] ; frame(1,2) = Y[2] ;
......
......@@ -40,9 +40,9 @@ typename PFP::VEC3 triangleNormal(typename PFP::MAP& map, Dart d, const typename
{
typedef typename PFP::VEC3 VEC3 ;
VEC3 p1 = position[d];
VEC3 p2 = position[map.phi1(d)];
VEC3 p3 = position[map.phi_1(d)];
const VEC3& p1 = position[d];
const VEC3& p2 = position[map.phi1(d)];
const VEC3& p3 = position[map.phi_1(d)];
VEC3 N = Geom::triangleNormal(p1, p2, p3) ;
N.normalize() ;
......@@ -64,8 +64,8 @@ typename PFP::VEC3 faceNormal(typename PFP::MAP& map, Dart d, const typename PFP
do
{
VEC3 n = triangleNormal<PFP>(map, it, position) ;
<