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
ada7c5ba
Commit
ada7c5ba
authored
Apr 01, 2015
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SCHNApps: bug fix in render vector plugin
parent
9c85376f
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
133 additions
and
189 deletions
+133
-189
CGoGN/src/Utils/Shaders/shaderPhong.cpp
CGoGN/src/Utils/Shaders/shaderPhong.cpp
+24
-11
SCHNApps/Plugins/surface_radiance/src/surface_radiance.cpp
SCHNApps/Plugins/surface_radiance/src/surface_radiance.cpp
+32
-39
SCHNApps/Plugins/surface_render/src/surface_render_dockTab.cpp
...pps/Plugins/surface_render/src/surface_render_dockTab.cpp
+6
-6
SCHNApps/Plugins/surface_renderVector/forms/surface_renderVector.ui
...lugins/surface_renderVector/forms/surface_renderVector.ui
+24
-44
SCHNApps/Plugins/surface_renderVector/include/surface_renderVector.h
...ugins/surface_renderVector/include/surface_renderVector.h
+0
-18
SCHNApps/Plugins/surface_renderVector/include/surface_renderVector_dockTab.h
...rface_renderVector/include/surface_renderVector_dockTab.h
+0
-2
SCHNApps/Plugins/surface_renderVector/src/surface_renderVector.cpp
...Plugins/surface_renderVector/src/surface_renderVector.cpp
+0
-13
SCHNApps/Plugins/surface_renderVector/src/surface_renderVector_dockTab.cpp
...surface_renderVector/src/surface_renderVector_dockTab.cpp
+46
-56
SCHNApps/src/view.cpp
SCHNApps/src/view.cpp
+1
-0
No files found.
CGoGN/src/Utils/Shaders/shaderPhong.cpp
View file @
ada7c5ba
...
@@ -54,17 +54,30 @@ ShaderPhong::ShaderPhong(bool withClipping, bool doubleSided, bool withEyePositi
...
@@ -54,17 +54,30 @@ ShaderPhong::ShaderPhong(bool withClipping, bool doubleSided, bool withEyePositi
std
::
string
glxvert
(
GLSLShader
::
defines_gl
());
std
::
string
glxvert
(
GLSLShader
::
defines_gl
());
std
::
string
glxfrag
(
GLSLShader
::
defines_gl
());
std
::
string
glxfrag
(
GLSLShader
::
defines_gl
());
// get choose GL defines (2 or 3)
if
(
withClipping
)
// ans compile shaders
{
std
::
string
glxvert
(
GLSLShader
::
defines_gl
());
m_nameVS
=
"ShaderPhongClip_vs"
;
if
(
m_with_eyepos
)
m_nameFS
=
"ShaderPhongClip_fs"
;
glxvert
.
append
(
"#define WITH_EYEPOSITION"
);
if
(
m_with_eyepos
)
glxvert
.
append
(
vertexShaderText
);
glxvert
.
append
(
"#define WITH_EYEPOSITION"
);
std
::
string
glxfrag
(
GLSLShader
::
defines_gl
());
glxvert
.
append
(
vertexShaderClipText
);
// Use double sided lighting if set
// Use double sided lighting if set
if
(
doubleSided
)
if
(
doubleSided
)
glxfrag
.
append
(
"#define DOUBLE_SIDED
\n
"
);
glxfrag
.
append
(
"#define DOUBLE_SIDED
\n
"
);
glxfrag
.
append
(
fragmentShaderText
);
glxfrag
.
append
(
fragmentShaderClipText
);
}
else
{
m_nameVS
=
"ShaderPhong_vs"
;
m_nameFS
=
"ShaderPhong_fs"
;
if
(
m_with_eyepos
)
glxvert
.
append
(
"#define WITH_EYEPOSITION"
);
glxvert
.
append
(
vertexShaderText
);
// Use double sided lighting if set
if
(
doubleSided
)
glxfrag
.
append
(
"#define DOUBLE_SIDED
\n
"
);
glxfrag
.
append
(
fragmentShaderText
);
}
loadShadersFromMemory
(
glxvert
.
c_str
(),
glxfrag
.
c_str
());
loadShadersFromMemory
(
glxvert
.
c_str
(),
glxfrag
.
c_str
());
...
...
SCHNApps/Plugins/surface_radiance/src/surface_radiance.cpp
View file @
ada7c5ba
...
@@ -335,50 +335,43 @@ void Surface_Radiance_Plugin::decimate(const QString& mapName, const QString& po
...
@@ -335,50 +335,43 @@ void Surface_Radiance_Plugin::decimate(const QString& mapName, const QString& po
mapParams.positionApproximator = new Algo::Surface::Decimation::Approximator_QEM<PFP2>(*map, position);
mapParams.positionApproximator = new Algo::Surface::Decimation::Approximator_QEM<PFP2>(*map, position);
}
}
//
if (mapParams.normalApproximator == NULL)
if (mapParams.normalApproximator == NULL)
//
{
{
//
mapParams.normalApproximator =
mapParams.normalApproximator =
//
new Algo::Surface::Decimation::Approximator_InterpolateAlongEdge<PFP2, PFP2::VEC3>(
new Algo::Surface::Decimation::Approximator_InterpolateAlongEdge<PFP2, PFP2::VEC3>(
//
*map,
*map,
//
normal,
normal,
//
position,
position,
//
((Algo::Surface::Decimation::Approximator<PFP2, PFP2::VEC3, EDGE>*)(mapParams.positionApproximator))->getApproximationResultAttribute()
((Algo::Surface::Decimation::Approximator<PFP2, PFP2::VEC3, EDGE>*)(mapParams.positionApproximator))->getApproximationResultAttribute()
//
);
);
//
}
}
//
if (mapParams.radianceApproximator == NULL)
if (mapParams.radianceApproximator == NULL)
//
{
{
//
mapParams.radianceApproximator =
mapParams.radianceApproximator =
//
new Algo::Surface::Decimation::Approximator_InterpolateAlongEdge<PFP2, Utils::SphericalHarmonics<PFP2::REAL, PFP2::VEC3> >(
new Algo::Surface::Decimation::Approximator_InterpolateAlongEdge<PFP2, Utils::SphericalHarmonics<PFP2::REAL, PFP2::VEC3> >(
//
*map,
*map,
//
mapParams.radiance,
mapParams.radiance,
//
position,
position,
//
((Algo::Surface::Decimation::Approximator<PFP2, PFP2::VEC3, EDGE>*)(mapParams.positionApproximator))->getApproximationResultAttribute()
((Algo::Surface::Decimation::Approximator<PFP2, PFP2::VEC3, EDGE>*)(mapParams.positionApproximator))->getApproximationResultAttribute()
//
);
);
//
}
}
if (mapParams.selector == NULL)
if (mapParams.selector == NULL)
{
{
// mapParams.selector =
mapParams.selector =
// new EdgeSelector_Radiance<PFP2>(
new EdgeSelector_Radiance<PFP2>(
// *map,
*map,
// position,
position,
// normal,
normal,
// mapParams.radiance,
mapParams.radiance,
// *(Algo::Surface::Decimation::Approximator<PFP2, PFP2::VEC3, EDGE>*)(mapParams.positionApproximator),
*(Algo::Surface::Decimation::Approximator<PFP2, PFP2::VEC3, EDGE>*)(mapParams.positionApproximator),
// *(Algo::Surface::Decimation::Approximator<PFP2, PFP2::VEC3, EDGE>*)(mapParams.normalApproximator),
*(Algo::Surface::Decimation::Approximator<PFP2, PFP2::VEC3, EDGE>*)(mapParams.normalApproximator),
// *(Algo::Surface::Decimation::Approximator<PFP2, Utils::SphericalHarmonics<PFP2::REAL, PFP2::VEC3>, EDGE>*)(mapParams.radianceApproximator)
*(Algo::Surface::Decimation::Approximator<PFP2, Utils::SphericalHarmonics<PFP2::REAL, PFP2::VEC3>, EDGE>*)(mapParams.radianceApproximator)
// );
);
// mapParams.selector =
// new Algo::Surface::Decimation::EdgeSelector_QEM<PFP2>(
// *map,
// position,
// *(Algo::Surface::Decimation::Approximator<PFP2, PFP2::VEC3, EDGE>*)(mapParams.positionApproximator)
// );
mapParams.selector =
mapParams.selector =
new
Algo
::
Surface
::
Decimation
::
EdgeSelector_
ColorNaive
<
PFP2
>
(
new Algo::Surface::Decimation::EdgeSelector_
QEM
<PFP2>(
*map,
*map,
position,
position,
*(Algo::Surface::Decimation::Approximator<PFP2, PFP2::VEC3, EDGE>*)(mapParams.positionApproximator)
*(Algo::Surface::Decimation::Approximator<PFP2, PFP2::VEC3, EDGE>*)(mapParams.positionApproximator)
...
...
SCHNApps/Plugins/surface_render/src/surface_render_dockTab.cpp
View file @
ada7c5ba
...
@@ -50,7 +50,7 @@ void Surface_Render_DockTab::positionVBOChanged(int index)
...
@@ -50,7 +50,7 @@ void Surface_Render_DockTab::positionVBOChanged(int index)
{
{
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
(
"change
VertexColor"
,
""
,
view
->
getName
(),
map
->
getName
(),
rgbCol
[
0
],
rgbCol
[
1
],
rgbCol
[
2
]
);
m_plugin
->
pythonRecording
(
"change
PositionVBO"
,
""
,
view
->
getName
(),
map
->
getName
(),
combo_positionVBO
->
currentText
()
);
}
}
}
}
}
}
...
@@ -65,7 +65,7 @@ void Surface_Render_DockTab::normalVBOChanged(int index)
...
@@ -65,7 +65,7 @@ void Surface_Render_DockTab::normalVBOChanged(int index)
{
{
m_plugin
->
h_viewParameterSet
[
view
][
map
].
normalVBO
=
map
->
getVBO
(
combo_normalVBO
->
currentText
());
m_plugin
->
h_viewParameterSet
[
view
][
map
].
normalVBO
=
map
->
getVBO
(
combo_normalVBO
->
currentText
());
view
->
updateGL
();
view
->
updateGL
();
m_plugin
->
pythonRecording
(
"change
PositionVBO"
,
""
,
view
->
getName
(),
map
->
getName
(),
combo_position
VBO
->
currentText
());
m_plugin
->
pythonRecording
(
"change
NormalVBO"
,
""
,
view
->
getName
(),
map
->
getName
(),
combo_normal
VBO
->
currentText
());
}
}
}
}
}
}
...
@@ -80,7 +80,7 @@ void Surface_Render_DockTab::colorVBOChanged(int index)
...
@@ -80,7 +80,7 @@ void Surface_Render_DockTab::colorVBOChanged(int index)
{
{
m_plugin
->
h_viewParameterSet
[
view
][
map
].
colorVBO
=
map
->
getVBO
(
combo_colorVBO
->
currentText
());
m_plugin
->
h_viewParameterSet
[
view
][
map
].
colorVBO
=
map
->
getVBO
(
combo_colorVBO
->
currentText
());
view
->
updateGL
();
view
->
updateGL
();
m_plugin
->
pythonRecording
(
"change
NormalVBO"
,
""
,
view
->
getName
(),
map
->
getName
(),
combo_normal
VBO
->
currentText
());
m_plugin
->
pythonRecording
(
"change
ColorVBO"
,
""
,
view
->
getName
(),
map
->
getName
(),
combo_color
VBO
->
currentText
());
}
}
}
}
}
}
...
@@ -208,7 +208,6 @@ void Surface_Render_DockTab::colorSelected(const QColor& col)
...
@@ -208,7 +208,6 @@ void Surface_Render_DockTab::colorSelected(const QColor& col)
{
{
if
(
m_currentColorDial
==
1
)
if
(
m_currentColorDial
==
1
)
{
{
m_diffuseColor
=
col
;
m_diffuseColor
=
col
;
dcolorButton
->
setStyleSheet
(
"QPushButton { background-color:"
+
col
.
name
()
+
"}"
);
dcolorButton
->
setStyleSheet
(
"QPushButton { background-color:"
+
col
.
name
()
+
"}"
);
...
@@ -220,12 +219,12 @@ void Surface_Render_DockTab::colorSelected(const QColor& col)
...
@@ -220,12 +219,12 @@ void Surface_Render_DockTab::colorSelected(const QColor& col)
{
{
m_plugin
->
h_viewParameterSet
[
view
][
map
].
diffuseColor
=
rgbCol
;
m_plugin
->
h_viewParameterSet
[
view
][
map
].
diffuseColor
=
rgbCol
;
view
->
updateGL
();
view
->
updateGL
();
m_plugin
->
pythonRecording
(
"changeFaceColor"
,
""
,
view
->
getName
(),
map
->
getName
(),
rgbCol
[
0
],
rgbCol
[
1
],
rgbCol
[
2
]);
}
}
}
}
if
(
m_currentColorDial
==
2
)
if
(
m_currentColorDial
==
2
)
{
{
m_simpleColor
=
col
;
m_simpleColor
=
col
;
scolorButton
->
setStyleSheet
(
"QPushButton { background-color:"
+
col
.
name
()
+
"}"
);
scolorButton
->
setStyleSheet
(
"QPushButton { background-color:"
+
col
.
name
()
+
"}"
);
...
@@ -237,12 +236,12 @@ void Surface_Render_DockTab::colorSelected(const QColor& col)
...
@@ -237,12 +236,12 @@ void Surface_Render_DockTab::colorSelected(const QColor& col)
{
{
m_plugin
->
h_viewParameterSet
[
view
][
map
].
simpleColor
=
rgbCol
;
m_plugin
->
h_viewParameterSet
[
view
][
map
].
simpleColor
=
rgbCol
;
view
->
updateGL
();
view
->
updateGL
();
m_plugin
->
pythonRecording
(
"changeEdgeColor"
,
""
,
view
->
getName
(),
map
->
getName
(),
rgbCol
[
0
],
rgbCol
[
1
],
rgbCol
[
2
]);
}
}
}
}
if
(
m_currentColorDial
==
3
)
if
(
m_currentColorDial
==
3
)
{
{
m_vertexColor
=
col
;
m_vertexColor
=
col
;
vcolorButton
->
setStyleSheet
(
"QPushButton { background-color:"
+
col
.
name
()
+
"}"
);
vcolorButton
->
setStyleSheet
(
"QPushButton { background-color:"
+
col
.
name
()
+
"}"
);
...
@@ -254,6 +253,7 @@ void Surface_Render_DockTab::colorSelected(const QColor& col)
...
@@ -254,6 +253,7 @@ void Surface_Render_DockTab::colorSelected(const QColor& col)
{
{
m_plugin
->
h_viewParameterSet
[
view
][
map
].
vertexColor
=
rgbCol
;
m_plugin
->
h_viewParameterSet
[
view
][
map
].
vertexColor
=
rgbCol
;
view
->
updateGL
();
view
->
updateGL
();
m_plugin
->
pythonRecording
(
"changeVertexColor"
,
""
,
view
->
getName
(),
map
->
getName
(),
rgbCol
[
0
],
rgbCol
[
1
],
rgbCol
[
2
]);
}
}
}
}
}
}
...
...
SCHNApps/Plugins/surface_renderVector/forms/surface_renderVector.ui
View file @
ada7c5ba
...
@@ -14,23 +14,6 @@
...
@@ -14,23 +14,6 @@
<string>
Form
</string>
<string>
Form
</string>
</property>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<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"
>
<string>
Position :
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QComboBox"
name=
"combo_positionVBO"
>
<widget
class=
"QComboBox"
name=
"combo_positionVBO"
>
<property
name=
"sizePolicy"
>
<property
name=
"sizePolicy"
>
...
@@ -46,13 +29,23 @@
...
@@ -46,13 +29,23 @@
</item>
</item>
</widget>
</widget>
</item>
</item>
<item
row=
"
1"
column=
"0
"
>
<item
row=
"
4"
column=
"0"
colspan=
"2
"
>
<widget
class=
"QLabel"
name=
"label
_3
"
>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<property
name=
"text"
>
<string>
Vectors :
</string>
<string>
Selected vector size :
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
<string>
Position :
</string>
</property>
</property>
</widget>
</widget>
</item>
</item>
<item
row=
"8"
column=
"0"
colspan=
"2"
>
<widget
class=
"ColorComboBox"
name=
"combo_color"
/>
</item>
<item
row=
"2"
column=
"0"
colspan=
"2"
>
<item
row=
"2"
column=
"0"
colspan=
"2"
>
<widget
class=
"QListWidget"
name=
"list_vectorVBO"
>
<widget
class=
"QListWidget"
name=
"list_vectorVBO"
>
<property
name=
"selectionMode"
>
<property
name=
"selectionMode"
>
...
@@ -60,7 +53,14 @@
...
@@ -60,7 +53,14 @@
</property>
</property>
</widget>
</widget>
</item>
</item>
<item
row=
"11"
column=
"0"
colspan=
"2"
>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_3"
>
<property
name=
"text"
>
<string>
Vectors :
</string>
</property>
</widget>
</item>
<item
row=
"9"
column=
"0"
colspan=
"2"
>
<spacer
name=
"verticalSpacer"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
<enum>
Qt::Vertical
</enum>
...
@@ -73,7 +73,7 @@
...
@@ -73,7 +73,7 @@
</property>
</property>
</spacer>
</spacer>
</item>
</item>
<item
row=
"
8
"
column=
"0"
colspan=
"2"
>
<item
row=
"
6
"
column=
"0"
colspan=
"2"
>
<widget
class=
"QSlider"
name=
"slider_vectorsScaleFactor"
>
<widget
class=
"QSlider"
name=
"slider_vectorsScaleFactor"
>
<property
name=
"value"
>
<property
name=
"value"
>
<number>
50
</number>
<number>
50
</number>
...
@@ -83,30 +83,10 @@
...
@@ -83,30 +83,10 @@
</property>
</property>
</widget>
</widget>
</item>
</item>
<item
row=
"6"
column=
"0"
colspan=
"2"
>
<item
row=
"7"
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>
20
</width>
<height>
40
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"9"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_4"
>
<widget
class=
"QLabel"
name=
"label_4"
>
<property
name=
"text"
>
<property
name=
"text"
>
<string>
Color
:
</string>
<string>
Selected vector color
:
</string>
</property>
</property>
</widget>
</widget>
</item>
</item>
...
...
SCHNApps/Plugins/surface_renderVector/include/surface_renderVector.h
View file @
ada7c5ba
...
@@ -12,22 +12,8 @@ namespace CGoGN
...
@@ -12,22 +12,8 @@ namespace CGoGN
namespace
SCHNApps
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
struct
MapParameters
{
{
MapParameters
()
:
MapParameters
()
:
positionVBO
(
NULL
)
positionVBO
(
NULL
)
{}
{}
...
@@ -36,10 +22,6 @@ struct MapParameters
...
@@ -36,10 +22,6 @@ struct MapParameters
QList
<
Utils
::
VBO
*>
vectorVBOs
;
QList
<
Utils
::
VBO
*>
vectorVBOs
;
QList
<
QColor
>
colors
;
QList
<
QColor
>
colors
;
QList
<
float
>
scaleFactors
;
QList
<
float
>
scaleFactors
;
//float vectorsScaleFactor;
};
};
class
Surface_RenderVector_Plugin
:
public
PluginInteraction
class
Surface_RenderVector_Plugin
:
public
PluginInteraction
...
...
SCHNApps/Plugins/surface_renderVector/include/surface_renderVector_dockTab.h
View file @
ada7c5ba
...
@@ -26,8 +26,6 @@ private:
...
@@ -26,8 +26,6 @@ private:
SCHNApps
*
m_schnapps
;
SCHNApps
*
m_schnapps
;
Surface_RenderVector_Plugin
*
m_plugin
;
Surface_RenderVector_Plugin
*
m_plugin
;
bool
b_updatingUI
;
bool
b_updatingUI
;
int
m_current_vbo
;
QString
m_currentVBOName
;
private
slots
:
private
slots
:
void
positionVBOChanged
(
int
index
);
void
positionVBOChanged
(
int
index
);
...
...
SCHNApps/Plugins/surface_renderVector/src/surface_renderVector.cpp
View file @
ada7c5ba
...
@@ -51,19 +51,6 @@ void Surface_RenderVector_Plugin::drawMap(View* view, MapHandlerGen* map)
...
@@ -51,19 +51,6 @@ void Surface_RenderVector_Plugin::drawMap(View* view, MapHandlerGen* map)
{
{
const
MapParameters
&
p
=
h_viewParameterSet
[
view
][
map
];
const
MapParameters
&
p
=
h_viewParameterSet
[
view
][
map
];
//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
)
if
(
p
.
positionVBO
)
{
{
m_vectorShader
->
setAttributePosition
(
p
.
positionVBO
);
m_vectorShader
->
setAttributePosition
(
p
.
positionVBO
);
...
...
SCHNApps/Plugins/surface_renderVector/src/surface_renderVector_dockTab.cpp
View file @
ada7c5ba
...
@@ -15,8 +15,7 @@ namespace SCHNApps
...
@@ -15,8 +15,7 @@ namespace SCHNApps
Surface_RenderVector_DockTab
::
Surface_RenderVector_DockTab
(
SCHNApps
*
s
,
Surface_RenderVector_Plugin
*
p
)
:
Surface_RenderVector_DockTab
::
Surface_RenderVector_DockTab
(
SCHNApps
*
s
,
Surface_RenderVector_Plugin
*
p
)
:
m_schnapps
(
s
),
m_schnapps
(
s
),
m_plugin
(
p
),
m_plugin
(
p
),
b_updatingUI
(
false
),
b_updatingUI
(
false
)
m_current_vbo
(
-
1
)
{
{
setupUi
(
this
);
setupUi
(
this
);
...
@@ -24,11 +23,6 @@ Surface_RenderVector_DockTab::Surface_RenderVector_DockTab(SCHNApps* s, Surface_
...
@@ -24,11 +23,6 @@ Surface_RenderVector_DockTab::Surface_RenderVector_DockTab(SCHNApps* s, Surface_
slider_vectorsScaleFactor
->
setDisabled
(
true
);
slider_vectorsScaleFactor
->
setDisabled
(
true
);
combo_color
->
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
(
combo_positionVBO
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
positionVBOChanged
(
int
)));
connect
(
slider_vectorsScaleFactor
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
vectorsScaleFactorChanged
(
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
(
itemChanged
(
QListWidgetItem
*
)),
this
,
SLOT
(
vectorsVBOChecked
(
QListWidgetItem
*
)));
...
@@ -37,10 +31,9 @@ Surface_RenderVector_DockTab::Surface_RenderVector_DockTab(SCHNApps* s, Surface_
...
@@ -37,10 +31,9 @@ Surface_RenderVector_DockTab::Surface_RenderVector_DockTab(SCHNApps* s, Surface_
connect
(
combo_color
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
colorChanged
(
int
)));
connect
(
combo_color
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
colorChanged
(
int
)));
}
}
void
Surface_RenderVector_DockTab
::
positionVBOChanged
(
int
index
)
void
Surface_RenderVector_DockTab
::
positionVBOChanged
(
int
index
)
{
{
if
(
!
b_updatingUI
)
if
(
!
b_updatingUI
)
{
{
View
*
view
=
m_schnapps
->
getSelectedView
();
View
*
view
=
m_schnapps
->
getSelectedView
();
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
...
@@ -55,38 +48,31 @@ void Surface_RenderVector_DockTab::positionVBOChanged(int index)
...
@@ -55,38 +48,31 @@ void Surface_RenderVector_DockTab::positionVBOChanged(int index)
void
Surface_RenderVector_DockTab
::
selectedVectorVBOChanged
(
QListWidgetItem
*
item
,
QListWidgetItem
*
old
)
void
Surface_RenderVector_DockTab
::
selectedVectorVBOChanged
(
QListWidgetItem
*
item
,
QListWidgetItem
*
old
)
{
{
if
(
!
b_updatingUI
)
if
(
!
b_updatingUI
)
{
{
if
((
item
->
checkState
()
==
Qt
::
Checked
))
View
*
view
=
m_schnapps
->
getSelectedView
();
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
if
(
view
&&
map
)
{
{
selectedName
->
setText
(
item
->
text
());
if
((
item
->
checkState
()
==
Qt
::
Checked
))
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
];
const
MapParameters
&
p
=
m_plugin
->
h_viewParameterSet
[
view
][
map
];
Utils
::
VBO
*
v
=
map
->
getVBO
(
item
->
text
());
Utils
::
VBO
*
v
=
map
->
getVBO
(
item
->
text
());
m_current_vbo
=
p
.
vectorVBOs
.
indexOf
(
v
);
int
idx
=
p
.
vectorVBOs
.
indexOf
(
v
);
if
(
m_current_vbo
>=
0
)
slider_vectorsScaleFactor
->
setEnabled
(
true
);
{
slider_vectorsScaleFactor
->
setSliderPosition
(
p
.
scaleFactors
[
idx
]
*
50.0
f
);
slider_vectorsScaleFactor
->
setSliderPosition
(
p
.
scaleFactors
[
m_current_vbo
]
*
50.0
f
);
combo_color
->
setEnabled
(
true
);
std
::
cout
<<
item
->
text
().
toStdString
()
<<
" : "
<<
p
.
scaleFactors
[
m_current_vbo
]
<<
" / "
<<
slider_vectorsScaleFactor
->
value
()
<<
std
::
endl
;
combo_color
->
setColor
(
p
.
colors
[
idx
]);
combo_color
->
setColor
(
p
.
colors
[
m_current_vbo
]);
}
}
else
{
slider_vectorsScaleFactor
->
setDisabled
(
true
);
combo_color
->
setDisabled
(
true
);
}
}
}
else
{
selectedName
->
setText
(
"not selected"
);
slider_vectorsScaleFactor
->
setDisabled
(
true
);
combo_color
->
setDisabled
(
true
);
}
}
}
}
}
}
void
Surface_RenderVector_DockTab
::
vectorsVBOChecked
(
QListWidgetItem
*
item
)
void
Surface_RenderVector_DockTab
::
vectorsVBOChecked
(
QListWidgetItem
*
item
)
{
{
if
(
!
b_updatingUI
)
if
(
!
b_updatingUI
)
...
@@ -97,6 +83,7 @@ void Surface_RenderVector_DockTab::vectorsVBOChecked(QListWidgetItem* item)
...
@@ -97,6 +83,7 @@ void Surface_RenderVector_DockTab::vectorsVBOChecked(QListWidgetItem* item)
{
{
MapParameters
&
p
=
m_plugin
->
h_viewParameterSet
[
view
][
map
];
MapParameters
&
p
=
m_plugin
->
h_viewParameterSet
[
view
][
map
];
Utils
::
VBO
*
vbo
=
map
->
getVBO
(
item
->
text
());
Utils
::
VBO
*
vbo
=
map
->
getVBO
(
item
->
text
());
if
(
item
->
checkState
()
==
Qt
::
Checked
)
if
(
item
->
checkState
()
==
Qt
::
Checked
)
{
{
p
.
vectorVBOs
.
append
(
vbo
);
p
.
vectorVBOs
.
append
(
vbo
);
...
@@ -114,11 +101,10 @@ void Surface_RenderVector_DockTab::vectorsVBOChecked(QListWidgetItem* item)
...
@@ -114,11 +101,10 @@ void Surface_RenderVector_DockTab::vectorsVBOChecked(QListWidgetItem* item)
p
.
vectorVBOs
.
removeAt
(
idx
);