Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CGoGN
CGoGN
Commits
fae720e1
Commit
fae720e1
authored
Oct 20, 2015
by
Kevin Tew
Browse files
Added computeDartMiddlePositions to topoRender
parent
8e42adeb
Changes
2
Hide whitespace changes
Inline
Side-by-side
CGoGN/include/Algo/Render/GL2/topoRender.h
View file @
fae720e1
...
...
@@ -383,6 +383,14 @@ public:
template
<
typename
MAP
>
void
drawColoredDarts
(
MAP
&
map
);
/**
* Get back middle position of drawn darts
* @param map the map
* @param posExpl the output positions
*/
template
<
typename
PFP
>
void
computeDartMiddlePositions
(
typename
PFP
::
MAP
&
map
,
DartAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
posExpl
);
};
...
...
CGoGN/include/Algo/Render/GL2/topoRender.hpp
View file @
fae720e1
...
...
@@ -641,6 +641,23 @@ Dart TopoRender::raySelection(MAP& map, const Geom::Vec3f& rayA, const Geom::Vec
return
dFinal
;
}
template
<
typename
PFP
>
void
TopoRender
::
computeDartMiddlePositions
(
typename
PFP
::
MAP
&
map
,
DartAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
posExpl
)
{
DartAttribute
<
unsigned
int
,
typename
PFP
::
MAP
>
attIndex
=
map
.
template
getAttribute
<
unsigned
int
,
DART
,
typename
PFP
::
MAP
>(
m_nameIndex
);
if
(
!
attIndex
.
isValid
())
attIndex
=
map
.
template
addAttribute
<
unsigned
int
,
DART
,
typename
PFP
::
MAP
>(
m_nameIndex
);
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
{
const
Geom
::
Vec3f
&
P
=
m_bufferDartPosition
[
attIndex
[
d
]];
const
Geom
::
Vec3f
&
Q
=
m_bufferDartPosition
[
attIndex
[
d
]
+
1
];
posExpl
[
d
]
=
(
P
+
Q
)
*
0.5
f
;
}
}
}
// namespace GL2
}
// namespace Algo
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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