curvature.h 4.8 KB
Newer Older
Pierre Kraemer's avatar
Pierre Kraemer committed
1
2
3
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps  *
* version 0.1                                                                  *
4
* Copyright (C) 2009-2011, IGG Team, LSIIT, University of Strasbourg           *
Pierre Kraemer's avatar
Pierre Kraemer committed
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
*                                                                              *
* 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.           *
*                                                                              *
20
* Web site: http://cgogn.u-strasbg.fr/                                         *
Pierre Kraemer's avatar
Pierre Kraemer committed
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
* Contact information: cgogn@unistra.fr                                        *
*                                                                              *
*******************************************************************************/

#ifndef __ALGO_GEOMETRY_CURVATURE_H__
#define __ALGO_GEOMETRY_CURVATURE_H__

#include "Geometry/basic.h"

#include "OpenNL/linear_solver.h"
#include "OpenNL/sparse_matrix.h"
#include "OpenNL/full_vector.h"

namespace CGoGN
{

namespace Algo
{

namespace Geometry
{

typedef CPULinearSolverTraits< SparseMatrix<double>, FullVector<double> > CPUSolverTraits ;

template <typename PFP>
Pierre Kraemer's avatar
Pierre Kraemer committed
46
void computeCurvatureVertices_QuadraticFitting(
Pierre Kraemer's avatar
Pierre Kraemer committed
47
48
49
	typename PFP::MAP& map,
	const typename PFP::TVEC3& position,
	const typename PFP::TVEC3& normal,
Pierre Kraemer's avatar
Pierre Kraemer committed
50
51
52
53
	typename PFP::TREAL& kmax,
	typename PFP::TREAL& kmin,
	typename PFP::TVEC3& Kmax,
	typename PFP::TVEC3& Kmin,
Pierre Kraemer's avatar
Pierre Kraemer committed
54
55
56
	const FunctorSelect& select = SelectorTrue()) ;

template <typename PFP>
Pierre Kraemer's avatar
Pierre Kraemer committed
57
void computeCurvatureVertex_QuadraticFitting(
Pierre Kraemer's avatar
Pierre Kraemer committed
58
59
60
61
	typename PFP::MAP& map,
	Dart dart,
	const typename PFP::TVEC3& position,
	const typename PFP::TVEC3& normal,
Pierre Kraemer's avatar
Pierre Kraemer committed
62
63
64
65
	typename PFP::TREAL& kmax,
	typename PFP::TREAL& kmin,
	typename PFP::TVEC3& Kmax,
	typename PFP::TVEC3& Kmin) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
66
67

template <typename PFP>
Pierre Kraemer's avatar
Pierre Kraemer committed
68
void vertexQuadraticFitting(
Pierre Kraemer's avatar
Pierre Kraemer committed
69
70
71
72
73
74
75
76
	typename PFP::MAP& map,
	Dart dart,
	typename PFP::MATRIX33& localFrame,
	const typename PFP::TVEC3& position,
	const typename PFP::TVEC3& normal,
	float& a, float& b, float& c, float& d, float& e) ;

template <typename PFP>
Pierre Kraemer's avatar
Pierre Kraemer committed
77
void quadraticFittingAddVertexPos(typename PFP::VEC3& v, typename PFP::VEC3& p, typename PFP::MATRIX33& localFrame, LinearSolver<CPUSolverTraits>& solver) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
78
79

template <typename PFP>
Pierre Kraemer's avatar
Pierre Kraemer committed
80
void quadraticFittingAddVertexNormal(typename PFP::VEC3& v, typename PFP::VEC3& n, typename PFP::VEC3& p, typename PFP::MATRIX33& localFrame, LinearSolver<CPUSolverTraits>& solver) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
81
82
83
84
85
86
87
88
89
90
91
/*
template <typename PFP>
void vertexCubicFitting(Dart dart, typename PFP::VEC3& normal, float& a, float& b, float& c, float& d, float& e, float& f, float& g, float& h, float& i) ;

template <typename PFP>
void cubicFittingAddVertexPos(typename PFP::VEC3& v, typename PFP::VEC3& p, typename PFP::MATRIX33& localFrame) ;

template <typename PFP>
void cubicFittingAddVertexNormal(typename PFP::VEC3& v, typename PFP::VEC3& n, typename PFP::VEC3& p, typename PFP::MATRIX33& localFrame) ;
*/

Pierre Kraemer's avatar
Pierre Kraemer committed
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
template <typename PFP>
void computeCurvatureVertices_NormalCycles(
	typename PFP::MAP& map,
	typename PFP::REAL radius,
	const typename PFP::TVEC3& position,
	const typename PFP::TVEC3& normal,
	const typename PFP::TREAL& angles,
	typename PFP::TREAL& kmax,
	typename PFP::TREAL& kmin,
	typename PFP::TVEC3& Kmax,
	typename PFP::TVEC3& Kmin,
	typename PFP::TVEC3& Knormal,
	const FunctorSelect& select = SelectorTrue()) ;

template <typename PFP>
void computeCurvatureVertex_NormalCycles(
	typename PFP::MAP& map,
	Dart dart,
110
	typename PFP::REAL radius,
Pierre Kraemer's avatar
Pierre Kraemer committed
111
112
113
114
115
116
117
118
119
	const typename PFP::TVEC3& position,
	const typename PFP::TVEC3& normal,
	const typename PFP::TREAL& angles,
	typename PFP::TREAL& kmax,
	typename PFP::TREAL& kmin,
	typename PFP::TVEC3& Kmax,
	typename PFP::TVEC3& Kmin,
	typename PFP::TVEC3& Knormal) ;

120
} // namespace Geometry
Pierre Kraemer's avatar
Pierre Kraemer committed
121
122
123
124
125
126
127
128

} // namespace Algo

} // namespace CGoGN

#include "Algo/Geometry/curvature.hpp"

#endif