Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CGoGN
CGoGN
Commits
a87c07ab
Commit
a87c07ab
authored
May 04, 2012
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AttributeHandler -> [Vertex,Edge,...]Attribute
parent
5c271985
Changes
37
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
272 additions
and
318 deletions
+272
-318
Apps/Examples/texturesExample.cpp
Apps/Examples/texturesExample.cpp
+32
-10
Apps/Tuto/tp_master.cpp
Apps/Tuto/tp_master.cpp
+2
-2
Apps/Tuto/tuto2.cpp
Apps/Tuto/tuto2.cpp
+1
-1
Apps/Tuto/tuto_mt.cpp
Apps/Tuto/tuto_mt.cpp
+9
-9
Apps/Tuto/tuto_oper2.h
Apps/Tuto/tuto_oper2.h
+1
-1
Apps/Tuto/tuto_orbits.cpp
Apps/Tuto/tuto_orbits.cpp
+10
-23
include/Algo/Decimation/approximator.h
include/Algo/Decimation/approximator.h
+4
-4
include/Algo/Decimation/decimation.hpp
include/Algo/Decimation/decimation.hpp
+14
-14
include/Algo/Decimation/edgeSelector.h
include/Algo/Decimation/edgeSelector.h
+7
-7
include/Algo/Decimation/geometryApproximator.h
include/Algo/Decimation/geometryApproximator.h
+2
-2
include/Algo/Decimation/halfEdgeSelector.h
include/Algo/Decimation/halfEdgeSelector.h
+6
-6
include/Algo/Decimation/lightfieldApproximator.h
include/Algo/Decimation/lightfieldApproximator.h
+10
-10
include/Algo/Decimation/predictor.h
include/Algo/Decimation/predictor.h
+2
-2
include/Algo/DecimationVolumique/approximator.h
include/Algo/DecimationVolumique/approximator.h
+9
-8
include/Algo/DecimationVolumique/selector.h
include/Algo/DecimationVolumique/selector.h
+1
-1
include/Algo/Filtering/average.h
include/Algo/Filtering/average.h
+8
-8
include/Algo/Filtering/functors.h
include/Algo/Filtering/functors.h
+1
-1
include/Algo/Geometry/feature.h
include/Algo/Geometry/feature.h
+5
-5
include/Algo/Geometry/feature.hpp
include/Algo/Geometry/feature.hpp
+6
-6
include/Algo/Geometry/laplacian.h
include/Algo/Geometry/laplacian.h
+6
-6
include/Algo/Geometry/laplacian.hpp
include/Algo/Geometry/laplacian.hpp
+6
-6
include/Algo/ImplicitHierarchicalMesh/ihm.h
include/Algo/ImplicitHierarchicalMesh/ihm.h
+2
-2
include/Algo/ImplicitHierarchicalMesh/ihm3.h
include/Algo/ImplicitHierarchicalMesh/ihm3.h
+3
-3
include/Algo/Import/AHEMImporter.hpp
include/Algo/Import/AHEMImporter.hpp
+5
-36
include/Algo/Import/AHEMImporterDefAttr.hpp
include/Algo/Import/AHEMImporterDefAttr.hpp
+7
-31
include/Algo/Import/importMoka.hpp
include/Algo/Import/importMoka.hpp
+4
-4
include/Algo/Import/importSvg.hpp
include/Algo/Import/importSvg.hpp
+2
-2
include/Algo/LinearSolving/basic.h
include/Algo/LinearSolving/basic.h
+26
-26
include/Algo/LinearSolving/matrixSetup.h
include/Algo/LinearSolving/matrixSetup.h
+36
-36
include/Algo/LinearSolving/variablesSetup.h
include/Algo/LinearSolving/variablesSetup.h
+16
-16
include/Algo/MC/marchingcube.h
include/Algo/MC/marchingcube.h
+1
-1
include/Algo/MC/marchingcube.hpp
include/Algo/MC/marchingcube.hpp
+1
-1
include/Algo/Modelisation/subdivision.hpp
include/Algo/Modelisation/subdivision.hpp
+15
-15
include/Algo/Render/GL2/topo3Render.h
include/Algo/Render/GL2/topo3Render.h
+2
-3
include/Algo/Render/GL2/topo3Render.hpp
include/Algo/Render/GL2/topo3Render.hpp
+5
-5
include/Algo/Render/GL2/topoRender.h
include/Algo/Render/GL2/topoRender.h
+1
-1
include/Topology/generic/mapBrowser.h
include/Topology/generic/mapBrowser.h
+4
-4
No files found.
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"
);
AttributeHandler
<
Geom
::
Vec2f
,
VERTEX
>
texcoord
=
m
.
addAttribute
<
Geom
::
Vec2f
,
VERTEX
>
(
"texcoord"
);
VertexAttribute
<
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
AttributeHandler
<
Point3D
,
VERTEX
>
position
;
VertexAttribute
<
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
AttributeHandler
<
int
,
FACE
>
side
=
myMap
.
addAttribute
<
int
,
FACE
>
(
"nb_sides"
);
FaceAttribute
<
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
AttributeHandler
<
PFP
::
VEC3
>
position
;
AttributeHandler
<
PFP
::
VEC3
>
normal
;
VertexAttribute
<
PFP
::
VEC3
>
position
;
VertexAttribute
<
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
AttributeHandler
<
PFP
::
VEC3
>
normal2
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal2"
);
VertexAttribute
<
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
;
AttributeHandler
<
VEC3
,
DART
>
colorDarts
;
DartAttribute
<
VEC3
>
colorDarts
;
SelectorDartNoBoundary
<
PFP
::
MAP
>
nb
;
...
...
Apps/Tuto/tuto_orbits.cpp
View file @
a87c07ab
...
...
@@ -38,7 +38,7 @@
MAP
myMap
;
VertexAttribute
<
VEC3
>
position
;
AttributeHandler
<
VEC3
,
DART
>
middleDarts
;
DartAttribute
<
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
;
AttributeHandler
<
T
,
VERTEX
>&
m_attrV
;
// vertex attribute to be approximated
AttributeHandler
<
T
,
EDGE
>
m_approx
;
// attribute to store approximation result
AttributeHandler
<
T
,
EDGE
>
m_detail
;
// attribute to store detail information for reconstruction
VertexAttribute
<
T
>&
m_attrV
;
// vertex attribute to be approximated
EdgeAttribute
<
T
>
m_approx
;
// attribute to store approximation result
EdgeAttribute
<
T
>
m_detail
;
// attribute to store detail information for reconstruction
T
m_app
;
public:
Approximator
(
MAP
&
m
,
AttributeHandler
<
T
,
VERTEX
>&
a
,
Predictor
<
PFP
,
T
>*
predictor
)
:
Approximator
(
MAP
&
m
,
VertexAttribute
<
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 ;
}
AttributeHandler
<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") ;
VertexAttribute
<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 ;
}
*/
AttributeHandler
<
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>
,
VERTEX
>
frame
=
map
.
template
getAttribute
<
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>,
VERTEX
>
(
"frame"
)
;
AttributeHandler
<
Geom
::
Matrix
<
3
,
6
,
typename
PFP
::
REAL
>
,
VERTEX
>
RGBfunctions
=
map
.
template
getAttribute
<
Geom
::
Matrix
<
3
,
6
,
typename
PFP
::
REAL
>,
VERTEX
>
(
"colorPTM"
)
;
VertexAttribute
<
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>
>
frame
=
map
.
template
getAttribute
<
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>,
VERTEX
>
(
"frame"
)
;
VertexAttribute
<
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
))
;
AttributeHandler
<
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>
,
VERTEX
>
frame
=
map
.
template
getAttribute
<
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>,
VERTEX
>
(
"frame"
)
;
AttributeHandler
<
Geom
::
Matrix
<
3
,
6
,
typename
PFP
::
REAL
>
,
VERTEX
>
RGBfunctions
=
map
.
template
getAttribute
<
Geom
::
Matrix
<
3
,
6
,
typename
PFP
::
REAL
>,
VERTEX
>
(
"colorPTM"
)
;
VertexAttribute
<
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>
>
frame
=
map
.
template
getAttribute
<
Geom
::
Matrix
<
3
,
3
,
typename
PFP
::
REAL
>,
VERTEX
>
(
"frame"
)
;
VertexAttribute
<
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
;
AttributeHandler
<
EdgeInfo
,
EDGE
>
edgeInfo
;
EdgeAttribute
<
EdgeInfo
>
edgeInfo
;
std
::
multimap
<
float
,
Dart
>
edges
;
typename
std
::
multimap
<
float
,
Dart
>::
iterator
cur
;
...
...
@@ -154,8 +154,8 @@ private:
}
QEMedgeInfo
;
typedef
NoMathIOAttribute
<
QEMedgeInfo
>
EdgeInfo
;
AttributeHandler
<
EdgeInfo
,
EDGE
>
edgeInfo
;
AttributeHandler
<
Quadric
<
REAL
>
,
VERTEX
>
quadric
;
EdgeAttribute
<
EdgeInfo
>
edgeInfo
;
VertexAttribute
<
Quadric
<
REAL
>
>
quadric
;
Quadric
<
REAL
>
tmpQ
;
std
::
multimap
<
float
,
Dart
>
edges
;
...
...
@@ -203,8 +203,8 @@ private:
}
QEMedgeInfo
;
typedef
NoMathIOAttribute
<
QEMedgeInfo
>
EdgeInfo
;
AttributeHandler
<
EdgeInfo
,
EDGE
>
edgeInfo
;
AttributeHandler
<
Quadric
<
REAL
>
,
VERTEX
>
quadric
;
EdgeAttribute
<
EdgeInfo
>
edgeInfo
;
VertexAttribute
<
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
;
AttributeHandler
<
EdgeInfo
,
EDGE
>
edgeInfo
;
EdgeAttribute
<
EdgeInfo
>
edgeInfo
;
EdgeAttribute
<
REAL
>
edgeangle
;
VertexAttribute
<
REAL
>
kmax
;
VertexAttribute
<
REAL
>
kmin
;
...
...
@@ -347,7 +347,7 @@ private:
}
MinDetailEdgeInfo
;
typedef
NoMathIOAttribute
<
MinDetailEdgeInfo
>
EdgeInfo
;
AttributeHandler
<
EdgeInfo
,
EDGE
>
edgeInfo
;
EdgeAttribute
<
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:
AttributeHandler
<
Quadric
<
REAL
>
,
VERTEX
>
m_quadric
;
VertexAttribute
<
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:
AttributeHandler
<
Quadric
<
REAL
>
,
VERTEX
>
m_quadric
;
VertexAttribute
<
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
;
AttributeHandler
<
HalfEdgeInfo
,
DART
>
halfEdgeInfo
;
AttributeHandler
<
Quadric
<
REAL
>
,
VERTEX
>
quadric
;
DartAttribute
<
HalfEdgeInfo
>
halfEdgeInfo
;
VertexAttribute
<
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
;
AttributeHandler
<
MATRIX33
,
VERTEX
>
m_frame
;
VertexAttribute
<
MATRIX33
>
m_frame
;
AttributeHandler
<
HalfEdgeInfo
,
DART
>
halfEdgeInfo
;
AttributeHandler
<
Quadric
<
REAL
>
,
VERTEX
>
quadric
;
AttributeHandler
<
QuadricRGBfunctions
<
REAL
>
,
EDGE
>
quadricRGBfunctions
;
DartAttribute
<
HalfEdgeInfo
>
halfEdgeInfo
;
VertexAttribute
<
Quadric
<
REAL
>
>
quadric
;
EdgeAttribute
<
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
,
AttributeHandler
<
MATRIX33
,
VERTEX
>&
frame
,
Predictor
<
PFP
,
MATRIX33
>*
pred
=
NULL
)
:
Approximator_FrameHalf
(
MAP
&
m
,
VertexAttribute
<
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:
AttributeHandler
<
MATRIX33
,
VERTEX
>
m_frame
;
AttributeHandler
<
MATRIX33
,
EDGE
>
m_approxFrame
;
AttributeHandler
<
QuadricRGBfunctions
<
REAL
>
,
EDGE
>
m_quadricRGBfunctions
;
VertexAttribute
<
MATRIX33
>
m_frame
;
EdgeAttribute
<
MATRIX33
>
m_approxFrame
;
EdgeAttribute
<
QuadricRGBfunctions
<
REAL
>
>
m_quadricRGBfunctions
;
public:
Approximator_RGBfunctionsHalf
(
MAP
&
m
,
AttributeHandler
<
MATRIX36
,
VERTEX
>&
rgbfunctions
,
Predictor
<
PFP
,
MATRIX36
>*
pred
=
NULL
)
:
Approximator_RGBfunctionsHalf
(
MAP
&
m
,
VertexAttribute
<
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
,
AttributeHandler
<
MATRIX33
,
VERTEX
>&
frame
,
Predictor
<
PFP
,
MATRIX33
>*
pred
=
NULL
)
:
Approximator_Frame
(
MAP
&
m
,
VertexAttribute
<
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:
AttributeHandler
<
MATRIX33
,
VERTEX
>
m_frame
;
AttributeHandler
<
MATRIX33
,
EDGE
>
m_approxFrame
;
AttributeHandler
<
QuadricRGBfunctions
<
REAL
>
,
EDGE
>
m_quadricRGBfunctions
;
VertexAttribute
<
MATRIX33
>
m_frame
;
EdgeAttribute
<
MATRIX33
>
m_approxFrame
;
EdgeAttribute
<
QuadricRGBfunctions
<
REAL
>
>
m_quadricRGBfunctions
;
public:
Approximator_RGBfunctions
(
MAP
&
m
,
AttributeHandler
<
MATRIX36
,
VERTEX
>&
rgbfunctions
,
Predictor
<
PFP
,
MATRIX36
>*
pred
=
NULL
)
:
Approximator_RGBfunctions
(
MAP
&
m
,
VertexAttribute
<
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:
AttributeHandler
<
T
,
VERTEX
>&
m_attrV
;
// vertex attribute to be predicted
VertexAttribute
<
T
>&
m_attrV
;
// vertex attribute to be predicted
std
::
vector
<
T
>
m_predict
;
// prediction results
public:
Predictor
(
MAP
&
m
,
AttributeHandler
<
T
,
VERTEX
>&
p
)
:
Predictor
(
MAP
&
m
,
VertexAttribute
<
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
::
TVEC3
&
m_position
;
VertexAttribute
<
VEC3
>
&
m_position
;
CGoGN
::
Algo
::
DecimationVolumique
::
Selector
<
PFP
>*
m_selector
;
//
VEC3
m_approx
;
public:
Approximator
(
MAP
&
m
,
typename
PFP
::
TVEC3
&
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
,
AttributeHandler
<
VEC3
>&
pos
)
:
Approximator
<
PFP
>
(
m
,
pos
)
Approximator_Centroid
(
MAP
&
m
,
VertexAttribute
<
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
;
AttributeHandler
<
EdgeInfo
>
edgeInfo
;
EdgeAttribute
<
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
AttributeHandler
<
T
,
VERTEX
>&
attIn
,
AttributeHandler
<
T
,
VERTEX
>&
attOut
,
const
VertexAttribute
<
T
>&
attIn
,
VertexAttribute
<
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
AttributeHandler
<
T
,
VERTEX
>&
attIn
,
AttributeHandler
<
T
,
VERTEX
>&
attOut
,
const
VertexAttribute
<
T
>&
attIn
,
VertexAttribute
<
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
AttributeHandler
<
T
,
EDGE
>&
attIn
,
AttributeHandler
<
T
,
EDGE
>&
attOut
,
const
EdgeAttribute
<
T
>&
attIn
,
EdgeAttribute
<
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
AttributeHandler
<
T
,
FACE
>&
attIn
,
AttributeHandler
<
T
,
FACE
>&
attOut
,
const
FaceAttribute
<
T
>&
attIn
,
FaceAttribute
<
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
AttributeHandler
<
T
,
VERTEX
>&
attr
;
const
VertexAttribute
<
T
>&
attr
;
const
VertexAttribute
<
VEC3
>&
position
;
VEC3
center
;
typename
PFP
::
REAL
radius
;
...
...
include/Algo/Geometry/feature.h
View file @
a87c07ab
...
...
@@ -109,7 +109,7 @@ bool isTriangleRegular(typename PFP::MAP& map, Dart d, const VertexAttribute<typ
template
<
typename
PFP
>
void
initRidgeSegments
(
typename
PFP
::
MAP
&
map
,
AttributeHandler
<
ridgeSegment
,
FACE
>&
ridge_segments
,
FaceAttribute
<
ridgeSegment
>&
ridge_segments
,
const
FunctorSelect
&
select
=
allDarts
,
unsigned
int
thread
=
0
)
;
...
...
@@ -119,7 +119,7 @@ void computeRidgeLines(
CellMarker
<
FACE
>&
regularMarker
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
vertex_gradient
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
K
,