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
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
David Cazier
CGoGN
Commits
986a72a3
Commit
986a72a3
authored
Jan 29, 2013
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCHNApps: update some signals connections
parent
42e522b2
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
151 additions
and
105 deletions
+151
-105
SCHNApps/Plugins/differentialProperties/include/computeCurvatureDialog.h
...s/differentialProperties/include/computeCurvatureDialog.h
+2
-1
SCHNApps/Plugins/differentialProperties/include/computeNormalDialog.h
...gins/differentialProperties/include/computeNormalDialog.h
+2
-1
SCHNApps/Plugins/differentialProperties/src/computeCurvatureDialog.cpp
...ins/differentialProperties/src/computeCurvatureDialog.cpp
+20
-9
SCHNApps/Plugins/differentialProperties/src/computeNormalDialog.cpp
...lugins/differentialProperties/src/computeNormalDialog.cpp
+20
-9
SCHNApps/Plugins/differentialProperties/src/differentialProperties.cpp
...ins/differentialProperties/src/differentialProperties.cpp
+41
-41
SCHNApps/Plugins/importSurface/importSurface.cpp
SCHNApps/Plugins/importSurface/importSurface.cpp
+2
-0
SCHNApps/Plugins/importVolume/importVolume.cpp
SCHNApps/Plugins/importVolume/importVolume.cpp
+2
-0
SCHNApps/Plugins/subdivideSurface/include/subdivideSurfaceDialog.h
...Plugins/subdivideSurface/include/subdivideSurfaceDialog.h
+2
-1
SCHNApps/Plugins/subdivideSurface/src/subdivideSurfaceDialog.cpp
...s/Plugins/subdivideSurface/src/subdivideSurfaceDialog.cpp
+19
-8
SCHNApps/include/mapHandler.h
SCHNApps/include/mapHandler.h
+21
-0
SCHNApps/src/dialogs/cameraViewDialog.cpp
SCHNApps/src/dialogs/cameraViewDialog.cpp
+4
-11
SCHNApps/src/dialogs/mapsViewDialog.cpp
SCHNApps/src/dialogs/mapsViewDialog.cpp
+3
-11
SCHNApps/src/dialogs/pluginsViewDialog.cpp
SCHNApps/src/dialogs/pluginsViewDialog.cpp
+3
-11
SCHNApps/src/view.cpp
SCHNApps/src/view.cpp
+2
-2
SCHNApps/src/window.cpp
SCHNApps/src/window.cpp
+8
-0
No files found.
SCHNApps/Plugins/differentialProperties/include/computeCurvatureDialog.h
View file @
986a72a3
...
...
@@ -21,9 +21,10 @@ public:
private:
Window
*
m_window
;
MapHandlerGen
*
m_selectedMap
;
public
slots
:
void
selectedMapChanged
();
void
refreshUI
();
void
addMapToList
(
MapHandlerGen
*
m
);
void
removeMapFromList
(
MapHandlerGen
*
m
);
};
...
...
SCHNApps/Plugins/differentialProperties/include/computeNormalDialog.h
View file @
986a72a3
...
...
@@ -21,9 +21,10 @@ public:
private:
Window
*
m_window
;
MapHandlerGen
*
m_selectedMap
;
public
slots
:
void
selectedMapChanged
();
void
refreshUI
();
void
addMapToList
(
MapHandlerGen
*
m
);
void
removeMapFromList
(
MapHandlerGen
*
m
);
};
...
...
SCHNApps/Plugins/differentialProperties/src/computeCurvatureDialog.cpp
View file @
986a72a3
...
...
@@ -10,7 +10,9 @@ namespace CGoGN
namespace
SCHNApps
{
ComputeCurvatureDialog
::
ComputeCurvatureDialog
(
Window
*
w
)
:
m_window
(
w
)
ComputeCurvatureDialog
::
ComputeCurvatureDialog
(
Window
*
w
)
:
m_window
(
w
),
m_selectedMap
(
NULL
)
{
setupUi
(
this
);
...
...
@@ -23,15 +25,18 @@ ComputeCurvatureDialog::ComputeCurvatureDialog(Window* w) : m_window(w)
connect
(
m_window
,
SIGNAL
(
mapAdded
(
MapHandlerGen
*
)),
this
,
SLOT
(
addMapToList
(
MapHandlerGen
*
)));
connect
(
m_window
,
SIGNAL
(
mapRemoved
(
MapHandlerGen
*
)),
this
,
SLOT
(
removeMapFromList
(
MapHandlerGen
*
)));
connect
(
mapList
,
SIGNAL
(
itemSelectionChanged
()),
this
,
SLOT
(
selectedMapChanged
()));
connect
(
mapList
,
SIGNAL
(
itemSelectionChanged
()),
this
,
SLOT
(
refreshUI
()));
const
QList
<
MapHandlerGen
*>&
maps
=
m_window
->
getMapsList
();
foreach
(
MapHandlerGen
*
map
,
maps
)
mapList
->
addItem
(
map
->
getName
());
}
void
ComputeCurvatureDialog
::
selectedMapChanged
()
void
ComputeCurvatureDialog
::
refreshUI
()
{
if
(
m_selectedMap
)
disconnect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
()),
this
,
SLOT
(
refreshUI
()));
QList
<
QListWidgetItem
*>
currentItems
=
mapList
->
selectedItems
();
if
(
!
currentItems
.
empty
())
{
...
...
@@ -94,7 +99,12 @@ void ComputeCurvatureDialog::selectedMapChanged()
++
k
;
}
}
m_selectedMap
=
mh
;
connect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
()),
this
,
SLOT
(
refreshUI
()));
}
else
m_selectedMap
=
NULL
;
}
void
ComputeCurvatureDialog
::
addMapToList
(
MapHandlerGen
*
m
)
...
...
@@ -104,13 +114,14 @@ void ComputeCurvatureDialog::addMapToList(MapHandlerGen* m)
void
ComputeCurvatureDialog
::
removeMapFromList
(
MapHandlerGen
*
m
)
{
for
(
int
i
=
0
;
i
<
mapList
->
count
();
++
i
)
QList
<
QListWidgetItem
*>
items
=
mapList
->
findItems
(
m
->
getName
(),
Qt
::
MatchExactly
);
if
(
!
items
.
empty
())
delete
items
[
0
];
if
(
m_selectedMap
==
m
)
{
if
(
mapList
->
item
(
i
)
->
text
()
==
m
->
getName
())
{
delete
mapList
->
item
(
i
);
return
;
}
disconnect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
()),
this
,
SLOT
(
refreshUI
()));
m_selectedMap
=
NULL
;
}
}
...
...
SCHNApps/Plugins/differentialProperties/src/computeNormalDialog.cpp
View file @
986a72a3
...
...
@@ -10,7 +10,9 @@ namespace CGoGN
namespace
SCHNApps
{
ComputeNormalDialog
::
ComputeNormalDialog
(
Window
*
w
)
:
m_window
(
w
)
ComputeNormalDialog
::
ComputeNormalDialog
(
Window
*
w
)
:
m_window
(
w
),
m_selectedMap
(
NULL
)
{
setupUi
(
this
);
...
...
@@ -19,15 +21,18 @@ ComputeNormalDialog::ComputeNormalDialog(Window* w) : m_window(w)
connect
(
m_window
,
SIGNAL
(
mapAdded
(
MapHandlerGen
*
)),
this
,
SLOT
(
addMapToList
(
MapHandlerGen
*
)));
connect
(
m_window
,
SIGNAL
(
mapRemoved
(
MapHandlerGen
*
)),
this
,
SLOT
(
removeMapFromList
(
MapHandlerGen
*
)));
connect
(
mapList
,
SIGNAL
(
itemSelectionChanged
()),
this
,
SLOT
(
selectedMapChanged
()));
connect
(
mapList
,
SIGNAL
(
itemSelectionChanged
()),
this
,
SLOT
(
refreshUI
()));
const
QList
<
MapHandlerGen
*>&
maps
=
m_window
->
getMapsList
();
foreach
(
MapHandlerGen
*
map
,
maps
)
mapList
->
addItem
(
map
->
getName
());
}
void
ComputeNormalDialog
::
selectedMapChanged
()
void
ComputeNormalDialog
::
refreshUI
()
{
if
(
m_selectedMap
)
disconnect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
()),
this
,
SLOT
(
refreshUI
()));
QList
<
QListWidgetItem
*>
currentItems
=
mapList
->
selectedItems
();
if
(
!
currentItems
.
empty
())
{
...
...
@@ -59,7 +64,12 @@ void ComputeNormalDialog::selectedMapChanged()
++
j
;
}
}
m_selectedMap
=
mh
;
connect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
()),
this
,
SLOT
(
refreshUI
()));
}
else
m_selectedMap
=
NULL
;
}
void
ComputeNormalDialog
::
addMapToList
(
MapHandlerGen
*
m
)
...
...
@@ -69,13 +79,14 @@ void ComputeNormalDialog::addMapToList(MapHandlerGen* m)
void
ComputeNormalDialog
::
removeMapFromList
(
MapHandlerGen
*
m
)
{
for
(
int
i
=
0
;
i
<
mapList
->
count
();
++
i
)
QList
<
QListWidgetItem
*>
items
=
mapList
->
findItems
(
m
->
getName
(),
Qt
::
MatchExactly
);
if
(
!
items
.
empty
())
delete
items
[
0
];
if
(
m_selectedMap
==
m
)
{
if
(
mapList
->
item
(
i
)
->
text
()
==
m
->
getName
())
{
delete
mapList
->
item
(
i
);
return
;
}
disconnect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
()),
this
,
SLOT
(
refreshUI
()));
m_selectedMap
=
NULL
;
}
}
...
...
SCHNApps/Plugins/differentialProperties/src/differentialProperties.cpp
View file @
986a72a3
...
...
@@ -45,20 +45,20 @@ void DifferentialPropertiesPlugin::computeNormal()
{
const
QString
&
mapname
=
currentItems
[
0
]
->
text
();
MapHandler
<
PFP2
>*
mh
=
static_cast
<
MapHandler
<
PFP2
>*>
(
m_window
->
getMap
(
mapname
));
PFP2
::
MAP
*
map
=
mh
->
getMap
();
std
::
string
positionName
=
m_computeNormalDialog
->
combo_positionAttribute
->
currentText
().
toUtf8
().
constData
();
std
::
s
tring
normalName
;
QString
positionName
=
m_computeNormalDialog
->
combo_positionAttribute
->
currentText
();
QS
tring
normalName
;
if
(
m_computeNormalDialog
->
normalAttributeName
->
text
().
isEmpty
())
normalName
=
m_computeNormalDialog
->
combo_normalAttribute
->
currentText
()
.
toUtf8
().
constData
()
;
normalName
=
m_computeNormalDialog
->
combo_normalAttribute
->
currentText
();
else
normalName
=
m_computeNormalDialog
->
normalAttributeName
->
text
()
.
toUtf8
().
constData
()
;
normalName
=
m_computeNormalDialog
->
normalAttributeName
->
text
();
VertexAttribute
<
PFP2
::
VEC3
>
position
=
m
ap
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
positionName
);
VertexAttribute
<
PFP2
::
VEC3
>
normal
=
m
ap
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
normalName
);
VertexAttribute
<
PFP2
::
VEC3
>
position
=
m
h
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
positionName
);
VertexAttribute
<
PFP2
::
VEC3
>
normal
=
m
h
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
normalName
);
if
(
!
normal
.
isValid
())
normal
=
m
ap
->
addAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
normalName
);
normal
=
m
h
->
addAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
normalName
);
PFP2
::
MAP
*
map
=
mh
->
getMap
();
Algo
::
Surface
::
Geometry
::
computeNormalVertices
<
PFP2
>
(
*
map
,
position
,
normal
);
if
(
m_computeNormalDialog
->
check_createVBO
->
checkState
()
==
Qt
::
Checked
)
...
...
@@ -77,64 +77,64 @@ void DifferentialPropertiesPlugin::computeCurvature()
{
const
QString
&
mapname
=
currentItems
[
0
]
->
text
();
MapHandler
<
PFP2
>*
mh
=
static_cast
<
MapHandler
<
PFP2
>*>
(
m_window
->
getMap
(
mapname
));
PFP2
::
MAP
*
map
=
mh
->
getMap
();
std
::
string
positionName
=
m_computeCurvatureDialog
->
combo_positionAttribute
->
currentText
().
toUtf8
().
constData
();
std
::
string
normalName
=
m_computeCurvatureDialog
->
combo_normalAttribute
->
currentText
().
toUtf8
().
constData
();
QString
positionName
=
m_computeCurvatureDialog
->
combo_positionAttribute
->
currentText
();
QString
normalName
=
m_computeCurvatureDialog
->
combo_normalAttribute
->
currentText
();
VertexAttribute
<
PFP2
::
VEC3
>
position
=
m
ap
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
positionName
);
VertexAttribute
<
PFP2
::
VEC3
>
normal
=
m
ap
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
normalName
);
VertexAttribute
<
PFP2
::
VEC3
>
position
=
m
h
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
positionName
);
VertexAttribute
<
PFP2
::
VEC3
>
normal
=
m
h
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
normalName
);
std
::
s
tring
KmaxName
;
QS
tring
KmaxName
;
if
(
m_computeCurvatureDialog
->
KmaxAttributeName
->
text
().
isEmpty
())
KmaxName
=
m_computeCurvatureDialog
->
combo_KmaxAttribute
->
currentText
()
.
toUtf8
().
constData
()
;
KmaxName
=
m_computeCurvatureDialog
->
combo_KmaxAttribute
->
currentText
();
else
KmaxName
=
m_computeCurvatureDialog
->
KmaxAttributeName
->
text
()
.
toUtf8
().
constData
()
;
VertexAttribute
<
PFP2
::
VEC3
>
Kmax
=
m
ap
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
KmaxName
);
KmaxName
=
m_computeCurvatureDialog
->
KmaxAttributeName
->
text
();
VertexAttribute
<
PFP2
::
VEC3
>
Kmax
=
m
h
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
KmaxName
);
if
(
!
Kmax
.
isValid
())
Kmax
=
m
ap
->
addAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
KmaxName
);
Kmax
=
m
h
->
addAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
KmaxName
);
std
::
s
tring
kmaxName
;
QS
tring
kmaxName
;
if
(
m_computeCurvatureDialog
->
kmaxAttributeName
->
text
().
isEmpty
())
kmaxName
=
m_computeCurvatureDialog
->
combo_kmaxAttribute
->
currentText
()
.
toUtf8
().
constData
()
;
kmaxName
=
m_computeCurvatureDialog
->
combo_kmaxAttribute
->
currentText
();
else
kmaxName
=
m_computeCurvatureDialog
->
kmaxAttributeName
->
text
()
.
toUtf8
().
constData
()
;
VertexAttribute
<
PFP2
::
REAL
>
kmax
=
m
ap
->
getAttribute
<
PFP2
::
REAL
,
VERTEX
>
(
kmaxName
);
kmaxName
=
m_computeCurvatureDialog
->
kmaxAttributeName
->
text
();
VertexAttribute
<
PFP2
::
REAL
>
kmax
=
m
h
->
getAttribute
<
PFP2
::
REAL
,
VERTEX
>
(
kmaxName
);
if
(
!
kmax
.
isValid
())
kmax
=
m
ap
->
addAttribute
<
PFP2
::
REAL
,
VERTEX
>
(
kmaxName
);
kmax
=
m
h
->
addAttribute
<
PFP2
::
REAL
,
VERTEX
>
(
kmaxName
);
std
::
s
tring
KminName
;
QS
tring
KminName
;
if
(
m_computeCurvatureDialog
->
KminAttributeName
->
text
().
isEmpty
())
KminName
=
m_computeCurvatureDialog
->
combo_KminAttribute
->
currentText
()
.
toUtf8
().
constData
()
;
KminName
=
m_computeCurvatureDialog
->
combo_KminAttribute
->
currentText
();
else
KminName
=
m_computeCurvatureDialog
->
KminAttributeName
->
text
()
.
toUtf8
().
constData
()
;
VertexAttribute
<
PFP2
::
VEC3
>
Kmin
=
m
ap
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
KminName
);
KminName
=
m_computeCurvatureDialog
->
KminAttributeName
->
text
();
VertexAttribute
<
PFP2
::
VEC3
>
Kmin
=
m
h
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
KminName
);
if
(
!
Kmin
.
isValid
())
Kmin
=
m
ap
->
addAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
KminName
);
Kmin
=
m
h
->
addAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
KminName
);
std
::
s
tring
kminName
;
QS
tring
kminName
;
if
(
m_computeCurvatureDialog
->
kminAttributeName
->
text
().
isEmpty
())
kminName
=
m_computeCurvatureDialog
->
combo_kminAttribute
->
currentText
()
.
toUtf8
().
constData
()
;
kminName
=
m_computeCurvatureDialog
->
combo_kminAttribute
->
currentText
();
else
kminName
=
m_computeCurvatureDialog
->
kminAttributeName
->
text
()
.
toUtf8
().
constData
()
;
VertexAttribute
<
PFP2
::
REAL
>
kmin
=
m
ap
->
getAttribute
<
PFP2
::
REAL
,
VERTEX
>
(
kminName
);
kminName
=
m_computeCurvatureDialog
->
kminAttributeName
->
text
();
VertexAttribute
<
PFP2
::
REAL
>
kmin
=
m
h
->
getAttribute
<
PFP2
::
REAL
,
VERTEX
>
(
kminName
);
if
(
!
kmin
.
isValid
())
kmin
=
m
ap
->
addAttribute
<
PFP2
::
REAL
,
VERTEX
>
(
kminName
);
kmin
=
m
h
->
addAttribute
<
PFP2
::
REAL
,
VERTEX
>
(
kminName
);
std
::
s
tring
KnormalName
;
QS
tring
KnormalName
;
if
(
m_computeCurvatureDialog
->
KnormalAttributeName
->
text
().
isEmpty
())
KnormalName
=
m_computeCurvatureDialog
->
combo_KnormalAttribute
->
currentText
()
.
toUtf8
().
constData
()
;
KnormalName
=
m_computeCurvatureDialog
->
combo_KnormalAttribute
->
currentText
();
else
KnormalName
=
m_computeCurvatureDialog
->
KnormalAttributeName
->
text
()
.
toUtf8
().
constData
()
;
VertexAttribute
<
PFP2
::
VEC3
>
Knormal
=
m
ap
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
KnormalName
);
KnormalName
=
m_computeCurvatureDialog
->
KnormalAttributeName
->
text
();
VertexAttribute
<
PFP2
::
VEC3
>
Knormal
=
m
h
->
getAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
KnormalName
);
if
(
!
Knormal
.
isValid
())
Knormal
=
m
ap
->
addAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
KnormalName
);
Knormal
=
m
h
->
addAttribute
<
PFP2
::
VEC3
,
VERTEX
>
(
KnormalName
);
EdgeAttribute
<
PFP2
::
REAL
>
edgeAngle
=
m
ap
->
getAttribute
<
PFP2
::
REAL
,
EDGE
>
(
"edgeAngle"
);
EdgeAttribute
<
PFP2
::
REAL
>
edgeAngle
=
m
h
->
getAttribute
<
PFP2
::
REAL
,
EDGE
>
(
"edgeAngle"
);
if
(
!
edgeAngle
.
isValid
())
edgeAngle
=
map
->
addAttribute
<
PFP2
::
REAL
,
EDGE
>
(
"edgeAngle"
);
Algo
::
Surface
::
Geometry
::
computeAnglesBetweenNormalsOnEdges
<
PFP2
>
(
*
map
,
position
,
edgeAngle
);
edgeAngle
=
mh
->
addAttribute
<
PFP2
::
REAL
,
EDGE
>
(
"edgeAngle"
);
PFP2
::
MAP
*
map
=
mh
->
getMap
();
Algo
::
Surface
::
Geometry
::
computeAnglesBetweenNormalsOnEdges
<
PFP2
>
(
*
map
,
position
,
edgeAngle
);
Algo
::
Surface
::
Geometry
::
computeCurvatureVertices_NormalCycles_Projected
<
PFP2
>
(
*
map
,
0.01
f
*
mh
->
getBBdiagSize
(),
position
,
normal
,
edgeAngle
,
kmax
,
kmin
,
Kmax
,
Kmin
,
Knormal
);
if
(
m_computeCurvatureDialog
->
check_KmaxCreateVBO
->
checkState
()
==
Qt
::
Checked
)
...
...
SCHNApps/Plugins/importSurface/importSurface.cpp
View file @
986a72a3
...
...
@@ -45,6 +45,8 @@ MapHandlerGen* ImportSurfacePlugin::importFromFile(const QString& fileName)
}
return
mhg
;
}
else
return
NULL
;
}
void
ImportSurfacePlugin
::
importFromFileDialog
()
...
...
SCHNApps/Plugins/importVolume/importVolume.cpp
View file @
986a72a3
...
...
@@ -45,6 +45,8 @@ MapHandlerGen* ImportVolumePlugin::importFromFile(const QString& fileName)
}
return
mhg
;
}
else
return
NULL
;
}
void
ImportVolumePlugin
::
importFromFileDialog
()
...
...
SCHNApps/Plugins/subdivideSurface/include/subdivideSurfaceDialog.h
View file @
986a72a3
...
...
@@ -21,9 +21,10 @@ public:
private:
Window
*
m_window
;
MapHandlerGen
*
m_selectedMap
;
public
slots
:
void
selectedMapChanged
();
void
refreshUI
();
void
addMapToList
(
MapHandlerGen
*
m
);
void
removeMapFromList
(
MapHandlerGen
*
m
);
};
...
...
SCHNApps/Plugins/subdivideSurface/src/subdivideSurfaceDialog.cpp
View file @
986a72a3
...
...
@@ -10,7 +10,9 @@ namespace CGoGN
namespace
SCHNApps
{
SubdivideSurfaceDialog
::
SubdivideSurfaceDialog
(
Window
*
w
)
:
m_window
(
w
)
SubdivideSurfaceDialog
::
SubdivideSurfaceDialog
(
Window
*
w
)
:
m_window
(
w
),
m_selectedMap
(
NULL
)
{
setupUi
(
this
);
...
...
@@ -24,8 +26,11 @@ SubdivideSurfaceDialog::SubdivideSurfaceDialog(Window* w) : m_window(w)
mapList
->
addItem
(
map
->
getName
());
}
void
SubdivideSurfaceDialog
::
selectedMapChanged
()
void
SubdivideSurfaceDialog
::
refreshUI
()
{
if
(
m_selectedMap
)
disconnect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
()),
this
,
SLOT
(
refreshUI
()));
QList
<
QListWidgetItem
*>
currentItems
=
mapList
->
selectedItems
();
if
(
!
currentItems
.
empty
())
{
...
...
@@ -52,7 +57,12 @@ void SubdivideSurfaceDialog::selectedMapChanged()
++
j
;
}
}
m_selectedMap
=
mh
;
connect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
()),
this
,
SLOT
(
refreshUI
()));
}
else
m_selectedMap
=
NULL
;
}
void
SubdivideSurfaceDialog
::
addMapToList
(
MapHandlerGen
*
m
)
...
...
@@ -62,13 +72,14 @@ void SubdivideSurfaceDialog::addMapToList(MapHandlerGen* m)
void
SubdivideSurfaceDialog
::
removeMapFromList
(
MapHandlerGen
*
m
)
{
for
(
int
i
=
0
;
i
<
mapList
->
count
();
++
i
)
QList
<
QListWidgetItem
*>
items
=
mapList
->
findItems
(
m
->
getName
(),
Qt
::
MatchExactly
);
if
(
!
items
.
empty
())
delete
items
[
0
];
if
(
m_selectedMap
==
m
)
{
if
(
mapList
->
item
(
i
)
->
text
()
==
m
->
getName
())
{
delete
mapList
->
item
(
i
);
return
;
}
disconnect
(
m_selectedMap
,
SIGNAL
(
attributeAdded
()),
this
,
SLOT
(
refreshUI
()));
m_selectedMap
=
NULL
;
}
}
...
...
SCHNApps/include/mapHandler.h
View file @
986a72a3
...
...
@@ -8,6 +8,7 @@
#include "plugin.h"
#include "Topology/generic/genericmap.h"
#include "Topology/generic/attribmap.h"
#include "Topology/generic/functor.h"
#include "Topology/generic/attributeHandler.h"
#include "Utils/vbo.h"
...
...
@@ -48,6 +49,25 @@ public slots:
public:
void
draw
(
Utils
::
GLSLShader
*
shader
,
int
primitive
)
{
m_render
->
draw
(
shader
,
primitive
);
}
/*********************************************************
* MANAGE ATTRIBUTES
*********************************************************/
template
<
typename
T
,
unsigned
int
ORBIT
>
AttributeHandler
<
T
,
ORBIT
>
getAttribute
(
const
QString
&
nameAttr
)
{
AttributeHandler
<
T
,
ORBIT
>
ah
=
static_cast
<
AttribMap
*>
(
m_map
)
->
getAttribute
<
T
,
ORBIT
>
(
nameAttr
.
toUtf8
().
constData
());
return
ah
;
}
template
<
typename
T
,
unsigned
int
ORBIT
>
AttributeHandler
<
T
,
ORBIT
>
addAttribute
(
const
QString
&
nameAttr
)
{
AttributeHandler
<
T
,
ORBIT
>
ah
=
static_cast
<
AttribMap
*>
(
m_map
)
->
addAttribute
<
T
,
ORBIT
>
(
nameAttr
.
toUtf8
().
constData
());
emit
(
attributeAdded
());
return
ah
;
}
/*********************************************************
* MANAGE VBOs
*********************************************************/
...
...
@@ -105,6 +125,7 @@ protected:
VBOHash
h_vbo
;
signals:
void
attributeAdded
();
void
vboAdded
(
Utils
::
VBO
*
vbo
);
void
vboRemoved
(
Utils
::
VBO
*
vbo
);
};
...
...
SCHNApps/src/dialogs/cameraViewDialog.cpp
View file @
986a72a3
...
...
@@ -54,7 +54,7 @@ void CameraViewDialog::selectCurrentCamera()
void
CameraViewDialog
::
selectedCameraChanged
()
{
if
(
b_refreshingUI
)
if
(
!
b_refreshingUI
)
{
QList
<
QListWidgetItem
*>
currentItems
=
cameraList
->
selectedItems
();
if
(
currentItems
.
empty
())
...
...
@@ -77,7 +77,6 @@ void CameraViewDialog::selectCamera(View* view, Camera* camera)
{
b_refreshingUI
=
true
;
items
[
0
]
->
setSelected
(
true
);
m_view
->
updateGL
();
b_refreshingUI
=
false
;
}
}
...
...
@@ -92,7 +91,6 @@ void CameraViewDialog::deselectCamera(View* view, Camera* camera)
{
b_refreshingUI
=
true
;
items
[
0
]
->
setSelected
(
false
);
m_view
->
updateGL
();
b_refreshingUI
=
false
;
}
}
...
...
@@ -105,14 +103,9 @@ void CameraViewDialog::addCameraToList(Camera* c)
void
CameraViewDialog
::
removeCameraFromList
(
Camera
*
c
)
{
for
(
int
i
=
0
;
i
<
cameraList
->
count
();
++
i
)
{
if
(
cameraList
->
item
(
i
)
->
text
()
==
c
->
getName
())
{
delete
cameraList
->
item
(
i
);
return
;
}
}
QList
<
QListWidgetItem
*>
items
=
cameraList
->
findItems
(
c
->
getName
(),
Qt
::
MatchExactly
);
if
(
!
items
.
empty
())
delete
items
[
0
];
}
}
// namespace SCHNApps
...
...
SCHNApps/src/dialogs/mapsViewDialog.cpp
View file @
986a72a3
...
...
@@ -54,7 +54,6 @@ void MapsViewDialog::selectedMapsChanged()
else
if
(
!
mapList
->
item
(
i
)
->
isSelected
()
&&
m_view
->
isLinkedToMap
(
map
))
m_window
->
unlinkViewAndMap
(
m_view
,
map
);
}
m_view
->
updateGL
();
}
}
...
...
@@ -67,7 +66,6 @@ void MapsViewDialog::selectMap(View* view, MapHandlerGen* plugin)
{
b_refreshingUI
=
true
;
items
[
0
]
->
setSelected
(
true
);
m_view
->
updateGL
();
b_refreshingUI
=
false
;
}
}
...
...
@@ -82,7 +80,6 @@ void MapsViewDialog::deselectMap(View* view, MapHandlerGen* plugin)
{
b_refreshingUI
=
true
;
items
[
0
]
->
setSelected
(
false
);
m_view
->
updateGL
();
b_refreshingUI
=
false
;
}
}
...
...
@@ -95,14 +92,9 @@ void MapsViewDialog::addMapToList(MapHandlerGen* m)
void
MapsViewDialog
::
removeMapFromList
(
MapHandlerGen
*
m
)
{
for
(
int
i
=
0
;
i
<
mapList
->
count
();
++
i
)
{
if
(
mapList
->
item
(
i
)
->
text
()
==
m
->
getName
())
{
delete
mapList
->
item
(
i
);
return
;
}
}
QList
<
QListWidgetItem
*>
items
=
mapList
->
findItems
(
m
->
getName
(),
Qt
::
MatchExactly
);
if
(
!
items
.
empty
())
delete
items
[
0
];
}
}
// namespace SCHNApps
...
...
SCHNApps/src/dialogs/pluginsViewDialog.cpp
View file @
986a72a3
...
...
@@ -55,7 +55,6 @@ void PluginsViewDialog::selectedPluginsChanged()
else
if
(
!
pluginList
->
item
(
i
)
->
isSelected
()
&&
m_view
->
isLinkedToPlugin
(
plugin
))
m_window
->
unlinkViewAndPlugin
(
m_view
,
plugin
);
}
m_view
->
updateGL
();
}
}
...
...
@@ -68,7 +67,6 @@ void PluginsViewDialog::selectPlugin(View* view, Plugin* plugin)
{
b_refreshingUI
=
true
;
items
[
0
]
->
setSelected
(
true
);
m_view
->
updateGL
();
b_refreshingUI
=
false
;
}
}
...
...
@@ -83,7 +81,6 @@ void PluginsViewDialog::deselectPlugin(View* view, Plugin* plugin)
{
b_refreshingUI
=
true
;
items
[
0
]
->
setSelected
(
false
);
m_view
->
updateGL
();
b_refreshingUI
=
false
;
}
}
...
...
@@ -99,14 +96,9 @@ void PluginsViewDialog::removePluginFromList(Plugin* p)
{
if
(
p
->
getProvidesRendering
())
{
for
(
int
i
=
0
;
i
<
pluginList
->
count
();
++
i
)
{
if
(
pluginList
->
item
(
i
)
->
text
()
==
p
->
getName
())
{
delete
pluginList
->
item
(
i
);
return
;
}
}
QList
<
QListWidgetItem
*>
items
=
pluginList
->
findItems
(
p
->
getName
(),
Qt
::
MatchExactly
);
if
(
!
items
.
empty
())
delete
items
[
0
];
}
}
...
...
SCHNApps/src/view.cpp
View file @
986a72a3
...
...
@@ -292,8 +292,8 @@ void View::updateViewBB()
}
}
}
setSceneBoundingBox
(
bbMin
,
bbMax
);
showEntireScene
();
camera
()
->
setSceneBoundingBox
(
bbMin
,
bbMax
);
camera
()
->
showEntireScene
();
}
/*********************************************************
...
...
SCHNApps/src/window.cpp
View file @
986a72a3
...
...
@@ -607,6 +607,8 @@ void Window::linkViewAndMap(View* v, MapHandlerGen* m)
m
->
linkView
(
v
);
emit
(
viewAndMapLinked
(
v
,
m
));
v
->
updateGL
();
}
void
Window
::
linkViewAndMap
(
const
QString
&
viewName
,
const
QString
&
mapName
)
...
...
@@ -623,6 +625,8 @@ void Window::unlinkViewAndMap(View* v, MapHandlerGen* m)
m
->
unlinkView
(
v
);
emit
(
viewAndMapUnlinked
(
v
,
m
));
v
->
updateGL
();
}
void
Window
::
unlinkViewAndMap
(
const
QString
&
viewName
,
const
QString
&
mapName
)
...
...
@@ -639,6 +643,8 @@ void Window::linkViewAndPlugin(View* v, Plugin* p)
p
->
linkView
(
v
);
emit
(
viewAndPluginLinked
(
v
,
p
));
v
->
updateGL
();
}
void
Window
::
linkViewAndPlugin
(
const
QString
&
viewName
,
const
QString
&
pluginName
)
...
...
@@ -655,6 +661,8 @@ void Window::unlinkViewAndPlugin(View* v, Plugin* p)
p
->
unlinkView
(
v
);
emit
(
viewAndPluginUnlinked
(
v
,
p
));
v
->
updateGL
();
}
void
Window
::
unlinkViewAndPlugin
(
const
QString
&
viewName
,
const
QString
&
pluginName
)
...
...
Write
Preview