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
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
David Cazier
CGoGN
Commits
aff22ee0
Commit
aff22ee0
authored
Feb 08, 2013
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
topo/topo3 Renders use now faceCentroidELWgit add include/Algo/Render/GL2/topoRender.hpp
parent
92c348c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
61 deletions
+35
-61
include/Algo/Render/GL2/topo3Render.hpp
include/Algo/Render/GL2/topo3Render.hpp
+19
-30
include/Algo/Render/GL2/topoRender.hpp
include/Algo/Render/GL2/topoRender.hpp
+16
-31
No files found.
include/Algo/Render/GL2/topo3Render.hpp
View file @
aff22ee0
...
...
@@ -83,7 +83,7 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const VertexAttribute<
CellMarker
<
VOLUME
>
cmv
(
mapx
);
VolumeAutoAttribute
<
VEC3
>
centerVolumes
(
mapx
,
"centerVolumes"
);
Algo
::
Volume
::
Geometry
::
Parallel
::
computeCentroidVolumes
<
PFP
>
(
mapx
,
positions
,
centerVolumes
,
allDarts
,
3
);
Algo
::
Volume
::
Geometry
::
Parallel
::
computeCentroid
ELW
Volumes
<
PFP
>
(
mapx
,
positions
,
centerVolumes
,
allDarts
,
3
);
// debut phi1
...
...
@@ -123,27 +123,21 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const VertexAttribute<
float
okv
=
1.0
f
-
kv
;
VEC3
vc
=
centerVolumes
[
d
];
VEC3
centerFace
(
0
,
0
,
0
);
VEC3
centerFace
=
Algo
::
Surface
::
Geometry
::
faceCentroidELW
<
PFP
>
(
mapx
,
d
,
positions
)
*
kv
+
vc
*
okv
;
//shrink the face
float
okf
=
1.0
f
-
kf
;
Dart
dd
=
d
;
do
{
VEC3
P
=
positions
[
dd
];
P
=
vc
*
okv
+
P
*
kv
;
VEC3
P
=
centerFace
*
okf
+
(
vc
*
okv
+
positions
[
dd
]
*
kv
)
*
kf
;
vecPos
.
push_back
(
P
);
centerFace
+=
P
;
dd
=
mapx
.
phi1
(
dd
);
}
while
(
dd
!=
d
);
centerFace
/=
REAL
(
vecPos
.
size
());
//shrink the face
unsigned
int
nb
=
vecPos
.
size
();
float
okf
=
1.0
f
-
kf
;
for
(
unsigned
int
i
=
0
;
i
<
nb
;
++
i
)
{
vecPos
[
i
]
=
centerFace
*
okf
+
vecPos
[
i
]
*
kf
;
}
vecPos
.
push_back
(
vecPos
.
front
());
// copy the first for easy computation on next loop
// compute position of points to use for drawing topo
...
...
@@ -338,7 +332,7 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const VertexAttribute
// compute center of each volumes
VolumeAutoAttribute
<
VEC3
>
centerVolumes
(
mapx
,
"centerVolumes"
);
Algo
::
Volume
::
Geometry
::
Parallel
::
computeCentroidVolumes
<
PFP
>
(
mapx
,
positions
,
centerVolumes
,
good
);
Algo
::
Volume
::
Geometry
::
Parallel
::
computeCentroid
ELW
Volumes
<
PFP
>
(
mapx
,
positions
,
centerVolumes
,
good
);
// beta1
DartAutoAttribute
<
VEC3
>
fv1
(
mapx
);
...
...
@@ -379,27 +373,22 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const VertexAttribute
float
okv
=
1.0
f
-
kv
;
VEC3
vc
=
centerVolumes
[
d
];
VEC3
centerFace
(
0
,
0
,
0
);
VEC3
centerFace
=
Algo
::
Surface
::
Geometry
::
faceCentroidELW
<
PFP
>
(
mapx
,
d
,
positions
)
*
kv
+
vc
*
okv
;
//shrink the face
float
okf
=
1.0
f
-
kf
;
Dart
dd
=
d
;
do
{
VEC3
P
=
positions
[
dd
];
P
=
vc
*
okv
+
P
*
kv
;
VEC3
P
=
centerFace
*
okf
+
(
vc
*
okv
+
positions
[
dd
]
*
kv
)
*
kf
;
vecPos
.
push_back
(
P
);
centerFace
+=
P
;
dd
=
mapx
.
phi1
(
dd
);
}
while
(
dd
!=
d
);
centerFace
/=
REAL
(
vecPos
.
size
());
//shrink the face
unsigned
int
nb
=
vecPos
.
size
();
float
okf
=
1.0
f
-
kf
;
for
(
unsigned
int
i
=
0
;
i
<
nb
;
++
i
)
{
vecPos
[
i
]
=
centerFace
*
okf
+
vecPos
[
i
]
*
kf
;
}
vecPos
.
push_back
(
vecPos
.
front
());
// copy the first for easy computation on next loop
// compute position of points to use for drawing topo
...
...
include/Algo/Render/GL2/topoRender.hpp
View file @
aff22ee0
...
...
@@ -31,6 +31,8 @@
#include "Topology/gmap/embeddedGMap2.h"
#include "Geometry/distances.h"
#include "Algo/Geometry/centroid.h"
namespace
CGoGN
{
...
...
@@ -117,30 +119,21 @@ void TopoRender::updateDataMap(typename PFP::MAP& mapx, const VertexAttribute<ty
Dart
d
=
*
id
;
if
(
!
mf
.
isMarked
(
d
))
{
vecPos
.
clear
();
// store the face & center
VEC3
center
(
0.0
f
,
0.0
f
,
0.0
f
);
VEC3
center
=
Algo
::
Surface
::
Geometry
::
faceCentroidELW
<
PFP
>
(
mapx
,
d
,
positions
);
float
k
=
1.0
f
-
kf
;
Dart
dd
=
d
;
do
{
const
VEC3
&
P
=
positions
[
d
];
vecPos
.
push_back
(
P
);
center
+=
P
;
Dart
e
=
map
.
phi1
(
d
);
d
=
e
;
}
while
(
d
!=
dd
);
center
/=
REAL
(
vecPos
.
size
());
//shrink the face
vecPos
.
push_back
(
center
*
k
+
positions
[
dd
]
*
kf
);
dd
=
map
.
phi1
(
dd
);
}
while
(
dd
!=
d
);
unsigned
int
nb
=
vecPos
.
size
();
float
k
=
1.0
f
-
kf
;
for
(
unsigned
int
i
=
0
;
i
<
nb
;
++
i
)
{
vecPos
[
i
]
=
center
*
k
+
vecPos
[
i
]
*
kf
;
}
vecPos
.
push_back
(
vecPos
.
front
());
// copy the first for easy computation on next loop
k
=
1.0
f
-
ke
;
for
(
unsigned
int
i
=
0
;
i
<
nb
;
++
i
)
{
...
...
@@ -266,25 +259,17 @@ void TopoRender::updateDataGMap(typename PFP::MAP& mapx, const VertexAttribute<t
if
(
!
mf
.
isMarked
(
d
))
{
vecPos
.
clear
();
// store the face & center
VEC3
center
(
0.0
f
,
0.0
f
,
0.0
f
);
VEC3
center
=
Algo
::
Surface
::
Geometry
::
faceCentroidELW
<
PFP
>
(
mapx
,
d
,
positions
);
float
k
=
1.0
f
-
kf
;
Dart
dd
=
d
;
do
{
const
VEC3
&
P
=
positions
[
d
];
vecPos
.
push_back
(
P
);
center
+=
P
;
d
=
map
.
phi1
(
d
);
}
while
(
d
!=
dd
);
center
/=
REAL
(
vecPos
.
size
());
vecPos
.
push_back
(
center
*
k
+
positions
[
dd
]
*
kf
);
dd
=
map
.
phi1
(
dd
);
}
while
(
dd
!=
d
);
//shrink the face
unsigned
int
nb
=
vecPos
.
size
();
float
k
=
1.0
f
-
kf
;
for
(
unsigned
int
i
=
0
;
i
<
nb
;
++
i
)
{
vecPos
[
i
]
=
center
*
k
+
vecPos
[
i
]
*
kf
;
}
vecPos
.
push_back
(
vecPos
.
front
());
// copy the first for easy computation on next loop
k
=
1.0
f
-
ke
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment