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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
KennethVanhoey
CGoGN
Commits
bdb3cd9c
Commit
bdb3cd9c
authored
Feb 20, 2014
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
less warnings
parent
437409f6
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
328 additions
and
332 deletions
+328
-332
Apps/Examples/clipping.cpp
Apps/Examples/clipping.cpp
+1
-1
Apps/Examples/mcmesh.h
Apps/Examples/mcmesh.h
+0
-2
Apps/Examples/simpleGMap3.cpp
Apps/Examples/simpleGMap3.cpp
+1
-1
Apps/Examples/volumeExplorer.cpp
Apps/Examples/volumeExplorer.cpp
+6
-13
Apps/Examples/volumeExplorer.h
Apps/Examples/volumeExplorer.h
+5
-14
Apps/SandBox/multi_att.cpp
Apps/SandBox/multi_att.cpp
+17
-20
include/Algo/Export/export.h
include/Algo/Export/export.h
+7
-7
include/Algo/Export/export.hpp
include/Algo/Export/export.hpp
+16
-17
include/Algo/Import/import.hpp
include/Algo/Import/import.hpp
+2
-2
include/Algo/Parallel/parallel_foreach.hpp
include/Algo/Parallel/parallel_foreach.hpp
+2
-2
include/Algo/Render/GL2/explodeVolumeRender.h
include/Algo/Render/GL2/explodeVolumeRender.h
+0
-1
include/Algo/Render/GL2/explodeVolumeRender.hpp
include/Algo/Render/GL2/explodeVolumeRender.hpp
+16
-11
include/Algo/Render/GL2/topo3PrimalRender.hpp
include/Algo/Render/GL2/topo3PrimalRender.hpp
+4
-4
include/Algo/Render/GL2/topo3Render.h
include/Algo/Render/GL2/topo3Render.h
+40
-20
include/Algo/Render/GL2/topo3Render.hpp
include/Algo/Render/GL2/topo3Render.hpp
+163
-153
include/Algo/Render/GL2/topoRender.h
include/Algo/Render/GL2/topoRender.h
+1
-0
include/Algo/Render/GL2/topoRender.hpp
include/Algo/Render/GL2/topoRender.hpp
+15
-14
include/Topology/generic/autoAttributeHandler.h
include/Topology/generic/autoAttributeHandler.h
+1
-1
include/Topology/generic/cellmarker.h
include/Topology/generic/cellmarker.h
+6
-6
include/Topology/generic/dartmarker.h
include/Topology/generic/dartmarker.h
+5
-5
include/Topology/generic/mapCommon.hpp
include/Topology/generic/mapCommon.hpp
+1
-1
include/Topology/generic/multiAttribs.h
include/Topology/generic/multiAttribs.h
+16
-34
include/Topology/generic/traversor2.hpp
include/Topology/generic/traversor2.hpp
+3
-3
No files found.
Apps/Examples/clipping.cpp
View file @
bdb3cd9c
...
...
@@ -843,7 +843,7 @@ void Clipping::cb_initGL()
// create the render
m_render = new Algo::Render::GL2::MapRender();
m_render_topo
=
new
Algo
::
Render
::
GL2
::
Topo3Render
<
PFP
>
();
m_render_topo = new Algo::Render::GL2::Topo3Render
Map
<PFP>();
// create VBO for position
m_positionVBO = new Utils::VBO();
...
...
Apps/Examples/mcmesh.h
View file @
bdb3cd9c
...
...
@@ -29,7 +29,6 @@
#include "Utils/Qt/qtui.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/map2.h"
#include "Topology/map/embeddedMap2.h"
#include "Geometry/vector_gen.h"
...
...
@@ -66,7 +65,6 @@ class MCMesh : public Utils::QT::SimpleQT
public:
MAP
myMap
;
SelectorTrue
allDarts
;
Utils
::
QT
::
uiDockInterface
dock
;
...
...
Apps/Examples/simpleGMap3.cpp
View file @
bdb3cd9c
...
...
@@ -132,7 +132,7 @@ void SimpleGMap3::cb_initGL()
float
gWidthObj
=
std
::
max
<
float
>
(
std
::
max
<
float
>
(
tailleX
,
tailleY
),
tailleZ
)
;
setParamObject
(
gWidthObj
,
gPosObj
.
data
());
m_render_topo
=
new
Algo
::
Render
::
GL2
::
Topo3Render
<
PFP
>
();
m_render_topo
=
new
Algo
::
Render
::
GL2
::
Topo3Render
GMap
<
PFP
>
();
m_render_topo
->
setDartWidth
(
2.0
f
);
m_render_topo
->
setInitialDartsColor
(
1.0
f
,
1.0
f
,
1.0
f
);
m_render_topo
->
updateData
(
myMap
,
position
,
0.9
f
,
0.9
f
,
0.8
f
);
...
...
Apps/Examples/volumeExplorer.cpp
View file @
bdb3cd9c
...
...
@@ -22,7 +22,6 @@
* *
*******************************************************************************/
#include "volumeExplorer.h"
#include <iostream>
...
...
@@ -35,10 +34,9 @@
#include "Algo/Export/exportVol.h"
PFP
::
MAP
myMap
;
VertexAttribute
<
PFP
::
VEC3
>
position
;
VolumeAttribute
<
PFP
::
VEC3
>
color
;
MAP
myMap
;
VertexAttribute
<
VEC3
,
MAP_IMPL
>
position
;
VolumeAttribute
<
VEC3
,
MAP_IMPL
>
color
;
void
MyQT
::
volumes_onoff
(
bool
/*x*/
)
{
...
...
@@ -59,7 +57,7 @@ void MyQT::topo_onoff(bool /*x*/)
{
// SelectorDartNoBoundary<PFP::MAP> nb(myMap);
//TODO MapBrowser
m_topo_render
->
updateData
<
PFP
>
(
myMap
,
position
,
0.8
f
,
m_explode_factorf
-
0.05
f
,
m_explode_factor
);
m_topo_render
->
updateData
(
myMap
,
position
,
0.8
f
,
m_explode_factorf
-
0.05
f
,
m_explode_factor
);
}
updateGL
();
...
...
@@ -96,7 +94,6 @@ void MyQT::hide_onoff(bool /*x*/)
updateGL
();
}
void
MyQT
::
slider_explode
(
int
x
)
{
m_explode_factor
=
0.01
f
*
(
x
+
1
)
-
0.0001
f
;
...
...
@@ -111,7 +108,6 @@ void MyQT::slider_explodeF(int x)
updateGL
();
}
void
MyQT
::
slider_pressed
()
{
render_topoTemp
=
render_topo
;
...
...
@@ -119,10 +115,8 @@ void MyQT::slider_pressed()
updateGL
();
}
void
MyQT
::
slider_released
()
{
render_topo
=
render_topoTemp
;
if
(
render_topo
)
{
...
...
@@ -190,7 +184,7 @@ void MyQT::cb_Open()
}
// SelectorDartNoBoundary<PFP::MAP> nb(myMap);
m_topo_render
->
updateData
<
PFP
>
(
myMap
,
position
,
0.8
f
,
0.8
f
,
0.8
f
);
m_topo_render
->
updateData
(
myMap
,
position
,
0.8
f
,
0.8
f
,
0.8
f
);
m_explode_render
->
updateData
<
PFP
>
(
myMap
,
position
,
color
);
updateGL
()
;
...
...
@@ -206,14 +200,13 @@ void MyQT::cb_Save()
Algo
::
Volume
::
Export
::
exportMesh
<
PFP
>
(
myMap
,
position
,
filename
);
}
void
MyQT
::
cb_initGL
()
{
// choose to use GL version 2
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
);
// create the renders
m_topo_render
=
new
Algo
::
Render
::
GL2
::
Topo3Render
();
m_topo_render
=
new
Algo
::
Render
::
GL2
::
Topo3RenderMap
<
PFP
>
();
m_explode_render
=
new
Algo
::
Render
::
GL2
::
ExplodeVolumeRender
(
true
,
true
,
true
);
// SelectorDartNoBoundary<PFP::MAP> nb(myMap);
...
...
Apps/Examples/volumeExplorer.h
View file @
bdb3cd9c
...
...
@@ -24,17 +24,10 @@
#ifndef __TUTO5_
#define __TUTO5_
#include <iostream>
// #define WITH_GMAP 1
#include "Topology/generic/parameters.h"
#ifdef WITH_GMAP
#include "Topology/gmap/embeddedGMap3.h"
#else
#include "Topology/map/embeddedMap3.h"
#endif
#include "Topology/map/embeddedMap3.h"
#include "Geometry/vector_gen.h"
#include "Algo/Geometry/boundingbox.h"
...
...
@@ -56,17 +49,15 @@ using namespace CGoGN ;
struct
PFP
:
public
PFP_STANDARD
{
// definition de la carte
#ifdef WITH_GMAP
typedef
EmbeddedGMap3
MAP
;
#else
typedef
EmbeddedMap3
MAP
;
#endif
};
typedef
PFP
::
MAP
MAP
;
typedef
PFP
::
MAP
::
IMPL
MAP_IMPL
;
typedef
PFP
::
VEC3
VEC3
;
using
namespace
CGoGN
;
/**
* Utilisation de designer-qt4:
* Faire un DockWiget (laisser le nom par defaut
...
...
@@ -85,7 +76,7 @@ class MyQT: public Utils::QT::SimpleQT
bool
clip_volume
;
bool
hide_clipping
;
Algo
::
Render
::
GL2
::
Topo3Render
*
m_topo_render
;
Algo
::
Render
::
GL2
::
Topo3Render
Map
<
PFP
>
*
m_topo_render
;
Algo
::
Render
::
GL2
::
ExplodeVolumeRender
*
m_explode_render
;
float
m_explode_factor
;
...
...
Apps/SandBox/multi_att.cpp
View file @
bdb3cd9c
...
...
@@ -50,6 +50,11 @@ struct PFP: public PFP_STANDARD
typedef
EmbeddedMap2
MAP
;
};
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
MAP
::
IMPL
MAP_IMPL
;
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
VEC4
VEC4
;
/**
* Simple example of function that work with generic type of attribute
*/
...
...
@@ -59,7 +64,6 @@ typename V_ATT::DATA_TYPE smooth(typename PFP::MAP& map, Dart d, const V_ATT& at
typename
V_ATT
::
DATA_TYPE
res
(
0
);
int
count
=
0
;
if
(
attributs
.
getOrbit
()
==
VERTEX
)
{
Traversor2VVaE
<
typename
PFP
::
MAP
>
tra
(
map
,
d
);
...
...
@@ -86,7 +90,6 @@ typename V_ATT::DATA_TYPE smooth(typename PFP::MAP& map, Dart d, const V_ATT& at
return
res
;
}
template
<
typename
PFP
,
typename
V_ATT
>
void
applySmooth
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
att_in
,
V_ATT
&
att_out
)
{
...
...
@@ -111,11 +114,6 @@ void applySmooth(typename PFP::MAP& map, const V_ATT& att_in, V_ATT& att_out)
CGoGNerr
<<
"unsupported orbit"
<<
CGoGNendl
;
}
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
!=
3
)
...
...
@@ -131,31 +129,30 @@ int main(int argc, char **argv)
iss
>>
nbSteps
;
// declaration of the map
PFP
::
MAP
myMap
;
MAP
myMap
;
std
::
vector
<
std
::
string
>
attrNames
;
Algo
::
Surface
::
Import
::
importMesh
<
PFP
>
(
myMap
,
argv
[
1
],
attrNames
);
// get a handler to the 3D vector attribute created by the import
VertexAttribute
<
PFP
::
VEC3
>
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
]);
VertexAttribute
<
PFP
::
VEC3
>
pos2
=
myMap
.
addAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
"pos2"
);
VertexAttribute
<
PFP
::
VEC4
>
vc
=
myMap
.
addAttribute
<
PFP
::
VEC4
,
VERTEX
>
(
"vertexColor"
);
VertexAttribute
<
PFP
::
VEC4
>
vc2
=
myMap
.
addAttribute
<
PFP
::
VEC4
,
VERTEX
>
(
"vertexColor2"
);
VertexAttribute
<
VEC3
,
MAP_IMPL
>
position
=
myMap
.
getAttribute
<
VEC3
,
VERTEX
>
(
attrNames
[
0
]);
VertexAttribute
<
VEC3
,
MAP_IMPL
>
pos2
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"pos2"
);
VertexAttribute
<
VEC4
,
MAP_IMPL
>
vc
=
myMap
.
addAttribute
<
VEC4
,
VERTEX
>
(
"vertexColor"
);
VertexAttribute
<
VEC4
,
MAP_IMPL
>
vc2
=
myMap
.
addAttribute
<
VEC4
,
VERTEX
>
(
"vertexColor2"
);
// classic usage with simple vertex attributes
applySmooth
<
PFP
>
(
myMap
,
position
,
pos2
);
applySmooth
<
PFP
>
(
myMap
,
position
,
pos2
);
// multi attributes usage
Vertex2Attributes
<
PFP
::
VEC3
,
PFP
::
VEC4
>
pv_in
(
position
,
vc
);
Vertex2Attributes
<
PFP
::
VEC3
,
PFP
::
VEC4
>
pv_out
(
pos2
,
vc2
);
applySmooth
<
PFP
>
(
myMap
,
pv_in
,
pv_out
);
Vertex2Attributes
<
VEC3
,
VEC4
,
MAP_IMPL
>
pv_in
(
position
,
vc
);
Vertex2Attributes
<
VEC3
,
VEC4
,
MAP_IMPL
>
pv_out
(
pos2
,
vc2
);
applySmooth
<
PFP
>
(
myMap
,
pv_in
,
pv_out
);
// usage with with a face attribute
FaceAttribute
<
PFP
::
VEC4
>
fc
=
myMap
.
addAttribute
<
PFP
::
VEC4
,
FACE
>
(
"faceColor"
);
FaceAttribute
<
PFP
::
VEC4
>
fc2
=
myMap
.
addAttribute
<
PFP
::
VEC4
,
FACE
>
(
"faceColor2"
);
applySmooth
<
PFP
>
(
myMap
,
fc
,
fc2
);
FaceAttribute
<
VEC4
,
MAP_IMPL
>
fc
=
myMap
.
addAttribute
<
VEC4
,
FACE
>
(
"faceColor"
);
FaceAttribute
<
VEC4
,
MAP_IMPL
>
fc2
=
myMap
.
addAttribute
<
VEC4
,
FACE
>
(
"faceColor2"
);
applySmooth
<
PFP
>
(
myMap
,
fc
,
fc2
);
//// for(unsigned int i = 0; i < nbSteps; ++i)
...
...
include/Algo/Export/export.h
View file @
bdb3cd9c
...
...
@@ -52,7 +52,7 @@ namespace Export
* @return true
*/
template
<
typename
PFP
>
bool
exportPLY
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
char
*
filename
,
const
bool
binary
)
;
bool
exportPLY
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
const
char
*
filename
,
const
bool
binary
)
;
/**
* export the map into a PLY file
...
...
@@ -63,7 +63,7 @@ bool exportPLY(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>
* @return true
*/
template
<
typename
PFP
>
bool
exportPLYnew
(
typename
PFP
::
MAP
&
map
,
const
std
::
vector
<
VertexAttribute
<
typename
PFP
::
VEC3
>*
>&
attributeHandlers
,
const
char
*
filename
,
const
bool
binary
)
;
bool
exportPLYnew
(
typename
PFP
::
MAP
&
map
,
const
std
::
vector
<
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>*
>&
attributeHandlers
,
const
char
*
filename
,
const
bool
binary
)
;
/**
* export the map into a OFF file
...
...
@@ -72,7 +72,7 @@ bool exportPLYnew(typename PFP::MAP& map, const std::vector<VertexAttribute<type
* @return true
*/
template
<
typename
PFP
>
bool
exportOFF
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
char
*
filename
)
;
bool
exportOFF
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
const
char
*
filename
)
;
/**
* export the map into a OBJ file
...
...
@@ -81,7 +81,7 @@ bool exportOFF(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>
* @return true
*/
template
<
typename
PFP
>
bool
exportOBJ
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
char
*
filename
)
;
bool
exportOBJ
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
const
char
*
filename
)
;
/**
* export the map into a Trian file
...
...
@@ -90,7 +90,7 @@ bool exportOBJ(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>
* @return true
*/
template
<
typename
PFP
>
bool
exportTrian
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
char
*
filename
)
;
bool
exportTrian
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
char
*
filename
)
;
...
...
@@ -160,12 +160,12 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const VertexAttr
* @return
*/
template
<
typename
PFP
>
bool
exportChoupi
(
typename
PFP
::
MAP
&
map
,
const
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>&
position
,
const
char
*
filename
)
;
bool
exportChoupi
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
const
char
*
filename
)
;
}
// namespace Export
}
}
// namespace Surface
}
// namespace Algo
...
...
include/Algo/Export/export.hpp
View file @
bdb3cd9c
...
...
@@ -43,7 +43,7 @@ namespace Export
{
template
<
typename
PFP
>
bool
exportPLY
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
char
*
filename
,
bool
binary
)
bool
exportPLY
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
const
char
*
filename
,
bool
binary
)
{
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
VEC3
VEC3
;
...
...
@@ -72,7 +72,7 @@ bool exportPLY(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>
vertices
.
reserve
(
nbDarts
/
6
)
;
// Go over all faces
CellMarker
<
VERTEX
>
markV
(
map
)
;
CellMarker
<
MAP
,
VERTEX
>
markV
(
map
)
;
TraversorF
<
MAP
>
t
(
map
)
;
for
(
Dart
d
=
t
.
begin
();
d
!=
t
.
end
();
d
=
t
.
next
())
{
...
...
@@ -170,9 +170,10 @@ bool exportPLY(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>
}
template
<
typename
PFP
>
bool
exportPLYnew
(
typename
PFP
::
MAP
&
map
,
const
std
::
vector
<
VertexAttribute
<
typename
PFP
::
VEC3
>*>&
attributeHandlers
,
const
char
*
filename
,
bool
binary
)
bool
exportPLYnew
(
typename
PFP
::
MAP
&
map
,
const
std
::
vector
<
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>*>&
attributeHandlers
,
const
char
*
filename
,
bool
binary
)
{
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
MAP
::
IMPL
MAP_IMPL
;
typedef
typename
PFP
::
VEC3
VEC3
;
// open file
...
...
@@ -199,14 +200,14 @@ bool exportPLYnew(typename PFP::MAP& map, const std::vector<VertexAttribute<type
vertices
.
reserve
(
nbDarts
/
6
)
;
// Go over all faces
CellMarker
<
VERTEX
>
markV
(
map
)
;
CellMarker
<
MAP
,
VERTEX
>
markV
(
map
)
;
TraversorF
<
MAP
>
t
(
map
)
;
for
(
Dart
d
=
t
.
begin
();
d
!=
t
.
end
();
d
=
t
.
next
())
{
std
::
vector
<
unsigned
int
>
fidx
;
fidx
.
reserve
(
8
)
;
unsigned
int
degree
=
0
;
Traversor2FV
<
typename
PFP
::
MAP
>
tfv
(
map
,
d
)
;
Traversor2FV
<
MAP
>
tfv
(
map
,
d
)
;
for
(
Dart
it
=
tfv
.
begin
();
it
!=
tfv
.
end
();
it
=
tfv
.
next
())
{
++
degree
;
...
...
@@ -246,7 +247,7 @@ bool exportPLYnew(typename PFP::MAP& map, const std::vector<VertexAttribute<type
out
<<
"comment or contact : cgogn@unistra.fr"
<<
std
::
endl
;
// Vertex elements
out
<<
"element vertex "
<<
vertices
.
size
()
<<
std
::
endl
;
for
(
typename
std
::
vector
<
VertexAttribute
<
typename
PFP
::
VEC3
>*
>::
const_iterator
attrHandler
=
attributeHandlers
.
begin
()
;
attrHandler
!=
attributeHandlers
.
end
()
;
++
attrHandler
)
for
(
typename
std
::
vector
<
VertexAttribute
<
VEC3
,
MAP_IMPL
>*
>::
const_iterator
attrHandler
=
attributeHandlers
.
begin
()
;
attrHandler
!=
attributeHandlers
.
end
()
;
++
attrHandler
)
{
if
((
*
attrHandler
)
->
isValid
()
&&
((
*
attrHandler
)
->
getOrbit
()
==
VERTEX
)
)
{
...
...
@@ -287,7 +288,7 @@ bool exportPLYnew(typename PFP::MAP& map, const std::vector<VertexAttribute<type
// ascii vertices
for
(
unsigned
int
i
=
0
;
i
<
vertices
.
size
();
++
i
)
{
for
(
typename
std
::
vector
<
VertexAttribute
<
typename
PFP
::
VEC3
>*
>::
const_iterator
attrHandler
=
attributeHandlers
.
begin
()
;
attrHandler
!=
attributeHandlers
.
end
()
;
++
attrHandler
)
for
(
typename
std
::
vector
<
VertexAttribute
<
VEC3
,
MAP_IMPL
>*
>::
const_iterator
attrHandler
=
attributeHandlers
.
begin
()
;
attrHandler
!=
attributeHandlers
.
end
()
;
++
attrHandler
)
if
((
*
attrHandler
)
->
isValid
()
&&
(
*
attrHandler
)
->
getOrbit
()
==
VERTEX
)
out
<<
(
*
(
*
attrHandler
))[
vertices
[
i
]]
;
out
<<
std
::
endl
;
...
...
@@ -306,10 +307,10 @@ bool exportPLYnew(typename PFP::MAP& map, const std::vector<VertexAttribute<type
{
// binary vertices
for
(
unsigned
int
i
=
0
;
i
<
vertices
.
size
();
++
i
)
for
(
typename
std
::
vector
<
VertexAttribute
<
typename
PFP
::
VEC3
>*>::
const_iterator
attrHandler
=
attributeHandlers
.
begin
()
;
attrHandler
!=
attributeHandlers
.
end
()
;
++
attrHandler
)
for
(
typename
std
::
vector
<
VertexAttribute
<
VEC3
,
MAP_IMPL
>*>::
const_iterator
attrHandler
=
attributeHandlers
.
begin
()
;
attrHandler
!=
attributeHandlers
.
end
()
;
++
attrHandler
)
if
((
*
attrHandler
)
->
isValid
()
&&
(
*
attrHandler
)
->
getOrbit
()
==
VERTEX
)
{
const
typename
PFP
::
VEC3
&
v
=
(
*
(
*
attrHandler
))[
vertices
[
i
]]
;
const
VEC3
&
v
=
(
*
(
*
attrHandler
))[
vertices
[
i
]]
;
out
.
write
((
char
*
)(
&
(
v
[
0
])),
sizeof
(
v
))
;
}
...
...
@@ -328,7 +329,7 @@ bool exportPLYnew(typename PFP::MAP& map, const std::vector<VertexAttribute<type
}
template
<
typename
PFP
>
bool
exportOFF
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
>&
position
,
const
char
*
filename
)
bool
exportOFF
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
const
char
*
filename
)
{
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
VEC3
VEC3
;
...
...
@@ -350,7 +351,7 @@ bool exportOFF(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>
std
::
vector
<
unsigned
int
>
vertices
;
vertices
.
reserve
(
nbDarts
/
6
)
;
CellMarker
<
VERTEX
>
markV
(
map
)
;
CellMarker
<
MAP
,
VERTEX
>
markV
(
map
)
;
TraversorF
<
MAP
>
t
(
map
)
;
for
(
Dart
d
=
t
.
begin
();
d
!=
t
.
end
();
d
=
t
.
next
())
{
...
...
@@ -986,7 +987,7 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const VertexAttr
*/
template
<
typename
PFP
>
bool
exportChoupi
(
typename
PFP
::
MAP
&
map
,
const
AttributeHandler
<
typename
PFP
::
VEC3
,
VERTEX
>&
position
,
const
char
*
filename
)
bool
exportChoupi
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
::
IMPL
>&
position
,
const
char
*
filename
)
{
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
VEC3
VEC3
;
...
...
@@ -1000,13 +1001,13 @@ bool exportChoupi(typename PFP::MAP& map, const AttributeHandler<typename PFP::V
out
<<
map
.
template
getNbOrbits
<
VERTEX
>()
<<
" "
<<
map
.
template
getNbOrbits
<
EDGE
>()
<<
std
::
endl
;
TraversorV
<
typename
PFP
::
MAP
>
travV
(
map
);
TraversorV
<
MAP
>
travV
(
map
);
for
(
Dart
dit
=
travV
.
begin
()
;
dit
!=
travV
.
end
()
;
dit
=
travV
.
next
())
{
out
<<
map
.
template
getEmbedding
<
VERTEX
>(
dit
)
<<
" "
<<
position
[
dit
]
<<
std
::
endl
;
}
TraversorE
<
typename
PFP
::
MAP
>
travE
(
map
);
TraversorE
<
MAP
>
travE
(
map
);
unsigned
int
indexE
=
0
;
for
(
Dart
dit
=
travE
.
begin
()
;
dit
!=
travE
.
end
()
;
dit
=
travE
.
next
())
{
...
...
@@ -1018,11 +1019,9 @@ bool exportChoupi(typename PFP::MAP& map, const AttributeHandler<typename PFP::V
return
true
;
}
}
// namespace Export
}
}
// namespace Surface
}
// namespace Algo
...
...
include/Algo/Import/import.hpp
View file @
bdb3cd9c
...
...
@@ -117,7 +117,7 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
if
(
good_dart
==
map
.
phi2
(
good_dart
))
{
map
.
sewFaces
(
d
,
good_dart
,
false
);
m
.
unmarkOrbit
<
EDGE
>
(
d
);
m
.
template
unmarkOrbit
<
EDGE
>(
d
);
}
else
{
...
...
@@ -132,7 +132,7 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
if
(
good_dart
==
NIL
)
{
m
.
unmarkOrbit
<
EDGE
>
(
d
);
m
.
template
unmarkOrbit
<
EDGE
>(
d
);
++
nbBoundaryEdges
;
}
}
...
...
include/Algo/Parallel/parallel_foreach.hpp
View file @
bdb3cd9c
...
...
@@ -221,7 +221,7 @@ void foreach_cell(MAP& map, std::vector<FunctorMapThreaded<MAP>*>& funcs, bool n
{
if
((
!
map
.
template
isBoundaryMarked
<
MAP
::
DIMENSION
>(
d
))
&&
(
!
dmark
->
isMarked
(
d
)))
{
dmark
->
markOrbit
<
ORBIT
>
(
d
);
dmark
->
template
markOrbit
<
ORBIT
>(
d
);
vd
[
nb
%
nbth
].
push_back
(
d
);
nb
++
;
}
...
...
@@ -315,7 +315,7 @@ void foreach_cell(MAP& map, std::vector<FunctorMapThreaded<MAP>*>& funcs, bool n
{
if
((
!
map
.
template
isBoundaryMarked
<
MAP
::
DIMENSION
>(
d
))
&&
(
!
dmark
->
isMarked
(
d
)))
{
dmark
->
markOrbit
<
ORBIT
>
(
d
);
dmark
->
template
markOrbit
<
ORBIT
>(
d
);
tempo
[
nb
%
nbth
].
push_back
(
d
);
nb
++
;
}
...
...
include/Algo/Render/GL2/explodeVolumeRender.h
View file @
bdb3cd9c
...
...
@@ -162,7 +162,6 @@ public:
template
<
typename
PFP
,
typename
V_ATT
,
typename
W_ATT
>
void
updateData
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
positions
,
const
W_ATT
&
colorPerFace
)
;
/**
* draw edges
*/
...
...
include/Algo/Render/GL2/explodeVolumeRender.hpp
View file @
bdb3cd9c
...
...
@@ -138,23 +138,23 @@ void ExplodeVolumeRender::computeFace(typename PFP::MAP& map, Dart d, const EMBV
}
}
//template<typename PFP>
//void ExplodeVolumeRender::updateSmooth(typename PFP::MAP& map, const VertexAttribute<typename PFP::VEC3>& positions, const VolumeAttribute<typename PFP::VEC3>& colorPerXXX)
//{
// updateSmoothGen<PFP, VertexAttribute<typename PFP::VEC3>, typename PFP::VEC3>(map,positions,colorPerXXX);
//}
template
<
typename
PFP
,
typename
V_ATT
,
typename
W_ATT
>
void
ExplodeVolumeRender
::
updateSmooth
(
typename
PFP
::
MAP
&
map
,
const
V_ATT
&
positions
,
const
W_ATT
&
colorPerXXX
)
{
typedef
typename
V_ATT
::
DATA_TYPE
VEC3
;
typedef
typename
W_ATT
::
DATA_TYPE
COL3
;
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
MAP
::
IMPL
MAP_IMPL
;
typedef
typename
PFP
::
REAL
REAL
;
typedef
Geom
::
Vec3f
VEC3F
;
VolumeAutoAttribute
<
VEC3
>
centerVolumes
(
map
,
"centerVolumes"
);
VolumeAutoAttribute
<
VEC3
,
MAP_IMPL
>
centerVolumes
(
map
,
"centerVolumes"
);
Algo
::
Volume
::
Geometry
::
Parallel
::
computeCentroidELWVolumes
<
PFP
>
(
map
,
positions
,
centerVolumes
);
std
::
vector
<
VEC3F
>
buffer
;
...
...
@@ -170,8 +170,7 @@ void ExplodeVolumeRender::updateSmooth(typename PFP::MAP& map, const V_ATT& posi
std
::
vector
<
VEC3
>
vertices
;
vertices
.
reserve
(
20
);
TraversorCell
<
typename
PFP
::
MAP
,
PFP
::
MAP
::
FACE_OF_PARENT
>
traFace
(
map
);
TraversorCell
<
MAP
,
MAP
::
FACE_OF_PARENT
>
traFace
(
map
);
for
(
Dart
d
=
traFace
.
begin
();
d
!=
traFace
.
end
();
d
=
traFace
.
next
())
{
...
...
@@ -285,10 +284,12 @@ template<typename PFP, typename EMBV>
void
ExplodeVolumeRender
::
updateSmooth
(
typename
PFP
::
MAP
&
map
,
const
EMBV
&
positions
)
{
typedef
typename
EMBV
::
DATA_TYPE
VEC3
;
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
MAP
::
IMPL
MAP_IMPL
;
typedef
typename
PFP
::
REAL
REAL
;
typedef
typename
Geom
::
Vec3f
VEC3F
;
VolumeAutoAttribute
<
VEC3
>
centerVolumes
(
map
,
"centerVolumes"
);
VolumeAutoAttribute
<
VEC3
,
MAP_IMPL
>
centerVolumes
(
map
,
"centerVolumes"
);
Algo
::
Volume
::
Geometry
::
Parallel
::
computeCentroidELWVolumes
<
PFP
>
(
map
,
positions
,
centerVolumes
);
std
::
vector
<
VEC3F
>
buffer
;
...
...
@@ -304,7 +305,7 @@ void ExplodeVolumeRender::updateSmooth(typename PFP::MAP& map, const EMBV& posit
std
::
vector
<
VEC3
>
vertices
;
bufferNormals
.
reserve
(
20
);
TraversorCell
<
typename
PFP
::
MAP
,
PFP
::
MAP
::
FACE_OF_PARENT
>
traFace
(
map
);
TraversorCell
<
MAP
,
MAP
::
FACE_OF_PARENT
>
traFace
(
map
);
for
(
Dart
d
=
traFace
.
begin
();
d
!=
traFace
.
end
();
d
=
traFace
.
next
())
{
...
...
@@ -431,10 +432,12 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, const V_ATT& positi
//typedef typename PFP::VEC3 VEC3;
typedef
typename
V_ATT
::
DATA_TYPE
VEC3
;
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
MAP
::
IMPL
MAP_IMPL
;
typedef
typename
PFP
::
REAL
REAL
;
typedef
Geom
::
Vec3f
VEC3F
;
VolumeAutoAttribute
<
VEC3
>
centerVolumes
(
map
,
"centerVolumes"
);
VolumeAutoAttribute
<
VEC3
,
MAP_IMPL
>
centerVolumes
(
map
,
"centerVolumes"
);
Algo
::
Volume
::
Geometry
::
Parallel
::
computeCentroidELWVolumes
<
PFP
>
(
map
,
positions
,
centerVolumes
);
std
::
vector
<
VEC3F
>
buffer
;
...
...
@@ -444,7 +447,7 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, const V_ATT& positi
bufferColors
.
reserve
(
16384
);
TraversorCell
<
typename
PFP
::
MAP
,
PFP
::
MAP
::
FACE_OF_PARENT
>
traFace
(
map
);
TraversorCell
<
MAP
,
MAP
::
FACE_OF_PARENT
>
traFace
(
map
);
for
(
Dart
d
=
traFace
.
begin
();
d
!=
traFace
.
end
();
d
=
traFace
.
next
())
{
...
...
@@ -541,10 +544,12 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, const EMBV& positio
}
typedef
typename
EMBV
::
DATA_TYPE
VEC3
;
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
MAP
::
IMPL
MAP_IMPL
;
typedef
typename
PFP
::
REAL
REAL
;
typedef
Geom
::
Vec3f
VEC3F
;
VolumeAutoAttribute
<
VEC3
>
centerVolumes
(
map
,
"centerVolumes"
);
VolumeAutoAttribute
<
VEC3
,
MAP_IMPL
>
centerVolumes
(
map
,
"centerVolumes"
);
Algo
::
Volume
::
Geometry
::
Parallel
::
computeCentroidELWVolumes
<
PFP
>
(
map
,
positions
,
centerVolumes
);
std
::
vector
<
VEC3F
>
buffer
;
...
...
@@ -553,7 +558,7 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, const EMBV& positio
std
::
vector
<
VEC3F
>
bufferColors
;
bufferColors
.
reserve
(
16384
);
TraversorCell
<
typename
PFP
::
MAP
,
PFP
::
MAP
::
FACE_OF_PARENT
>
traFace
(
map
);
TraversorCell
<
MAP
,
MAP
::
FACE_OF_PARENT
>
traFace
(
map
);
for
(
Dart
d
=
traFace
.
begin
();
d
!=
traFace
.
end
();
d
=
traFace
.
next
())
{
...
...
include/Algo/Render/GL2/topo3PrimalRender.hpp
View file @
bdb3cd9c
...
...
@@ -393,7 +393,7 @@ void Topo3PrimalRender<PFP>::setDartsIdColor(typename PFP::MAP& map)
}
template
<
typename
PFP
>
void
Topo3PrimalRender
<
PFP
>::
updateColors
(
typename
PFP
::
MAP
&
map
,
const
VertexAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
colors
)
void
Topo3PrimalRender
<
PFP
>::
updateColors
(
MAP
&
map
,
const
VertexAttribute
<
VEC3
,
MAP_IMPL
>&
colors
)
{
m_vbo2
->
bind
();
Geom
::
Vec3f
*
colorBuffer
=
reinterpret_cast
<
Geom
::
Vec3f
*>
(
glMapBuffer
(
GL_ARRAY_BUFFER
,
GL_READ_WRITE
));
...
...
@@ -543,14 +543,14 @@ void Topo3PrimalRender<PFP>::updateData(MAP& mapx, const VertexAttribute<VEC3, M
glUnmapBuffer
(
GL_ARRAY_BUFFER
);
m_vbo0
->
bind
();
glBufferData
(
GL_ARRAY_BUFFER
,
2
*
m_nbDarts
*
sizeof
(
VEC3F
),
m_bufferDartPosition
,
GL_STREAM_DRAW
);
glBufferData
(
GL_ARRAY_BUFFER
,
2
*
m_nbDarts
*
sizeof
(
Geom
::
Vec3f
),
m_bufferDartPosition
,
GL_STREAM_DRAW
);
// alpha2
m_vbo1
->
bind
();
glBufferData
(
GL_ARRAY_BUFFER
,
2
*
m_nbDarts
*
sizeof
(
VEC3F
),
0
,
GL_STREAM_DRAW
);
glBufferData
(
GL_ARRAY_BUFFER
,
2
*
m_nbDarts
*
sizeof
(
Geom
::
Vec3f
),
0
,
GL_STREAM_DRAW
);
GLvoid
*
PositionBuffer2
=
glMapBufferARB
(
GL_ARRAY_BUFFER
,
GL_READ_WRITE
);
VEC3F
*
positionF2
=
reinterpret_cast
<
VEC3F
*>
(
PositionBuffer2
);
Geom
::
Vec3f
*
positionF2
=
reinterpret_cast
<
Geom
::
Vec3f
*>
(
PositionBuffer2
);
m_nbRel2
=
0
;
...
...
include/Algo/Render/GL2/topo3Render.h