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
CGoGN
CGoGN
Commits
fae720e1
Commit
fae720e1
authored
Oct 20, 2015
by
Kevin Tew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added computeDartMiddlePositions to topoRender
parent
8e42adeb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
CGoGN/include/Algo/Render/GL2/topoRender.h
CGoGN/include/Algo/Render/GL2/topoRender.h
+8
-0
CGoGN/include/Algo/Render/GL2/topoRender.hpp
CGoGN/include/Algo/Render/GL2/topoRender.hpp
+17
-0
No files found.
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
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