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
2df7e300
Commit
2df7e300
authored
Nov 12, 2013
by
Pierre Kraemer
Browse files
surface selection : within sphere method for edges and faces
parent
1e04a087
Changes
1
Hide whitespace changes
Inline
Side-by-side
SCHNApps/Plugins/surface_selection/src/surface_selection.cpp
View file @
2df7e300
...
...
@@ -151,6 +151,21 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
break
;
}
case
WithinSphere
:
{
std
::
vector
<
PFP2
::
VEC3
>
selectionPoint
;
selectionPoint
.
push_back
(
p
.
positionAttribute
[
m_selectingEdge
]);
m_selectionSphereVBO
->
updateData
(
selectionPoint
);
m_pointSprite
->
setAttributePosition
(
m_selectionSphereVBO
);
m_pointSprite
->
setColor
(
CGoGN
::
Geom
::
Vec4f
(
0.0
f
,
0.0
f
,
1.0
f
,
0.5
f
));
m_pointSprite
->
setLightPosition
(
CGoGN
::
Geom
::
Vec3f
(
0.0
f
,
0.0
f
,
1.0
f
));
m_pointSprite
->
setSize
(
m_selectionRadius
);
m_pointSprite
->
enableVertexAttribs
();
glEnable
(
GL_BLEND
);
glBlendFunc
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
);
glDrawArrays
(
GL_POINTS
,
0
,
1
);
glDisable
(
GL_BLEND
);
m_pointSprite
->
disableVertexAttribs
();
break
;
}
}
...
...
@@ -177,6 +192,21 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
break
;
}
case
WithinSphere
:
{
std
::
vector
<
PFP2
::
VEC3
>
selectionPoint
;
selectionPoint
.
push_back
(
p
.
positionAttribute
[
m_selectingFace
]);
m_selectionSphereVBO
->
updateData
(
selectionPoint
);
m_pointSprite
->
setAttributePosition
(
m_selectionSphereVBO
);
m_pointSprite
->
setColor
(
CGoGN
::
Geom
::
Vec4f
(
0.0
f
,
0.0
f
,
1.0
f
,
0.5
f
));
m_pointSprite
->
setLightPosition
(
CGoGN
::
Geom
::
Vec3f
(
0.0
f
,
0.0
f
,
1.0
f
));
m_pointSprite
->
setSize
(
m_selectionRadius
);
m_pointSprite
->
enableVertexAttribs
();
glEnable
(
GL_BLEND
);
glBlendFunc
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
);
glDrawArrays
(
GL_POINTS
,
0
,
1
);
glDisable
(
GL_BLEND
);
m_pointSprite
->
disableVertexAttribs
();
break
;
}
}
...
...
@@ -264,6 +294,12 @@ void Surface_Selection_Plugin::mousePress(View* view, QMouseEvent* event)
break
;
}
case
WithinSphere
:
{
Algo
::
Surface
::
Selection
::
Collector_WithinSphere
<
PFP2
>
neigh
(
*
map
,
p
.
positionAttribute
,
m_selectionRadius
);
neigh
.
collectAll
(
m_selectingEdge
);
if
(
event
->
button
()
==
Qt
::
LeftButton
)
selector
->
select
(
neigh
.
getInsideEdges
());
else
if
(
event
->
button
()
==
Qt
::
RightButton
)
selector
->
unselect
(
neigh
.
getInsideEdges
());
break
;
}
}
...
...
@@ -284,6 +320,12 @@ void Surface_Selection_Plugin::mousePress(View* view, QMouseEvent* event)
break
;
}
case
WithinSphere
:
{
Algo
::
Surface
::
Selection
::
Collector_WithinSphere
<
PFP2
>
neigh
(
*
map
,
p
.
positionAttribute
,
m_selectionRadius
);
neigh
.
collectAll
(
m_selectingFace
);
if
(
event
->
button
()
==
Qt
::
LeftButton
)
selector
->
select
(
neigh
.
getInsideFaces
());
else
if
(
event
->
button
()
==
Qt
::
RightButton
)
selector
->
unselect
(
neigh
.
getInsideFaces
());
break
;
}
}
...
...
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