Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
KennethVanhoey
CGoGN
Commits
3036f4ac
Commit
3036f4ac
authored
Feb 06, 2012
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove bug in topo rendering
parent
6e88e219
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
43 deletions
+33
-43
include/Algo/Render/GL2/topo3Render.hpp
include/Algo/Render/GL2/topo3Render.hpp
+33
-43
No files found.
include/Algo/Render/GL2/topo3Render.hpp
View file @
3036f4ac
...
...
@@ -68,46 +68,41 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const typename PFP::TV
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
Map3
&
map
=
dynamic_cast
<
Map3
&>
(
mapx
);
//
Map3& map = dynamic_cast<Map3&>(mapx);
typedef
typename
PFP
::
VEC3
VEC3
;
typedef
typename
PFP
::
REAL
REAL
;
if
(
m_attIndex
.
map
()
!=
&
map
)
if
(
m_attIndex
.
map
()
!=
&
map
x
)
{
m_attIndex
=
map
.
template
getAttribute
<
unsigned
int
>(
DART
,
"dart_index"
);
m_attIndex
=
map
x
.
template
getAttribute
<
unsigned
int
>(
DART
,
"dart_index"
);
if
(
!
m_attIndex
.
isValid
())
m_attIndex
=
map
.
template
addAttribute
<
unsigned
int
>(
DART
,
"dart_index"
);
m_attIndex
=
map
x
.
template
addAttribute
<
unsigned
int
>(
DART
,
"dart_index"
);
}
m_nbDarts
=
0
;
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
for
(
Dart
d
=
map
x
.
begin
();
d
!=
map
x
.
end
();
map
x
.
next
(
d
))
{
if
(
good
(
d
))
m_nbDarts
++
;
}
// compute center of each volumes
CellMarker
cmv
(
map
,
VOLUME
);
AutoAttributeHandler
<
VEC3
>
centerVolumes
(
map
,
VOLUME
,
"centerVolumes"
);
// TraversorW<Map3> traVol(map,good);
// for (Dart d=traVol.begin(); d!=traVol.end(); d=traVol.next())
// {
// centerVolumes[d] = Algo::Geometry::volumeCentroid<PFP>(mapx, d, positions);
// }
CellMarker
cmv
(
mapx
,
VOLUME
);
AutoAttributeHandler
<
VEC3
>
centerVolumes
(
mapx
,
VOLUME
,
"centerVolumes"
);
Algo
::
Geometry
::
computeCentroidVolumes
<
PFP
>
(
mapx
,
positions
,
centerVolumes
,
good
);
// debut phi1
AutoAttributeHandler
<
VEC3
>
fv1
(
map
,
DART
);
AutoAttributeHandler
<
VEC3
>
fv1
(
map
x
,
DART
);
// fin phi1
AutoAttributeHandler
<
VEC3
>
fv11
(
map
,
DART
);
AutoAttributeHandler
<
VEC3
>
fv11
(
map
x
,
DART
);
// phi2
AutoAttributeHandler
<
VEC3
>
fv2
(
map
,
DART
);
AutoAttributeHandler
<
VEC3
>
fv2x
(
map
,
DART
);
AutoAttributeHandler
<
VEC3
>
fv2
(
map
x
,
DART
);
AutoAttributeHandler
<
VEC3
>
fv2x
(
map
x
,
DART
);
m_vbo4
->
bind
();
glBufferData
(
GL_ARRAY_BUFFER
,
2
*
m_nbDarts
*
sizeof
(
VEC3
),
0
,
GL_STREAM_DRAW
);
...
...
@@ -121,11 +116,11 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const typename PFP::TV
std
::
vector
<
Dart
>
vecDartFaces
;
vecDartFaces
.
reserve
(
m
ap
.
getN
bDarts
()
/
4
);
vecDartFaces
.
reserve
(
m
_n
bDarts
/
3
);
unsigned
int
posDBI
=
0
;
// traverse each face of each volume
TraversorCell
<
Map3
>
traFace
(
map
,
PFP
::
MAP
::
ORBIT_IN_PARENT
(
FACE
),
good
);
TraversorCell
<
typename
PFP
::
MAP
>
traFace
(
map
x
,
PFP
::
MAP
::
ORBIT_IN_PARENT
(
FACE
),
good
);
for
(
Dart
d
=
traFace
.
begin
();
d
!=
traFace
.
end
();
d
=
traFace
.
next
())
{
vecDartFaces
.
push_back
(
d
);
...
...
@@ -145,7 +140,7 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const typename PFP::TV
P
=
vc
*
okv
+
P
*
kv
;
vecPos
.
push_back
(
P
);
centerFace
+=
P
;
dd
=
map
.
phi1
(
dd
);
dd
=
map
x
.
phi1
(
dd
);
}
while
(
dd
!=
d
);
centerFace
/=
REAL
(
vecPos
.
size
());
...
...
@@ -181,7 +176,7 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const typename PFP::TV
fv2
[
d
]
=
P
*
0.52
f
+
Q
*
0.48
f
;
fv2x
[
d
]
=
P
*
0.48
f
+
Q
*
0.52
f
;
d
=
map
.
phi1
(
d
);
d
=
map
x
.
phi1
(
d
);
}
}
...
...
@@ -218,7 +213,7 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const typename PFP::TV
Dart
d
=
*
face
;
do
{
Dart
e
=
map
.
phi2
(
d
);
Dart
e
=
map
x
.
phi2
(
d
);
if
(
d
<
e
)
{
*
positionF2
++
=
fv2
[
d
];
...
...
@@ -227,8 +222,8 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const typename PFP::TV
*
positionF2
++
=
fv2x
[
d
];
m_nbRel2
++
;
}
e
=
map
.
phi3
(
d
);
if
(
!
map
.
isBoundaryMarked
(
e
)
&&
(
d
<
e
))
e
=
map
x
.
phi3
(
d
);
if
(
!
map
x
.
isBoundaryMarked
(
e
)
&&
(
d
<
e
))
{
*
positionF3
++
=
fv2
[
d
];
*
positionF3
++
=
fv2x
[
e
];
...
...
@@ -236,11 +231,11 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const typename PFP::TV
*
positionF3
++
=
fv2x
[
d
];
m_nbRel3
++
;
}
e
=
map
.
phi1
(
d
);
e
=
map
x
.
phi1
(
d
);
*
positionF1
++
=
fv1
[
d
];
*
positionF1
++
=
fv11
[
e
];
d
=
map
.
phi1
(
d
);
d
=
map
x
.
phi1
(
d
);
}
while
(
d
!=
*
face
);
}
...
...
@@ -332,35 +327,30 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const typename PFP::T
typedef
typename
PFP
::
REAL
REAL
;
if
(
m_attIndex
.
map
()
!=
&
map
)
if
(
m_attIndex
.
map
()
!=
&
map
x
)
{
m_attIndex
=
map
.
template
getAttribute
<
unsigned
int
>(
DART
,
"dart_index"
);
m_attIndex
=
map
x
.
template
getAttribute
<
unsigned
int
>(
DART
,
"dart_index"
);
if
(
!
m_attIndex
.
isValid
())
m_attIndex
=
map
.
template
addAttribute
<
unsigned
int
>(
DART
,
"dart_index"
);
m_attIndex
=
map
x
.
template
addAttribute
<
unsigned
int
>(
DART
,
"dart_index"
);
}
m_nbDarts
=
0
;
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
for
(
Dart
d
=
map
x
.
begin
();
d
!=
map
x
.
end
();
map
x
.
next
(
d
))
{
if
(
good
(
d
))
m_nbDarts
++
;
}
// compute center of each volumes
AutoAttributeHandler
<
VEC3
>
centerVolumes
(
map
,
VOLUME
,
"centerVolumes"
);
// TraversorW<GMap3> traVol(map,good);
// for (Dart d=traVol.begin(); d!=traVol.end(); d=traVol.next())
// {
// centerVolumes[d] = Algo::Geometry::volumeCentroid<PFP>(mapx, d, positions);
// }
AutoAttributeHandler
<
VEC3
>
centerVolumes
(
mapx
,
VOLUME
,
"centerVolumes"
);
Algo
::
Geometry
::
computeCentroidVolumes
<
PFP
>
(
mapx
,
positions
,
centerVolumes
,
good
);
// beta1
AutoAttributeHandler
<
VEC3
>
fv1
(
map
,
DART
);
AutoAttributeHandler
<
VEC3
>
fv1
(
map
x
,
DART
);
// beta2/3
AutoAttributeHandler
<
VEC3
>
fv2
(
map
,
DART
);
AutoAttributeHandler
<
VEC3
>
fv2x
(
map
,
DART
);
AutoAttributeHandler
<
VEC3
>
fv2
(
map
x
,
DART
);
AutoAttributeHandler
<
VEC3
>
fv2x
(
map
x
,
DART
);
m_vbo4
->
bind
();
glBufferData
(
GL_ARRAY_BUFFER
,
2
*
m_nbDarts
*
sizeof
(
VEC3
),
0
,
GL_STREAM_DRAW
);
...
...
@@ -374,11 +364,11 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const typename PFP::T
std
::
vector
<
Dart
>
vecDartFaces
;
vecDartFaces
.
reserve
(
m
ap
.
getN
bDarts
()
/
4
);
vecDartFaces
.
reserve
(
m
_n
bDarts
/
6
);
unsigned
int
posDBI
=
0
;
//traverse each face of each volume
TraversorCell
<
GMap3
>
traFace
(
map
,
PFP
::
MAP
::
ORBIT_IN_PARENT
(
FACE
),
good
);
TraversorCell
<
typename
PFP
::
MAP
>
traFace
(
map
x
,
PFP
::
MAP
::
ORBIT_IN_PARENT
(
FACE
),
good
);
for
(
Dart
d
=
traFace
.
begin
();
d
!=
traFace
.
end
();
d
=
traFace
.
next
())
{
vecDartFaces
.
push_back
(
d
);
...
...
@@ -398,7 +388,7 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const typename PFP::T
P
=
vc
*
okv
+
P
*
kv
;
vecPos
.
push_back
(
P
);
centerFace
+=
P
;
dd
=
map
.
phi1
(
dd
);
dd
=
map
x
.
phi1
(
dd
);
}
while
(
dd
!=
d
);
centerFace
/=
REAL
(
vecPos
.
size
());
...
...
@@ -447,7 +437,7 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const typename PFP::T
m_attIndex
[
dx
]
=
posDBI
;
posDBI
+=
2
;
d
=
map
.
phi1
(
d
);
}
d
=
map
x
.
phi1
(
d
);
}
}
m_vbo0
->
bind
();
...
...
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