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
David Cazier
CGoGN
Commits
fdb2571f
Commit
fdb2571f
authored
Nov 28, 2011
by
untereiner
Browse files
Merge cgogn:~jund/CGoGN
parents
95c02e0a
68b2491a
Changes
4
Hide whitespace changes
Inline
Side-by-side
include/Algo/Render/GL2/topo3Render.h
View file @
fdb2571f
...
...
@@ -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 @
fdb2571f
...
...
@@ -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 @
fdb2571f
...
...
@@ -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 @
fdb2571f
...
...
@@ -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
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