Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Etienne Schmitt
CGoGN
Commits
a87c07ab
Commit
a87c07ab
authored
May 04, 2012
by
Pierre Kraemer
Browse files
AttributeHandler -> [Vertex,Edge,...]Attribute
parent
5c271985
Changes
37
Hide whitespace changes
Inline
Side-by-side
Apps/Examples/texturesExample.cpp
View file @
a87c07ab
/*
* texturesExample.cpp
*
* Created on: Jul 21, 2011
* Author: thery
*/
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, 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: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include
"texturesExample.h"
#include
"Algo/Geometry/boundingbox.h"
#include
"Algo/Modelisation/polyhedron.h"
TexView
::
TexView
()
:
m_render
(
NULL
),
m_positionVBO
(
NULL
),
m_texcoordVBO
(
NULL
),
m_texture
(
NULL
),
m_shader
(
NULL
),
m_modeMask
(
false
),
m_fileName
(
""
)
{
}
m_render
(
NULL
),
m_positionVBO
(
NULL
),
m_texcoordVBO
(
NULL
),
m_texture
(
NULL
),
m_shader
(
NULL
),
m_modeMask
(
false
),
m_fileName
(
""
)
{}
TexView
::~
TexView
()
{
...
...
@@ -205,7 +227,7 @@ int main(int argc, char**argv)
PFP
::
MAP
&
m
=
tv
.
myMap
;
VertexAttribute
<
VEC3
>
position
=
m
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
Attribute
Handler
<
Geom
::
Vec2f
,
VERTEX
>
texcoord
=
m
.
addAttribute
<
Geom
::
Vec2f
,
VERTEX
>
(
"texcoord"
);
Vertex
Attribute
<
Geom
::
Vec2f
>
texcoord
=
m
.
addAttribute
<
Geom
::
Vec2f
,
VERTEX
>
(
"texcoord"
);
#define NB 96
...
...
Apps/Tuto/tp_master.cpp
View file @
a87c07ab
...
...
@@ -62,9 +62,9 @@ typedef PFP::VEC3 Point3D;
// Variables pour la gestion des plongements
// handler d'attribut de position par sommet
Attribute
Handler
<
Point3D
,
VERTEX
>
position
;
Vertex
Attribute
<
Point3D
>
position
;
// handler d'attribut de normale par sommet
VertexAttribute
<
P
FP
::
VEC3
>
normal
;
VertexAttribute
<
P
oint3D
>
normal
;
/// Fonctions a connaitre:
...
...
Apps/Tuto/tuto2.cpp
View file @
a87c07ab
...
...
@@ -80,7 +80,7 @@ void MyQT::createMap()
// example of attribute on face
// here for example we store the number of edges of faces at construction
Attribute
Handler
<
int
,
FACE
>
side
=
myMap
.
addAttribute
<
int
,
FACE
>
(
"nb_sides"
);
Face
Attribute
<
int
>
side
=
myMap
.
addAttribute
<
int
,
FACE
>
(
"nb_sides"
);
side
[
d1
]
=
3
;
side
[
d2
]
=
4
;
...
...
Apps/Tuto/tuto_mt.cpp
View file @
a87c07ab
...
...
@@ -60,8 +60,8 @@ struct PFP: public PFP_STANDARD
PFP
::
MAP
myMap
;
// attribute handlers
Attribute
Handler
<
PFP
::
VEC3
>
position
;
Attribute
Handler
<
PFP
::
VEC3
>
normal
;
Vertex
Attribute
<
PFP
::
VEC3
>
position
;
Vertex
Attribute
<
PFP
::
VEC3
>
normal
;
// open file
void
MyQT
::
cb_Open
()
...
...
@@ -86,10 +86,10 @@ void MyQT::cb_Open()
}
// recuper l'attribut pour la position des points (créé lors de l'import)
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
if
(
!
normal
.
isValid
())
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
);
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
"normal"
);
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
myMap
,
position
,
normal
)
;
...
...
@@ -107,7 +107,7 @@ void MyQT::cb_Open()
void
MyQT
::
cb_New
()
{
if
(
!
position
.
isValid
())
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
"position"
);
// create a sphere
Algo
::
Modelisation
::
Polyhedron
<
PFP
>
prim
(
myMap
,
position
);
...
...
@@ -115,7 +115,7 @@ void MyQT::cb_New()
prim
.
embedSphere
(
10.0
f
);
if
(
!
normal
.
isValid
())
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
);
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
"normal"
);
Algo
::
Geometry
::
computeNormalVertices
<
PFP
>
(
myMap
,
position
,
normal
)
;
...
...
@@ -332,7 +332,7 @@ public:
void
MyQT
::
menu_slot1
()
{
// cree un handler pour les normales aux sommets
Attribute
Handler
<
PFP
::
VEC3
>
normal2
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal2"
);
Vertex
Attribute
<
PFP
::
VEC3
>
normal2
=
myMap
.
addAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
"normal2"
);
// ajout de 4 threads pour les markers
myMap
.
addThreadMarker
(
4
);
...
...
@@ -346,7 +346,7 @@ void MyQT::menu_slot1()
// parallelisation de boucle sans resultat
calculFunctor1
<
PFP
>
tf1
(
myMap
,
position
,
normal
);
Algo
::
Parallel
::
foreach_orbit
<
PFP
>
(
myMap
,
VERTEX
,
tf1
,
4
);
Algo
::
Parallel
::
foreach_orbit
<
PFP
>
(
myMap
,
VERTEX
,
tf1
,
4
);
CGoGNout
<<
"ok:"
<<
CGoGNendl
;
// parallelisation de boucle avec resultats stockes
...
...
@@ -355,7 +355,7 @@ void MyQT::menu_slot1()
std
::
vector
<
std
::
pair
<
double
,
unsigned
int
>
>
lengthp
;
LengthEdgeFunctor
<
PFP
>
tflef
(
myMap
,
position
);
// le foncteur
// on lance l'algo parallelise (4 threads, buffer de 16384 brins par thread)
Algo
::
Parallel
::
foreach_orbit_res
<
PFP
,
std
::
pair
<
double
,
unsigned
int
>
>
(
myMap
,
EDGE
,
tflef
,
4
,
16384
,
lengthp
);
Algo
::
Parallel
::
foreach_orbit_res
<
PFP
,
std
::
pair
<
double
,
unsigned
int
>
>
(
myMap
,
EDGE
,
tflef
,
4
,
16384
,
lengthp
);
// on calcule la somme des resultats
std
::
pair
<
double
,
unsigned
int
>
le
=
Algo
::
Parallel
::
sumPairResult
<
double
,
unsigned
int
>
(
lengthp
);
CGoGNout
<<
"length :"
<<
le
.
first
/
le
.
second
<<
CGoGNendl
;
...
...
Apps/Tuto/tuto_oper2.h
View file @
a87c07ab
...
...
@@ -85,7 +85,7 @@ protected:
MAP
myMap
;
VertexAttribute
<
VEC3
>
position
;
Attribute
Handler
<
VEC3
,
DART
>
colorDarts
;
Dart
Attribute
<
VEC3
>
colorDarts
;
SelectorDartNoBoundary
<
PFP
::
MAP
>
nb
;
...
...
Apps/Tuto/tuto_orbits.cpp
View file @
a87c07ab
...
...
@@ -38,7 +38,7 @@
MAP
myMap
;
VertexAttribute
<
VEC3
>
position
;
Attribute
Handler
<
VEC3
,
DART
>
middleDarts
;
Dart
Attribute
<
VEC3
>
middleDarts
;
void
MyQT
::
text_onoff
(
bool
x
)
...
...
@@ -170,7 +170,7 @@ void MyQT::cb_mousePress(int button, int x, int y)
m_clicked
=
m_render_topo
->
picking
<
PFP
>
(
myMap
,
x
,
y
,
nb
);
if
(
m_clicked
!=
Dart
::
nil
())
{
unsigned
int
orbs
[
9
]
=
{
VERTEX
,
EDGE
,
FACE
,
VOLUME
,
PFP
::
MAP
::
ORBIT_IN_PARENT
(
VERTEX
)
,
PFP
::
MAP
::
ORBIT_IN
_PARENT
(
EDGE
)
,
PFP
::
MAP
::
ORBIT_IN
_PARENT
(
FACE
)
,
PFP
::
MAP
::
ORBIT_IN_PARENT2
(
VERTEX
)
,
PFP
::
MAP
::
ORBIT_IN
_PARENT2
(
EDGE
)
};
unsigned
int
orbs
[
9
]
=
{
VERTEX
,
EDGE
,
FACE
,
VOLUME
,
PFP
::
MAP
::
VERTEX_OF_PARENT
,
PFP
::
MAP
::
EDGE_OF
_PARENT
,
PFP
::
MAP
::
FACE_OF
_PARENT
,
PFP
::
MAP
::
VERTEX_OF_PARENT2
,
PFP
::
MAP
::
EDGE_OF
_PARENT2
};
m_selected
.
clear
();
// easy way to traverse darts of orbit
...
...
@@ -182,14 +182,12 @@ void MyQT::cb_mousePress(int button, int x, int y)
}
}
template
<
unsigned
int
ORB
>
void
MyQT
::
init_att_orb
(
AttributeHandlerGen
*
attg
)
{
int
i
=
0
;
unsigned
int
i
=
0
;
TraversorCell
<
MAP
,
ORB
>
tra
(
myMap
);
// AttributeHandler<int,ORB>* attx = reinterpret_cast< AttributeHandler<int,ORB>* >(attg);
AttributeHandler
<
int
,
ORB
>*
att
=
static_cast
<
AttributeHandler
<
int
,
ORB
>*
>
(
attg
);
for
(
Dart
d
=
tra
.
begin
();
d
!=
tra
.
end
();
d
=
tra
.
next
())
...
...
@@ -208,35 +206,24 @@ void MyQT::initMap()
prim
.
hexaGrid_topo
(
nb
,
nb
,
nb
);
prim
.
embedHexaGrid
(
1.0
f
,
1.0
f
,
1.0
f
);
AttributeHandler
<
int
,
VERTEX
>
att0
=
myMap
.
addAttribute
<
int
,
VERTEX
>
(
"vertex"
);
m_att_orbits
[
0
]
=
new
AttributeHandler
<
int
,
VERTEX
>
(
att0
);
init_att_orb
<
VERTEX
>
(
m_att_orbits
[
0
]);
m_att_orbits
[
0
]
=
new
AttributeHandler
<
int
,
VERTEX
>
(
myMap
.
addAttribute
<
int
,
VERTEX
>
(
"vertex"
));
m_att_orbits
[
1
]
=
new
AttributeHandler
<
int
,
EDGE
>
(
myMap
.
addAttribute
<
int
,
EDGE
>
(
"edge"
));
m_att_orbits
[
2
]
=
new
AttributeHandler
<
int
,
FACE
>
(
myMap
.
addAttribute
<
int
,
FACE
>
(
"face"
));
m_att_orbits
[
3
]
=
new
AttributeHandler
<
int
,
VOLUME
>
(
myMap
.
addAttribute
<
int
,
VOLUME
>
(
"volume"
));
m_att_orbits
[
4
]
=
new
AttributeHandler
<
int
,
VERTEX
+
PFP
::
MAP
::
IN_PARENT
>
(
myMap
.
addAttribute
<
int
,
VERTEX
+
PFP
::
MAP
::
IN_PARENT
>
(
"vertex2"
));
m_att_orbits
[
5
]
=
new
AttributeHandler
<
int
,
EDGE
+
PFP
::
MAP
::
IN_PARENT
>
(
myMap
.
addAttribute
<
int
,
EDGE
+
PFP
::
MAP
::
IN_PARENT
>
(
"edge2"
));
m_att_orbits
[
6
]
=
new
AttributeHandler
<
int
,
FACE
+
PFP
::
MAP
::
IN_PARENT
>
(
myMap
.
addAttribute
<
int
,
FACE
+
PFP
::
MAP
::
IN_PARENT
>
(
"face2"
));
m_att_orbits
[
7
]
=
new
AttributeHandler
<
int
,
VERTEX
+
PFP
::
MAP
::
IN_PARENT2
>
(
myMap
.
addAttribute
<
int
,
VERTEX
+
PFP
::
MAP
::
IN_PARENT2
>
(
"vertex1"
));
m_att_orbits
[
8
]
=
new
AttributeHandler
<
int
,
EDGE
+
PFP
::
MAP
::
IN_PARENT2
>
(
myMap
.
addAttribute
<
int
,
EDGE
+
PFP
::
MAP
::
IN_PARENT2
>
(
"face1"
));
m_att_orbits
[
4
]
=
new
AttributeHandler
<
int
,
PFP
::
MAP
::
VERTEX_OF_PARENT
>
(
myMap
.
addAttribute
<
int
,
PFP
::
MAP
::
VERTEX_OF_PARENT
>
(
"vertex2"
));
m_att_orbits
[
5
]
=
new
AttributeHandler
<
int
,
PFP
::
MAP
::
EDGE_OF_PARENT
>
(
myMap
.
addAttribute
<
int
,
PFP
::
MAP
::
EDGE_OF_PARENT
>
(
"edge2"
));
m_att_orbits
[
6
]
=
new
AttributeHandler
<
int
,
PFP
::
MAP
::
FACE_OF_PARENT
>
(
myMap
.
addAttribute
<
int
,
PFP
::
MAP
::
FACE_OF_PARENT
>
(
"face2"
));
m_att_orbits
[
7
]
=
new
AttributeHandler
<
int
,
PFP
::
MAP
::
VERTEX_OF_PARENT2
>
(
myMap
.
addAttribute
<
int
,
PFP
::
MAP
::
VERTEX_OF_PARENT2
>
(
"vertex1"
));
m_att_orbits
[
8
]
=
new
AttributeHandler
<
int
,
PFP
::
MAP
::
EDGE_OF_PARENT2
>
(
myMap
.
addAttribute
<
int
,
PFP
::
MAP
::
EDGE_OF_PARENT2
>
(
"face1"
));
init_att_orb
<
VERTEX
>
(
m_att_orbits
[
0
]);
init_att_orb
<
EDGE
>
(
m_att_orbits
[
1
]);
init_att_orb
<
FACE
>
(
m_att_orbits
[
2
]);
init_att_orb
<
VOLUME
>
(
m_att_orbits
[
3
]);
init_att_orb
<
PFP
::
MAP
::
VERTEX_OF_PARENT
>
(
m_att_orbits
[
4
]);
init_att_orb
<
PFP
::
MAP
::
EDGE_OF_PARENT
>
(
m_att_orbits
[
5
]);
init_att_orb
<
PFP
::
MAP
::
FACE_OF_PARENT
>
(
m_att_orbits
[
6
]);
init_att_orb
<
PFP
::
MAP
::
VERTEX_OF_PARENT2
>
(
m_att_orbits
[
7
]);
init_att_orb
<
PFP
::
MAP
::
EDGE_OF_PARENT2
>
(
m_att_orbits
[
8
]);
middleDarts
=
myMap
.
addAttribute
<
VEC3
,
DART
>
(
"middle"
);
...
...
include/Algo/Decimation/approximator.h
View file @
a87c07ab
...
...
@@ -87,13 +87,13 @@ public:
protected:
Predictor
<
PFP
,
T
>*
m_predictor
;
Attribute
Handler
<
T
,
VERTEX
>&
m_attrV
;
// vertex attribute to be approximated
Attribute
Handler
<
T
,
EDGE
>
m_approx
;
// attribute to store approximation result
Attribute
Handler
<
T
,
EDGE
>
m_detail
;
// attribute to store detail information for reconstruction
Vertex
Attribute
<
T
>&
m_attrV
;
// vertex attribute to be approximated
Edge
Attribute
<
T
>
m_approx
;
// attribute to store approximation result
Edge
Attribute
<
T
>
m_detail
;
// attribute to store detail information for reconstruction
T
m_app
;
public:
Approximator
(
MAP
&
m
,
Attribute
Handler
<
T
,
VERTEX
>&
a
,
Predictor
<
PFP
,
T
>*
predictor
)
:
Approximator
(
MAP
&
m
,
Vertex
Attribute
<
T
>&
a
,
Predictor
<
PFP
,
T
>*
predictor
)
:
ApproximatorGen
<
PFP
>
(
m
),
m_predictor
(
predictor
),
m_attrV
(
a
)
{
std
::
stringstream
aname
;
...
...
include/Algo/Decimation/decimation.hpp
View file @
a87c07ab
...
...
@@ -68,28 +68,28 @@ void decimate(
approximators
.
push_back
(
new
Approximator_QEMhalfEdge
<
PFP
>
(
map
,
position
))
;
/*
PFP::TVEC3 frame[3] ;
frame[0] = map.template getAttribute<typename PFP::VEC3
>(
VERTEX
,
"frame_T") ; // Tangent
frame[1] = map.template getAttribute<typename PFP::VEC3
>(
VERTEX
,
"frame_B") ; // Bitangent
frame[2] = map.template getAttribute<typename PFP::VEC3
>(
VERTEX
,
"frame_N") ; // Normal
frame[0] = map.template getAttribute<typename PFP::VEC3
,
VERTEX
>(
"frame_T") ; // Tangent
frame[1] = map.template getAttribute<typename PFP::VEC3
,
VERTEX
>(
"frame_B") ; // Bitangent
frame[2] = map.template getAttribute<typename PFP::VEC3
,
VERTEX
>(
"frame_N") ; // Normal
for (unsigned int i = 0 ; i < 3 ; ++i)
if (!frame[i].isValid()) {
CGoGNerr << "In function decimate : frame[" << i << "] is not valid" << CGoGNendl ;
}
Attribute
Handler
<typename PFP::VEC3> colorPTM[6] ;
colorPTM[0] = map.template getAttribute<typename PFP::VEC3
>(
VERTEX
,
"colorPTM_a") ;
colorPTM[1] = map.template getAttribute<typename PFP::VEC3
>(
VERTEX
,
"colorPTM_b") ;
colorPTM[2] = map.template getAttribute<typename PFP::VEC3
>(
VERTEX
,
"colorPTM_c") ;
colorPTM[3] = map.template getAttribute<typename PFP::VEC3
>(
VERTEX
,
"colorPTM_d") ;
colorPTM[4] = map.template getAttribute<typename PFP::VEC3
>(
VERTEX
,
"colorPTM_e") ;
colorPTM[5] = map.template getAttribute<typename PFP::VEC3
>(
VERTEX
,
"colorPTM_f") ;
Vertex
Attribute<typename PFP::VEC3> colorPTM[6] ;
colorPTM[0] = map.template getAttribute<typename PFP::VEC3
,
VERTEX
>(
"colorPTM_a") ;
colorPTM[1] = map.template getAttribute<typename PFP::VEC3
,
VERTEX
>(
"colorPTM_b") ;
colorPTM[2] = map.template getAttribute<typename PFP::VEC3
,
VERTEX
>(
"colorPTM_c") ;
colorPTM[3] = map.template getAttribute<typename PFP::VEC3
,
VERTEX
>(
"colorPTM_d") ;
colorPTM[4] = map.template getAttribute<typename PFP::VEC3
,
VERTEX
>(
"colorPTM_e") ;
colorPTM[5] = map.template getAttribute<typename PFP::VEC3
,
VERTEX
>(
"colorPTM_f") ;
for (unsigned int i = 0 ; i < 6 ; ++i)
if (!colorPTM[i].isValid()) {
CGoGNerr << "In function decimate : colorPTM[" << i << "] is not valid" << CGoGNendl ;
}
*/
Attribute
Handler
<
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>
,
VERTEX
>
frame
=
map
.
template
getAttribute
<
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>,
VERTEX
>
(
"frame"
)
;
Attribute
Handler
<
Geom
::
Matrix
<
3
,
6
,
typename
PFP
::
REAL
>
,
VERTEX
>
RGBfunctions
=
map
.
template
getAttribute
<
Geom
::
Matrix
<
3
,
6
,
typename
PFP
::
REAL
>,
VERTEX
>
(
"colorPTM"
)
;
Vertex
Attribute
<
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>
>
frame
=
map
.
template
getAttribute
<
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>,
VERTEX
>
(
"frame"
)
;
Vertex
Attribute
<
Geom
::
Matrix
<
3
,
6
,
typename
PFP
::
REAL
>
>
RGBfunctions
=
map
.
template
getAttribute
<
Geom
::
Matrix
<
3
,
6
,
typename
PFP
::
REAL
>,
VERTEX
>
(
"colorPTM"
)
;
approximators
.
push_back
(
new
Approximator_Frame
<
PFP
>
(
map
,
frame
))
;
approximators
.
push_back
(
new
Approximator_RGBfunctions
<
PFP
>
(
map
,
RGBfunctions
))
;
break
;
...
...
@@ -97,8 +97,8 @@ void decimate(
case
A_LightfieldHalf
:
{
approximators
.
push_back
(
new
Approximator_HalfCollapse
<
PFP
>
(
map
,
position
))
;
Attribute
Handler
<
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>
,
VERTEX
>
frame
=
map
.
template
getAttribute
<
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>,
VERTEX
>
(
"frame"
)
;
Attribute
Handler
<
Geom
::
Matrix
<
3
,
6
,
typename
PFP
::
REAL
>
,
VERTEX
>
RGBfunctions
=
map
.
template
getAttribute
<
Geom
::
Matrix
<
3
,
6
,
typename
PFP
::
REAL
>,
VERTEX
>
(
"colorPTM"
)
;
Vertex
Attribute
<
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>
>
frame
=
map
.
template
getAttribute
<
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>,
VERTEX
>
(
"frame"
)
;
Vertex
Attribute
<
Geom
::
Matrix
<
3
,
6
,
typename
PFP
::
REAL
>
>
RGBfunctions
=
map
.
template
getAttribute
<
Geom
::
Matrix
<
3
,
6
,
typename
PFP
::
REAL
>,
VERTEX
>
(
"colorPTM"
)
;
approximators
.
push_back
(
new
Approximator_FrameHalf
<
PFP
>
(
map
,
frame
))
;
approximators
.
push_back
(
new
Approximator_RGBfunctionsHalf
<
PFP
>
(
map
,
RGBfunctions
))
;
break
;
...
...
include/Algo/Decimation/edgeSelector.h
View file @
a87c07ab
...
...
@@ -111,7 +111,7 @@ private:
}
LengthEdgeInfo
;
typedef
NoMathIOAttribute
<
LengthEdgeInfo
>
EdgeInfo
;
Attribute
Handler
<
EdgeInfo
,
EDGE
>
edgeInfo
;
Edge
Attribute
<
EdgeInfo
>
edgeInfo
;
std
::
multimap
<
float
,
Dart
>
edges
;
typename
std
::
multimap
<
float
,
Dart
>::
iterator
cur
;
...
...
@@ -154,8 +154,8 @@ private:
}
QEMedgeInfo
;
typedef
NoMathIOAttribute
<
QEMedgeInfo
>
EdgeInfo
;
Attribute
Handler
<
EdgeInfo
,
EDGE
>
edgeInfo
;
Attribute
Handler
<
Quadric
<
REAL
>
,
VERTEX
>
quadric
;
Edge
Attribute
<
EdgeInfo
>
edgeInfo
;
Vertex
Attribute
<
Quadric
<
REAL
>
>
quadric
;
Quadric
<
REAL
>
tmpQ
;
std
::
multimap
<
float
,
Dart
>
edges
;
...
...
@@ -203,8 +203,8 @@ private:
}
QEMedgeInfo
;
typedef
NoMathIOAttribute
<
QEMedgeInfo
>
EdgeInfo
;
Attribute
Handler
<
EdgeInfo
,
EDGE
>
edgeInfo
;
Attribute
Handler
<
Quadric
<
REAL
>
,
VERTEX
>
quadric
;
Edge
Attribute
<
EdgeInfo
>
edgeInfo
;
Vertex
Attribute
<
Quadric
<
REAL
>
>
quadric
;
std
::
multimap
<
float
,
Dart
>
edges
;
typename
std
::
multimap
<
float
,
Dart
>::
iterator
cur
;
...
...
@@ -256,7 +256,7 @@ private:
REAL
radius
;
VertexAttribute
<
VEC3
>
normal
;
Attribute
Handler
<
EdgeInfo
,
EDGE
>
edgeInfo
;
Edge
Attribute
<
EdgeInfo
>
edgeInfo
;
EdgeAttribute
<
REAL
>
edgeangle
;
VertexAttribute
<
REAL
>
kmax
;
VertexAttribute
<
REAL
>
kmin
;
...
...
@@ -347,7 +347,7 @@ private:
}
MinDetailEdgeInfo
;
typedef
NoMathIOAttribute
<
MinDetailEdgeInfo
>
EdgeInfo
;
Attribute
Handler
<
EdgeInfo
,
EDGE
>
edgeInfo
;
Edge
Attribute
<
EdgeInfo
>
edgeInfo
;
std
::
multimap
<
float
,
Dart
>
edges
;
typename
std
::
multimap
<
float
,
Dart
>::
iterator
cur
;
...
...
include/Algo/Decimation/geometryApproximator.h
View file @
a87c07ab
...
...
@@ -45,7 +45,7 @@ public:
typedef
typename
PFP
::
REAL
REAL
;
protected:
Attribute
Handler
<
Quadric
<
REAL
>
,
VERTEX
>
m_quadric
;
Vertex
Attribute
<
Quadric
<
REAL
>
>
m_quadric
;
public:
Approximator_QEM
(
MAP
&
m
,
VertexAttribute
<
VEC3
>&
pos
,
Predictor
<
PFP
,
VEC3
>*
pred
=
NULL
)
:
...
...
@@ -67,7 +67,7 @@ public:
typedef
typename
PFP
::
REAL
REAL
;
protected:
Attribute
Handler
<
Quadric
<
REAL
>
,
VERTEX
>
m_quadric
;
Vertex
Attribute
<
Quadric
<
REAL
>
>
m_quadric
;
public:
Approximator_QEMhalfEdge
(
MAP
&
m
,
VertexAttribute
<
VEC3
>&
pos
,
Predictor
<
PFP
,
VEC3
>*
pred
=
NULL
)
:
...
...
include/Algo/Decimation/halfEdgeSelector.h
View file @
a87c07ab
...
...
@@ -53,8 +53,8 @@ private:
}
QEMhalfEdgeInfo
;
typedef
NoMathIOAttribute
<
QEMhalfEdgeInfo
>
HalfEdgeInfo
;
Attribute
Handler
<
HalfEdgeInfo
,
DART
>
halfEdgeInfo
;
Attribute
Handler
<
Quadric
<
REAL
>
,
VERTEX
>
quadric
;
Dart
Attribute
<
HalfEdgeInfo
>
halfEdgeInfo
;
Vertex
Attribute
<
Quadric
<
REAL
>
>
quadric
;
std
::
multimap
<
float
,
Dart
>
halfEdges
;
typename
std
::
multimap
<
float
,
Dart
>::
iterator
cur
;
...
...
@@ -105,11 +105,11 @@ private:
}
LightfieldHalfEdgeInfo
;
typedef
NoMathIOAttribute
<
LightfieldHalfEdgeInfo
>
HalfEdgeInfo
;
Attribute
Handler
<
MATRIX33
,
VERTEX
>
m_frame
;
Vertex
Attribute
<
MATRIX33
>
m_frame
;
Attribute
Handler
<
HalfEdgeInfo
,
DART
>
halfEdgeInfo
;
Attribute
Handler
<
Quadric
<
REAL
>
,
VERTEX
>
quadric
;
Attribute
Handler
<
QuadricRGBfunctions
<
REAL
>
,
EDGE
>
quadricRGBfunctions
;
Dart
Attribute
<
HalfEdgeInfo
>
halfEdgeInfo
;
Vertex
Attribute
<
Quadric
<
REAL
>
>
quadric
;
Edge
Attribute
<
QuadricRGBfunctions
<
REAL
>
>
quadricRGBfunctions
;
std
::
multimap
<
float
,
Dart
>
halfEdges
;
typename
std
::
multimap
<
float
,
Dart
>::
iterator
cur
;
...
...
include/Algo/Decimation/lightfieldApproximator.h
View file @
a87c07ab
...
...
@@ -49,7 +49,7 @@ public:
typedef
Geom
::
Matrix
<
3
,
6
,
REAL
>
MATRIX36
;
public:
Approximator_FrameHalf
(
MAP
&
m
,
Attribute
Handler
<
MATRIX33
,
VERTEX
>&
frame
,
Predictor
<
PFP
,
MATRIX33
>*
pred
=
NULL
)
:
Approximator_FrameHalf
(
MAP
&
m
,
Vertex
Attribute
<
MATRIX33
>&
frame
,
Predictor
<
PFP
,
MATRIX33
>*
pred
=
NULL
)
:
Approximator
<
PFP
,
MATRIX33
>
(
m
,
frame
,
pred
)
{}
~
Approximator_FrameHalf
()
...
...
@@ -71,12 +71,12 @@ public:
typedef
Geom
::
Matrix
<
3
,
6
,
REAL
>
MATRIX36
;
protected:
Attribute
Handler
<
MATRIX33
,
VERTEX
>
m_frame
;
Attribute
Handler
<
MATRIX33
,
EDGE
>
m_approxFrame
;
Attribute
Handler
<
QuadricRGBfunctions
<
REAL
>
,
EDGE
>
m_quadricRGBfunctions
;
Vertex
Attribute
<
MATRIX33
>
m_frame
;
Edge
Attribute
<
MATRIX33
>
m_approxFrame
;
Edge
Attribute
<
QuadricRGBfunctions
<
REAL
>>
m_quadricRGBfunctions
;
public:
Approximator_RGBfunctionsHalf
(
MAP
&
m
,
Attribute
Handler
<
MATRIX36
,
VERTEX
>&
rgbfunctions
,
Predictor
<
PFP
,
MATRIX36
>*
pred
=
NULL
)
:
Approximator_RGBfunctionsHalf
(
MAP
&
m
,
Vertex
Attribute
<
MATRIX36
>&
rgbfunctions
,
Predictor
<
PFP
,
MATRIX36
>*
pred
=
NULL
)
:
Approximator
<
PFP
,
MATRIX36
>
(
m
,
rgbfunctions
,
pred
)
{
}
~
Approximator_RGBfunctionsHalf
()
...
...
@@ -102,7 +102,7 @@ protected:
EdgeAttribute
<
VEC3
>
m_approxPosition
;
public:
Approximator_Frame
(
MAP
&
m
,
Attribute
Handler
<
MATRIX33
,
VERTEX
>&
frame
,
Predictor
<
PFP
,
MATRIX33
>*
pred
=
NULL
)
:
Approximator_Frame
(
MAP
&
m
,
Vertex
Attribute
<
MATRIX33
>&
frame
,
Predictor
<
PFP
,
MATRIX33
>*
pred
=
NULL
)
:
Approximator
<
PFP
,
MATRIX33
>
(
m
,
frame
,
pred
)
{}
~
Approximator_Frame
()
...
...
@@ -124,12 +124,12 @@ public:
typedef
Geom
::
Matrix
<
3
,
6
,
REAL
>
MATRIX36
;
protected:
Attribute
Handler
<
MATRIX33
,
VERTEX
>
m_frame
;
Attribute
Handler
<
MATRIX33
,
EDGE
>
m_approxFrame
;
Attribute
Handler
<
QuadricRGBfunctions
<
REAL
>
,
EDGE
>
m_quadricRGBfunctions
;
Vertex
Attribute
<
MATRIX33
>
m_frame
;
Edge
Attribute
<
MATRIX33
>
m_approxFrame
;
Edge
Attribute
<
QuadricRGBfunctions
<
REAL
>>
m_quadricRGBfunctions
;
public:
Approximator_RGBfunctions
(
MAP
&
m
,
Attribute
Handler
<
MATRIX36
,
VERTEX
>&
rgbfunctions
,
Predictor
<
PFP
,
MATRIX36
>*
pred
=
NULL
)
:
Approximator_RGBfunctions
(
MAP
&
m
,
Vertex
Attribute
<
MATRIX36
>&
rgbfunctions
,
Predictor
<
PFP
,
MATRIX36
>*
pred
=
NULL
)
:
Approximator
<
PFP
,
MATRIX36
>
(
m
,
rgbfunctions
,
pred
)
{
}
~
Approximator_RGBfunctions
()
...
...
include/Algo/Decimation/predictor.h
View file @
a87c07ab
...
...
@@ -75,11 +75,11 @@ public:
typedef
typename
PFP
::
REAL
REAL
;
protected:
Attribute
Handler
<
T
,
VERTEX
>&
m_attrV
;
// vertex attribute to be predicted
Vertex
Attribute
<
T
>&
m_attrV
;
// vertex attribute to be predicted
std
::
vector
<
T
>
m_predict
;
// prediction results
public:
Predictor
(
MAP
&
m
,
Attribute
Handler
<
T
,
VERTEX
>&
p
)
:
Predictor
(
MAP
&
m
,
Vertex
Attribute
<
T
>&
p
)
:
PredictorGen
<
PFP
>
(
m
),
m_attrV
(
p
)
{}
...
...
include/Algo/DecimationVolumique/approximator.h
View file @
a87c07ab
...
...
@@ -30,13 +30,13 @@ public:
protected:
MAP
&
m_map
;
typename
PFP
::
T
VEC3
&
m_position
;
VertexAttribute
<
VEC3
>
&
m_position
;
CGoGN
::
Algo
::
DecimationVolumique
::
Selector
<
PFP
>*
m_selector
;
//
VEC3
m_approx
;
public:
Approximator
(
MAP
&
m
,
typename
PFP
::
T
VEC3
&
pos
)
:
Approximator
(
MAP
&
m
,
VertexAttribute
<
VEC3
>
&
pos
)
:
m_map
(
m
),
m_position
(
pos
)
{}
...
...
@@ -48,7 +48,6 @@ public:
virtual
void
approximate
(
CGoGN
::
Algo
::
DecimationVolumique
::
Operator
<
PFP
>
*
op
)
=
0
;
};
template
<
typename
PFP
>
class
Approximator_Centroid
:
public
Approximator
<
PFP
>
{
...
...
@@ -57,8 +56,8 @@ public:
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
Approximator_Centroid
(
MAP
&
m
,
Attribute
Handler
<
VEC3
>&
pos
)
:
Approximator
<
PFP
>
(
m
,
pos
)
Approximator_Centroid
(
MAP
&
m
,
Vertex
Attribute
<
VEC3
>&
pos
)
:
Approximator
<
PFP
>
(
m
,
pos
)
{}
ApproximatorType
getType
()
{
return
A_Centroid
;
}
...
...
@@ -67,9 +66,11 @@ public:
}
;
}
//end namespace DecimationVolumique
}
//end namespace Algo
}
//end namespace CGoGN
}
// namespace DecimationVolumique
}
// namespace Algo
}
// namespace CGoGN
#include
"Algo/DecimationVolumique/approximator.hpp"
...
...
include/Algo/DecimationVolumique/selector.h
View file @
a87c07ab
...
...
@@ -259,7 +259,7 @@ private:
typedef
NoMathIOAttribute
<
LengthEdgeInfo
>
EdgeInfo
;
Attribute
Handler
<
EdgeInfo
>
edgeInfo
;
Edge
Attribute
<
EdgeInfo
>
edgeInfo
;
std
::
multimap
<
float
,
Dart
>
edges
;
typename
std
::
multimap
<
float
,
Dart
>::
iterator
cur
;
...
...
include/Algo/Filtering/average.h
View file @
a87c07ab
...
...
@@ -40,8 +40,8 @@ enum neighborhood { INSIDE = 1, BORDER = 2 };
template
<
typename
PFP
,
typename
T
>
void
filterAverageAttribute_OneRing
(
typename
PFP
::
MAP
&
map
,
const
Attribute
Handler
<
T
,
VERTEX
>&
attIn
,
Attribute
Handler
<
T
,
VERTEX
>&
attOut
,
const
Vertex
Attribute
<
T
>&
attIn
,
Vertex
Attribute
<
T
>&
attOut
,
int
neigh
,
const
FunctorSelect
&
select
=
allDarts
)
{
...
...
@@ -86,8 +86,8 @@ void filterAverageAttribute_OneRing(
template
<
typename
PFP
,
typename
T
>
void
filterAverageVertexAttribute_WithinSphere
(
typename
PFP
::
MAP
&
map
,
const
Attribute
Handler
<
T
,
VERTEX
>&
attIn
,
Attribute
Handler
<
T
,
VERTEX
>&
attOut
,
const
Vertex
Attribute
<
T
>&
attIn
,
Vertex
Attribute
<
T
>&
attOut
,
int
neigh
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
typename
PFP
::
REAL
radius
,
...
...
@@ -128,8 +128,8 @@ void filterAverageVertexAttribute_WithinSphere(
template
<
typename
PFP
,
typename
T
>
void
filterAverageEdgeAttribute_WithinSphere
(
typename
PFP
::
MAP
&
map
,
const
Attribute
Handler
<
T
,
EDGE
>&
attIn
,
Attribute
Handler
<
T
,
EDGE
>&
attOut
,
const
Edge
Attribute
<
T
>&
attIn
,
Edge
Attribute
<
T
>&
attOut
,
int
neigh
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
typename
PFP
::
REAL
radius
,
...
...
@@ -156,8 +156,8 @@ void filterAverageEdgeAttribute_WithinSphere(
template
<
typename
PFP
,
typename
T
>
void
filterAverageFaceAttribute_WithinSphere
(
typename
PFP
::
MAP
&
map
,
const
Attribute
Handler
<
T
,
FACE
>&
attIn
,
Attribute
Handler
<
T
,
FACE
>&
attOut
,
const
Face
Attribute
<
T
>&
attIn
,
Face
Attribute
<
T
>&
attOut
,
int
neigh
,
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
typename
PFP
::
REAL
radius
,
...
...
include/Algo/Filtering/functors.h
View file @
a87c07ab
...
...
@@ -66,7 +66,7 @@ class FunctorAverageOnSphereBorder : public FunctorMap<typename PFP::MAP>
typedef
typename
PFP
::
VEC3
VEC3
;
protected:
const
Attribute
Handler
<
T
,
VERTEX
>&
attr
;
const
Vertex
Attribute
<
T
>&
attr
;
const
VertexAttribute
<
VEC3
>&
position
;
VEC3
center
;
typename
PFP
::
REAL
radius
;
...
...
include/Algo/Geometry/feature.h