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
68b2491a
Commit
68b2491a
authored
Nov 28, 2011
by
Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
picking g-carte fonctionnel
parent
80cc5c15
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
11 deletions
+14
-11
include/Algo/Render/GL2/topo3Render.h
include/Algo/Render/GL2/topo3Render.h
+3
-3
include/Algo/Render/GL2/topo3Render.hpp
include/Algo/Render/GL2/topo3Render.hpp
+7
-4
include/Algo/Render/GL2/topoRender.h
include/Algo/Render/GL2/topoRender.h
+3
-3
src/Algo/Render/topoRender.cpp
src/Algo/Render/topoRender.cpp
+1
-1
No files found.
include/Algo/Render/GL2/topo3Render.h
View file @
68b2491a
...
...
@@ -144,7 +144,7 @@ protected:
void
popColors
();
/**
* pick dart with color set b
e
y setDartsIdColor
* pick dart with color set by setDartsIdColor
* @param x position of mouse (x)
* @param y position of mouse (pass H-y, classic pb of origin)
* @return the dart or NIL
...
...
@@ -270,7 +270,7 @@ class Topo3RenderMapD: public Topo3Render
{
public:
/**
* update all drawing buffers
* update all drawing buffers
to render a dual map
* @param map the map
* @param good selector
* @param positions attribute of position vertices
...
...
@@ -287,7 +287,7 @@ class Topo3RenderGMap: public Topo3Render
{
public:
/**
* update all drawing buffers
* update all drawing buffers
to render a gmap
* @param map the map
* @param good selector
* @param positions attribute of position vertices
...
...
include/Algo/Render/GL2/topo3Render.hpp
View file @
68b2491a
...
...
@@ -305,7 +305,6 @@ Dart Topo3Render::picking(typename PFP::MAP& map, const FunctorSelect& good, int
Dart
d
=
pickColor
(
x
,
y
);
popColors
();
return
d
;
}
template
<
typename
PFP
>
...
...
@@ -320,7 +319,6 @@ void Topo3RenderGMap::updateData(typename PFP::MAP& map, const FunctorSelect& go
AutoAttributeHandler
<
Geom
::
Vec3f
>
vert
(
map
,
DART
);
if
(
m_attIndex
.
map
()
!=
&
map
)
// if(!m_attIndex.isValid())
{
m_attIndex
=
map
.
template
addAttribute
<
unsigned
int
>(
DART
,
"dart_index"
);
}
...
...
@@ -388,13 +386,15 @@ void Topo3RenderGMap::updateData(typename PFP::MAP& map, const FunctorSelect& go
}
}
m_nbDarts
*=
2
;
m_nbDarts
*=
2
;
// x2 : only one orientation is used for the previous computation, multiply by 2 to get the number of darts
//colors
m_vbo4
->
bind
();
glBufferData
(
GL_ARRAY_BUFFER
,
2
*
m_nbDarts
*
sizeof
(
VEC3
),
0
,
GL_STREAM_DRAW
);
GLvoid
*
ColorDartsBuffer
=
glMapBuffer
(
GL_ARRAY_BUFFER
,
GL_READ_WRITE
);
VEC3
*
colorDartBuf
=
reinterpret_cast
<
VEC3
*>
(
ColorDartsBuffer
);
//darts
m_vbo0
->
bind
();
glBufferData
(
GL_ARRAY_BUFFER
,
2
*
m_nbDarts
*
sizeof
(
VEC3
),
0
,
GL_STREAM_DRAW
);
GLvoid
*
PositionDartsBuffer
=
glMapBuffer
(
GL_ARRAY_BUFFER
,
GL_READ_WRITE
);
...
...
@@ -418,8 +418,11 @@ void Topo3RenderGMap::updateData(typename PFP::MAP& map, const FunctorSelect& go
{
const
VEC3
&
P
=
positions
[
dd
];
vecPos
.
push_back
(
P
);
// m_attIndex[dd] = posDBI;
m_attIndex
[
dd
]
=
posDBI
;
posDBI
+=
2
;
m_attIndex
[
map
.
beta0
(
dd
)]
=
posDBI
;
//for gmap : also affect a number to the other orientation for picking
posDBI
+=
2
;
center
+=
P
;
dd
=
map
.
phi1
(
dd
);
}
while
(
dd
!=
d
);
...
...
include/Algo/Render/GL2/topoRender.h
View file @
68b2491a
...
...
@@ -189,7 +189,7 @@ public:
/**
* pick dart with color set b
e
y setDartsIdColor
* pick dart with color set by setDartsIdColor
* Do not forget to apply same transformation to scene before picking than before drawing !
* @param map the map in which we pick (same as drawn !)
* @param good the selector (same as used during drawing)
...
...
@@ -205,7 +205,7 @@ class TopoRenderMapD : public TopoRender
{
public:
/**
* update all drawing buffers
* update all drawing buffers
to render a dual map
* @param map the map
* @param positions attribute of position vertices
* @param ke exploding coef for edge
...
...
@@ -220,7 +220,7 @@ class TopoRenderGMap : public TopoRender
{
public:
/**
* update all drawing buffers
* update all drawing buffers
to render a gmap
* @param map the map
* @param positions attribute of position vertices
* @param ke exploding coef for edge
...
...
src/Algo/Render/topoRender.cpp
View file @
68b2491a
...
...
@@ -227,7 +227,7 @@ Dart TopoRender::pickColor(unsigned int x, unsigned int y)
// draw in back buffer (not shown on screen)
drawDarts
();
// restore dart with
// restore dart wi
d
th
m_topo_dart_width
=
dw
;
// read the pixel under the mouse in back buffer
...
...
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