Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
David Cazier
CGoGN
Commits
dbe4add0
Commit
dbe4add0
authored
Mar 31, 2015
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into 'develop'
Develop See merge request !60
parents
36744b8a
f6a1f2bf
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
316 additions
and
59 deletions
+316
-59
SCHNApps/Plugins/surface_renderVector/forms/surface_renderVector.ui
...lugins/surface_renderVector/forms/surface_renderVector.ui
+47
-10
SCHNApps/Plugins/surface_renderVector/include/surface_renderVector.h
...ugins/surface_renderVector/include/surface_renderVector.h
+23
-4
SCHNApps/Plugins/surface_renderVector/include/surface_renderVector_dockTab.h
...rface_renderVector/include/surface_renderVector_dockTab.h
+5
-1
SCHNApps/Plugins/surface_renderVector/src/surface_renderVector.cpp
...Plugins/surface_renderVector/src/surface_renderVector.cpp
+50
-8
SCHNApps/Plugins/surface_renderVector/src/surface_renderVector_dockTab.cpp
...surface_renderVector/src/surface_renderVector_dockTab.cpp
+122
-31
SCHNApps/include/dialogList.h
SCHNApps/include/dialogList.h
+2
-0
SCHNApps/include/schnapps.h
SCHNApps/include/schnapps.h
+2
-0
SCHNApps/src/controlDock_cameraTab.cpp
SCHNApps/src/controlDock_cameraTab.cpp
+1
-1
SCHNApps/src/dialogList.cpp
SCHNApps/src/dialogList.cpp
+26
-2
SCHNApps/src/schnapps.cpp
SCHNApps/src/schnapps.cpp
+4
-0
SCHNApps/src/view.cpp
SCHNApps/src/view.cpp
+34
-2
No files found.
SCHNApps/Plugins/surface_renderVector/forms/surface_renderVector.ui
View file @
dbe4add0
...
...
@@ -14,6 +14,16 @@
<string>
Form
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"5"
column=
"0"
colspan=
"2"
>
<widget
class=
"QLineEdit"
name=
"selectedName"
>
<property
name=
"readOnly"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"10"
column=
"0"
colspan=
"2"
>
<widget
class=
"ColorComboBox"
name=
"combo_color"
/>
</item>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
...
...
@@ -50,14 +60,20 @@
</property>
</widget>
</item>
<item
row=
"
3
"
column=
"0"
colspan=
"2"
>
<
widget
class=
"QLabel"
name=
"label
"
>
<property
name=
"
text
"
>
<
string>
Vectors Size :
</string
>
<item
row=
"
11
"
column=
"0"
colspan=
"2"
>
<
spacer
name=
"verticalSpacer
"
>
<property
name=
"
orientation
"
>
<
enum>
Qt::Vertical
</enum
>
</property>
</widget>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
156
</width>
<height>
161
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"
4
"
column=
"0"
colspan=
"2"
>
<item
row=
"
8
"
column=
"0"
colspan=
"2"
>
<widget
class=
"QSlider"
name=
"slider_vectorsScaleFactor"
>
<property
name=
"value"
>
<number>
50
</number>
...
...
@@ -67,21 +83,42 @@
</property>
</widget>
</item>
<item
row=
"5"
column=
"0"
colspan=
"2"
>
<spacer
name=
"verticalSpacer"
>
<item
row=
"6"
column=
"0"
colspan=
"2"
>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
Vectors Size :
</string>
</property>
</widget>
</item>
<item
row=
"4"
column=
"0"
>
<spacer
name=
"verticalSpacer_2"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
156
</width>
<height>
161
</height>
<width>
20
</width>
<height>
40
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"9"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_4"
>
<property
name=
"text"
>
<string>
Color:
</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>
ColorComboBox
</class>
<extends>
QComboBox
</extends>
<header>
colorComboBox.h
</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
SCHNApps/Plugins/surface_renderVector/include/surface_renderVector.h
View file @
dbe4add0
...
...
@@ -12,16 +12,34 @@ namespace CGoGN
namespace
SCHNApps
{
//struct SVectorInfo
//{
// Utils::VBO* vbo;
// QColor color;
// float scaleFactor;
// SVectorInfo() :
// vbo(NULL), color(QColor("red")), scaleFactor(1.0f)
// {}
// SVectorInfo(Utils::VBO* ptr) :
// vbo(ptr), color(QColor("red")), scaleFactor(1.0f)
// {}
//};
struct
MapParameters
{
MapParameters
()
:
positionVBO
(
NULL
),
vectorsScaleFactor
(
1.0
f
)
positionVBO
(
NULL
)
{}
Utils
::
VBO
*
positionVBO
;
QList
<
Utils
::
VBO
*>
vectorVBOs
;
float
vectorsScaleFactor
;
QList
<
QColor
>
colors
;
QList
<
float
>
scaleFactors
;
//float vectorsScaleFactor;
};
class
Surface_RenderVector_Plugin
:
public
PluginInteraction
...
...
@@ -72,7 +90,8 @@ public slots:
void
changePositionVBO
(
const
QString
&
view
,
const
QString
&
map
,
const
QString
&
vbo
);
void
addVectorVBO
(
const
QString
&
view
,
const
QString
&
map
,
const
QString
&
vbo
);
void
removeVectorVBO
(
const
QString
&
view
,
const
QString
&
map
,
const
QString
&
vbo
);
void
changeVectorsScaleFactor
(
const
QString
&
view
,
const
QString
&
map
,
float
f
);
void
changeVectorScaleFactor
(
const
QString
&
view
,
const
QString
&
map
,
const
QString
&
vbo
,
float
f
);
void
changeVectorColor
(
const
QString
&
view
,
const
QString
&
map
,
const
QString
&
vbo
,
const
QString
&
col
);
protected:
Surface_RenderVector_DockTab
*
m_dockTab
;
...
...
SCHNApps/Plugins/surface_renderVector/include/surface_renderVector_dockTab.h
View file @
dbe4add0
...
...
@@ -26,11 +26,15 @@ private:
SCHNApps
*
m_schnapps
;
Surface_RenderVector_Plugin
*
m_plugin
;
bool
b_updatingUI
;
int
m_current_vbo
;
QString
m_currentVBOName
;
private
slots
:
void
positionVBOChanged
(
int
index
);
void
selectedVectorsVBOChanged
();
void
selectedVectorVBOChanged
(
QListWidgetItem
*
item
,
QListWidgetItem
*
old
);
void
vectorsVBOChecked
(
QListWidgetItem
*
item
);
void
vectorsScaleFactorChanged
(
int
i
);
void
colorChanged
(
int
i
);
private:
void
addPositionVBO
(
QString
name
);
...
...
SCHNApps/Plugins/surface_renderVector/src/surface_renderVector.cpp
View file @
dbe4add0
...
...
@@ -51,13 +51,29 @@ void Surface_RenderVector_Plugin::drawMap(View* view, MapHandlerGen* map)
{
const
MapParameters
&
p
=
h_viewParameterSet
[
view
][
map
];
m_vectorShader
->
setScale
(
map
->
getBBdiagSize
()
/
100.0
f
*
p
.
vectorsScaleFactor
)
;
if
(
p
.
positionVBO
)
//m_vectorShader->setScale(map->getBBdiagSize() / 100.0f * p.vectorsScaleFactor) ;
//if(p.positionVBO)
//{
// m_vectorShader->setAttributePosition(p.positionVBO);
// for(QList<Utils::VBO*>::const_iterator it = p.vectorVBOs.begin(); it != p.vectorVBOs.end(); ++it)
// {
// m_vectorShader->setAttributeVector(*it);
// glLineWidth(1.0f);
// map->draw(m_vectorShader, Algo::Render::GL2::POINTS);
// }
//}
if
(
p
.
positionVBO
)
{
m_vectorShader
->
setAttributePosition
(
p
.
positionVBO
);
for
(
QList
<
Utils
::
VBO
*>::
const_iterator
it
=
p
.
vectorVBOs
.
begin
();
it
!=
p
.
vectorVBOs
.
end
();
++
it
)
int
nb
=
p
.
vectorVBOs
.
size
();
for
(
int
i
=
0
;
i
<
nb
;
++
i
)
{
m_vectorShader
->
setAttributeVector
(
*
it
);
m_vectorShader
->
setAttributeVector
(
p
.
vectorVBOs
[
i
]);
m_vectorShader
->
setScale
(
map
->
getBBdiagSize
()
/
100.0
f
*
p
.
scaleFactors
[
i
]);
const
QColor
&
col
=
p
.
colors
[
i
];
m_vectorShader
->
setColor
(
Geom
::
Vec4f
(
col
.
redF
(),
col
.
greenF
(),
col
.
blueF
(),
0.0
f
));
glLineWidth
(
1.0
f
);
map
->
draw
(
m_vectorShader
,
Algo
::
Render
::
GL2
::
POINTS
);
}
...
...
@@ -177,6 +193,8 @@ void Surface_RenderVector_Plugin::addVectorVBO(const QString& view, const QStrin
{
Utils
::
VBO
*
vbuf
=
m
->
getVBO
(
vbo
);
h_viewParameterSet
[
v
][
m
].
vectorVBOs
.
append
(
vbuf
);
h_viewParameterSet
[
v
][
m
].
colors
.
append
(
QColor
(
"red"
));
h_viewParameterSet
[
v
][
m
].
scaleFactors
.
append
(
1.0
f
);
if
(
v
->
isSelectedView
())
{
if
(
v
->
isLinkedToMap
(
m
))
v
->
updateGL
();
...
...
@@ -192,7 +210,10 @@ void Surface_RenderVector_Plugin::removeVectorVBO(const QString& view, const QSt
if
(
v
&&
m
)
{
Utils
::
VBO
*
vbuf
=
m
->
getVBO
(
vbo
);
h_viewParameterSet
[
v
][
m
].
vectorVBOs
.
removeOne
(
vbuf
);
int
idx
=
h_viewParameterSet
[
v
][
m
].
vectorVBOs
.
indexOf
(
vbuf
);
h_viewParameterSet
[
v
][
m
].
vectorVBOs
.
removeAt
(
idx
);
h_viewParameterSet
[
v
][
m
].
colors
.
removeAt
(
idx
);
h_viewParameterSet
[
v
][
m
].
scaleFactors
.
removeAt
(
idx
);
if
(
v
->
isSelectedView
())
{
if
(
v
->
isLinkedToMap
(
m
))
v
->
updateGL
();
...
...
@@ -201,17 +222,38 @@ void Surface_RenderVector_Plugin::removeVectorVBO(const QString& view, const QSt
}
}
void
Surface_RenderVector_Plugin
::
changeVector
s
ScaleFactor
(
const
QString
&
view
,
const
QString
&
map
,
float
f
)
void
Surface_RenderVector_Plugin
::
changeVectorScaleFactor
(
const
QString
&
view
,
const
QString
&
map
,
const
QString
&
vbo
,
float
f
)
{
View
*
v
=
m_schnapps
->
getView
(
view
);
MapHandlerGen
*
m
=
m_schnapps
->
getMap
(
map
);
if
(
v
&&
m
)
{
h_viewParameterSet
[
v
][
m
].
vectorsScaleFactor
=
f
;
Utils
::
VBO
*
vboPtr
=
m
->
getVBO
(
vbo
);
int
idx
=
h_viewParameterSet
[
v
][
m
].
vectorVBOs
.
indexOf
(
vboPtr
);
h_viewParameterSet
[
v
][
m
].
scaleFactors
[
idx
]
=
f
;
if
(
v
->
isSelectedView
())
{
if
(
v
->
isLinkedToMap
(
m
))
v
->
updateGL
();
if
(
m
->
isSelectedMap
())
m_dockTab
->
updateMapParameters
();
if
(
m
->
isSelectedMap
())
m_dockTab
->
updateMapParameters
();
}
}
}
void
Surface_RenderVector_Plugin
::
changeVectorColor
(
const
QString
&
view
,
const
QString
&
map
,
const
QString
&
vbo
,
const
QString
&
col
)
{
View
*
v
=
m_schnapps
->
getView
(
view
);
MapHandlerGen
*
m
=
m_schnapps
->
getMap
(
map
);
if
(
v
&&
m
)
{
Utils
::
VBO
*
vboPtr
=
m
->
getVBO
(
vbo
);
int
idx
=
h_viewParameterSet
[
v
][
m
].
vectorVBOs
.
indexOf
(
vboPtr
);
h_viewParameterSet
[
v
][
m
].
colors
[
idx
]
=
QColor
(
col
);
if
(
v
->
isSelectedView
())
{
if
(
v
->
isLinkedToMap
(
m
))
v
->
updateGL
();
if
(
m
->
isSelectedMap
())
m_dockTab
->
updateMapParameters
();
}
}
}
...
...
SCHNApps/Plugins/surface_renderVector/src/surface_renderVector_dockTab.cpp
View file @
dbe4add0
...
...
@@ -15,17 +15,27 @@ namespace SCHNApps
Surface_RenderVector_DockTab
::
Surface_RenderVector_DockTab
(
SCHNApps
*
s
,
Surface_RenderVector_Plugin
*
p
)
:
m_schnapps
(
s
),
m_plugin
(
p
),
b_updatingUI
(
false
)
b_updatingUI
(
false
),
m_current_vbo
(
-
1
)
{
setupUi
(
this
);
connect
(
combo_positionVBO
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
positionVBOChanged
(
int
)));
connect
(
list_vectorVBO
,
SIGNAL
(
itemSelectionChanged
()),
this
,
SLOT
(
selectedVectorsVBOChanged
()));
connect
(
slider_vectorsScaleFactor
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
vectorsScaleFactorChanged
(
int
)));
}
list_vectorVBO
->
setSelectionMode
(
QAbstractItemView
::
SingleSelection
);
slider_vectorsScaleFactor
->
setDisabled
(
true
);
combo_color
->
setDisabled
(
true
);
QFont
font
=
selectedName
->
font
();
font
.
setBold
(
true
);
selectedName
->
setFont
(
font
);
selectedName
->
setText
(
"not selected"
);
connect
(
combo_positionVBO
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
positionVBOChanged
(
int
)));
connect
(
slider_vectorsScaleFactor
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
vectorsScaleFactorChanged
(
int
)));
connect
(
list_vectorVBO
,
SIGNAL
(
itemChanged
(
QListWidgetItem
*
)),
this
,
SLOT
(
vectorsVBOChecked
(
QListWidgetItem
*
)));
connect
(
list_vectorVBO
,
SIGNAL
(
currentItemChanged
(
QListWidgetItem
*
,
QListWidgetItem
*
)),
this
,
SLOT
(
selectedVectorVBOChanged
(
QListWidgetItem
*
,
QListWidgetItem
*
)));
connect
(
combo_color
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
colorChanged
(
int
)));
}
void
Surface_RenderVector_DockTab
::
positionVBOChanged
(
int
index
)
...
...
@@ -43,53 +53,123 @@ void Surface_RenderVector_DockTab::positionVBOChanged(int index)
}
}
void
Surface_RenderVector_DockTab
::
selectedVector
s
VBOChanged
()
void
Surface_RenderVector_DockTab
::
selectedVectorVBOChanged
(
QListWidgetItem
*
item
,
QListWidgetItem
*
old
)
{
if
(
!
b_updatingUI
)
{
if
((
item
->
checkState
()
==
Qt
::
Checked
))
{
selectedName
->
setText
(
item
->
text
());
slider_vectorsScaleFactor
->
setEnabled
(
true
);
combo_color
->
setEnabled
(
true
);
View
*
view
=
m_schnapps
->
getSelectedView
();
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
if
(
view
&&
map
)
{
const
MapParameters
&
p
=
m_plugin
->
h_viewParameterSet
[
view
][
map
];
Utils
::
VBO
*
v
=
map
->
getVBO
(
item
->
text
());
m_current_vbo
=
p
.
vectorVBOs
.
indexOf
(
v
);
if
(
m_current_vbo
>=
0
)
{
slider_vectorsScaleFactor
->
setSliderPosition
(
p
.
scaleFactors
[
m_current_vbo
]
*
50.0
f
);
std
::
cout
<<
item
->
text
().
toStdString
()
<<
" : "
<<
p
.
scaleFactors
[
m_current_vbo
]
<<
" / "
<<
slider_vectorsScaleFactor
->
value
()
<<
std
::
endl
;
combo_color
->
setColor
(
p
.
colors
[
m_current_vbo
]);
}
}
}
else
{
selectedName
->
setText
(
"not selected"
);
slider_vectorsScaleFactor
->
setDisabled
(
true
);
combo_color
->
setDisabled
(
true
);
}
}
}
void
Surface_RenderVector_DockTab
::
vectorsVBOChecked
(
QListWidgetItem
*
item
)
{
if
(
!
b_updatingUI
)
{
View
*
view
=
m_schnapps
->
getSelectedView
();
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
if
(
view
&&
map
)
if
(
view
&&
map
)
{
QList
<
QListWidgetItem
*>
currentItems
=
list_vectorVBO
->
selectedItems
();
QList
<
Utils
::
VBO
*>
vbos
;
const
QList
<
Utils
::
VBO
*>&
vboList
=
m_plugin
->
h_viewParameterSet
[
view
][
map
].
vectorVBOs
;
foreach
(
QListWidgetItem
*
item
,
currentItems
)
MapParameters
&
p
=
m_plugin
->
h_viewParameterSet
[
view
][
map
];
Utils
::
VBO
*
vbo
=
map
->
getVBO
(
item
->
text
());
if
(
item
->
checkState
()
==
Qt
::
Checked
)
{
Utils
::
VBO
*
vbo
=
map
->
getVBO
(
item
->
text
());
vbos
.
append
(
vbo
);
if
(
!
vboList
.
contains
(
vbo
))
m_plugin
->
pythonRecording
(
"addVectorVBO"
,
""
,
view
->
getName
(),
map
->
getName
(),
item
->
text
());
p
.
vectorVBOs
.
append
(
vbo
);
p
.
scaleFactors
.
append
(
1.0
f
);
p
.
colors
.
append
(
QColor
(
"red"
));
if
(
list_vectorVBO
->
currentItem
()
==
item
)
selectedVectorVBOChanged
(
item
,
NULL
);
else
list_vectorVBO
->
setCurrentItem
(
item
);
m_plugin
->
pythonRecording
(
"addVectorVBO"
,
""
,
view
->
getName
(),
map
->
getName
(),
item
->
text
());
}
foreach
(
Utils
::
VBO
*
vbo
,
vboList
)
else
{
if
(
!
vbos
.
contains
(
vbo
))
m_plugin
->
pythonRecording
(
"removeVectorVBO"
,
""
,
view
->
getName
(),
map
->
getName
(),
QString
(
vbo
->
name
().
c_str
()));
int
idx
=
p
.
vectorVBOs
.
indexOf
(
vbo
);
p
.
vectorVBOs
.
removeAt
(
idx
);
p
.
scaleFactors
.
removeAt
(
idx
);
p
.
colors
.
removeAt
(
idx
);
list_vectorVBO
->
setCurrentItem
(
item
);
list_vectorVBO
->
clearSelection
();
slider_vectorsScaleFactor
->
setDisabled
(
true
);
combo_color
->
setDisabled
(
true
);
m_current_vbo
=
-
1
;
m_plugin
->
pythonRecording
(
"removeVectorVBO"
,
""
,
view
->
getName
(),
map
->
getName
(),
QString
(
item
->
text
()));
}
m_plugin
->
h_viewParameterSet
[
view
][
map
].
vectorVBOs
=
vbos
;
view
->
updateGL
();
}
}
}
void
Surface_RenderVector_DockTab
::
vectorsScaleFactorChanged
(
int
i
)
{
if
(
!
b_updatingUI
)
{
View
*
view
=
m_schnapps
->
getSelectedView
();
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
if
(
view
&&
map
)
if
(
view
&&
map
&&
(
m_current_vbo
>=
0
)
)
{
m_plugin
->
h_viewParameterSet
[
view
][
map
].
vectorsScaleFactor
=
i
/
50.0
;
view
->
updateGL
();
float
&
scale
=
m_plugin
->
h_viewParameterSet
[
view
][
map
].
scaleFactors
[
m_current_vbo
];
float
newScale
=
float
(
i
)
/
50.0
f
;
std
::
cout
<<
"vectorsScaleFactorChanged "
<<
i
<<
" -> "
<<
newScale
<<
" / old:"
<<
scale
<<
std
::
endl
;
if
(
fabs
(
scale
-
newScale
)
>
0.01
f
)
{
scale
=
newScale
;
m_plugin
->
pythonRecording
(
"changeVectorScaleFactor"
,
""
,
view
->
getName
(),
map
->
getName
(),
selectedName
->
text
(),
newScale
);
view
->
updateGL
();
}
}
}
}
void
Surface_RenderVector_DockTab
::
colorChanged
(
int
i
)
{
if
(
!
b_updatingUI
)
{
View
*
view
=
m_schnapps
->
getSelectedView
();
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
if
(
view
&&
map
&&
(
m_current_vbo
>=
0
))
{
QColor
&
col
=
m_plugin
->
h_viewParameterSet
[
view
][
map
].
colors
[
m_current_vbo
];
if
(
col
!=
combo_color
->
color
())
{
col
=
combo_color
->
color
();
m_plugin
->
pythonRecording
(
"changeVectorColor"
,
""
,
view
->
getName
(),
map
->
getName
(),
selectedName
->
text
(),
combo_color
->
color
().
name
());
view
->
updateGL
();
}
}
}
}
void
Surface_RenderVector_DockTab
::
addPositionVBO
(
QString
name
)
...
...
@@ -114,6 +194,9 @@ void Surface_RenderVector_DockTab::addVectorVBO(QString name)
{
b_updatingUI
=
true
;
list_vectorVBO
->
addItem
(
name
);
QListWidgetItem
*
item
=
list_vectorVBO
->
item
(
list_vectorVBO
->
count
()
-
1
);
item
->
setFlags
(
item
->
flags
()
|
Qt
::
ItemIsEditable
);
item
->
setCheckState
(
Qt
::
Unchecked
);
b_updatingUI
=
false
;
}
...
...
@@ -128,6 +211,8 @@ void Surface_RenderVector_DockTab::removeVectorVBO(QString name)
void
Surface_RenderVector_DockTab
::
updateMapParameters
()
{
std
::
cout
<<
"Surface_RenderVector_DockTab::updateMapParameters"
<<
std
::
endl
;
b_updatingUI
=
true
;
combo_positionVBO
->
clear
();
...
...
@@ -148,17 +233,23 @@ void Surface_RenderVector_DockTab::updateMapParameters()
{
combo_positionVBO
->
addItem
(
QString
::
fromStdString
(
vbo
->
name
()));
if
(
vbo
==
p
.
positionVBO
)
combo_positionVBO
->
setCurrentIndex
(
i
);
combo_positionVBO
->
setCurrentIndex
(
i
+
1
);
// +1 for "- select VBO -"
list_vectorVBO
->
addItem
(
QString
::
fromStdString
(
vbo
->
name
()));
QListWidgetItem
*
item
=
list_vectorVBO
->
item
(
list_vectorVBO
->
count
()
-
1
);
item
->
setFlags
(
item
->
flags
()
|
Qt
::
ItemIsEditable
);
item
->
setCheckState
(
Qt
::
Unchecked
);
if
(
p
.
vectorVBOs
.
contains
(
vbo
))
list_vectorVBO
->
item
(
i
)
->
setSelected
(
true
);
list_vectorVBO
->
item
(
i
)
->
setCheckState
(
Qt
::
Checked
);
++
i
;
}
}
slider_vectorsScaleFactor
->
setSliderPosition
(
p
.
vectorsScaleFactor
*
50.0
);
if
(
m_current_vbo
>=
0
)
{
slider_vectorsScaleFactor
->
setSliderPosition
(
p
.
scaleFactors
[
m_current_vbo
]
*
50.0
f
);
combo_color
->
setColor
(
p
.
colors
[
m_current_vbo
]);
}
// set color
}
b_updatingUI
=
false
;
...
...
SCHNApps/include/dialogList.h
View file @
dbe4add0
...
...
@@ -26,6 +26,8 @@ public:
virtual
~
ListPopUp
();
virtual
void
show
();
QListWidget
*
list
();
QListWidgetItem
*
addItem
(
const
QString
&
str
,
Qt
::
CheckState
checked
=
Qt
::
Unchecked
);
...
...
SCHNApps/include/schnapps.h
View file @
dbe4add0
...
...
@@ -129,6 +129,8 @@ public:
void
addMenuAction
(
Plugin
*
plugin
,
const
QString
&
menuPath
,
QAction
*
action
);
void
removeMenuAction
(
Plugin
*
plugin
,
QAction
*
action
);
void
statusBarMessage
(
const
QString
&
msg
,
int
msec
);
public
slots
:
void
aboutSCHNApps
();
void
aboutCGoGN
();
...
...
SCHNApps/src/controlDock_cameraTab.cpp
View file @
dbe4add0
...
...
@@ -67,7 +67,7 @@ void ControlDock_CameraTab::selectedCameraChanged()
void
ControlDock_CameraTab
::
cameraProjectionChanged
(
QAbstractButton
*
b
)
{
if
(
!
b_updatingUI
)
if
(
!
b_updatingUI
&&
m_selectedCamera
)
{
if
(
radio_orthographicProjection
->
isChecked
())
m_selectedCamera
->
setProjectionType
(
qglviewer
::
Camera
::
ORTHOGRAPHIC
);
...
...
SCHNApps/src/dialogList.cpp
View file @
dbe4add0
...
...
@@ -8,13 +8,14 @@ namespace CGoGN
namespace
SCHNApps
{
ListPopUp
::
ListPopUp
(
const
QString
&
name
,
QWidget
*
parent
)
:
ListPopUp
::
ListPopUp
(
const
QString
&
name
,
QWidget
*
parent
)
:
QDialog
(
parent
)
{
setWindowTitle
(
name
);
setWindowFlags
(
windowFlags
()
|
Qt
::
FramelessWindowHint
|
Qt
::
WindowStaysOnTopHint
);
setWindowFlags
(
windowFlags
()
/*
| Qt::FramelessWindowHint
*/
|
Qt
::
SplashScreen
|
Qt
::
WindowStaysOnTopHint
|
Qt
::
CustomizeWindowHint
);
m_layout
=
new
QVBoxLayout
(
this
);
setLayout
(
m_layout
);
m_layout
->
setContentsMargins
(
1
,
1
,
1
,
1
);
m_list_items
=
new
QListWidget
();
m_list_items
->
setSelectionMode
(
QAbstractItemView
::
NoSelection
);
m_layout
->
addWidget
(
m_list_items
);
...
...
@@ -29,11 +30,33 @@ QListWidget* ListPopUp::list()
return
m_list_items
;
}
void
ListPopUp
::
show
()
{
int
rows
=
m_list_items
->
model
()
->
rowCount
();
int
rowSize
=
m_list_items
->
sizeHintForRow
(
0
);
int
height
=
rows
*
rowSize
+
6
;
if
(
height
<
96
)
// 96??
height
=
96
;
m_list_items
->
setFixedHeight
(
height
);
QDialog
::
show
();
}
QListWidgetItem
*
ListPopUp
::
addItem
(
const
QString
&
str
,
Qt
::
CheckState
checked
)
{
QListWidgetItem
*
item
=
new
QListWidgetItem
(
str
,
m_list_items
);
item
->
setCheckState
(
checked
);
int
rows
=
m_list_items
->
model
()
->
rowCount
();
int
rowSize
=
m_list_items
->
sizeHintForRow
(
0
);
int
height
=
rows
*
rowSize
;
if
(
height
>=
m_list_items
->
size
().
height
())
m_list_items
->
setFixedHeight
(
height
+
6
);
//QFontMetrics fm(m_list_items->font());
//int maxTextWidth = fm.width(item->text());
//if (maxTextWidth < 140)
// maxTextWidth = 140;
//m_list_items->setFixedWidth(maxTextWidth + 40);
return
item
;
}
...
...
@@ -61,6 +84,7 @@ bool ListPopUp::removeItem(const QString& str)
if
(
items
.
empty
())
return
false
;
m_list_items
->
takeItem
(
m_list_items
->
row
(
items
[
0
]));
return
true
;
}
...
...
SCHNApps/src/schnapps.cpp
View file @
dbe4add0
...
...
@@ -923,6 +923,10 @@ void SCHNApps::closeEvent(QCloseEvent *event)
QMainWindow
::
closeEvent
(
event
);
}
void
SCHNApps
::
statusBarMessage
(
const
QString
&
msg
,
int
msec
)
{
statusbar
->
showMessage
(
msg
,
msec
);
}
}
// namespace SCHNApps
...
...
SCHNApps/src/view.cpp
View file @
dbe4add0
...
...
@@ -13,6 +13,7 @@
#include <QKeyEvent>
#include <QMouseEvent>
#include <QWheelEvent>
#include <QMessageBox>