Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CAMP
campvis-public
Commits
bdcedc2b
Commit
bdcedc2b
authored
Sep 29, 2016
by
Jakob Weiss
Browse files
Use of ColorProperty's, metaprop has better styling
parent
ce6e4a7e
Changes
5
Hide whitespace changes
Inline
Side-by-side
application/gui/properties/colorpropertywidget.cpp
View file @
bdcedc2b
...
...
@@ -39,6 +39,7 @@ namespace campvis {
//connect(_colorPicker, SIGNAL(valueChanged(cgt::vec4)), this, SLOT(onColorChanged(cgt::vec4)));
connect
(
_colorPicker
,
SIGNAL
(
colorChanged
(
const
QColor
&
)),
this
,
SLOT
(
onColorChanged
(
const
QColor
&
)));
updateWidgetFromProperty
();
}
ColorPropertyWidget
::~
ColorPropertyWidget
()
{
...
...
application/gui/properties/metapropertywidget.cpp
View file @
bdcedc2b
...
...
@@ -28,17 +28,22 @@
#include
<QGroupBox>
namespace
campvis
{
MetaPropertyWidget
::
MetaPropertyWidget
(
MetaProperty
*
property
,
DataContainer
*
dc
,
QWidget
*
parent
/*= 0*/
)
:
AbstractPropertyWidget
(
property
,
true
,
dc
,
parent
,
true
)
,
_pcw
(
0
)
{
//cgtAssert(_dataContainer != 0, "Pointer to DataContainer must not be 0.");
MetaPropertyWidget
::
MetaPropertyWidget
(
MetaProperty
*
property
,
DataContainer
*
dc
,
QWidget
*
parent
/*= 0*/
)
:
AbstractPropertyWidget
(
property
,
true
,
dc
,
parent
,
true
)
,
_pcw
(
0
)
{
//cgtAssert(_dataContainer != 0, "Pointer to DataContainer must not be 0.");
_pcw
=
new
PropertyCollectionWidget
(
this
);
_pcw
->
updatePropCollection
(
property
,
_dataContainer
);
addWidget
(
_pcw
);
_pcw
=
new
PropertyCollectionWidget
(
this
);
_pcw
->
updatePropCollection
(
property
,
_dataContainer
);
addWidget
(
_pcw
);
updateWidgetFromProperty
();
updateWidgetFromProperty
();
_groupBox
->
parentWidget
()
->
setStyleSheet
(
"QGroupBox::indicator:checked { image: url(:/qt-project.org/styles/commonstyle/images/down-32.png); }
\n
"
"QGroupBox::indicator:unchecked { image: url(:/qt-project.org/styles/commonstyle/images/right-32.png);}"
);
}
MetaPropertyWidget
::~
MetaPropertyWidget
()
{
...
...
core/pipeline/processordecoratorbackground.h
View file @
bdcedc2b
...
...
@@ -28,6 +28,7 @@
#include
"core/pipeline/abstractprocessordecorator.h"
#include
"core/properties/floatingpointproperty.h"
#include
"core/properties/datanameproperty.h"
#include
"core/properties/colorproperty.h"
namespace
cgt
{
class
TextureUnit
;
...
...
@@ -47,8 +48,8 @@ namespace campvis {
virtual
void
renderEpilog
(
cgt
::
Shader
*
shader
)
override
;
Vec4
Property
_backgroundColor1
;
Vec4
Property
_backgroundColor2
;
Color
Property
_backgroundColor1
;
Color
Property
_backgroundColor2
;
DataNameProperty
_backgroundTexture
;
std
::
shared_ptr
<
cgt
::
TextureUnit
>
_bgTexUnit
;
...
...
modules/base/processors/lightsourceprovider.cpp
View file @
bdcedc2b
...
...
@@ -32,9 +32,9 @@ namespace campvis {
:
AbstractProcessor
()
,
p_lightId
(
"LightId"
,
"Light Name/ID"
,
"lightsource"
,
DataNameProperty
::
WRITE
)
,
p_lightPosition
(
"LightPosition"
,
"Light Position"
,
cgt
::
vec3
(
-
100.
f
),
cgt
::
vec3
(
-
500.
f
),
cgt
::
vec3
(
500.
f
),
cgt
::
vec3
(
1.
f
))
,
p_ambientColor
(
"AmbientColor"
,
"Ambient Light Color"
,
cgt
::
vec
3
(
0.4
f
),
cgt
::
vec
3
(
0.
f
),
cgt
::
vec
3
(
1.
f
))
,
p_diffuseColor
(
"DiffuseColor"
,
"Diffuse Light Color"
,
cgt
::
vec
3
(
0.75
f
),
cgt
::
vec
3
(
0.
f
),
cgt
::
vec
3
(
1.
f
))
,
p_specularColor
(
"SpecularColor"
,
"Specular Light Color"
,
cgt
::
vec
3
(
0.6
f
),
cgt
::
vec
3
(
0.
f
),
cgt
::
vec
3
(
1.
f
))
,
p_ambientColor
(
"AmbientColor"
,
"Ambient Light Color"
,
cgt
::
vec
4
(
0.4
f
),
cgt
::
vec
4
(
0.
f
),
cgt
::
vec
4
(
1.
f
))
,
p_diffuseColor
(
"DiffuseColor"
,
"Diffuse Light Color"
,
cgt
::
vec
4
(
0.75
f
),
cgt
::
vec
4
(
0.
f
),
cgt
::
vec
4
(
1.
f
))
,
p_specularColor
(
"SpecularColor"
,
"Specular Light Color"
,
cgt
::
vec
4
(
0.6
f
),
cgt
::
vec
4
(
0.
f
),
cgt
::
vec
4
(
1.
f
))
,
p_shininess
(
"Shininess"
,
"Specular Shininess"
,
24.
f
,
0.
f
,
64.
f
,
0.5
f
)
,
p_attenuation
(
"Attenuation"
,
"Attenuation Factors"
,
cgt
::
vec3
(
0.
f
),
cgt
::
vec3
(
0.
f
),
cgt
::
vec3
(
1.
f
))
{
...
...
@@ -54,9 +54,9 @@ namespace campvis {
void
LightSourceProvider
::
updateResult
(
DataContainer
&
data
)
{
LightSourceData
*
lsd
=
new
LightSourceData
(
p_lightPosition
.
getValue
(),
p_ambientColor
.
getValue
(),
p_diffuseColor
.
getValue
(),
p_specularColor
.
getValue
(),
p_ambientColor
.
getValue
()
.
xyz
()
,
p_diffuseColor
.
getValue
()
.
xyz
()
,
p_specularColor
.
getValue
()
.
xyz
()
,
p_shininess
.
getValue
(),
p_attenuation
.
getValue
());
data
.
addData
(
p_lightId
.
getValue
(),
lsd
);
...
...
modules/base/processors/lightsourceprovider.h
View file @
bdcedc2b
...
...
@@ -30,6 +30,7 @@
#include
"core/pipeline/abstractprocessor.h"
#include
"core/properties/datanameproperty.h"
#include
"core/properties/floatingpointproperty.h"
#include
"core/properties/colorproperty.h"
#include
"modules/modulesapi.h"
#include
"core/pipeline/processorfactory.h"
...
...
@@ -66,9 +67,9 @@ namespace campvis {
DataNameProperty
p_lightId
;
///< Name/ID for the LightSource to create
Vec3Property
p_lightPosition
;
///< Light position
Vec3
Property
p_ambientColor
;
///< Ambient light color
Vec3
Property
p_diffuseColor
;
///< Diffuse light color
Vec3
Property
p_specularColor
;
///< Specular light color
Color
Property
p_ambientColor
;
///< Ambient light color
Color
Property
p_diffuseColor
;
///< Diffuse light color
Color
Property
p_specularColor
;
///< Specular light color
FloatProperty
p_shininess
;
///< Specular shininess
Vec3Property
p_attenuation
;
///< Attenuation factors
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment