Commit 7eb49c63 authored by Aron Helser's avatar Aron Helser

Lights: move Light Kit to the lights inspector panel

Remove the dedicated light dialog, and move the light kit into
the light inspector panel with the configurable lights.

pqLightEditor becomes a PropertyGroupWidget instead of referencing
one, and moves to the Components directory.

Some UI re-arranging still todo.
parent 1010c4aa
......@@ -1781,7 +1781,7 @@
panel_visibility="never"
number_of_elements="1">
<Documentation>Set the delay (in seconds) after an interactive render
before switching to a full-rese render.</Documentation>
before switching to a full-res render.</Documentation>
<Hints>
<PropertyLink group="settings"
proxy="RenderViewSettings"
......@@ -2558,6 +2558,10 @@
or not.</Documentation>
<Hints>
<PropertyWidgetDecorator type="OSPRayHidingDecorator" />
<PropertyWidgetDecorator type="GenericDecorator"
mode="visibility"
property="EnableOSPRay"
values="1" />
</Hints>
</IntVectorProperty>
<StringVectorProperty name="OSPRayRendererType"
......@@ -2572,6 +2576,10 @@
<Documentation>Set the OSPRay renderer to use.</Documentation>
<Hints>
<PropertyWidgetDecorator type="OSPRayHidingDecorator" />
<PropertyWidgetDecorator type="GenericDecorator"
mode="visibility"
property="EnableOSPRay"
values="1" />
</Hints>
</StringVectorProperty>
<IntVectorProperty
......@@ -2587,6 +2595,10 @@
OSPRay sends at each intersection.</Documentation>
<Hints>
<PropertyWidgetDecorator type="OSPRayHidingDecorator" />
<PropertyWidgetDecorator type="GenericDecorator"
mode="visibility"
property="EnableOSPRay"
values="1" />
</Hints>
</IntVectorProperty>
<IntVectorProperty
......@@ -2602,6 +2614,10 @@
shoots per pixel.</Documentation>
<Hints>
<PropertyWidgetDecorator type="OSPRayHidingDecorator" />
<PropertyWidgetDecorator type="GenericDecorator"
mode="visibility"
property="EnableOSPRay"
values="1" />
</Hints>
</IntVectorProperty>
<IntVectorProperty
......@@ -2619,6 +2635,10 @@
is started with the --enable-streaming option.</Documentation>
<Hints>
<PropertyWidgetDecorator type="OSPRayHidingDecorator" />
<PropertyWidgetDecorator type="GenericDecorator"
mode="visibility"
property="EnableOSPRay"
values="1" />
</Hints>
</IntVectorProperty>
<DoubleVectorProperty
......@@ -2633,6 +2653,10 @@
<Documentation>Diminish or Amplify all lights in the scene.</Documentation>
<Hints>
<PropertyWidgetDecorator type="OSPRayHidingDecorator" />
<PropertyWidgetDecorator type="GenericDecorator"
mode="visibility"
property="EnableOSPRay"
values="1" />
</Hints>
</DoubleVectorProperty>
<DoubleVectorProperty
......@@ -2686,8 +2710,9 @@
<Property name="OrientationAxesLabelColor"/>
<Property name="OrientationAxesOutlineColor"/>
</PropertyGroup>
<PropertyGroup label="Lights" panel_widget="LightsEditor"
panel_visibility="advanced">
<PropertyGroup name="Lights"
label="Lights"
panel_visibility="never">
<!-- Light Kit -->
<Property name="UseLight"/>
<!-- Key Light -->
......@@ -10087,6 +10112,10 @@
</Documentation>
<Hints>
<PropertyWidgetDecorator type="OSPRayHidingDecorator" />
<PropertyWidgetDecorator type="GenericDecorator"
mode="visibility"
property="EnableOSPRay"
values="1" />
</Hints>
</DoubleVectorProperty>
<DoubleVectorProperty command="SetEdgeColor"
......
......@@ -172,8 +172,6 @@ set (Module_SRCS
pqInputDataTypeDecorator.h
pqInteractivePropertyWidget.cxx
pqInteractivePropertyWidget.h
pqLightsEditor.cxx
pqLightsEditor.h
pqLinePropertyWidget.cxx
pqLinePropertyWidget.h
pqLinkSelectionReaction.cxx
......@@ -402,7 +400,6 @@ set (Module_MOC_HDRS
pqImportCinemaReaction.h
pqInputDataTypeDecorator.h
pqInteractivePropertyWidget.h
pqLightsEditor.h
pqLinePropertyWidget.h
pqLinkSelectionReaction.h
pqListPropertyWidget.h
......@@ -526,7 +523,6 @@ set (Module_UI_FILES
Resources/UI/pqHandlePropertyWidget.ui
Resources/UI/pqImageCompressorWidget.ui
Resources/UI/pqImplicitPlanePropertyWidget.ui
Resources/UI/pqLightsEditor.ui
Resources/UI/pqLinePropertyWidget.ui
Resources/UI/pqMainControlsToolbar.ui
Resources/UI/pqPipelineBrowserContextMenu.ui
......
......@@ -61,7 +61,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqInputDataTypeDecorator.h"
#include "pqInputSelectorWidget.h"
#include "pqIntMaskPropertyWidget.h"
#include "pqLightsEditor.h"
#include "pqLinePropertyWidget.h"
#include "pqListPropertyWidget.h"
#include "pqOSPRayHidingDecorator.h"
......@@ -217,12 +216,6 @@ pqPropertyWidget* pqStandardPropertyWidgetInterface::createWidgetForPropertyGrou
{
return new pqBackgroundEditorWidget(proxy, group);
}
else if (panelWidget == "LightsEditor")
{
pqPropertyGroupButton* pgb = new pqPropertyGroupButton(proxy, group);
pgb->SetEditor(new pqLightsEditor(pgb));
return pgb;
}
else if (panelWidget == "ArrayStatus")
{
return new pqArrayStatusPropertyWidget(proxy, group);
......
......@@ -89,7 +89,6 @@ public:
* \li \c ColorEditor : pqColorEditorPropertyWidget
* \li \c ColorOpacityEditor : pqColorOpacityEditorWidget
* \li \c FontEditor : pqFontPropertyWidget
* \li \c LightsEditor : pqLightsPropertyGroup
* \li \c SeriesEditor : pqSeriesEditorPropertyWidget
* \li \c InteractivePlane : pqImplicitPlanePropertyWidget
* \li \c InteractiveBox: pqBoxPropertyWidget
......
......@@ -145,6 +145,8 @@ set (Module_SRCS
pqKeyFrameTypeWidget.h
pqLabel.cxx
pqLabel.h
pqLightsEditor.cxx
pqLightsEditor.h
pqLightsInspector.cxx
pqLightsInspector.h
pqLinksEditor.cxx
......@@ -366,6 +368,7 @@ set (Module_MOC_HDRS
pqKeyFrameTimeValidator.h
pqKeyFrameTypeWidget.h
pqLabel.h
pqLightsEditor.h
pqLightsInspector.h
pqLinksEditor.h
pqLinksManager.h
......@@ -472,6 +475,7 @@ set (Module_UI_FILES
Resources/UI/pqItemViewSearchWidget.ui
Resources/UI/pqKeyFrameEditor.ui
Resources/UI/pqKeyFrameTypeWidget.ui
Resources/UI/pqLightsEditor.ui
Resources/UI/pqLightsInspector.ui
Resources/UI/pqLinksEditor.ui
Resources/UI/pqLinksManager.ui
......
......@@ -787,13 +787,6 @@
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="Close">
<property name="text">
<string>Close</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
......
......@@ -83,14 +83,12 @@ const int PROPERTY_COUNT = sizeof(PROPERTY_NAME) / sizeof(PROPERTY_NAME[0]);
}
//-----------------------------------------------------------------------------
pqLightsEditor::pqLightsEditor(
pqPropertyGroupWidget* propertyWidget, QWidget* _parent, Qt::WindowFlags flags)
: Superclass(_parent, flags)
pqLightsEditor::pqLightsEditor(vtkSMProxy* proxy, vtkSMPropertyGroup* smGroup, QWidget* _parent)
: Superclass(proxy, smGroup, _parent)
, Internal(new pqInternal(this))
, PropertyWidget(propertyWidget)
{
Ui::LightsEditor& ui = *this->Internal;
pqPropertyGroupWidget& pg = *PropertyWidget;
pqPropertyGroupWidget& pg = *this;
pg.addPropertyLink(ui.LightKit, LIGHT_KIT);
pg.addPropertyLink(ui.KeyLightWarmth, KEY_LIGHT_WARMTH);
......@@ -113,7 +111,12 @@ pqLightsEditor::pqLightsEditor(
pg.addPropertyLink(ui.LightIntensity, LIGHT_INTENSITY);
pg.addPropertyLink(ui.LightColor, LIGHT_COLOR);
connect(ui.Close, SIGNAL(pressed()), this, SLOT(close()));
// set pqPropertyWidget links to update VTK immediately on UI change - lights are a display
// property
links().setUseUncheckedProperties(false);
links().setAutoUpdateVTKObjects(true);
// connect(ui.Close, SIGNAL(pressed()), this, SLOT(close()));
connect(ui.Reset, SIGNAL(pressed()), this, SLOT(reset()));
}
......@@ -130,9 +133,10 @@ void pqLightsEditor::reset()
BEGIN_UNDO_SET("Restore Default Lights");
for (int i = 0; i < PROPERTY_COUNT; ++i)
{
vtkSMProperty* _property = this->PropertyWidget->propertyGroup()->GetProperty(PROPERTY_NAME[i]);
vtkSMProperty* _property = this->propertyGroup()->GetProperty(PROPERTY_NAME[i]);
_property->ResetToDefault();
}
emit this->PropertyWidget->changeFinished();
proxy()->UpdateVTKObjects();
emit this->changeFinished();
END_UNDO_SET();
}
......@@ -32,20 +32,19 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef pqLightsEditor_h
#define pqLightsEditor_h
#include "pqApplicationComponentsModule.h"
#include <QDialog>
#include "pqComponentsModule.h" // for exports
#include "pqPropertyGroupWidget.h"
class vtkSMProxy;
class vtkSMPropertyGroup;
class pqPropertyGroupWidget;
class PQAPPLICATIONCOMPONENTS_EXPORT pqLightsEditor : public QDialog
class PQCOMPONENTS_EXPORT pqLightsEditor : public pqPropertyGroupWidget
{
Q_OBJECT
typedef QDialog Superclass;
typedef pqPropertyGroupWidget Superclass;
public:
pqLightsEditor(pqPropertyGroupWidget* propertyWidget, QWidget* parent = 0, Qt::WindowFlags f = 0);
pqLightsEditor(vtkSMProxy* proxy, vtkSMPropertyGroup* smGroup, QWidget* parent = 0);
~pqLightsEditor() override;
protected slots:
......@@ -54,7 +53,6 @@ protected slots:
private:
class pqInternal;
pqInternal* Internal;
pqPropertyGroupWidget* PropertyWidget;
};
#endif
......@@ -35,6 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "vtkCamera.h"
#include "vtkPVLight.h"
#include "vtkSMParaViewPipelineController.h"
#include "vtkSMPropertyGroup.h"
#include "vtkSMPropertyHelper.h"
#include "vtkSMRenderViewProxy.h"
#include "vtkSMSessionProxyManager.h"
......@@ -42,6 +43,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqActiveObjects.h"
#include "pqApplicationCore.h"
#include "pqLightsEditor.h"
#include "pqPropertiesPanel.h"
#include "pqPropertyWidget.h"
#include "pqProxyWidget.h"
......@@ -121,6 +123,7 @@ public:
}
delete child;
}
if (this->rview && this->observerTag != 0)
{
this->rview->GetProperty("AdditionalLights")->RemoveObserver(this->observerTag);
......@@ -137,6 +140,25 @@ public:
this->Ui.addLight->setEnabled(true);
pqView* pv = pqActiveObjects::instance().activeView();
// add new light kit for this view.
vtkSMPropertyGroup* lightkitGroup = nullptr;
size_t ngroups = view->GetNumberOfPropertyGroups();
for (size_t j = 0; j < ngroups; ++j)
{
vtkSMPropertyGroup* smGroup = view->GetPropertyGroup(j);
if (smGroup->GetXMLLabel() == vtkStdString("Lights"))
{
lightkitGroup = smGroup;
break;
}
}
if (lightkitGroup)
{
pqLightsEditor* lightsEditor = new pqLightsEditor(view, lightkitGroup, self);
this->Ui.verticalLayout_2->addWidget(lightsEditor);
// whenever a property changes, do a render.
self->connect(lightsEditor, SIGNAL(changeFinished()), SLOT(render()));
}
// add new contents
unsigned int nlights = vtkSMPropertyHelper(view, "AdditionalLights").GetNumberOfElements();
for (unsigned int i = 0; i < nlights; ++i)
......@@ -259,7 +281,8 @@ void pqLightsInspector::addLight()
// call vtkPVRenderView::AddLight - light saved in "AdditionalLights" list
vtkSMPropertyHelper(view, "AdditionalLights").Add(light);
this->Internals->updateLightWidgets();
// modification of AdditionalLights already calls this:
// this->Internals->updateLightWidgets();
// make it so...
view->UpdateVTKObjects();
......@@ -334,7 +357,8 @@ void pqLightsInspector::removeLight(vtkSMProxy* lightProxy)
// vtkNew<vtkSMParaViewPipelineController> controller;
// controller->UnRegisterProxy(lightProxy);
this->Internals->updateLightWidgets();
// modification of AdditionalLights already calls this:
// this->Internals->updateLightWidgets();
// make it so...
view->UpdateVTKObjects();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment