Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
KennethVanhoey
CGoGN
Commits
ef19be46
Commit
ef19be46
authored
Apr 27, 2012
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
orbit as template -> examples OK
parent
22b6e6b6
Changes
28
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
233 additions
and
380 deletions
+233
-380
Apps/Examples/clipping.cpp
Apps/Examples/clipping.cpp
+6
-14
Apps/Examples/clipping.h
Apps/Examples/clipping.h
+2
-2
Apps/Examples/concave_rendering.cpp
Apps/Examples/concave_rendering.cpp
+6
-14
Apps/Examples/extrusionView.cpp
Apps/Examples/extrusionView.cpp
+5
-2
Apps/Examples/mcmesh.cpp
Apps/Examples/mcmesh.cpp
+7
-15
Apps/Examples/mcmesh.h
Apps/Examples/mcmesh.h
+2
-8
Apps/Examples/simpleGMap2.cpp
Apps/Examples/simpleGMap2.cpp
+1
-4
Apps/Examples/simpleGMap2.h
Apps/Examples/simpleGMap2.h
+1
-1
Apps/Examples/simpleGMap3.cpp
Apps/Examples/simpleGMap3.cpp
+3
-7
Apps/Examples/simpleGMap3.h
Apps/Examples/simpleGMap3.h
+3
-4
Apps/Examples/simpleMap3.cpp
Apps/Examples/simpleMap3.cpp
+2
-6
Apps/Examples/simpleMap3.h
Apps/Examples/simpleMap3.h
+1
-1
Apps/Examples/texturesExample.cpp
Apps/Examples/texturesExample.cpp
+4
-16
Apps/Examples/texturesExample.h
Apps/Examples/texturesExample.h
+1
-4
include/Algo/Geometry/curvature.h
include/Algo/Geometry/curvature.h
+30
-30
include/Algo/Geometry/curvature.hpp
include/Algo/Geometry/curvature.hpp
+30
-30
include/Algo/MC/marchingcube.h
include/Algo/MC/marchingcube.h
+13
-12
include/Algo/MC/marchingcube.hpp
include/Algo/MC/marchingcube.hpp
+24
-104
include/Algo/Modelisation/extrusion.h
include/Algo/Modelisation/extrusion.h
+8
-8
include/Algo/Modelisation/extrusion.hpp
include/Algo/Modelisation/extrusion.hpp
+16
-16
include/Algo/Modelisation/triangulation.h
include/Algo/Modelisation/triangulation.h
+10
-7
include/Algo/Modelisation/triangulation.hpp
include/Algo/Modelisation/triangulation.hpp
+5
-12
include/Algo/Render/GL1/map_glRender.h
include/Algo/Render/GL1/map_glRender.h
+4
-4
include/Algo/Render/GL1/map_glRender.hpp
include/Algo/Render/GL1/map_glRender.hpp
+5
-6
include/Algo/Render/GL1/renderFunctor.h
include/Algo/Render/GL1/renderFunctor.h
+13
-14
include/Algo/Render/GL1/renderFunctor.hpp
include/Algo/Render/GL1/renderFunctor.hpp
+4
-8
include/Algo/Render/GL1/topo_render.h
include/Algo/Render/GL1/topo_render.h
+5
-6
include/Algo/Render/GL1/topo_render.hpp
include/Algo/Render/GL1/topo_render.hpp
+22
-25
No files found.
Apps/Examples/clipping.cpp
View file @
ef19be46
...
@@ -726,8 +726,6 @@ void Clipping::initGUI()
...
@@ -726,8 +726,6 @@ void Clipping::initGUI()
m_planeDrawable
->
getPrecisionDrawing
(
planesPrecision1
,
planesPrecision2
);
m_planeDrawable
->
getPrecisionDrawing
(
planesPrecision1
,
planesPrecision2
);
dock
.
spinBox_GridResolution
->
setValue
(
planesPrecision1
);
dock
.
spinBox_GridResolution
->
setValue
(
planesPrecision1
);
setCallBack
(
dock
.
pushButton_addSphere
,
SIGNAL
(
clicked
()),
SLOT
(
slot_pushButton_addSphere
()));
setCallBack
(
dock
.
pushButton_addSphere
,
SIGNAL
(
clicked
()),
SLOT
(
slot_pushButton_addSphere
()));
setCallBack
(
dock
.
spinBox_SphereResolution
,
SIGNAL
(
valueChanged
(
int
)),
SLOT
(
slot_spinBox_SphereResolution
(
int
)));
setCallBack
(
dock
.
spinBox_SphereResolution
,
SIGNAL
(
valueChanged
(
int
)),
SLOT
(
slot_spinBox_SphereResolution
(
int
)));
...
@@ -737,8 +735,6 @@ void Clipping::initGUI()
...
@@ -737,8 +735,6 @@ void Clipping::initGUI()
m_sphereDrawable
->
getPrecisionDrawing
(
spheresPrecision1
,
spheresPrecision2
);
m_sphereDrawable
->
getPrecisionDrawing
(
spheresPrecision1
,
spheresPrecision2
);
dock
.
spinBox_SphereResolution
->
setValue
(
spheresPrecision1
);
dock
.
spinBox_SphereResolution
->
setValue
(
spheresPrecision1
);
setCallBack
(
dock
.
doubleSpinBox_ColorAttenuationFactor
,
SIGNAL
(
valueChanged
(
double
)),
SLOT
(
slot_doubleSpinBox_ColorAttenuationFactor
(
double
)));
setCallBack
(
dock
.
doubleSpinBox_ColorAttenuationFactor
,
SIGNAL
(
valueChanged
(
double
)),
SLOT
(
slot_doubleSpinBox_ColorAttenuationFactor
(
double
)));
setCallBack
(
dock
.
radioButton_ClippingModeAnd
,
SIGNAL
(
toggled
(
bool
)),
SLOT
(
slot_radioButton_ClippingMode
(
bool
)));
setCallBack
(
dock
.
radioButton_ClippingModeAnd
,
SIGNAL
(
toggled
(
bool
)),
SLOT
(
slot_radioButton_ClippingMode
(
bool
)));
setCallBack
(
dock
.
radioButton_ColorAttenuationModeLinear
,
SIGNAL
(
toggled
(
bool
)),
SLOT
(
slot_radioButton_ColorAttenuationMode
(
bool
)));
setCallBack
(
dock
.
radioButton_ColorAttenuationModeLinear
,
SIGNAL
(
toggled
(
bool
)),
SLOT
(
slot_radioButton_ColorAttenuationMode
(
bool
)));
...
@@ -755,7 +751,6 @@ void Clipping::initGUI()
...
@@ -755,7 +751,6 @@ void Clipping::initGUI()
else
if
(
colorAttMode
==
Utils
::
ClippingShader
::
COLOR_ATTENUATION_MODE_QUADRATIC
)
else
if
(
colorAttMode
==
Utils
::
ClippingShader
::
COLOR_ATTENUATION_MODE_QUADRATIC
)
dock
.
radioButton_ColorAttenuationModeQuadratic
->
setChecked
(
true
);
dock
.
radioButton_ColorAttenuationModeQuadratic
->
setChecked
(
true
);
setCallBack
(
dock
.
PushButton_ApplyStaticClippingPreset
,
SIGNAL
(
clicked
()),
SLOT
(
slot_pushButton_applyStaticClippingPreset
()));
setCallBack
(
dock
.
PushButton_ApplyStaticClippingPreset
,
SIGNAL
(
clicked
()),
SLOT
(
slot_pushButton_applyStaticClippingPreset
()));
dock
.
comboBox_StaticClippingPresets
->
addItem
(
"Dual Planes"
);
dock
.
comboBox_StaticClippingPresets
->
addItem
(
"Dual Planes"
);
...
@@ -763,7 +758,6 @@ void Clipping::initGUI()
...
@@ -763,7 +758,6 @@ void Clipping::initGUI()
dock
.
comboBox_StaticClippingPresets
->
addItem
(
"Tube"
);
dock
.
comboBox_StaticClippingPresets
->
addItem
(
"Tube"
);
dock
.
comboBox_StaticClippingPresets
->
addItem
(
"Molecule"
);
dock
.
comboBox_StaticClippingPresets
->
addItem
(
"Molecule"
);
setCallBack
(
dock
.
PushButton_ApplyAnimatedClippingPreset
,
SIGNAL
(
clicked
()),
SLOT
(
slot_pushButton_applyAnimatedClippingPreset
()));
setCallBack
(
dock
.
PushButton_ApplyAnimatedClippingPreset
,
SIGNAL
(
clicked
()),
SLOT
(
slot_pushButton_applyAnimatedClippingPreset
()));
dock
.
comboBox_AnimatedClippingPresets
->
addItem
(
"Moving Dual Planes"
);
dock
.
comboBox_AnimatedClippingPresets
->
addItem
(
"Moving Dual Planes"
);
...
@@ -777,7 +771,6 @@ void Clipping::initGUI()
...
@@ -777,7 +771,6 @@ void Clipping::initGUI()
// timer used for animation
// timer used for animation
m_timer
=
new
QTimer
(
this
);
m_timer
=
new
QTimer
(
this
);
setCallBack
(
m_timer
,
SIGNAL
(
timeout
()),
SLOT
(
slot_animationTimer
())
);
setCallBack
(
m_timer
,
SIGNAL
(
timeout
()),
SLOT
(
slot_animationTimer
())
);
}
}
void
Clipping
::
cb_Open
()
void
Clipping
::
cb_Open
()
...
@@ -804,7 +797,7 @@ void Clipping::importMesh(std::string& filename)
...
@@ -804,7 +797,7 @@ void Clipping::importMesh(std::string& filename)
return
;
return
;
}
}
else
else
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
position
=
myMap
.
getAttribute
<
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
}
}
else
if
(
extension
==
std
::
string
(
".ts"
))
else
if
(
extension
==
std
::
string
(
".ts"
))
{
{
...
@@ -814,7 +807,7 @@ void Clipping::importMesh(std::string& filename)
...
@@ -814,7 +807,7 @@ void Clipping::importMesh(std::string& filename)
return
;
return
;
}
}
else
else
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
position
=
myMap
.
getAttribute
<
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
}
}
if
(
extension
==
std
::
string
(
".map"
))
if
(
extension
==
std
::
string
(
".map"
))
{
{
...
@@ -824,10 +817,9 @@ void Clipping::importMesh(std::string& filename)
...
@@ -824,10 +817,9 @@ void Clipping::importMesh(std::string& filename)
return
;
return
;
}
}
else
else
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
)
;
position
=
myMap
.
getAttribute
<
VEC3
,
VERTEX
>
(
"position"
)
;
}
}
updateVBOprimitives
(
Algo
::
Render
::
GL2
::
TRIANGLES
|
Algo
::
Render
::
GL2
::
LINES
|
Algo
::
Render
::
GL2
::
POINTS
)
;
updateVBOprimitives
(
Algo
::
Render
::
GL2
::
TRIANGLES
|
Algo
::
Render
::
GL2
::
LINES
|
Algo
::
Render
::
GL2
::
POINTS
)
;
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
m_coeffTopoExplod
[
0
],
m_coeffTopoExplod
[
1
],
m_coeffTopoExplod
[
2
],
allDarts
);
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
m_coeffTopoExplod
[
0
],
m_coeffTopoExplod
[
1
],
m_coeffTopoExplod
[
2
],
allDarts
);
...
@@ -1125,12 +1117,12 @@ int main(int argc, char** argv)
...
@@ -1125,12 +1117,12 @@ int main(int argc, char** argv)
if
(
argc
==
2
)
if
(
argc
==
2
)
{
{
std
::
string
filename
(
argv
[
1
]);
std
::
string
filename
(
argv
[
1
]);
sqt
.
importMesh
(
filename
);
sqt
.
importMesh
(
filename
);
}
}
else
else
{
{
sqt
.
position
=
sqt
.
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
sqt
.
position
=
sqt
.
myMap
.
addAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
"position"
);
Algo
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
sqt
.
myMap
,
sqt
.
position
);
Algo
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
sqt
.
myMap
,
sqt
.
position
);
prim
.
hexaGrid_topo
(
10
,
10
,
10
);
prim
.
hexaGrid_topo
(
10
,
10
,
10
);
prim
.
embedHexaGrid
(
1.0
f
,
1.0
f
,
1.0
f
);
prim
.
embedHexaGrid
(
1.0
f
,
1.0
f
,
1.0
f
);
...
...
Apps/Examples/clipping.h
View file @
ef19be46
...
@@ -77,11 +77,11 @@ class Clipping: public Utils::QT::SimpleQT
...
@@ -77,11 +77,11 @@ class Clipping: public Utils::QT::SimpleQT
public:
public:
typedef
PFP
::
MAP
MAP
;
typedef
PFP
::
MAP
MAP
;
typedef
PFP
::
T
VEC3
T
VEC3
;
typedef
PFP
::
VEC3
VEC3
;
//Manip Carte
//Manip Carte
MAP
myMap
;
MAP
myMap
;
TVEC3
position
;
AttributeHandler
<
VEC3
,
VERTEX
>
position
;
Dart
dglobal
;
Dart
dglobal
;
//Render
//Render
...
...
Apps/Examples/concave_rendering.cpp
View file @
ef19be46
...
@@ -50,7 +50,6 @@ using namespace CGoGN ;
...
@@ -50,7 +50,6 @@ using namespace CGoGN ;
float
Ifont
[
74
*
2
]
=
{
float
Ifont
[
74
*
2
]
=
{
0.145434
f
,
0.126469
f
,
0.141475
f
,
0.096252
f
,
0.133621
f
,
0.0730446
f
,
0.120846
f
,
0.0558913
f
,
0.145434
f
,
0.126469
f
,
0.141475
f
,
0.096252
f
,
0.133621
f
,
0.0730446
f
,
0.120846
f
,
0.0558913
f
,
0.0764256
f
,
0.0359233
f
,
0.0
f
,
0.028701
f
,
0.0
f
,
0.0215257
f
,
0.0
f
,
0.0143506
f
,
0.0
f
,
0.00717529
f
,
0.0
f
,
0.0
f
,
0.0764256
f
,
0.0359233
f
,
0.0
f
,
0.028701
f
,
0.0
f
,
0.0215257
f
,
0.0
f
,
0.0143506
f
,
0.0
f
,
0.00717529
f
,
0.0
f
,
0.0
f
,
0.0560801
f
,
0.0
f
,
0.11216
f
,
0.0
f
,
0.16824
f
,
0.0
f
,
0.22432
f
,
0.0
f
,
0.2804
f
,
0.0
f
,
0.33648
f
,
0.0
f
,
0.39256
f
,
0.0
f
,
0.0560801
f
,
0.0
f
,
0.11216
f
,
0.0
f
,
0.16824
f
,
0.0
f
,
0.22432
f
,
0.0
f
,
0.2804
f
,
0.0
f
,
0.33648
f
,
0.0
f
,
0.39256
f
,
0.0
f
,
0.448641
f
,
0.0
f
,
0.448641
f
,
0.00717529
f
,
0.448641
f
,
0.0143506
f
,
0.448641
f
,
0.0215257
f
,
0.448641
f
,
0.028701
f
,
0.448641
f
,
0.0
f
,
0.448641
f
,
0.00717529
f
,
0.448641
f
,
0.0143506
f
,
0.448641
f
,
0.0215257
f
,
0.448641
f
,
0.028701
f
,
0.406716
f
,
0.0313208
f
,
0.373254
f
,
0.0363483
f
,
0.347367
f
,
0.0446329
f
,
0.328172
f
,
0.0570242
f
,
0.406716
f
,
0.0313208
f
,
0.373254
f
,
0.0363483
f
,
0.347367
f
,
0.0446329
f
,
0.328172
f
,
0.0570242
f
,
...
@@ -127,10 +126,13 @@ struct PFP: public PFP_STANDARD
...
@@ -127,10 +126,13 @@ struct PFP: public PFP_STANDARD
typedef
EmbeddedMap2
MAP
;
typedef
EmbeddedMap2
MAP
;
};
};
typedef
PFP
::
MAP
MAP
;
typedef
PFP
::
VEC3
VEC3
;
// declaration of the map
// declaration of the map
PFP
::
MAP
myMap
;
MAP
myMap
;
// and attribute of position
// and attribute of position
AttributeHandler
<
PFP
::
VEC3
>
position
;
AttributeHandler
<
VEC3
,
VERTEX
>
position
;
unsigned
int
nb_ears
;
unsigned
int
nb_ears
;
...
@@ -241,8 +243,7 @@ void MyQT::cb_keyPress(int code)
...
@@ -241,8 +243,7 @@ void MyQT::cb_keyPress(int code)
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
{
{
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
Dart
d0
=
myMap
.
newFace
(
12
);
Dart
d0
=
myMap
.
newFace
(
12
);
position
[
d0
]
=
PFP
::
VEC3
(
0
,
20
,
0
);
position
[
d0
]
=
PFP
::
VEC3
(
0
,
20
,
0
);
...
@@ -267,8 +268,6 @@ int main(int argc, char **argv)
...
@@ -267,8 +268,6 @@ int main(int argc, char **argv)
d0
=
myMap
.
phi1
(
d0
);
d0
=
myMap
.
phi1
(
d0
);
position
[
d0
]
=
PFP
::
VEC3
(
0
,
30
,
0
);
position
[
d0
]
=
PFP
::
VEC3
(
0
,
30
,
0
);
d0
=
myMap
.
newFace
(
4
);
d0
=
myMap
.
newFace
(
4
);
position
[
d0
]
=
PFP
::
VEC3
(
-
5
,
14
,
-
5
);
position
[
d0
]
=
PFP
::
VEC3
(
-
5
,
14
,
-
5
);
d0
=
myMap
.
phi1
(
d0
);
d0
=
myMap
.
phi1
(
d0
);
...
@@ -279,8 +278,6 @@ int main(int argc, char **argv)
...
@@ -279,8 +278,6 @@ int main(int argc, char **argv)
position
[
d0
]
=
PFP
::
VEC3
(
0
,
20
,
-
5
);
position
[
d0
]
=
PFP
::
VEC3
(
0
,
20
,
-
5
);
d0
=
myMap
.
phi1
(
d0
);
d0
=
myMap
.
phi1
(
d0
);
Dart
d1
=
myMap
.
newFace
(
10
);
Dart
d1
=
myMap
.
newFace
(
10
);
position
[
d1
]
=
PFP
::
VEC3
(
0
,
0
,
0
);
position
[
d1
]
=
PFP
::
VEC3
(
0
,
0
,
0
);
...
@@ -307,7 +304,6 @@ int main(int argc, char **argv)
...
@@ -307,7 +304,6 @@ int main(int argc, char **argv)
d1
=
myMap
.
phi1
(
d1
);
d1
=
myMap
.
phi1
(
d1
);
position
[
d1
]
=
PFP
::
VEC3
(
0
,
8
,
0
);
position
[
d1
]
=
PFP
::
VEC3
(
0
,
8
,
0
);
Dart
d2
=
myMap
.
newFace
(
12
);
Dart
d2
=
myMap
.
newFace
(
12
);
position
[
d2
]
=
PFP
::
VEC3
(
0
,
-
20
,
0
);
position
[
d2
]
=
PFP
::
VEC3
(
0
,
-
20
,
0
);
...
@@ -335,8 +331,6 @@ int main(int argc, char **argv)
...
@@ -335,8 +331,6 @@ int main(int argc, char **argv)
position
[
d2
]
=
PFP
::
VEC3
(
0
,
-
16
,
0
);
position
[
d2
]
=
PFP
::
VEC3
(
0
,
-
16
,
0
);
d2
=
myMap
.
phi1
(
d2
);
d2
=
myMap
.
phi1
(
d2
);
#define NB 32
#define NB 32
//SPIRAL
//SPIRAL
...
@@ -361,7 +355,6 @@ int main(int argc, char **argv)
...
@@ -361,7 +355,6 @@ int main(int argc, char **argv)
d3
=
myMap
.
phi1
(
d3
);
d3
=
myMap
.
phi1
(
d3
);
}
}
//CIRCLE
//CIRCLE
Dart
d6
=
myMap
.
newFace
(
NB
);
Dart
d6
=
myMap
.
newFace
(
NB
);
...
@@ -411,7 +404,6 @@ int main(int argc, char **argv)
...
@@ -411,7 +404,6 @@ int main(int argc, char **argv)
d9
=
myMap
.
phi1
(
d9
);
d9
=
myMap
.
phi1
(
d9
);
}
}
// interface:
// interface:
QApplication
app
(
argc
,
argv
);
QApplication
app
(
argc
,
argv
);
MyQT
sqt
;
MyQT
sqt
;
...
...
Apps/Examples/extrusionView.cpp
View file @
ef19be46
...
@@ -51,7 +51,10 @@ struct PFP: public PFP_STANDARD
...
@@ -51,7 +51,10 @@ struct PFP: public PFP_STANDARD
typedef
EmbeddedMap2
MAP
;
typedef
EmbeddedMap2
MAP
;
};
};
PFP
::
MAP
myMap
;
typedef
PFP
::
MAP
MAP
;
typedef
PFP
::
VEC3
VEC3
;
MAP
myMap
;
void
MyQT
::
cb_initGL
()
void
MyQT
::
cb_initGL
()
{
{
...
@@ -99,7 +102,7 @@ int main(int argc, char **argv)
...
@@ -99,7 +102,7 @@ int main(int argc, char **argv)
QApplication
app
(
argc
,
argv
);
QApplication
app
(
argc
,
argv
);
MyQT
sqt
;
MyQT
sqt
;
PFP
::
TVEC3
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
)
;
AttributeHandler
<
VEC3
,
VERTEX
>
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
)
;
// define the face extruded (here a cross)
// define the face extruded (here a cross)
std
::
vector
<
PFP
::
VEC3
>
objV
;
std
::
vector
<
PFP
::
VEC3
>
objV
;
...
...
Apps/Examples/mcmesh.cpp
View file @
ef19be46
...
@@ -30,8 +30,7 @@ MCMesh::MCMesh() :
...
@@ -30,8 +30,7 @@ MCMesh::MCMesh() :
m_render
(
NULL
),
m_render
(
NULL
),
m_flatShader
(
NULL
),
m_flatShader
(
NULL
),
m_simpleColorShader
(
NULL
)
m_simpleColorShader
(
NULL
)
{
{}
}
void
MCMesh
::
initGUI
()
void
MCMesh
::
initGUI
()
{
{
...
@@ -130,24 +129,18 @@ void MCMesh::slot_drawFaces(bool b)
...
@@ -130,24 +129,18 @@ void MCMesh::slot_drawFaces(bool b)
updateGL
();
updateGL
();
}
}
void
MCMesh
::
MC
()
void
MCMesh
::
MC
()
{
{
myMap
.
clear
(
false
);
myMap
.
clear
(
false
);
// elargir l'image pour le calcul de la courbure
// elargir l'image pour le calcul de la courbure
Algo
::
MC
::
Image
<
DATATYPE
>*
myImgFr
=
myImg
->
addFrame
(
1
);
Algo
::
MC
::
Image
<
DATATYPE
>*
myImgFr
=
myImg
->
addFrame
(
1
);
Algo
::
MC
::
WindowingGreater
<
DATATYPE
>
myWindFunc
;
Algo
::
MC
::
WindowingGreater
<
DATATYPE
>
myWindFunc
;
myWindFunc
.
setIsoValue
(
DATATYPE
(
127
));
myWindFunc
.
setIsoValue
(
DATATYPE
(
127
));
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
position
=
myMap
.
getAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
if
(
!
position
.
isValid
())
if
(
!
position
.
isValid
())
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
// instanciation du mc
// instanciation du mc
Algo
::
MC
::
MarchingCube
<
DATATYPE
,
Algo
::
MC
::
WindowingGreater
,
PFP
>
mc
(
myImgFr
,
&
myMap
,
position
,
myWindFunc
,
false
);
Algo
::
MC
::
MarchingCube
<
DATATYPE
,
Algo
::
MC
::
WindowingGreater
,
PFP
>
mc
(
myImgFr
,
&
myMap
,
position
,
myWindFunc
,
false
);
...
@@ -159,12 +152,8 @@ void MCMesh::MC()
...
@@ -159,12 +152,8 @@ void MCMesh::MC()
updateGL
();
updateGL
();
}
}
void
MCMesh
::
updateRender
()
void
MCMesh
::
updateRender
()
{
{
SelectorDartNoBoundary
<
PFP
::
MAP
>
nb
(
myMap
);
SelectorDartNoBoundary
<
PFP
::
MAP
>
nb
(
myMap
);
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
nb
,
Algo
::
Render
::
GL2
::
LINES
);
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
nb
,
Algo
::
Render
::
GL2
::
LINES
);
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
nb
,
Algo
::
Render
::
GL2
::
TRIANGLES
);
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
nb
,
Algo
::
Render
::
GL2
::
TRIANGLES
);
...
@@ -190,7 +179,9 @@ void MCMesh::sphere()
...
@@ -190,7 +179,9 @@ void MCMesh::sphere()
DATATYPE
*
img
=
new
DATATYPE
[
128
*
128
*
128
];
DATATYPE
*
img
=
new
DATATYPE
[
128
*
128
*
128
];
DATATYPE
*
ptr
=
img
;
DATATYPE
*
ptr
=
img
;
for
(
int
x
=
0
;
x
<
128
;
++
x
)
for
(
int
x
=
0
;
x
<
128
;
++
x
)
{
for
(
int
y
=
0
;
y
<
128
;
++
y
)
for
(
int
y
=
0
;
y
<
128
;
++
y
)
{
for
(
int
z
=
0
;
z
<
128
;
++
z
)
for
(
int
z
=
0
;
z
<
128
;
++
z
)
{
{
Geom
::
Vec3f
V
(
x
-
64
,
y
-
64
,
z
-
64
);
Geom
::
Vec3f
V
(
x
-
64
,
y
-
64
,
z
-
64
);
...
@@ -199,6 +190,8 @@ void MCMesh::sphere()
...
@@ -199,6 +190,8 @@ void MCMesh::sphere()
else
else
*
ptr
++
=
0
;
*
ptr
++
=
0
;
}
}
}
}
myImg
=
new
Algo
::
MC
::
Image
<
DATATYPE
>
(
img
,
128
,
128
,
128
,
1.0
f
,
1.0
f
,
1.0
f
,
false
);
myImg
=
new
Algo
::
MC
::
Image
<
DATATYPE
>
(
img
,
128
,
128
,
128
,
1.0
f
,
1.0
f
,
1.0
f
,
false
);
}
}
...
@@ -235,4 +228,3 @@ int main(int argc, char **argv)
...
@@ -235,4 +228,3 @@ int main(int argc, char **argv)
return
app
.
exec
();
return
app
.
exec
();
}
}
Apps/Examples/mcmesh.h
View file @
ef19be46
...
@@ -52,11 +52,10 @@ struct PFP: public PFP_STANDARD
...
@@ -52,11 +52,10 @@ struct PFP: public PFP_STANDARD
};
};
typedef
PFP
::
MAP
MAP
;
typedef
PFP
::
MAP
MAP
;
typedef
PFP
::
VEC3
VEC3
;
typedef
unsigned
char
DATATYPE
;
typedef
unsigned
char
DATATYPE
;
class
MCMesh
:
public
Utils
::
QT
::
SimpleQT
class
MCMesh
:
public
Utils
::
QT
::
SimpleQT
{
{
Q_OBJECT
Q_OBJECT
...
@@ -67,7 +66,6 @@ public:
...
@@ -67,7 +66,6 @@ public:
Utils
::
QT
::
uiDockInterface
dock
;
Utils
::
QT
::
uiDockInterface
dock
;
float
shininess
;
float
shininess
;
Geom
::
BoundingBox
<
PFP
::
VEC3
>
bb
;
Geom
::
BoundingBox
<
PFP
::
VEC3
>
bb
;
...
@@ -75,7 +73,7 @@ public:
...
@@ -75,7 +73,7 @@ public:
bool
m_drawEdges
;
bool
m_drawEdges
;
bool
m_drawFaces
;
bool
m_drawFaces
;
PFP
::
TVEC3
position
;
AttributeHandler
<
VEC3
,
VERTEX
>
position
;
Algo
::
Render
::
GL2
::
MapRender
*
m_render
;
Algo
::
Render
::
GL2
::
MapRender
*
m_render
;
...
@@ -83,7 +81,6 @@ public:
...
@@ -83,7 +81,6 @@ public:
Utils
::
ShaderFlat
*
m_flatShader
;
Utils
::
ShaderFlat
*
m_flatShader
;
Utils
::
ShaderSimpleColor
*
m_simpleColorShader
;
Utils
::
ShaderSimpleColor
*
m_simpleColorShader
;
DATATYPE
valLabel
;
DATATYPE
valLabel
;
Algo
::
MC
::
Image
<
DATATYPE
>*
myImg
;
Algo
::
MC
::
Image
<
DATATYPE
>*
myImg
;
...
@@ -100,10 +97,7 @@ public:
...
@@ -100,10 +97,7 @@ public:
void
fromFile
(
char
*
fname
);
void
fromFile
(
char
*
fname
);
void
sphere
();
void
sphere
();
public
slots
:
public
slots
:
void
slot_drawEdges
(
bool
b
)
;
void
slot_drawEdges
(
bool
b
)
;
void
slot_drawFaces
(
bool
b
)
;
void
slot_drawFaces
(
bool
b
)
;
};
};
Apps/Examples/simpleGMap2.cpp
View file @
ef19be46
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
SimpleGMap2
::
SimpleGMap2
()
SimpleGMap2
::
SimpleGMap2
()
{
{
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
Dart
d
=
Algo
::
Modelisation
::
createTetrahedron
<
PFP
>
(
myMap
);
Dart
d
=
Algo
::
Modelisation
::
createTetrahedron
<
PFP
>
(
myMap
);
position
[
d
]
=
VEC3
(
0
,
0
,
0
);
position
[
d
]
=
VEC3
(
0
,
0
,
0
);
...
@@ -57,7 +57,6 @@ SimpleGMap2::SimpleGMap2()
...
@@ -57,7 +57,6 @@ SimpleGMap2::SimpleGMap2()
void
SimpleGMap2
::
initGUI
()
void
SimpleGMap2
::
initGUI
()
{
{
}
}
void
SimpleGMap2
::
cb_initGL
()
void
SimpleGMap2
::
cb_initGL
()
...
@@ -80,7 +79,6 @@ void SimpleGMap2::cb_redraw()
...
@@ -80,7 +79,6 @@ void SimpleGMap2::cb_redraw()
Algo
::
Render
::
GL1
::
renderTopoGMD2
<
PFP
>
(
myMap
,
position
,
true
,
true
,
true
,
0.9
f
,
0.9
f
,
0.9
f
);
Algo
::
Render
::
GL1
::
renderTopoGMD2
<
PFP
>
(
myMap
,
position
,
true
,
true
,
true
,
0.9
f
,
0.9
f
,
0.9
f
);
}
}
/**********************************************************************************************
/**********************************************************************************************
* MAIN FUNCTION *
* MAIN FUNCTION *
**********************************************************************************************/
**********************************************************************************************/
...
@@ -97,4 +95,3 @@ int main(int argc, char **argv)
...
@@ -97,4 +95,3 @@ int main(int argc, char **argv)
return
app
.
exec
()
;
return
app
.
exec
()
;
}
}
Apps/Examples/simpleGMap2.h
View file @
ef19be46
...
@@ -51,7 +51,7 @@ class SimpleGMap2 : public Utils::QT::SimpleQT
...
@@ -51,7 +51,7 @@ class SimpleGMap2 : public Utils::QT::SimpleQT
public:
public:
MAP
myMap
;
MAP
myMap
;
PFP
::
TVEC3
position
;
AttributeHandler
<
VEC3
,
VERTEX
>
position
;
SimpleGMap2
()
;
SimpleGMap2
()
;
...
...
Apps/Examples/simpleGMap3.cpp
View file @
ef19be46
...
@@ -30,9 +30,9 @@
...
@@ -30,9 +30,9 @@
SimpleGMap3
::
SimpleGMap3
()
SimpleGMap3
::
SimpleGMap3
()
{
{
position
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
);
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
normal
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"normal"
);
normal
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"normal"
);
volume
=
myMap
.
addAttribute
<
PFP
::
VEC3
>
(
VOLUME
,
"volume"
);
volume
=
myMap
.
addAttribute
<
VEC3
,
VOLUME
>
(
"volume"
);
Algo
::
Modelisation
::
Primitive3D
<
PFP
>
primCat
(
myMap
,
position
);
Algo
::
Modelisation
::
Primitive3D
<
PFP
>
primCat
(
myMap
,
position
);
Dart
d
=
primCat
.
hexaGrid_topo
(
3
,
1
,
1
);
Dart
d
=
primCat
.
hexaGrid_topo
(
3
,
1
,
1
);
...
@@ -88,12 +88,10 @@ SimpleGMap3::SimpleGMap3()
...
@@ -88,12 +88,10 @@ SimpleGMap3::SimpleGMap3()
myMap
.
unsewVolumes
(
d
);
myMap
.
unsewVolumes
(
d
);
myMap
.
check
();
myMap
.
check
();
}
}
void
SimpleGMap3
::
initGUI
()
void
SimpleGMap3
::
initGUI
()
{
{
}
}
void
SimpleGMap3
::
cb_initGL
()
void
SimpleGMap3
::
cb_initGL
()
...
@@ -122,7 +120,6 @@ void SimpleGMap3::cb_redraw()
...
@@ -122,7 +120,6 @@ void SimpleGMap3::cb_redraw()
Algo
::
Render
::
GL1
::
renderTriQuadPoly
<
PFP
>
(
myMap
,
Algo
::
Render
::
GL1
::
LINE
,
1.0
,
position
,
normal
);
Algo
::
Render
::
GL1
::
renderTriQuadPoly
<
PFP
>
(
myMap
,
Algo
::
Render
::
GL1
::
LINE
,
1.0
,
position
,
normal
);
}
}
/**********************************************************************************************
/**********************************************************************************************