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
16c584ca
Commit
16c584ca
authored
Dec 20, 2013
by
CGoGN
Browse files
Options
Browse Files
Download
Plain Diff
Merge /home/untereiner/CGoGN
parents
193852a3
fd9a5728
Changes
62
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
62 changed files
with
44604 additions
and
2133 deletions
+44604
-2133
Apps/Examples/clipping.cpp
Apps/Examples/clipping.cpp
+21
-30
Apps/Examples/simpleGMap3.cpp
Apps/Examples/simpleGMap3.cpp
+93
-60
Apps/Examples/simpleGMap3.h
Apps/Examples/simpleGMap3.h
+1
-1
Apps/Examples/simpleMap3.cpp
Apps/Examples/simpleMap3.cpp
+88
-28
Apps/Examples/simpleMap3.h
Apps/Examples/simpleMap3.h
+3
-0
Apps/Examples/volumeExplorer.cpp
Apps/Examples/volumeExplorer.cpp
+3
-3
SCHNApps/Plugins/CMakeLists.txt
SCHNApps/Plugins/CMakeLists.txt
+3
-0
SCHNApps/Plugins/volume_import/CMakeLists.txt
SCHNApps/Plugins/volume_import/CMakeLists.txt
+3
-3
SCHNApps/Plugins/volume_import/include/volume_import.h
SCHNApps/Plugins/volume_import/include/volume_import.h
+40
-0
SCHNApps/Plugins/volume_import/src/volume_import.cpp
SCHNApps/Plugins/volume_import/src/volume_import.cpp
+10
-12
SCHNApps/Plugins/volume_render/CMakeLists.txt
SCHNApps/Plugins/volume_render/CMakeLists.txt
+4
-4
SCHNApps/Plugins/volume_render/forms/volume_render.ui
SCHNApps/Plugins/volume_render/forms/volume_render.ui
+0
-0
SCHNApps/Plugins/volume_render/include/volume_render.h
SCHNApps/Plugins/volume_render/include/volume_render.h
+105
-0
SCHNApps/Plugins/volume_render/include/volume_render_dockTab.h
...pps/Plugins/volume_render/include/volume_render_dockTab.h
+48
-0
SCHNApps/Plugins/volume_render/src/volume_render.cpp
SCHNApps/Plugins/volume_render/src/volume_render.cpp
+131
-0
SCHNApps/Plugins/volume_render/src/volume_render_dockTab.cpp
SCHNApps/Plugins/volume_render/src/volume_render_dockTab.cpp
+106
-0
SCHNApps/Plugins/volume_renderExplod/include/renderExplod.h
SCHNApps/Plugins/volume_renderExplod/include/renderExplod.h
+0
-110
SCHNApps/Plugins/volume_renderExplod/include/renderExplodDockTab.h
...Plugins/volume_renderExplod/include/renderExplodDockTab.h
+0
-47
SCHNApps/Plugins/volume_renderExplod/src/renderExplod.cpp
SCHNApps/Plugins/volume_renderExplod/src/renderExplod.cpp
+0
-383
SCHNApps/Plugins/volume_renderExplod/src/renderExplodDockTab.cpp
...s/Plugins/volume_renderExplod/src/renderExplodDockTab.cpp
+0
-177
ThirdParty/CMakeLists.txt
ThirdParty/CMakeLists.txt
+3
-2
ThirdParty/tetgen/CMakeLists.txt
ThirdParty/tetgen/CMakeLists.txt
+13
-0
ThirdParty/tetgen/LICENSE
ThirdParty/tetgen/LICENSE
+666
-0
ThirdParty/tetgen/README
ThirdParty/tetgen/README
+25
-0
ThirdParty/tetgen/makefile
ThirdParty/tetgen/makefile
+62
-0
ThirdParty/tetgen/predicates.cxx
ThirdParty/tetgen/predicates.cxx
+4706
-0
ThirdParty/tetgen/tetgen.cxx
ThirdParty/tetgen/tetgen.cxx
+31244
-0
ThirdParty/tetgen/tetgen.h
ThirdParty/tetgen/tetgen.h
+3334
-0
include/Algo/Filtering/tools.h
include/Algo/Filtering/tools.h
+96
-58
include/Algo/ImplicitHierarchicalMesh/ihm3.h
include/Algo/ImplicitHierarchicalMesh/ihm3.h
+19
-2
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
+44
-13
include/Algo/ImplicitHierarchicalMesh/subdivision3.h
include/Algo/ImplicitHierarchicalMesh/subdivision3.h
+7
-0
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
+581
-91
include/Algo/Import/import.h
include/Algo/Import/import.h
+13
-31
include/Algo/Import/import.hpp
include/Algo/Import/import.hpp
+129
-63
include/Algo/Import/import2tables.h
include/Algo/Import/import2tables.h
+75
-57
include/Algo/Import/import2tablesSurface.hpp
include/Algo/Import/import2tablesSurface.hpp
+30
-30
include/Algo/Import/import2tablesVolume.hpp
include/Algo/Import/import2tablesVolume.hpp
+545
-45
include/Algo/Import/importNodeEle.hppxx
include/Algo/Import/importNodeEle.hppxx
+0
-0
include/Algo/Import/importObjEle.hppxx
include/Algo/Import/importObjEle.hppxx
+0
-0
include/Algo/Import/importTet.hppxx
include/Algo/Import/importTet.hppxx
+0
-0
include/Algo/Import/importTetmesh.hppxx
include/Algo/Import/importTetmesh.hppxx
+0
-0
include/Algo/Import/importTs.hppxx
include/Algo/Import/importTs.hppxx
+1
-1
include/Algo/Modelisation/polyhedron.hpp
include/Algo/Modelisation/polyhedron.hpp
+5
-1
include/Algo/Modelisation/subdivision3.h
include/Algo/Modelisation/subdivision3.h
+4
-0
include/Algo/Modelisation/subdivision3.hpp
include/Algo/Modelisation/subdivision3.hpp
+22
-0
include/Algo/Modelisation/tetrahedralization.h
include/Algo/Modelisation/tetrahedralization.h
+30
-1
include/Algo/Modelisation/tetrahedralization.hpp
include/Algo/Modelisation/tetrahedralization.hpp
+586
-285
include/Algo/Multiresolution/Map3MR/Filters/lerp.h
include/Algo/Multiresolution/Map3MR/Filters/lerp.h
+2
-10
include/Algo/Multiresolution/Map3MR/Filters/schaefer.h
include/Algo/Multiresolution/Map3MR/Filters/schaefer.h
+447
-445
include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.h
include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.h
+4
-0
include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.hpp
include/Algo/Multiresolution/Map3MR/map3MR_PrimalAdapt.hpp
+306
-46
include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.h
include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.h
+2
-0
include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.hpp
include/Algo/Multiresolution/Map3MR/map3MR_PrimalRegular.hpp
+286
-94
include/Algo/Simulation/ShapeMatching/shapeMatching.h
include/Algo/Simulation/ShapeMatching/shapeMatching.h
+89
-0
include/Algo/Simulation/ShapeMatching/shapeMatching.hpp
include/Algo/Simulation/ShapeMatching/shapeMatching.hpp
+158
-0
include/Algo/Simulation/ShapeMatching/shapeMatchingLinear.h
include/Algo/Simulation/ShapeMatching/shapeMatchingLinear.h
+86
-0
include/Algo/Simulation/ShapeMatching/shapeMatchingLinear.hpp
...ude/Algo/Simulation/ShapeMatching/shapeMatchingLinear.hpp
+156
-0
include/Algo/Simulation/ShapeMatching/shapeMatchingQuadratic.h
...de/Algo/Simulation/ShapeMatching/shapeMatchingQuadratic.h
+91
-0
include/Algo/Simulation/ShapeMatching/shapeMatchingQuadratic.hpp
.../Algo/Simulation/ShapeMatching/shapeMatchingQuadratic.hpp
+54
-0
include/Topology/map/map3.h
include/Topology/map/map3.h
+4
-0
src/Topology/map/map3.cpp
src/Topology/map/map3.cpp
+20
-0
No files found.
Apps/Examples/clipping.cpp
View file @
16c584ca
...
@@ -790,36 +790,27 @@ void Clipping::importMesh(std::string& filename)
...
@@ -790,36 +790,27 @@ void Clipping::importMesh(std::string& filename)
size_t
pos
=
filename
.
rfind
(
"."
);
// position of "." in filename
size_t
pos
=
filename
.
rfind
(
"."
);
// position of "." in filename
std
::
string
extension
=
filename
.
substr
(
pos
);
std
::
string
extension
=
filename
.
substr
(
pos
);
if
(
extension
==
std
::
string
(
".tet"
))
if
(
extension
==
std
::
string
(
".map"
))
{
{
if
(
!
Algo
::
Volume
::
Import
::
importTet
<
PFP
>
(
myMap
,
filename
.
c_str
(),
attrNames
))
if
(
!
myMap
.
loadMapBin
(
filename
))
{
{
CGoGNerr
<<
"could not import "
<<
filename
<<
CGoGNendl
;
CGoGNerr
<<
"could not import "
<<
filename
<<
CGoGNendl
;
return
;
return
;
}
}
else
else
position
=
myMap
.
getAttribute
<
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
position
=
myMap
.
getAttribute
<
VEC3
,
VERTEX
>
(
"position"
)
;
}
}
else
if
(
extension
==
std
::
string
(
".ts"
))
else
{
{
if
(
!
Algo
::
Volume
::
Import
::
importTs
<
PFP
>
(
myMap
,
filename
.
c_str
(),
attrNames
))
if
(
!
Algo
::
Volume
::
Import
::
importMesh
<
PFP
>
(
myMap
,
filename
,
attrNames
))
{
{
CGoGNerr
<<
"could not import "
<<
filename
<<
CGoGNendl
;
std
::
cerr
<<
"could not import "
<<
filename
<<
std
::
endl
;
return
;
return
;
}
}
else
else
position
=
myMap
.
getAttribute
<
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
,
VERTEX
>
(
attrNames
[
0
])
;
}
}
if
(
extension
==
std
::
string
(
".map"
))
{
if
(
!
myMap
.
loadMapBin
(
filename
))
{
CGoGNerr
<<
"could not import "
<<
filename
<<
CGoGNendl
;
return
;
}
else
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
)
;
...
...
Apps/Examples/simpleGMap3.cpp
View file @
16c584ca
...
@@ -30,87 +30,120 @@
...
@@ -30,87 +30,120 @@
SimpleGMap3
::
SimpleGMap3
()
SimpleGMap3
::
SimpleGMap3
()
{
{
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
normal
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"normal"
);
volume
=
myMap
.
addAttribute
<
VEC3
,
VOLUME
>
(
"volume"
);
volume
=
myMap
.
addAttribute
<
VEC3
,
VOLUME
>
(
"volume"
);
CellMarker
<
EDGE
>
mE
(
myMap
);
//
CellMarker<EDGE> mE(myMap);
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
primCat
(
myMap
,
position
);
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
primCat
(
myMap
,
position
);
Dart
d
=
primCat
.
hexaGrid_topo
(
3
,
1
,
1
);
Dart
d
=
primCat
.
hexaGrid_topo
(
1
,
1
,
1
);
primCat
.
embedHexaGrid
(
2
,
1
,
1
);
primCat
.
embedHexaGrid
(
1
,
1
,
1
);
myMap
.
check
();
myMap
.
check
();
Geom
::
Plane3D
<
PFP
::
REAL
>
pl
(
VEC3
(
-
1
,
-
0.5
,
-
0.5
),
VEC3
(
-
1
,
-
0.5
,
0.5
),
VEC3
(
1
,
0.5
,
0.5
));
Dart
dp
=
Algo
::
Surface
::
Modelisation
::
createQuadrangularPyramid
<
PFP
>
(
myMap
);
Algo
::
Volume
::
Modelisation
::
sliceConvexVolume
<
PFP
>
(
myMap
,
position
,
d
,
pl
);
myMap
.
check
();
position
[
dp
]
=
typename
PFP
::
VEC3
(
0.5
,
0.5
,
-
0.5
);
position
[
myMap
.
phi1
(
dp
)]
=
typename
PFP
::
VEC3
(
0.5
,
0.5
,
0.5
);
position
[
myMap
.
phi1
(
myMap
.
phi1
(
dp
))]
=
typename
PFP
::
VEC3
(
0.5
,
-
0.5
,
0.5
);
position
[
myMap
.
phi_1
(
dp
)]
=
typename
PFP
::
VEC3
(
0.5
,
-
0.5
,
-
0.5
);
position
[
myMap
.
phi_1
(
myMap
.
phi2
(
dp
))]
=
typename
PFP
::
VEC3
(
1.5
f
,
0.0
f
,
0.0
f
);
for
(
unsigned
int
i
=
position
.
begin
()
;
i
!=
position
.
end
()
;
position
.
next
(
i
))
Dart
dtemp
=
myMap
.
beta1
(
myMap
.
beta0
(
myMap
.
beta1
(
myMap
.
beta2
(
myMap
.
beta1
(
myMap
.
beta0
(
myMap
.
beta1
(
myMap
.
beta2
(
d
))))))));
position
[
i
]
+=
VEC3
(
2
,
0
,
0
);
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
prim
(
myMap
,
position
);
myMap
.
sewVolumes
(
dtemp
,
dp
);
d
=
prim
.
hexaGrid_topo
(
2
,
2
,
1
);
prim
.
embedHexaGrid
(
1
,
1
,
1
);
Dart
d1
=
myMap
.
phi1
(
myMap
.
phi1
(
myMap
.
phi2
(
myMap
.
phi1
(
myMap
.
phi1
(
d
)))));
// Geom::Plane3D<PFP::REAL> pl(VEC3(-1,-0.5,-0.5),VEC3(-1,-0.5,0.5),VEC3(1,0.5,0.5));
VEC3
mid0
=
(
position
[
d1
]
+
position
[
myMap
.
phi1
(
d1
)])
/
2.0
f
;
// Algo::Volume::Modelisation::sliceConvexVolume<PFP>(myMap, position, d, pl);
myMap
.
cutEdge
(
d1
);
position
[
myMap
.
phi1
(
d1
)]
=
mid0
;
VEC3
mid1
=
(
position
[
d
]
+
position
[
myMap
.
phi1
(
d
)])
/
2.0
f
;
// myMap.check();
myMap
.
cutEdge
(
d
);
position
[
myMap
.
phi1
(
d
)]
=
mid1
;
d
=
myMap
.
phi1
(
myMap
.
phi1
(
myMap
.
phi2
(
myMap
.
phi1
(
myMap
.
phi1
(
d
)))));
// for(unsigned int i = position.begin() ; i != position.end() ; position.next(i))
VEC3
mid
=
(
position
[
d
]
+
position
[
myMap
.
phi1
(
d
)])
/
2.0
f
;
// position[i] += VEC3(2,0,0);
myMap
.
cutEdge
(
d
);
position
[
myMap
.
phi1
(
d
)]
=
mid
;
myMap
.
splitFace
(
d
,
myMap
.
phi1
(
myMap
.
phi1
(
myMap
.
phi1
(
d
))));
// Algo::Volume::Modelisation::Primitive3D<PFP> prim(myMap, position);
// d = prim.hexaGrid_topo(2,2,1);
// prim.embedHexaGrid(1,1,1);
myMap
.
check
();
// Dart d1 = myMap.phi1(myMap.phi1(myMap.phi2(myMap.phi1(myMap.phi1(d)))));
// VEC3 mid0 = (position[d1] + position[myMap.phi1(d1)]) / 2.0f;
// myMap.cutEdge(d1);
// position[myMap.phi1(d1)] = mid0;
for
(
unsigned
int
i
=
position
.
begin
()
;
i
!=
position
.
end
()
;
position
.
next
(
i
))
// VEC3 mid1 = (position[d] + position[myMap.phi1(d)]) / 2.0f;
position
[
i
]
+=
VEC3
(
0
,
2
,
0
);
// myMap.cutEdge(d);
// position[myMap.phi1(d)] = mid1;
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
prim2
(
myMap
,
position
);
// d = myMap.phi1(myMap.phi1(myMap.phi2(myMap.phi1(myMap.phi1(d)))));
d
=
prim2
.
hexaGrid_topo
(
2
,
1
,
1
);
// VEC3 mid = (position[d] + position[myMap.phi1(d)]) / 2.0f;
prim2
.
embedHexaGrid
(
1
,
1
,
1
);
// myMap.cutEdge(d);
// position[myMap.phi1(d)] = mid;
d
=
myMap
.
phi2
(
myMap
.
phi1
(
myMap
.
phi1
(
myMap
.
phi2
(
d
))));
// myMap.splitFace(d,myMap.phi1(myMap.phi1(myMap.phi1(d))));
myMap
.
unsewVolumes
(
d
);
myMap
.
check
();
// myMap.check();
// for(unsigned int i = position.begin() ; i != position.end() ; position.next(i))
// position[i] += VEC3(0,2,0);
// Algo::Volume::Modelisation::Primitive3D<PFP> prim2(myMap,position);
// d = prim2.hexaGrid_topo(2,1,1);
// prim2.embedHexaGrid(1,1,1);
// d = myMap.phi2(myMap.phi1(myMap.phi1(myMap.phi2(d))));
// myMap.unsewVolumes(d);
// myMap.check();
}
}
void
SimpleGMap3
::
initGUI
()
void
SimpleGMap3
::
initGUI
()
{
{
}
}
void
SimpleGMap3
::
cb_keyPress
(
int
code
)
{
switch
(
code
)
{
case
'e'
:
{
time_t
rawtime
;
struct
tm
*
timeinfo
;
char
buffer
[
80
];
time
(
&
rawtime
);
timeinfo
=
localtime
(
&
rawtime
);
strftime
(
buffer
,
80
,
".%F.%H:%M:%S"
,
timeinfo
);
std
::
string
filename
=
std
::
string
(
"topo_screenshot"
)
+
std
::
string
(
buffer
)
+
std
::
string
(
".svg"
);
m_render_topo
->
svgout2D
(
filename
,
modelViewMatrix
(),
projectionMatrix
());
break
;
}
}
}
void
SimpleGMap3
::
cb_initGL
()
void
SimpleGMap3
::
cb_initGL
()
{
{
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
)
;
Utils
::
GLSLShader
::
setCurrentOGLVersion
(
2
)
;
Geom
::
BoundingBox
<
PFP
::
VEC3
>
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
)
;
Geom
::
BoundingBox
<
PFP
::
VEC3
>
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
)
;
VEC3
gPosObj
=
bb
.
center
()
;
VEC3
gPosObj
=
bb
.
center
()
;
float
tailleX
=
bb
.
size
(
0
)
;
float
tailleX
=
bb
.
size
(
0
)
;
float
tailleY
=
bb
.
size
(
1
)
;
float
tailleY
=
bb
.
size
(
1
)
;
float
tailleZ
=
bb
.
size
(
2
)
;
float
tailleZ
=
bb
.
size
(
2
)
;
float
gWidthObj
=
std
::
max
<
float
>
(
std
::
max
<
float
>
(
tailleX
,
tailleY
),
tailleZ
)
;
float
gWidthObj
=
std
::
max
<
float
>
(
std
::
max
<
float
>
(
tailleX
,
tailleY
),
tailleZ
)
;
setParamObject
(
gWidthObj
,
gPosObj
.
data
());
setParamObject
(
gWidthObj
,
gPosObj
.
data
());
m_render_topo
=
new
Algo
::
Render
::
GL2
::
Topo3Render
();
m_render_topo
=
new
Algo
::
Render
::
GL2
::
Topo3Render
();
m_render_topo
->
setDartWidth
(
2.0
f
);
m_render_topo
->
setDartWidth
(
2.0
f
);
m_render_topo
->
setInitialDartsColor
(
1.0
f
,
1.0
f
,
1.0
f
);
m_render_topo
->
setInitialDartsColor
(
1.0
f
,
1.0
f
,
1.0
f
);
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
0.9
f
,
0.9
f
,
0.9
f
);
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
0.9
f
,
0.9
f
,
0.8
f
);
}
}
void
SimpleGMap3
::
cb_redraw
()
void
SimpleGMap3
::
cb_redraw
()
{
{
glDisable
(
GL_LIGHTING
);
glDisable
(
GL_LIGHTING
);
glLineWidth
(
1.0
f
);
glLineWidth
(
1.0
f
);
m_render_topo
->
drawTopo
();
m_render_topo
->
drawTopo
();
}
}
/**********************************************************************************************
/**********************************************************************************************
...
@@ -119,13 +152,13 @@ void SimpleGMap3::cb_redraw()
...
@@ -119,13 +152,13 @@ void SimpleGMap3::cb_redraw()
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
{
{
QApplication
app
(
argc
,
argv
)
;
QApplication
app
(
argc
,
argv
)
;
SimpleGMap3
sqt
;
SimpleGMap3
sqt
;
sqt
.
setGeometry
(
0
,
0
,
1000
,
800
)
;
sqt
.
setGeometry
(
0
,
0
,
1000
,
800
)
;
sqt
.
show
()
;
sqt
.
show
()
;
sqt
.
initGUI
()
;
sqt
.
initGUI
()
;
return
app
.
exec
()
;
return
app
.
exec
()
;
}
}
Apps/Examples/simpleGMap3.h
View file @
16c584ca
...
@@ -53,7 +53,6 @@ public:
...
@@ -53,7 +53,6 @@ public:
MAP
myMap
;
MAP
myMap
;
VertexAttribute
<
VEC3
>
position
;
VertexAttribute
<
VEC3
>
position
;
VertexAttribute
<
VEC3
>
normal
;
VolumeAttribute
<
VEC3
>
volume
;
VolumeAttribute
<
VEC3
>
volume
;
Algo
::
Render
::
GL2
::
Topo3Render
*
m_render_topo
;
Algo
::
Render
::
GL2
::
Topo3Render
*
m_render_topo
;
...
@@ -64,4 +63,5 @@ public:
...
@@ -64,4 +63,5 @@ public:
void
cb_initGL
()
;
void
cb_initGL
()
;
void
cb_redraw
()
;
void
cb_redraw
()
;
void
cb_keyPress
(
int
c
);
};
};
Apps/Examples/simpleMap3.cpp
View file @
16c584ca
...
@@ -32,44 +32,62 @@ SimpleMap3::SimpleMap3()
...
@@ -32,44 +32,62 @@ SimpleMap3::SimpleMap3()
{
{
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
position
=
myMap
.
addAttribute
<
VEC3
,
VERTEX
>
(
"position"
);
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
primCat
(
myMap
,
position
);
Algo
::
Volume
::
Modelisation
::
Primitive3D
<
PFP
>
primCat
(
myMap
,
position
);
Dart
d
=
primCat
.
hexaGrid_topo
(
2
,
1
,
1
);
Dart
d
=
primCat
.
hexaGrid_topo
(
1
,
1
,
1
);
primCat
.
embedHexaGrid
(
1
,
1
,
1
);
primCat
.
embedHexaGrid
(
1
,
1
,
1
);
myMap
.
closeMap
();
myMap
.
closeMap
();
myMap
.
check
();
unsigned
int
nb
=
0
;
Dart
dp
=
Algo
::
Surface
::
Modelisation
::
createQuadrangularPyramid
<
PFP
>
(
myMap
);
for
(
unsigned
int
i
=
position
.
begin
();
i
!=
position
.
end
();
position
.
next
(
i
))
nb
++
;
std
::
cout
<<
"Nb vertices (equals 12) : "
<<
nb
<<
std
::
endl
;
position
[
dp
]
=
typename
PFP
::
VEC3
(
0.5
,
0.5
,
-
0.5
);
assert
(
nb
==
12
);
position
[
myMap
.
phi1
(
dp
)]
=
typename
PFP
::
VEC3
(
0.5
,
0.5
,
0.5
);
position
[
myMap
.
phi1
(
myMap
.
phi1
(
dp
))]
=
typename
PFP
::
VEC3
(
0.5
,
-
0.5
,
0.5
);
position
[
myMap
.
phi_1
(
dp
)]
=
typename
PFP
::
VEC3
(
0.5
,
-
0.5
,
-
0.5
);
position
[
myMap
.
phi_1
(
myMap
.
phi2
(
dp
))]
=
typename
PFP
::
VEC3
(
1.5
f
,
0.0
f
,
0.0
f
);
Dart
dtemp
=
myMap
.
phi_1
(
myMap
.
phi2
(
myMap
.
phi_1
(
myMap
.
phi_1
(
myMap
.
phi2
(
d
)))));
d
=
myMap
.
phi2
(
myMap
.
phi1
(
myMap
.
phi1
(
myMap
.
phi2
(
d
)))
);
myMap
.
sewVolumes
(
dtemp
,
dp
);
Dart
dd
=
myMap
.
phi3
(
d
);
// Algo::Volume::Modelisation::Primitive3D<PFP> primCat(myMap, position);
// Dart d = primCat.hexaGrid_topo(2,1,1);
// primCat.embedHexaGrid(1,1,1);
// myMap.closeMap();
myMap
.
unsewVolumes
(
d
);
// unsigned int nb=0;
// for(unsigned int i = position.begin(); i!=position.end(); position.next(i))
// nb++;
myMap
.
check
();
// std::cout << "Nb vertices (equals 12) : " << nb << std::endl;
// assert(nb==12);
nb
=
0
;
for
(
unsigned
int
i
=
position
.
begin
();
i
!=
position
.
end
();
position
.
next
(
i
))
nb
++
;
std
::
cout
<<
"Nb vertices after unsew (equals 16) : "
<<
nb
<<
std
::
endl
;
// d = myMap.phi2(myMap.phi1(myMap.phi1(myMap.phi2(d))));
assert
(
nb
==
16
);
myMap
.
sewVolumes
(
d
,
d
d
);
// Dart dd = myMap.phi3(
d);
myMap
.
check
(
);
// myMap.unsewVolumes(d
);
nb
=
0
;
// myMap.check();
for
(
unsigned
int
i
=
position
.
begin
();
i
!=
position
.
end
();
position
.
next
(
i
))
nb
++
;
std
::
cout
<<
"Nb vertices after resew (equals 12) : "
<<
nb
<<
std
::
endl
;
// nb=0;
assert
(
nb
==
12
);
// for(unsigned int i = position.begin(); i!=position.end(); position.next(i))
// nb++;
// std::cout << "Nb vertices after unsew (equals 16) : " << nb << std::endl;
// assert(nb==16);
// myMap.sewVolumes(d,dd);
// myMap.check();
// nb=0;
// for(unsigned int i = position.begin(); i!=position.end(); position.next(i))
// nb++;
// std::cout << "Nb vertices after resew (equals 12) : " << nb << std::endl;
// assert(nb==12);
}
}
...
@@ -92,22 +110,64 @@ void SimpleMap3::cb_initGL()
...
@@ -92,22 +110,64 @@ void SimpleMap3::cb_initGL()
m_render_topo
=
new
Algo
::
Render
::
GL2
::
Topo3Render
();
m_render_topo
=
new
Algo
::
Render
::
GL2
::
Topo3Render
();
m_render_topo
->
setDartWidth
(
2.0
f
);
m_render_topo
->
setDartWidth
(
2.0
f
);
m_render_topo
->
setInitialDartsColor
(
1.0
f
,
1.0
f
,
1.0
f
);
m_render_topo
->
setInitialDartsColor
(
1.0
f
,
1.0
f
,
1.0
f
);
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
0.9
f
,
0.9
f
,
0.9
f
);
m_render_topo
->
updateData
<
PFP
>
(
myMap
,
position
,
0.9
f
,
0.9
f
,
0.8
f
);
m_render_topo_boundary
=
new
Algo
::
Render
::
GL2
::
TopoRender
();
m_render_topo_boundary
=
new
Algo
::
Render
::
GL2
::
TopoRender
();
m_render_topo_boundary
->
setDartWidth
(
2.0
f
);
m_render_topo_boundary
->
setDartWidth
(
2.0
f
);
m_render_topo_boundary
->
setInitialDartsColor
(
0.4
f
,
0.8
f
,
0.4
f
);
m_render_topo_boundary
->
setInitialDartsColor
(
0.4
f
,
0.8
f
,
0.4
f
);
m_render_topo_boundary
->
updateDataBoundary
<
PFP
>
(
myMap
,
position
,
0.9
f
,
0.9
f
,
bb
.
maxSize
()
/
50.0
f
);
m_render_topo_boundary
->
updateDataBoundary
<
PFP
>
(
myMap
,
position
,
0.9
f
,
0.9
f
,
bb
.
maxSize
()
/
50.0
f
);
m_render_topo_primal
=
new
Algo
::
Render
::
GL2
::
Topo3PrimalRender
();
m_render_topo_primal
->
setDartWidth
(
2.0
f
);
m_render_topo_primal
->
setInitialDartsColor
(
1.0
f
,
1.0
f
,
1.0
f
);
m_render_topo_primal
->
updateData
<
PFP
>
(
myMap
,
position
,
0.95
f
,
0.85
f
);
}
}
void
SimpleMap3
::
cb_keyPress
(
int
code
)
{
switch
(
code
)
{
case
'e'
:
{
time_t
rawtime
;
struct
tm
*
timeinfo
;
char
buffer
[
80
];
time
(
&
rawtime
);
timeinfo
=
localtime
(
&
rawtime
);
strftime
(
buffer
,
80
,
".%F.%H:%M:%S"
,
timeinfo
);
std
::
string
filename
=
std
::
string
(
"topo_screenshot"
)
+
std
::
string
(
buffer
)
+
std
::
string
(
".svg"
);
m_render_topo
->
svgout2D
(
filename
,
modelViewMatrix
(),
projectionMatrix
());
break
;
}
case
'E'
:
{
time_t
rawtime
;
struct
tm
*
timeinfo
;
char
buffer
[
80
];
time
(
&
rawtime
);
timeinfo
=
localtime
(
&
rawtime
);
strftime
(
buffer
,
80
,
".%F.%H:%M:%S"
,
timeinfo
);
std
::
string
filename
=
std
::
string
(
"topo_screenshot"
)
+
std
::
string
(
buffer
)
+
std
::
string
(
".svg"
);
m_render_topo_primal
->
svgout2D
(
filename
,
modelViewMatrix
(),
projectionMatrix
());
break
;
}
}
}
void
SimpleMap3
::
cb_redraw
()
void
SimpleMap3
::
cb_redraw
()
{
{
glDisable
(
GL_LIGHTING
);
glDisable
(
GL_LIGHTING
);
glLineWidth
(
1.0
f
);
glLineWidth
(
1.0
f
);
m_render_topo
->
drawTopo
();
m_render_topo
->
drawTopo
();
m_render_topo_boundary
->
drawTopo
();
//m_render_topo_boundary->drawTopo();
//m_render_topo_primal->drawTopo();
}
}
/**********************************************************************************************
/**********************************************************************************************
...
...
Apps/Examples/simpleMap3.h
View file @
16c584ca
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#include "Geometry/vector_gen.h"
#include "Geometry/vector_gen.h"
#include "Algo/Render/GL2/topo3Render.h"
#include "Algo/Render/GL2/topo3Render.h"
#include "Algo/Render/GL2/topo3PrimalRender.h"
#include "Algo/Render/GL2/topoRender.h"
#include "Algo/Render/GL2/topoRender.h"
using
namespace
CGoGN
;
using
namespace
CGoGN
;
...
@@ -58,6 +59,7 @@ public:
...
@@ -58,6 +59,7 @@ public:
Algo
::
Render
::
GL2
::
Topo3Render
*
m_render_topo
;
Algo
::
Render
::
GL2
::
Topo3Render
*
m_render_topo
;
Algo
::
Render
::
GL2
::
TopoRender
*
m_render_topo_boundary
;
Algo
::
Render
::
GL2
::
TopoRender
*
m_render_topo_boundary
;
Algo
::
Render
::
GL2
::
Topo3PrimalRender
*
m_render_topo_primal
;
SimpleMap3
()
;
SimpleMap3
()
;
...
@@ -65,5 +67,6 @@ public:
...
@@ -65,5 +67,6 @@ public:
void
cb_initGL
()
;
void
cb_initGL
()
;
void
cb_redraw
()
;
void
cb_redraw
()
;
void
cb_keyPress
(
int
code
);
};
};
Apps/Examples/volumeExplorer.cpp
View file @
16c584ca
...
@@ -136,7 +136,7 @@ void MyQT::slider_released()
...
@@ -136,7 +136,7 @@ void MyQT::slider_released()
void
MyQT
::
cb_Open
()
void
MyQT
::
cb_Open
()
{
{
std
::
string
filters
(
"all (*.*);; trian (*.trian);; ctm (*.ctm);; off (*.off);; ply (*.ply
)"
)
;
std
::
string
filters
(
"all (*.*
)"
)
;
std
::
string
filename
=
selectFile
(
"Open Mesh"
,
""
,
filters
)
;
std
::
string
filename
=
selectFile
(
"Open Mesh"
,
""
,
filters
)
;
if
(
filename
.
empty
())
if
(
filename
.
empty
())
return
;
return
;
...
@@ -145,8 +145,8 @@ void MyQT::cb_Open()
...
@@ -145,8 +145,8 @@ void MyQT::cb_Open()
std
::
vector
<
std
::
string
>
attrNames
;
std
::
vector
<
std
::
string
>
attrNames
;
size_t
pos
=
filename
.
rfind
(
"."
);
// position of "." in filename
//
size_t pos = filename.rfind("."); // position of "." in filename
std
::
string
extension
=
filename
.
substr
(
pos
);
//
std::string extension = filename.substr(pos);
// if(extension == std::string(".off"))
// if(extension == std::string(".off"))
// {
// {
...
...
SCHNApps/Plugins/CMakeLists.txt
View file @
16c584ca
...
@@ -10,3 +10,6 @@ ADD_SUBDIRECTORY(surface_subdivision)
...
@@ -10,3 +10,6 @@ ADD_SUBDIRECTORY(surface_subdivision)
ADD_SUBDIRECTORY
(
surface_selection
)
ADD_SUBDIRECTORY
(
surface_selection
)
ADD_SUBDIRECTORY
(
surface_deformation
)
ADD_SUBDIRECTORY
(
surface_deformation
)
ADD_SUBDIRECTORY
(
surface_modelisation
)
ADD_SUBDIRECTORY
(
surface_modelisation
)
ADD_SUBDIRECTORY
(
volume_import
)
ADD_SUBDIRECTORY
(
volume_render
)
SCHNApps/Plugins/volume_import/CMakeLists.txt
View file @
16c584ca
cmake_minimum_required
(
VERSION 2.8
)
cmake_minimum_required
(
VERSION 2.8
)
SET
(
PLUGIN_NAME
ImportVolume
)
SET
(
PLUGIN_NAME
Volume_Import
)
SET
(
PLUGIN_ROOT_DIR
${
SCHNApps_ROOT_DIR
}
/Plugins/
importVolume
)
SET
(
PLUGIN_ROOT_DIR
${
SCHNApps_ROOT_DIR
}
/Plugins/
volume_import
)
INCLUDE_DIRECTORIES
(
INCLUDE_DIRECTORIES
(
${
PLUGIN_ROOT_DIR
}
/include
${
PLUGIN_ROOT_DIR
}
/include
...
@@ -25,7 +25,7 @@ file(
...
@@ -25,7 +25,7 @@ file(
SET
(
SET
(
PLUGIN_QOBJECT_FILES
PLUGIN_QOBJECT_FILES
${
PLUGIN_ROOT_DIR
}
/include/
importVolume
.h
${
PLUGIN_ROOT_DIR
}
/include/
volume_import
.h
)
)
include
(
${
SCHNApps_ROOT_DIR
}
/Plugins/plugins_cmake.txt
)
include
(
${
SCHNApps_ROOT_DIR
}
/Plugins/plugins_cmake.txt
)
SCHNApps/Plugins/volume_import/include/
importVolume
.h
→
SCHNApps/Plugins/volume_import/include/
volume_import
.h
View file @
16c584ca
#ifndef _IMPORTVOLUME_PLUGIN_H_
#ifndef _VOLUME_IMPORT_PLUGIN_H_
#define _IMPORTVOLUME_PLUGIN_H_
#define _VOLUME_IMPORT_PLUGIN_H_
#include "plugin.h"
#include "plugin_processing.h"
namespace
CGoGN
namespace
CGoGN
{
{
...
@@ -10,32 +9,22 @@ namespace CGoGN
...
@@ -10,32 +9,22 @@ namespace CGoGN