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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
KennethVanhoey
CGoGN
Commits
430c8802
Commit
430c8802
authored
Oct 12, 2013
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of cgogn.u-strasbg.fr:CGoGN
parents
2dd3f2a4
895926cd
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
276 additions
and
182 deletions
+276
-182
SCHNApps/Plugins/surface_deformation/forms/surface_deformation.ui
.../Plugins/surface_deformation/forms/surface_deformation.ui
+42
-42
SCHNApps/Plugins/surface_deformation/include/surface_deformation.h
...Plugins/surface_deformation/include/surface_deformation.h
+3
-3
SCHNApps/Plugins/surface_deformation/include/surface_deformation_dockTab.h
...surface_deformation/include/surface_deformation_dockTab.h
+1
-1
SCHNApps/Plugins/surface_deformation/src/surface_deformation.cpp
...s/Plugins/surface_deformation/src/surface_deformation.cpp
+22
-15
SCHNApps/Plugins/surface_deformation/src/surface_deformation_dockTab.cpp
...s/surface_deformation/src/surface_deformation_dockTab.cpp
+21
-21
SCHNApps/Plugins/surface_differentialProperties/src/surface_differentialProperties.cpp
...erentialProperties/src/surface_differentialProperties.cpp
+3
-0
SCHNApps/Plugins/surface_renderTopo/forms/surface_renderTopo.ui
...ps/Plugins/surface_renderTopo/forms/surface_renderTopo.ui
+12
-1
SCHNApps/Plugins/surface_selection/forms/surface_selection.ui
...Apps/Plugins/surface_selection/forms/surface_selection.ui
+2
-2
SCHNApps/Plugins/surface_selection/src/surface_selection.cpp
SCHNApps/Plugins/surface_selection/src/surface_selection.cpp
+21
-21
SCHNApps/include/cellSelector.h
SCHNApps/include/cellSelector.h
+58
-21
SCHNApps/include/controlDock_mapTab.h
SCHNApps/include/controlDock_mapTab.h
+1
-0
SCHNApps/include/mapHandler.h
SCHNApps/include/mapHandler.h
+6
-1
SCHNApps/include/schnapps.h
SCHNApps/include/schnapps.h
+2
-0
SCHNApps/src/cellSelector.cpp
SCHNApps/src/cellSelector.cpp
+3
-1
SCHNApps/src/controlDock_mapTab.cpp
SCHNApps/src/controlDock_mapTab.cpp
+42
-35
SCHNApps/src/mapHandler.cpp
SCHNApps/src/mapHandler.cpp
+19
-3
SCHNApps/src/schnapps.cpp
SCHNApps/src/schnapps.cpp
+2
-0
SCHNApps/src/view.cpp
SCHNApps/src/view.cpp
+4
-3
include/Algo/LinearSolving/basic.h
include/Algo/LinearSolving/basic.h
+4
-4
include/Algo/LinearSolving/variablesSetup.h
include/Algo/LinearSolving/variablesSetup.h
+8
-8
No files found.
SCHNApps/Plugins/surface_deformation/forms/surface_deformation.ui
View file @
430c8802
...
...
@@ -6,7 +6,7 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
180
</width>
<width>
207
</width>
<height>
545
</height>
</rect>
</property>
...
...
@@ -14,35 +14,8 @@
<string>
Form
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
<string>
Position :
</string>
</property>
</widget>
</item>
<item
row=
"9"
column=
"0"
colspan=
"2"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
156
</width>
<height>
161
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"3"
column=
"0"
colspan=
"2"
>
<widget
class=
"QLabel"
name=
"label_3"
>
<property
name=
"text"
>
<string>
Locked selector :
</string>
</property>
</widget>
</item>
<item
row=
"4"
column=
"0"
colspan=
"2"
>
<widget
class=
"QComboBox"
name=
"combo_lockedSelector"
>
<item
row=
"6"
column=
"0"
colspan=
"2"
>
<widget
class=
"QComboBox"
name=
"combo_freeSelector"
>
<item>
<property
name=
"text"
>
<string>
- select selector -
</string>
...
...
@@ -50,20 +23,18 @@
</item>
</widget>
</item>
<item
row=
"
5"
column=
"0"
colspan=
"2
"
>
<widget
class=
"QLabel"
name=
"label"
>
<item
row=
"
0"
column=
"0
"
>
<widget
class=
"QLabel"
name=
"label
_2
"
>
<property
name=
"text"
>
<string>
Handle selector
:
</string>
<string>
Position
:
</string>
</property>
</widget>
</item>
<item
row=
"6"
column=
"0"
colspan=
"2"
>
<widget
class=
"QComboBox"
name=
"combo_handleSelector"
>
<item>
<item
row=
"5"
column=
"0"
colspan=
"2"
>
<widget
class=
"QLabel"
name=
"label_3"
>
<property
name=
"text"
>
<string>
- select selector -
</string>
<string>
Free vertices selector :
</string>
</property>
</item>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
...
...
@@ -81,20 +52,49 @@
</item>
</widget>
</item>
<item
row=
"
7
"
column=
"0"
colspan=
"2"
>
<item
row=
"
9
"
column=
"0"
colspan=
"2"
>
<widget
class=
"Line"
name=
"line"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
</widget>
</item>
<item
row=
"
8
"
column=
"0"
colspan=
"2"
>
<item
row=
"
10
"
column=
"0"
colspan=
"2"
>
<widget
class=
"QPushButton"
name=
"button_start_stop"
>
<property
name=
"text"
>
<string>
Start
</string>
</property>
</widget>
</item>
<item
row=
"4"
column=
"0"
colspan=
"2"
>
<widget
class=
"QComboBox"
name=
"combo_handleSelector"
>
<item>
<property
name=
"text"
>
<string>
- select selector -
</string>
</property>
</item>
</widget>
</item>
<item
row=
"11"
column=
"0"
colspan=
"2"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
156
</width>
<height>
161
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"3"
column=
"0"
colspan=
"2"
>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
Handle vertices selector :
</string>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
...
...
SCHNApps/Plugins/surface_deformation/include/surface_deformation.h
View file @
430c8802
...
...
@@ -30,8 +30,8 @@ struct MapParameters
VertexAttribute
<
PFP2
::
VEC3
>
positionAttribute
;
CellSelector
<
VERTEX
>*
lockedSelector
;
CellSelector
<
VERTEX
>*
handleSelector
;
CellSelector
<
VERTEX
>*
freeSelector
;
bool
initialized
;
...
...
@@ -88,13 +88,13 @@ private slots:
void
attributeAdded
(
unsigned
int
orbit
,
const
QString
&
name
);
void
cellSelectorAdded
(
unsigned
int
orbit
,
const
QString
&
name
);
void
cellSelectorRemoved
(
unsigned
int
orbit
,
const
QString
&
name
);
void
selectedCellsChanged
();
void
selectedCellsChanged
(
CellSelectorGen
*
cs
);
public
slots
:
// slots for Python calls
void
changePositionAttribute
(
const
QString
&
map
,
const
QString
&
name
);
void
changeLockedSelector
(
const
QString
&
map
,
const
QString
&
name
);
void
changeHandleSelector
(
const
QString
&
map
,
const
QString
&
name
);
void
changeFreeSelector
(
const
QString
&
map
,
const
QString
&
name
);
protected:
void
toggleMapDeformation
(
MapHandlerGen
*
map
);
...
...
SCHNApps/Plugins/surface_deformation/include/surface_deformation_dockTab.h
View file @
430c8802
...
...
@@ -29,8 +29,8 @@ private:
private
slots
:
void
positionAttributeChanged
(
int
index
);
void
lockedSelectorChanged
(
int
index
);
void
handleSelectorChanged
(
int
index
);
void
freeSelectorChanged
(
int
index
);
void
startStopButtonClicked
();
private:
...
...
SCHNApps/Plugins/surface_deformation/src/surface_deformation.cpp
View file @
430c8802
...
...
@@ -13,8 +13,8 @@ namespace SCHNApps
{
MapParameters
::
MapParameters
()
:
lockedSelector
(
NULL
),
handleSelector
(
NULL
),
freeSelector
(
NULL
),
initialized
(
false
),
nlContext
(
NULL
)
{}
...
...
@@ -29,7 +29,7 @@ void MapParameters::start(MapHandlerGen* mh)
{
if
(
!
initialized
)
{
if
(
positionAttribute
.
isValid
()
&&
lockedSelector
&&
handl
eSelector
)
if
(
positionAttribute
.
isValid
()
&&
handleSelector
&&
fre
eSelector
)
{
positionInit
=
mh
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
"positionInit"
,
false
);
if
(
!
positionInit
.
isValid
())
...
...
@@ -232,6 +232,7 @@ void Surface_Deformation_Plugin::mapAdded(MapHandlerGen* map)
connect
(
map
,
SIGNAL
(
attributeAdded
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
attributeAdded
(
unsigned
int
,
const
QString
&
)));
connect
(
map
,
SIGNAL
(
cellSelectorAdded
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
cellSelectorAdded
(
unsigned
int
,
const
QString
&
)));
connect
(
map
,
SIGNAL
(
cellSelectorRemoved
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
cellSelectorRemoved
(
unsigned
int
,
const
QString
&
)));
connect
(
map
,
SIGNAL
(
selectedCellsChanged
(
CellSelectorGen
*
)),
this
,
SLOT
(
selectedCellsChanged
(
CellSelectorGen
*
)));
}
void
Surface_Deformation_Plugin
::
mapRemoved
(
MapHandlerGen
*
map
)
...
...
@@ -239,6 +240,7 @@ void Surface_Deformation_Plugin::mapRemoved(MapHandlerGen* map)
disconnect
(
map
,
SIGNAL
(
attributeAdded
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
attributeAdded
(
unsigned
int
,
const
QString
&
)));
disconnect
(
map
,
SIGNAL
(
cellSelectorAdded
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
cellSelectorAdded
(
unsigned
int
,
const
QString
&
)));
disconnect
(
map
,
SIGNAL
(
cellSelectorRemoved
(
unsigned
int
,
const
QString
&
)),
this
,
SLOT
(
cellSelectorRemoved
(
unsigned
int
,
const
QString
&
)));
disconnect
(
map
,
SIGNAL
(
selectedCellsChanged
(
CellSelectorGen
*
)),
this
,
SLOT
(
selectedCellsChanged
(
CellSelectorGen
*
)));
}
...
...
@@ -268,26 +270,31 @@ void Surface_Deformation_Plugin::cellSelectorRemoved(unsigned int orbit, const Q
m_dockTab
->
removeVertexSelector
(
name
);
MapParameters
&
p
=
h_parameterSet
[
map
];
if
(
p
.
locked
Selector
->
getName
()
==
name
)
if
(
p
.
handle
Selector
->
getName
()
==
name
)
{
p
.
stop
(
map
);
if
(
!
p
.
initialized
&&
map
->
isSelectedMap
())
m_dockTab
->
mapParametersInitialized
(
false
);
p
.
locked
Selector
=
NULL
;
p
.
handle
Selector
=
NULL
;
}
if
(
p
.
handl
eSelector
->
getName
()
==
name
)
if
(
p
.
fre
eSelector
->
getName
()
==
name
)
{
p
.
stop
(
map
);
if
(
!
p
.
initialized
&&
map
->
isSelectedMap
())
m_dockTab
->
mapParametersInitialized
(
false
);
p
.
handl
eSelector
=
NULL
;
p
.
fre
eSelector
=
NULL
;
}
}
void
Surface_Deformation_Plugin
::
selectedCellsChanged
()
void
Surface_Deformation_Plugin
::
selectedCellsChanged
(
CellSelectorGen
*
cs
)
{
// nlMakeCurrent(perMap->nlContext) ;
// nlReset(NL_FALSE) ;
MapHandlerGen
*
map
=
static_cast
<
MapHandlerGen
*>
(
QObject
::
sender
());
MapParameters
&
p
=
h_parameterSet
[
map
];
if
(
p
.
initialized
&&
(
p
.
handleSelector
==
cs
||
p
.
freeSelector
==
cs
))
{
nlMakeCurrent
(
p
.
nlContext
)
;
nlReset
(
NL_FALSE
)
;
}
}
...
...
@@ -309,7 +316,7 @@ void Surface_Deformation_Plugin::changePositionAttribute(const QString& map, con
}
}
void
Surface_Deformation_Plugin
::
change
Locked
Selector
(
const
QString
&
map
,
const
QString
&
name
)
void
Surface_Deformation_Plugin
::
change
Handle
Selector
(
const
QString
&
map
,
const
QString
&
name
)
{
MapHandlerGen
*
m
=
m_schnapps
->
getMap
(
map
);
if
(
m
)
...
...
@@ -317,14 +324,14 @@ void Surface_Deformation_Plugin::changeLockedSelector(const QString& map, const
MapParameters
&
p
=
h_parameterSet
[
m
];
if
(
!
p
.
initialized
)
{
p
.
locked
Selector
=
m
->
getCellSelector
<
VERTEX
>
(
name
);
p
.
handle
Selector
=
m
->
getCellSelector
<
VERTEX
>
(
name
);
if
(
m
->
isSelectedMap
())
m_dockTab
->
updateMapParameters
();
}
}
}
void
Surface_Deformation_Plugin
::
change
Handl
eSelector
(
const
QString
&
map
,
const
QString
&
name
)
void
Surface_Deformation_Plugin
::
change
Fre
eSelector
(
const
QString
&
map
,
const
QString
&
name
)
{
MapHandlerGen
*
m
=
m_schnapps
->
getMap
(
map
);
if
(
m
)
...
...
@@ -332,7 +339,7 @@ void Surface_Deformation_Plugin::changeHandleSelector(const QString& map, const
MapParameters
&
p
=
h_parameterSet
[
m
];
if
(
!
p
.
initialized
)
{
p
.
handl
eSelector
=
m
->
getCellSelector
<
VERTEX
>
(
name
);
p
.
fre
eSelector
=
m
->
getCellSelector
<
VERTEX
>
(
name
);
if
(
m
->
isSelectedMap
())
m_dockTab
->
updateMapParameters
();
}
...
...
@@ -373,7 +380,7 @@ void Surface_Deformation_Plugin::matchDiffCoord(MapHandlerGen* mh)
nlBegin
(
NL_SYSTEM
)
;
for
(
int
coord
=
0
;
coord
<
3
;
++
coord
)
{
LinearSolving
::
setupVariables
<
PFP2
>
(
*
map
,
p
.
vIndex
,
p
.
locked
Selector
->
getMarker
(),
p
.
positionAttribute
,
coord
);
LinearSolving
::
setupVariables
<
PFP2
>
(
*
map
,
p
.
vIndex
,
p
.
free
Selector
->
getMarker
(),
p
.
positionAttribute
,
coord
);
nlBegin
(
NL_MATRIX
);
LinearSolving
::
addRowsRHS_Laplacian_Topo
<
PFP2
>
(
*
map
,
p
.
vIndex
,
p
.
diffCoord
,
coord
);
nlEnd
(
NL_MATRIX
);
...
...
@@ -503,7 +510,7 @@ void Surface_Deformation_Plugin::asRigidAsPossible(MapHandlerGen* mh)
nlBegin
(
NL_SYSTEM
);
for
(
int
coord
=
0
;
coord
<
3
;
++
coord
)
{
LinearSolving
::
setupVariables
<
PFP2
>
(
*
map
,
p
.
vIndex
,
p
.
locked
Selector
->
getMarker
(),
p
.
positionAttribute
,
coord
);
LinearSolving
::
setupVariables
<
PFP2
>
(
*
map
,
p
.
vIndex
,
p
.
free
Selector
->
getMarker
(),
p
.
positionAttribute
,
coord
);
nlBegin
(
NL_MATRIX
);
// LinearSolving::addRowsRHS_Laplacian_Cotan<PFP2>(*map, p.vIndex, p.edgeWeight, p.vertexArea, p.rotatedDiffCoord, coord);
LinearSolving
::
addRowsRHS_Laplacian_Topo
<
PFP2
>
(
*
map
,
p
.
vIndex
,
p
.
rotatedDiffCoord
,
coord
);
...
...
SCHNApps/Plugins/surface_deformation/src/surface_deformation_dockTab.cpp
View file @
430c8802
...
...
@@ -18,8 +18,8 @@ Surface_Deformation_DockTab::Surface_Deformation_DockTab(SCHNApps* s, Surface_De
setupUi
(
this
);
connect
(
combo_positionAttribute
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
positionAttributeChanged
(
int
)));
connect
(
combo_lockedSelector
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
lockedSelectorChanged
(
int
)));
connect
(
combo_handleSelector
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
handleSelectorChanged
(
int
)));
connect
(
combo_freeSelector
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
freeSelectorChanged
(
int
)));
connect
(
button_start_stop
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
startStopButtonClicked
()));
}
...
...
@@ -42,23 +42,23 @@ void Surface_Deformation_DockTab::positionAttributeChanged(int index)
}
}
void
Surface_Deformation_DockTab
::
locked
SelectorChanged
(
int
index
)
void
Surface_Deformation_DockTab
::
handle
SelectorChanged
(
int
index
)
{
if
(
!
b_updatingUI
)
{
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
if
(
map
)
m_plugin
->
h_parameterSet
[
map
].
lockedSelector
=
map
->
getCellSelector
<
VERTEX
>
(
combo_locked
Selector
->
currentText
());
m_plugin
->
h_parameterSet
[
map
].
handleSelector
=
map
->
getCellSelector
<
VERTEX
>
(
combo_handle
Selector
->
currentText
());
}
}
void
Surface_Deformation_DockTab
::
handl
eSelectorChanged
(
int
index
)
void
Surface_Deformation_DockTab
::
fre
eSelectorChanged
(
int
index
)
{
if
(
!
b_updatingUI
)
{
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
if
(
map
)
m_plugin
->
h_parameterSet
[
map
].
handleSelector
=
map
->
getCellSelector
<
VERTEX
>
(
combo_handl
eSelector
->
currentText
());
m_plugin
->
h_parameterSet
[
map
].
freeSelector
=
map
->
getCellSelector
<
VERTEX
>
(
combo_fre
eSelector
->
currentText
());
}
}
...
...
@@ -89,25 +89,25 @@ void Surface_Deformation_DockTab::addVertexAttribute(const QString& name)
void
Surface_Deformation_DockTab
::
addVertexSelector
(
const
QString
&
name
)
{
b_updatingUI
=
true
;
combo_lockedSelector
->
addItem
(
name
);
combo_handleSelector
->
addItem
(
name
);
combo_freeSelector
->
addItem
(
name
);
b_updatingUI
=
false
;
}
void
Surface_Deformation_DockTab
::
removeVertexSelector
(
const
QString
&
name
)
{
b_updatingUI
=
true
;
int
curIndex
=
combo_lockedSelector
->
currentIndex
();
int
index
=
combo_lockedSelector
->
findText
(
name
,
Qt
::
MatchExactly
);
if
(
curIndex
==
index
)
combo_lockedSelector
->
setCurrentIndex
(
0
);
combo_lockedSelector
->
removeItem
(
index
);
curIndex
=
combo_handleSelector
->
currentIndex
();
index
=
combo_handleSelector
->
findText
(
name
,
Qt
::
MatchExactly
);
int
curIndex
=
combo_handleSelector
->
currentIndex
();
int
index
=
combo_handleSelector
->
findText
(
name
,
Qt
::
MatchExactly
);
if
(
curIndex
==
index
)
combo_handleSelector
->
setCurrentIndex
(
0
);
combo_handleSelector
->
removeItem
(
index
);
curIndex
=
combo_freeSelector
->
currentIndex
();
index
=
combo_freeSelector
->
findText
(
name
,
Qt
::
MatchExactly
);
if
(
curIndex
==
index
)
combo_freeSelector
->
setCurrentIndex
(
0
);
combo_freeSelector
->
removeItem
(
index
);
b_updatingUI
=
false
;
}
...
...
@@ -115,8 +115,8 @@ void Surface_Deformation_DockTab::mapParametersInitialized(bool b)
{
b_updatingUI
=
true
;
combo_positionAttribute
->
setEnabled
(
!
b
);
combo_lockedSelector
->
setEnabled
(
!
b
);
combo_handleSelector
->
setEnabled
(
!
b
);
combo_freeSelector
->
setEnabled
(
!
b
);
if
(
b
)
button_start_stop
->
setText
(
"Stop"
);
else
button_start_stop
->
setText
(
"Start"
);
b_updatingUI
=
false
;
...
...
@@ -128,10 +128,10 @@ void Surface_Deformation_DockTab::updateMapParameters()
combo_positionAttribute
->
clear
();
combo_positionAttribute
->
addItem
(
"- select attribute -"
);
combo_lockedSelector
->
clear
();
combo_lockedSelector
->
addItem
(
"- select selector -"
);
combo_handleSelector
->
clear
();
combo_handleSelector
->
addItem
(
"- select selector -"
);
combo_freeSelector
->
clear
();
combo_freeSelector
->
addItem
(
"- select selector -"
);
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
...
...
@@ -159,14 +159,14 @@ void Surface_Deformation_DockTab::updateMapParameters()
const
CellSelectorSet
&
selectors
=
map
->
getCellSelectorSet
(
VERTEX
);
for
(
CellSelectorSet
::
const_iterator
it
=
selectors
.
constBegin
();
it
!=
selectors
.
constEnd
();
++
it
)
{
combo_lockedSelector
->
addItem
(
it
.
key
());
if
(
p
.
lockedSelector
&&
it
.
key
()
==
p
.
lockedSelector
->
getName
())
combo_lockedSelector
->
setCurrentIndex
(
i
);
combo_handleSelector
->
addItem
(
it
.
key
());
if
(
p
.
handleSelector
&&
it
.
key
()
==
p
.
handleSelector
->
getName
())
combo_handleSelector
->
setCurrentIndex
(
i
);
combo_freeSelector
->
addItem
(
it
.
key
());
if
(
p
.
freeSelector
&&
it
.
key
()
==
p
.
freeSelector
->
getName
())
combo_freeSelector
->
setCurrentIndex
(
i
);
++
i
;
}
...
...
SCHNApps/Plugins/surface_differentialProperties/src/surface_differentialProperties.cpp
View file @
430c8802
...
...
@@ -34,6 +34,9 @@ bool Surface_DifferentialProperties_Plugin::enable()
connect
(
m_schnapps
,
SIGNAL
(
mapAdded
(
MapHandlerGen
*
)),
this
,
SLOT
(
mapAdded
(
MapHandlerGen
*
)));
connect
(
m_schnapps
,
SIGNAL
(
mapRemoved
(
MapHandlerGen
*
)),
this
,
SLOT
(
mapRemoved
(
MapHandlerGen
*
)));
foreach
(
MapHandlerGen
*
map
,
m_schnapps
->
getMapSet
().
values
())
mapAdded
(
map
);
return
true
;
}
...
...
SCHNApps/Plugins/surface_renderTopo/forms/surface_renderTopo.ui
View file @
430c8802
...
...
@@ -6,7 +6,7 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
20
0
</width>
<width>
20
7
</width>
<height>
600
</height>
</rect>
</property>
...
...
@@ -131,6 +131,17 @@
<header>
colorComboBox.h
</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>
combo_positionAttribute
</tabstop>
<tabstop>
check_drawDarts
</tabstop>
<tabstop>
combo_dartsColor
</tabstop>
<tabstop>
check_drawPhi1
</tabstop>
<tabstop>
combo_phi1Color
</tabstop>
<tabstop>
check_drawPhi2
</tabstop>
<tabstop>
combo_phi2Color
</tabstop>
<tabstop>
slider_edgesScaleFactor
</tabstop>
<tabstop>
slider_facesScaleFactor
</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
SCHNApps/Plugins/surface_selection/forms/surface_selection.ui
View file @
430c8802
...
...
@@ -6,7 +6,7 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
20
0
</width>
<width>
20
7
</width>
<height>
600
</height>
</rect>
</property>
...
...
@@ -36,7 +36,7 @@
</item>
</widget>
</item>
<item
row=
"1"
column=
"
1
"
>
<item
row=
"1"
column=
"
0
"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
...
...
SCHNApps/Plugins/surface_selection/src/surface_selection.cpp
View file @
430c8802
...
...
@@ -81,8 +81,6 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
m_drawer
->
vertex
(
p
.
positionAttribute
[
*
it
]);
m_drawer
->
end
();
m_drawer
->
endList
();
}
}
if
(
m_selecting
)
{
...
...
@@ -103,6 +101,8 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
m_pointSprite
->
disableVertexAttribs
();
}
}
}
}
}
void
Surface_Selection_Plugin
::
keyPress
(
View
*
view
,
QKeyEvent
*
event
)
...
...
@@ -111,7 +111,7 @@ void Surface_Selection_Plugin::keyPress(View* view, QKeyEvent* event)
{
view
->
setMouseTracking
(
true
);
m_selecting
=
true
;
//
view->updateGL();
view
->
updateGL
();
}
}
...
...
@@ -121,7 +121,7 @@ void Surface_Selection_Plugin::keyRelease(View* view, QKeyEvent* event)
{
view
->
setMouseTracking
(
false
);
m_selecting
=
false
;
//
view->updateGL();
view
->
updateGL
();
}
}
...
...
SCHNApps/include/cellSelector.h
View file @
430c8802
#ifndef _CELL_SELECTOR_H_
#define _CELL_SELECTOR_H_
#include <QObject>
#include <QString>
#include <QList>
#include "Topology/generic/dart.h"
#include "Topology/generic/genericmap.h"
#include "Topology/generic/cellmarker.h"
#include <QObject>
namespace
CGoGN
{
...
...
@@ -35,27 +35,69 @@ public:
virtual
void
select
(
Dart
d
,
bool
emitSignal
)
=
0
;
virtual
void
unselect
(
Dart
d
,
bool
emitSignal
)
=
0
;
virtual
void
select
(
const
std
::
vector
<
Dart
>&
d
)
=
0
;
virtual
void
unselect
(
const
std
::
vector
<
Dart
>&
d
)
=
0
;
inline
void
select
(
const
std
::
vector
<
Dart
>&
d
)
{
for
(
unsigned
int
i
=
0
;
i
<
d
.
size
();
++
i
)
select
(
d
[
i
],
false
);
checkChange
();
if
(
m_isMutuallyExclusive
&&
!
m_mutuallyExclusive
.
empty
())
{
foreach
(
CellSelectorGen
*
cs
,
m_mutuallyExclusive
)
cs
->
checkChange
();
}
}
inline
void
unselect
(
const
std
::
vector
<
Dart
>&
d
)
{
for
(
unsigned
int
i
=
0
;
i
<
d
.
size
();
++
i
)
unselect
(
d
[
i
],
false
);
checkChange
();
}
virtual
bool
isSelected
(
Dart
d
)
=
0
;
inline
void
setMutuallyExclusive
(
bool
b
)
{
m_isMutuallyExclusive
=
b
;
}
inline
bool
isMutuallyExclusive
()
const
{
return
m_isMutuallyExclusive
;
}
inline
void
setMutuallyExclusiveSet
(
const
QList
<
CellSelectorGen
*>&
mex
)
{
m_mutuallyExclusive
.
clear
();
foreach
(
CellSelectorGen
*
cs
,
mex
)
{
if
(
cs
!=
this
)
m_mutuallyExclusive
.
append
(
cs
);
}
}
inline
void
checkChange
()
{
if
(
m_selectionChanged
)
{
emit
(
selectedCellsChanged
());
m_selectionChanged
=
false
;
}
}
signals:
void
selectedCellsChanged
();
protected:
QString
m_name
;
std
::
vector
<
Dart
>
m_cells
;
bool
m_selectionChanged
;
bool
m_isMutuallyExclusive
;
QList
<
CellSelectorGen
*>
m_mutuallyExclusive
;
};
template
<
unsigned
int
ORBIT
>
class
CellSelector
:
public
CellSelectorGen
{
public:
CellSelector
(
GenericMap
&
m
,
const
QString
&
name
,
unsigned
int
thread
=
0
)
:
CellSelector
(
GenericMap
&
m
ap
,
const
QString
&
name
,
unsigned
int
thread
=
0
)
:
CellSelectorGen
(
name
),
m_map
(
m
),
m_cm
(
m
,
thread
)
m_map
(
m
ap
),
m_cm
(
m
ap
,
thread
)
{}
~
CellSelector
()
...
...
@@ -72,8 +114,15 @@ public:
{
m_cells
.
push_back
(
d
);
m_cm
.
mark
(
v
);
if
(
m_isMutuallyExclusive
&&
!
m_mutuallyExclusive
.
empty
())
{
foreach
(
CellSelectorGen
*
cs
,
m_mutuallyExclusive
)
cs
->
unselect
(
d
,
emitSignal
);
}
if
(
emitSignal
)
emit
(
selectedCellsChanged
());
else
m_selectionChanged
=
true
;
}
}
...
...
@@ -96,24 +145,12 @@ public:
m_cells
.
pop_back
();
if
(
emitSignal
)
emit
(
selectedCellsChanged
());
else
m_selectionChanged
=
true
;
}
}
}
inline
void
select
(
const
std
::
vector
<
Dart
>&
d
)
{
for
(
unsigned
int
i
=
0
;
i
<
d
.
size
();
++
i
)
select
(
d
[
i
],
false
);
emit
(
selectedCellsChanged
());
}