Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CGoGN
CGoGN
Commits
938b9d3a
Commit
938b9d3a
authored
Jun 23, 2015
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug selector remove, selection of polygonal faces
parent
4c937c0e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
120 additions
and
37 deletions
+120
-37
SCHNApps/Plugins/surface_render/include/surface_render.h
SCHNApps/Plugins/surface_render/include/surface_render.h
+1
-0
SCHNApps/Plugins/surface_render/src/surface_render.cpp
SCHNApps/Plugins/surface_render/src/surface_render.cpp
+25
-4
SCHNApps/Plugins/surface_render/src/surface_render_dockTab.cpp
...pps/Plugins/surface_render/src/surface_render_dockTab.cpp
+3
-0
SCHNApps/Plugins/surface_selection/include/surface_selection.h
...pps/Plugins/surface_selection/include/surface_selection.h
+2
-0
SCHNApps/Plugins/surface_selection/src/surface_selection.cpp
SCHNApps/Plugins/surface_selection/src/surface_selection.cpp
+87
-28
SCHNApps/Plugins/surface_selection/src/surface_selection_dockTab.cpp
...ugins/surface_selection/src/surface_selection_dockTab.cpp
+0
-5
SCHNApps/src/controlDock_mapTab.cpp
SCHNApps/src/controlDock_mapTab.cpp
+2
-0
No files found.
SCHNApps/Plugins/surface_render/include/surface_render.h
View file @
938b9d3a
...
@@ -105,6 +105,7 @@ private slots:
...
@@ -105,6 +105,7 @@ private slots:
// slots called from MapHandler signals
// slots called from MapHandler signals
void
vboAdded
(
Utils
::
VBO
*
vbo
);
void
vboAdded
(
Utils
::
VBO
*
vbo
);
void
vboRemoved
(
Utils
::
VBO
*
vbo
);
void
vboRemoved
(
Utils
::
VBO
*
vbo
);
void
selectedMapBoundingBoxModified
();
void
schnappsClosing
();
void
schnappsClosing
();
...
...
SCHNApps/Plugins/surface_render/src/surface_render.cpp
View file @
938b9d3a
...
@@ -18,13 +18,13 @@ bool Surface_Render_Plugin::enable()
...
@@ -18,13 +18,13 @@ bool Surface_Render_Plugin::enable()
m_schnapps
->
addPluginDockTab
(
this
,
m_dockTab
,
"Surface_Render"
);
m_schnapps
->
addPluginDockTab
(
this
,
m_dockTab
,
"Surface_Render"
);
m_flatShader
=
new
CGoGN
::
Utils
::
ShaderFlat
();
m_flatShader
=
new
CGoGN
::
Utils
::
ShaderFlat
();
//
m_flatShader->setAmbiant(CGoGN::Geom::Vec4f(0.2f, 0.2f, 0.2f, 0.1f));
m_flatShader
->
setAmbiant
(
CGoGN
::
Geom
::
Vec4f
(
0.2
f
,
0.2
f
,
0.2
f
,
0.1
f
));
m_flatShader
->
setExplode
(
1.0
f
);
m_flatShader
->
setExplode
(
1.0
f
);
m_phongShader
=
new
CGoGN
::
Utils
::
ShaderPhong
();
m_phongShader
=
new
CGoGN
::
Utils
::
ShaderPhong
();
//
m_phongShader->setAmbiant(CGoGN::Geom::Vec4f(0.2f, 0.2f, 0.2f, 0.1f));
m_phongShader
->
setAmbiant
(
CGoGN
::
Geom
::
Vec4f
(
0.2
f
,
0.2
f
,
0.2
f
,
0.1
f
));
//
m_phongShader->setSpecular(CGoGN::Geom::Vec4f(0.9f, 0.9f, 0.9f, 1.0f));
m_phongShader
->
setSpecular
(
CGoGN
::
Geom
::
Vec4f
(
0.9
f
,
0.9
f
,
0.9
f
,
1.0
f
));
//
m_phongShader->setShininess(80.0f);
m_phongShader
->
setShininess
(
80.0
f
);
m_colorPerVertexShader
=
new
CGoGN
::
Utils
::
ShaderColorPerVertex
();
m_colorPerVertexShader
=
new
CGoGN
::
Utils
::
ShaderColorPerVertex
();
...
@@ -153,6 +153,13 @@ void Surface_Render_Plugin::selectedViewChanged(View *prev, View *cur)
...
@@ -153,6 +153,13 @@ void Surface_Render_Plugin::selectedViewChanged(View *prev, View *cur)
void
Surface_Render_Plugin
::
selectedMapChanged
(
MapHandlerGen
*
prev
,
MapHandlerGen
*
cur
)
void
Surface_Render_Plugin
::
selectedMapChanged
(
MapHandlerGen
*
prev
,
MapHandlerGen
*
cur
)
{
{
DEBUG_SLOT
();
DEBUG_SLOT
();
if
(
prev
)
disconnect
(
prev
,
SIGNAL
(
boundingBoxModified
()),
this
,
SLOT
(
selectedMapBoundingBoxModified
()));
if
(
cur
)
connect
(
cur
,
SIGNAL
(
boundingBoxModified
()),
this
,
SLOT
(
selectedMapBoundingBoxModified
()));
m_dockTab
->
updateMapParameters
();
m_dockTab
->
updateMapParameters
();
}
}
...
@@ -161,6 +168,7 @@ void Surface_Render_Plugin::mapAdded(MapHandlerGen *map)
...
@@ -161,6 +168,7 @@ void Surface_Render_Plugin::mapAdded(MapHandlerGen *map)
DEBUG_SLOT
();
DEBUG_SLOT
();
connect
(
map
,
SIGNAL
(
vboAdded
(
Utils
::
VBO
*
)),
this
,
SLOT
(
vboAdded
(
Utils
::
VBO
*
)));
connect
(
map
,
SIGNAL
(
vboAdded
(
Utils
::
VBO
*
)),
this
,
SLOT
(
vboAdded
(
Utils
::
VBO
*
)));
connect
(
map
,
SIGNAL
(
vboRemoved
(
Utils
::
VBO
*
)),
this
,
SLOT
(
vboRemoved
(
Utils
::
VBO
*
)));
connect
(
map
,
SIGNAL
(
vboRemoved
(
Utils
::
VBO
*
)),
this
,
SLOT
(
vboRemoved
(
Utils
::
VBO
*
)));
connect
(
map
,
SIGNAL
(
boundingBoxModified
()),
this
,
SLOT
(
selectedMapBoundingBoxModified
()));
}
}
void
Surface_Render_Plugin
::
mapRemoved
(
MapHandlerGen
*
map
)
void
Surface_Render_Plugin
::
mapRemoved
(
MapHandlerGen
*
map
)
...
@@ -168,6 +176,7 @@ void Surface_Render_Plugin::mapRemoved(MapHandlerGen *map)
...
@@ -168,6 +176,7 @@ void Surface_Render_Plugin::mapRemoved(MapHandlerGen *map)
DEBUG_SLOT
();
DEBUG_SLOT
();
disconnect
(
map
,
SIGNAL
(
vboAdded
(
Utils
::
VBO
*
)),
this
,
SLOT
(
vboAdded
(
Utils
::
VBO
*
)));
disconnect
(
map
,
SIGNAL
(
vboAdded
(
Utils
::
VBO
*
)),
this
,
SLOT
(
vboAdded
(
Utils
::
VBO
*
)));
disconnect
(
map
,
SIGNAL
(
vboRemoved
(
Utils
::
VBO
*
)),
this
,
SLOT
(
vboRemoved
(
Utils
::
VBO
*
)));
disconnect
(
map
,
SIGNAL
(
vboRemoved
(
Utils
::
VBO
*
)),
this
,
SLOT
(
vboRemoved
(
Utils
::
VBO
*
)));
disconnect
(
map
,
SIGNAL
(
boundingBoxModified
()),
this
,
SLOT
(
selectedMapBoundingBoxModified
()));
}
}
...
@@ -235,6 +244,18 @@ void Surface_Render_Plugin::vboRemoved(Utils::VBO *vbo)
...
@@ -235,6 +244,18 @@ void Surface_Render_Plugin::vboRemoved(Utils::VBO *vbo)
}
}
void
Surface_Render_Plugin
::
selectedMapBoundingBoxModified
()
{
MapHandlerGen
*
m
=
m_schnapps
->
getSelectedMap
();
QList
<
View
*>
views
=
m
->
getLinkedViews
();
if
(
m
)
foreach
(
View
*
v
,
views
)
{
if
(
h_viewParameterSet
.
contains
(
v
))
h_viewParameterSet
[
v
][
m
].
basePSradius
=
m
->
getBBdiagSize
()
/
(
2
*
std
::
sqrt
(
m
->
getNbOrbits
(
EDGE
)));
}
}
...
...
SCHNApps/Plugins/surface_render/src/surface_render_dockTab.cpp
View file @
938b9d3a
...
@@ -53,9 +53,12 @@ void Surface_Render_DockTab::positionVBOChanged(int index)
...
@@ -53,9 +53,12 @@ void Surface_Render_DockTab::positionVBOChanged(int index)
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
if
(
view
&&
map
)
if
(
view
&&
map
)
{
{
m_plugin
->
h_viewParameterSet
[
view
][
map
].
basePSradius
=
map
->
getBBdiagSize
()
/
(
2
*
std
::
sqrt
(
map
->
getNbOrbits
(
EDGE
)));
m_plugin
->
h_viewParameterSet
[
view
][
map
].
positionVBO
=
map
->
getVBO
(
combo_positionVBO
->
currentText
());
m_plugin
->
h_viewParameterSet
[
view
][
map
].
positionVBO
=
map
->
getVBO
(
combo_positionVBO
->
currentText
());
view
->
updateGL
();
view
->
updateGL
();
m_plugin
->
pythonRecording
(
"changePositionVBO"
,
""
,
view
->
getName
(),
map
->
getName
(),
combo_positionVBO
->
currentText
());
m_plugin
->
pythonRecording
(
"changePositionVBO"
,
""
,
view
->
getName
(),
map
->
getName
(),
combo_positionVBO
->
currentText
());
// TODO write this slot ?
// m_plugin->pythonRecording("changeVerticesBaseSize", "",view->getName(), map->getName(), h_viewParameterSet[view][map].basePSradius);
}
}
}
}
}
}
...
...
SCHNApps/Plugins/surface_selection/include/surface_selection.h
View file @
938b9d3a
...
@@ -70,6 +70,8 @@ private slots:
...
@@ -70,6 +70,8 @@ private slots:
// slots called from SCHNApps signals
// slots called from SCHNApps signals
void
selectedMapChanged
(
MapHandlerGen
*
prev
,
MapHandlerGen
*
cur
);
void
selectedMapChanged
(
MapHandlerGen
*
prev
,
MapHandlerGen
*
cur
);
void
updateSelectedCellsRendering
();
void
updateSelectedCellsRendering
();
void
updateRemovedSelector
(
unsigned
int
orbit
,
const
QString
&
name
);
// slots called from MapHandler signals
// slots called from MapHandler signals
void
selectedMapAttributeAdded
(
unsigned
int
orbit
,
const
QString
&
name
);
void
selectedMapAttributeAdded
(
unsigned
int
orbit
,
const
QString
&
name
);
...
...
SCHNApps/Plugins/surface_selection/src/surface_selection.cpp
View file @
938b9d3a
...
@@ -38,10 +38,10 @@ bool Surface_Selection_Plugin::enable()
...
@@ -38,10 +38,10 @@ bool Surface_Selection_Plugin::enable()
m_pointSprite
=
new
CGoGN
::
Utils
::
PointSprite
();
m_pointSprite
=
new
CGoGN
::
Utils
::
PointSprite
();
m_selectedVerticesVBO
=
new
Utils
::
VBO
();
m_selectedVerticesVBO
=
new
Utils
::
VBO
();
m_selectedEdgesDrawer
=
new
Utils
::
Drawer
();
m_selectedEdgesDrawer
=
new
Utils
::
Drawer
(
1
);
m_selectedFacesDrawer
=
new
Utils
::
Drawer
();
m_selectedFacesDrawer
=
new
Utils
::
Drawer
();
m_selectingCellDrawer
=
new
Utils
::
Drawer
();
m_selectingCellDrawer
=
new
Utils
::
Drawer
(
1
);
m_selectionSphereVBO
=
new
Utils
::
VBO
();
m_selectionSphereVBO
=
new
Utils
::
VBO
();
...
@@ -60,6 +60,8 @@ bool Surface_Selection_Plugin::enable()
...
@@ -60,6 +60,8 @@ bool Surface_Selection_Plugin::enable()
connect
(
cur
,
SIGNAL
(
attributeModified
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
selectedMapAttributeModified
(
unsigned
int
,
const
QString
&
)));
connect
(
cur
,
SIGNAL
(
attributeModified
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
selectedMapAttributeModified
(
unsigned
int
,
const
QString
&
)));
connect
(
cur
,
SIGNAL
(
connectivityModified
()),
this
,
SLOT
(
selectedMapConnectivityModified
()));
connect
(
cur
,
SIGNAL
(
connectivityModified
()),
this
,
SLOT
(
selectedMapConnectivityModified
()));
connect
(
cur
,
SIGNAL
(
boundingBoxModified
()),
this
,
SLOT
(
selectedMapBoundingBoxModified
()));
connect
(
cur
,
SIGNAL
(
boundingBoxModified
()),
this
,
SLOT
(
selectedMapBoundingBoxModified
()));
connect
(
cur
,
SIGNAL
(
cellSelectorRemoved
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
updateRemovedSelector
(
unsigned
int
,
const
QString
&
)));
m_selectionRadiusBase
=
cur
->
getBBdiagSize
()
/
50.0
f
;
m_selectionRadiusBase
=
cur
->
getBBdiagSize
()
/
50.0
f
;
h_parameterSet
[
cur
].
basePSradius
=
cur
->
getBBdiagSize
()
/
(
std
::
sqrt
(
cur
->
getNbOrbits
(
EDGE
)));
h_parameterSet
[
cur
].
basePSradius
=
cur
->
getBBdiagSize
()
/
(
std
::
sqrt
(
cur
->
getNbOrbits
(
EDGE
)));
h_parameterSet
[
cur
].
verticesScaleFactor
=
m_dockTab
->
slider_verticesScaleFactor
->
value
()
/
50.0
f
;
h_parameterSet
[
cur
].
verticesScaleFactor
=
m_dockTab
->
slider_verticesScaleFactor
->
value
()
/
50.0
f
;
...
@@ -94,6 +96,9 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
...
@@ -94,6 +96,9 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
{
{
if
(
map
->
isSelectedMap
())
if
(
map
->
isSelectedMap
())
{
{
glEnable
(
GL_POLYGON_OFFSET_FILL
);
glPolygonOffset
(
-
1.0
f
,
-
1.0
f
);
const
MapParameters
&
p
=
h_parameterSet
[
map
];
const
MapParameters
&
p
=
h_parameterSet
[
map
];
if
(
p
.
positionAttribute
.
isValid
())
if
(
p
.
positionAttribute
.
isValid
())
{
{
...
@@ -111,11 +116,9 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
...
@@ -111,11 +116,9 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
updateSelectedCellsRendering
();
updateSelectedCellsRendering
();
m_pointSprite
->
setAttributePosition
(
m_selectedVerticesVBO
);
m_pointSprite
->
setAttributePosition
(
m_selectedVerticesVBO
);
// m_pointSprite->setColor(CGoGN::Geom::Vec4f(1.0f, 0.0f, 0.0f, 1.0f));
const
QColor
&
col
=
p
.
color
;
const
QColor
&
col
=
p
.
color
;
m_pointSprite
->
setColor
(
Geom
::
Vec4f
(
col
.
redF
(),
col
.
greenF
(),
col
.
blueF
(),
0.0
f
));
m_pointSprite
->
setColor
(
Geom
::
Vec4f
(
col
.
redF
(),
col
.
greenF
(),
col
.
blueF
(),
0.0
f
));
m_pointSprite
->
setLightPosition
(
CGoGN
::
Geom
::
Vec3f
(
0.0
f
,
0.0
f
,
1.0
f
));
m_pointSprite
->
setLightPosition
(
CGoGN
::
Geom
::
Vec3f
(
0.0
f
,
0.0
f
,
1.0
f
));
// m_pointSprite->setSize(map->getBBdiagSize() / 75.0f);
m_pointSprite
->
setSize
(
p
.
basePSradius
*
p
.
verticesScaleFactor
);
m_pointSprite
->
setSize
(
p
.
basePSradius
*
p
.
verticesScaleFactor
);
m_pointSprite
->
enableVertexAttribs
();
m_pointSprite
->
enableVertexAttribs
();
...
@@ -136,14 +139,12 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
...
@@ -136,14 +139,12 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
switch
(
p
.
selectionMethod
)
switch
(
p
.
selectionMethod
)
{
{
case
NormalAngle
:
case
NormalAngle
:
case
SingleCell
:
{
case
SingleCell
:
// m_pointSprite->setSize(map->getBBdiagSize() / 60.0f);
m_pointSprite
->
setSize
(
p
.
basePSradius
*
p
.
verticesScaleFactor
*
2.0
f
);
m_pointSprite
->
setSize
(
p
.
basePSradius
*
p
.
verticesScaleFactor
);
break
;
}
case
WithinSphere
:
case
WithinSphere
:
{
m_pointSprite
->
setSize
(
m_selectionRadiusBase
*
m_selectionRadiusCoeff
);
m_pointSprite
->
setSize
(
m_selectionRadiusBase
*
m_selectionRadiusCoeff
);
break
;
break
;
}
}
}
m_pointSprite
->
enableVertexAttribs
();
m_pointSprite
->
enableVertexAttribs
();
...
@@ -183,8 +184,7 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
...
@@ -183,8 +184,7 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
case
WithinSphere
:
{
case
WithinSphere
:
{
PFP2
::
MAP
*
m
=
static_cast
<
MapHandler
<
PFP2
>*>
(
map
)
->
getMap
();
PFP2
::
MAP
*
m
=
static_cast
<
MapHandler
<
PFP2
>*>
(
map
)
->
getMap
();
std
::
vector
<
PFP2
::
VEC3
>
selectionPoint
;
std
::
vector
<
PFP2
::
VEC3
>
selectionPoint
;
selectionPoint
.
push_back
((
p
.
positionAttribute
[
m_selectingEdge
.
dart
]
+
p
.
positionAttribute
[
m
->
phi1
(
m_selectingEdge
.
dart
)])
/
2.0
f
);
selectionPoint
.
push_back
(
p
.
positionAttribute
[
m_selectingEdge
.
dart
]);
// selectionPoint.push_back(p.positionAttribute[m_selectingEdge.dart]);
m_selectionSphereVBO
->
updateData
(
selectionPoint
);
m_selectionSphereVBO
->
updateData
(
selectionPoint
);
m_pointSprite
->
setAttributePosition
(
m_selectionSphereVBO
);
m_pointSprite
->
setAttributePosition
(
m_selectionSphereVBO
);
...
@@ -220,11 +220,15 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
...
@@ -220,11 +220,15 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
case
SingleCell
:
{
case
SingleCell
:
{
PFP2
::
MAP
*
m
=
static_cast
<
MapHandler
<
PFP2
>*>
(
map
)
->
getMap
();
PFP2
::
MAP
*
m
=
static_cast
<
MapHandler
<
PFP2
>*>
(
map
)
->
getMap
();
m_selectingCellDrawer
->
newList
(
GL_COMPILE_AND_EXECUTE
);
m_selectingCellDrawer
->
newList
(
GL_COMPILE_AND_EXECUTE
);
m_selectingCellDrawer
->
lineWidth
(
6.0
f
);
m_selectingCellDrawer
->
color3f
(
0.0
f
,
0.0
f
,
1.0
f
);
m_selectingCellDrawer
->
color3f
(
0.0
f
,
0.0
f
,
1.0
f
);
m_selectingCellDrawer
->
begin
(
GL_TRIANGLES
);
m_selectingCellDrawer
->
begin
(
GL_LINE_LOOP
);
m_selectingCellDrawer
->
vertex
(
p
.
positionAttribute
[
m_selectingFace
.
dart
]);
Dart
d
=
m_selectingFace
.
dart
;
m_selectingCellDrawer
->
vertex
(
p
.
positionAttribute
[
m
->
phi1
(
m_selectingFace
.
dart
)]);
do
m_selectingCellDrawer
->
vertex
(
p
.
positionAttribute
[
m
->
phi_1
(
m_selectingFace
.
dart
)]);
{
m_selectingCellDrawer
->
vertex
(
p
.
positionAttribute
[
d
]);
d
=
m
->
phi1
(
d
);
}
while
(
d
!=
m_selectingFace
.
dart
);
m_selectingCellDrawer
->
end
();
m_selectingCellDrawer
->
end
();
m_selectingCellDrawer
->
endList
();
m_selectingCellDrawer
->
endList
();
break
;
break
;
...
@@ -233,8 +237,7 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
...
@@ -233,8 +237,7 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
PFP2
::
MAP
*
m
=
static_cast
<
MapHandler
<
PFP2
>*>
(
map
)
->
getMap
();
PFP2
::
MAP
*
m
=
static_cast
<
MapHandler
<
PFP2
>*>
(
map
)
->
getMap
();
std
::
vector
<
PFP2
::
VEC3
>
selectionPoint
;
std
::
vector
<
PFP2
::
VEC3
>
selectionPoint
;
selectionPoint
.
push_back
(
Algo
::
Surface
::
Geometry
::
faceCentroid
<
PFP2
>
(
*
m
,
m_selectingFace
,
p
.
positionAttribute
));
selectionPoint
.
push_back
(
p
.
positionAttribute
[
m_selectingFace
.
dart
]);
// selectionPoint.push_back(p.positionAttribute[m_selectingFace.dart]);
m_selectionSphereVBO
->
updateData
(
selectionPoint
);
m_selectionSphereVBO
->
updateData
(
selectionPoint
);
m_pointSprite
->
setAttributePosition
(
m_selectionSphereVBO
);
m_pointSprite
->
setAttributePosition
(
m_selectionSphereVBO
);
...
@@ -258,6 +261,7 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
...
@@ -258,6 +261,7 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
}
}
}
}
}
}
glDisable
(
GL_POLYGON_OFFSET_FILL
);
}
}
void
Surface_Selection_Plugin
::
keyPress
(
View
*
view
,
QKeyEvent
*
event
)
void
Surface_Selection_Plugin
::
keyPress
(
View
*
view
,
QKeyEvent
*
event
)
...
@@ -521,6 +525,7 @@ void Surface_Selection_Plugin::selectedMapChanged(MapHandlerGen *prev, MapHandle
...
@@ -521,6 +525,7 @@ void Surface_Selection_Plugin::selectedMapChanged(MapHandlerGen *prev, MapHandle
disconnect
(
prev
,
SIGNAL
(
attributeModified
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
selectedMapAttributeModified
(
unsigned
int
,
const
QString
&
)));
disconnect
(
prev
,
SIGNAL
(
attributeModified
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
selectedMapAttributeModified
(
unsigned
int
,
const
QString
&
)));
disconnect
(
prev
,
SIGNAL
(
connectivityModified
()),
this
,
SLOT
(
selectedMapConnectivityModified
()));
disconnect
(
prev
,
SIGNAL
(
connectivityModified
()),
this
,
SLOT
(
selectedMapConnectivityModified
()));
disconnect
(
prev
,
SIGNAL
(
boundingBoxModified
()),
this
,
SLOT
(
selectedMapBoundingBoxModified
()));
disconnect
(
prev
,
SIGNAL
(
boundingBoxModified
()),
this
,
SLOT
(
selectedMapBoundingBoxModified
()));
disconnect
(
prev
,
SIGNAL
(
cellSelectorRemoved
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
updateRemovedSelector
(
unsigned
int
,
const
QString
&
)));
}
}
if
(
cur
)
if
(
cur
)
{
{
...
@@ -528,6 +533,7 @@ void Surface_Selection_Plugin::selectedMapChanged(MapHandlerGen *prev, MapHandle
...
@@ -528,6 +533,7 @@ void Surface_Selection_Plugin::selectedMapChanged(MapHandlerGen *prev, MapHandle
connect
(
cur
,
SIGNAL
(
attributeModified
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
selectedMapAttributeModified
(
unsigned
int
,
const
QString
&
)));
connect
(
cur
,
SIGNAL
(
attributeModified
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
selectedMapAttributeModified
(
unsigned
int
,
const
QString
&
)));
connect
(
cur
,
SIGNAL
(
connectivityModified
()),
this
,
SLOT
(
selectedMapConnectivityModified
()));
connect
(
cur
,
SIGNAL
(
connectivityModified
()),
this
,
SLOT
(
selectedMapConnectivityModified
()));
connect
(
cur
,
SIGNAL
(
boundingBoxModified
()),
this
,
SLOT
(
selectedMapBoundingBoxModified
()));
connect
(
cur
,
SIGNAL
(
boundingBoxModified
()),
this
,
SLOT
(
selectedMapBoundingBoxModified
()));
connect
(
cur
,
SIGNAL
(
cellSelectorRemoved
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
updateRemovedSelector
(
unsigned
int
,
const
QString
&
)));
m_selectionRadiusBase
=
cur
->
getBBdiagSize
()
/
50.0
f
;
m_selectionRadiusBase
=
cur
->
getBBdiagSize
()
/
50.0
f
;
h_parameterSet
[
cur
].
basePSradius
=
cur
->
getBBdiagSize
()
/
(
std
::
sqrt
(
cur
->
getNbOrbits
(
EDGE
)));
h_parameterSet
[
cur
].
basePSradius
=
cur
->
getBBdiagSize
()
/
(
std
::
sqrt
(
cur
->
getNbOrbits
(
EDGE
)));
h_parameterSet
[
cur
].
verticesScaleFactor
=
m_dockTab
->
slider_verticesScaleFactor
->
value
()
/
50.0
f
;
h_parameterSet
[
cur
].
verticesScaleFactor
=
m_dockTab
->
slider_verticesScaleFactor
->
value
()
/
50.0
f
;
...
@@ -585,14 +591,20 @@ void Surface_Selection_Plugin::updateSelectedCellsRendering()
...
@@ -585,14 +591,20 @@ void Surface_Selection_Plugin::updateSelectedCellsRendering()
const
std
::
vector
<
Face
>&
selectedCells
=
cs
->
getSelectedCells
();
const
std
::
vector
<
Face
>&
selectedCells
=
cs
->
getSelectedCells
();
m_selectedFacesDrawer
->
newList
(
GL_COMPILE
);
m_selectedFacesDrawer
->
newList
(
GL_COMPILE
);
// m_selectedFacesDrawer->color3f(1.0f, 0.0f, 0.0f);
m_selectedFacesDrawer
->
color3f
(
p
.
color
.
redF
(),
p
.
color
.
greenF
(),
p
.
color
.
blueF
());
m_selectedFacesDrawer
->
color3f
(
p
.
color
.
redF
(),
p
.
color
.
greenF
(),
p
.
color
.
blueF
());
m_selectedFacesDrawer
->
begin
(
GL_TRIANGLES
);
m_selectedFacesDrawer
->
begin
(
GL_TRIANGLES
);
for
(
std
::
vector
<
Face
>::
const_iterator
f
=
selectedCells
.
begin
();
f
!=
selectedCells
.
end
();
++
f
)
for
(
std
::
vector
<
Face
>::
const_iterator
f
=
selectedCells
.
begin
();
f
!=
selectedCells
.
end
();
++
f
)
{
{
m_selectedFacesDrawer
->
vertex
(
p
.
positionAttribute
[(
*
f
).
dart
]);
Dart
d
=
m
->
phi1
((
*
f
).
dart
);
m_selectedFacesDrawer
->
vertex
(
p
.
positionAttribute
[
m
->
phi1
((
*
f
).
dart
)]);
Dart
e
=
m
->
phi1
(
d
);
m_selectedFacesDrawer
->
vertex
(
p
.
positionAttribute
[
m
->
phi_1
((
*
f
).
dart
)]);
do
{
m_selectedFacesDrawer
->
vertex
(
p
.
positionAttribute
[
f
->
dart
]);
m_selectedFacesDrawer
->
vertex
(
p
.
positionAttribute
[
d
]);
m_selectedFacesDrawer
->
vertex
(
p
.
positionAttribute
[
e
]);
d
=
e
;
e
=
m
->
phi1
(
d
);
}
while
(
e
!=
f
->
dart
);
}
}
m_selectedFacesDrawer
->
end
();
m_selectedFacesDrawer
->
end
();
m_selectedFacesDrawer
->
endList
();
m_selectedFacesDrawer
->
endList
();
...
@@ -604,6 +616,19 @@ void Surface_Selection_Plugin::updateSelectedCellsRendering()
...
@@ -604,6 +616,19 @@ void Surface_Selection_Plugin::updateSelectedCellsRendering()
}
}
void
Surface_Selection_Plugin
::
updateRemovedSelector
(
unsigned
int
orbit
,
const
QString
&
name
)
{
updateSelectedCellsRendering
();
MapHandlerGen
*
m
=
m_schnapps
->
getSelectedMap
();
View
*
v
=
m_schnapps
->
getSelectedView
();
if
(
v
&&
m
)
{
if
(
v
->
isLinkedToMap
(
m
))
v
->
updateGL
();
}
}
...
@@ -636,6 +661,8 @@ void Surface_Selection_Plugin::selectedMapBoundingBoxModified()
...
@@ -636,6 +661,8 @@ void Surface_Selection_Plugin::selectedMapBoundingBoxModified()
{
{
MapHandlerGen
*
map
=
static_cast
<
MapHandlerGen
*>
(
QObject
::
sender
());
MapHandlerGen
*
map
=
static_cast
<
MapHandlerGen
*>
(
QObject
::
sender
());
m_selectionRadiusBase
=
map
->
getBBdiagSize
()
/
50.0
f
;
m_selectionRadiusBase
=
map
->
getBBdiagSize
()
/
50.0
f
;
h_parameterSet
[
map
].
basePSradius
=
map
->
getBBdiagSize
()
/
(
std
::
sqrt
(
map
->
getNbOrbits
(
EDGE
)));
h_parameterSet
[
map
].
verticesScaleFactor
=
m_dockTab
->
slider_verticesScaleFactor
->
value
()
/
50.0
f
;
}
}
...
@@ -652,6 +679,12 @@ void Surface_Selection_Plugin::changePositionAttribute(const QString& map, const
...
@@ -652,6 +679,12 @@ void Surface_Selection_Plugin::changePositionAttribute(const QString& map, const
if
(
m
->
isSelectedMap
())
if
(
m
->
isSelectedMap
())
m_dockTab
->
updateMapParameters
();
m_dockTab
->
updateMapParameters
();
}
}
//View* v = m_schnapps->getSelectedView();
//if (v)
//{
// if (v->isLinkedToMap(m))
// v->updateGL();
//}
}
}
void
Surface_Selection_Plugin
::
changeNormalAttribute
(
const
QString
&
map
,
const
QString
&
name
)
void
Surface_Selection_Plugin
::
changeNormalAttribute
(
const
QString
&
map
,
const
QString
&
name
)
...
@@ -664,6 +697,12 @@ void Surface_Selection_Plugin::changeNormalAttribute(const QString& map, const Q
...
@@ -664,6 +697,12 @@ void Surface_Selection_Plugin::changeNormalAttribute(const QString& map, const Q
if
(
m
->
isSelectedMap
())
if
(
m
->
isSelectedMap
())
m_dockTab
->
updateMapParameters
();
m_dockTab
->
updateMapParameters
();
}
}
//View* v = m_schnapps->getSelectedView();
//if (v)
//{
// if (v->isLinkedToMap(m))
// v->updateGL();
//}
}
}
void
Surface_Selection_Plugin
::
changeSelectionMethod
(
const
QString
&
map
,
unsigned
int
method
)
void
Surface_Selection_Plugin
::
changeSelectionMethod
(
const
QString
&
map
,
unsigned
int
method
)
...
@@ -675,6 +714,12 @@ void Surface_Selection_Plugin::changeSelectionMethod(const QString& map, unsigne
...
@@ -675,6 +714,12 @@ void Surface_Selection_Plugin::changeSelectionMethod(const QString& map, unsigne
if
(
m
->
isSelectedMap
())
if
(
m
->
isSelectedMap
())
m_dockTab
->
updateMapParameters
();
m_dockTab
->
updateMapParameters
();
}
}
//View* v = m_schnapps->getSelectedView();
//if (v)
//{
// if (v->isLinkedToMap(m))
// v->updateGL();
//}
}
}
void
Surface_Selection_Plugin
::
changeVerticesScaleFactor
(
const
QString
&
map
,
float
f
)
void
Surface_Selection_Plugin
::
changeVerticesScaleFactor
(
const
QString
&
map
,
float
f
)
...
@@ -687,6 +732,13 @@ void Surface_Selection_Plugin::changeVerticesScaleFactor(const QString& map, flo
...
@@ -687,6 +732,13 @@ void Surface_Selection_Plugin::changeVerticesScaleFactor(const QString& map, flo
if
(
m
->
isSelectedMap
())
if
(
m
->
isSelectedMap
())
m_dockTab
->
updateMapParameters
();
m_dockTab
->
updateMapParameters
();
}
}
//View* v = m_schnapps->getSelectedView();
//if (v)
//{
// if (v->isLinkedToMap(m))
// v->updateGL();
//}
}
}
void
Surface_Selection_Plugin
::
changeVerticesBaseSize
(
const
QString
&
map
,
float
f
)
void
Surface_Selection_Plugin
::
changeVerticesBaseSize
(
const
QString
&
map
,
float
f
)
...
@@ -699,6 +751,13 @@ void Surface_Selection_Plugin::changeVerticesBaseSize(const QString& map, float
...
@@ -699,6 +751,13 @@ void Surface_Selection_Plugin::changeVerticesBaseSize(const QString& map, float
if
(
m
->
isSelectedMap
())
if
(
m
->
isSelectedMap
())
m_dockTab
->
updateMapParameters
();
m_dockTab
->
updateMapParameters
();
}
}
//View* v = m_schnapps->getSelectedView();
//if (v)
//{
// if (v->isLinkedToMap(m))
// v->updateGL();
//}
}
}
...
@@ -711,12 +770,12 @@ void Surface_Selection_Plugin::changeSelectedColor( const QString& map, const QS
...
@@ -711,12 +770,12 @@ void Surface_Selection_Plugin::changeSelectedColor( const QString& map, const QS
if
(
m
->
isSelectedMap
())
if
(
m
->
isSelectedMap
())
m_dockTab
->
updateMapParameters
();
m_dockTab
->
updateMapParameters
();
View
*
v
=
m_schnapps
->
getSelectedView
();
//
View* v = m_schnapps->getSelectedView();
if
(
v
)
//
if (v)
{
//
{
if
(
v
->
isLinkedToMap
(
m
))
//
if (v->isLinkedToMap(m))
v
->
updateGL
();
//
v->updateGL();
}
//
}
}
}
}
}
...
...
SCHNApps/Plugins/surface_selection/src/surface_selection_dockTab.cpp
View file @
938b9d3a
...
@@ -134,13 +134,8 @@ void Surface_Selection_DockTab::colorChanged(int i)
...
@@ -134,13 +134,8 @@ void Surface_Selection_DockTab::colorChanged(int i)
View
*
view
=
m_schnapps
->
getSelectedView
();
View
*
view
=
m_schnapps
->
getSelectedView
();
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
std
::
cout
<<
"colorChanged: "
<<
combo_color
->
color
().
name
().
toStdString
()
<<
std
::
endl
;
std
::
cout
<<
"colorChanged: "
<<
i
<<
std
::
endl
;
if
(
view
&&
map
)
if
(
view
&&
map
)
{
{
// MapParameters& p = m_plugin->h_parameterSet[map];
QColor
&
col
=
m_plugin
->
h_parameterSet
[
map
].
color
;
QColor
&
col
=
m_plugin
->
h_parameterSet
[
map
].
color
;
if
(
col
!=
combo_color
->
color
())
if
(
col
!=
combo_color
->
color
())
{
{
...
...
SCHNApps/src/controlDock_mapTab.cpp
View file @
938b9d3a
...
@@ -297,6 +297,8 @@ void ControlDock_MapTab::removeSelector()
...
@@ -297,6 +297,8 @@ void ControlDock_MapTab::removeSelector()
}
}
if
(
!
items
.
empty
())
if
(
!
items
.
empty
())
{
{
if
(
m_selectedSelector
[
orbit
]
->
getName
()
==
items
[
0
]
->
text
())
m_selectedSelector
[
orbit
]
=
NULL
;
m_selectedMap
->
removeCellSelector
(
orbit
,
items
[
0
]
->
text
());
m_selectedMap
->
removeCellSelector
(
orbit
,
items
[
0
]
->
text
());
// RECORDING
// RECORDING
QTextStream
*
rec
=
m_schnapps
->
pythonStreamRecorder
();
QTextStream
*
rec
=
m_schnapps
->
pythonStreamRecorder
();
...
...
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