Commit 1db0cdad authored by Joachim Pouderoux's avatar Joachim Pouderoux Committed by Kitware Robot

Merge topic 'custom-shader'

f035e5d6 Add shader replacements widget and settings.
94c48eb3 Rename property to ShaderReplacements where content is a Json string
a1489dbb Add option in UI to add code after light implementation in shader
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Mathieu Westphal's avatarMathieu Westphal <mathieu.westphal@kitware.com>
Merge-request: !2568
parents 2237791e f035e5d6
......@@ -443,6 +443,7 @@ list(APPEND TESTS_WITH_BASELINES
${CMAKE_CURRENT_SOURCE_DIR}/SelectionModifiersBlocks.xml
${CMAKE_CURRENT_SOURCE_DIR}/SelectReader.xml
${CMAKE_CURRENT_SOURCE_DIR}/SetCustomBasicPresets.xml
${CMAKE_CURRENT_SOURCE_DIR}/ShaderReplacements.xml
${CMAKE_CURRENT_SOURCE_DIR}/ShowAll.xml
${CMAKE_CURRENT_SOURCE_DIR}/SimpleInteraction.xml
${CMAKE_CURRENT_SOURCE_DIR}/SliceAlongPolyline.xml
......
<?xml version="1.0" ?>
<pqevents>
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuSources" />
<pqevent object="pqClientMainWindow/menubar/menuSources" command="activate" arguments="RTAnalyticSource" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/representationToolbar/displayRepresentation/comboBox" command="activated" arguments="Surface" />
<pqevent object="pqClientMainWindow/variableToolbar/displayColor/Variables" command="activated" arguments="RTData" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_vcontainer/1QScrollBar0" command="mousePress" arguments="1,1,0,3,77" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_vcontainer/1QScrollBar0" command="mouseMove" arguments="1,0,0,6,189" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_vcontainer/1QScrollBar0" command="mouseRelease" arguments="1,0,0,6,189" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/SearchBox/AdvancedButton" command="set_boolean" arguments="true" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_vcontainer/1QScrollBar0" command="mousePress" arguments="1,1,0,7,73" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_vcontainer/1QScrollBar0" command="mouseMove" arguments="1,0,0,20,201" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_vcontainer/1QScrollBar0" command="mouseRelease" arguments="1,0,0,20,201" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/UseShaderReplacements/CheckBox" command="set_boolean" arguments="true" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/DisplayFrame/ProxyPanel/ShaderReplacements/1pqTextEdit0" command="set_string" arguments="{&#xA;
&quot;type&quot;: &quot;fragment&quot;,&#xA;
&quot;original&quot;: &quot;//VTK::Light::Impl&quot;,&#xA;
&quot;replacement&quot;: &quot;gl_FragData[0]=vec4(1.0,0.0,0.0,1.0);&quot;&#xA;}" />
<pqevent object="pqClientMainWindow/cameraToolbar/actionResetCamera" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/axesToolbar/actionShowOrientationAxes" command="set_boolean" arguments="false" />
<pqevent object="pqClientMainWindow/variableToolbar/actionScalarBarVisibility" command="set_boolean" arguments="false" />
</pqevents>
......@@ -25,6 +25,7 @@ vtk_module(vtkPVClientServerCoreRendering
#vtkRenderingVolumeOpenGL
vtkViewsContext2D
vtkViewsCore
vtkjsoncpp
${__dependencies}
PRIVATE_DEPENDS
vtksys
......
......@@ -945,6 +945,9 @@
{ "name": "vtkjpeg",
"path": "VTK/ThirdParty/jpeg"
},
{ "name": "vtkjsoncpp",
"path": "VTK/ThirdParty/jsoncpp"
},
{ "name": "vtkpng",
"path": "VTK/ThirdParty/png"
},
......
# Add a ShaderReplacements property to the Geometry representation
This new property allows the user to customize the OpenGL shaders by providing
some replacement strings for the shader produced by VTK. The replacements are
provided through a Json string like this:
```json
[
{
"type": "fragment",
"original": "//VTK::Light::Impl",
"replacement": "gl_FragData[0]=vec4(1.0,0.0,0.0,1.0);\n"
},
// other replacements can follow
]
```
In the UI, the property is represented with a custom widget that allows to load
Json from a file and save its path as a preset which is saved in the SMSettings
(thus in user's configuration file). It is possible to select a preset, remove
it from the list and edit the content of the Json string in a text edit widget.
......@@ -29,6 +29,7 @@ vtk_module(vtkPVClientServerCoreRendering
vtkRenderingVolumeOpenGL2
vtkViewsContext2D
vtkViewsCore
vtkjsoncpp
${__dependencies}
PRIVATE_DEPENDS
vtksys
......
......@@ -53,8 +53,13 @@
#include "vtkOSPRayActorNode.h"
#endif
#include <vtk_jsoncpp.h>
#include <vtksys/SystemTools.hxx>
#include <memory>
#include <tuple>
#include <vector>
//*****************************************************************************
// This is used to convert a vtkPolyData to a vtkMultiBlockDataSet. If input is
// vtkMultiBlockDataSet, then this is simply a pass-through filter. This makes
......@@ -193,6 +198,9 @@ vtkGeometryRepresentation::vtkGeometryRepresentation()
this->PWF = NULL;
this->UseDataPartitions = false;
this->UseShaderReplacements = false;
this->ShaderReplacementsString = "";
}
//----------------------------------------------------------------------------
......@@ -1150,3 +1158,110 @@ void vtkGeometryRepresentation::ComputeVisibleDataBounds()
this->VisibleDataBoundsTime.Modified();
}
}
//----------------------------------------------------------------------------
void vtkGeometryRepresentation::SetUseShaderReplacements(bool useShaderRepl)
{
if (this->UseShaderReplacements != useShaderRepl)
{
this->UseShaderReplacements = useShaderRepl;
this->Modified();
this->UpdateShaderReplacements();
}
}
//----------------------------------------------------------------------------
void vtkGeometryRepresentation::SetShaderReplacements(const char* replacementsString)
{
if (strcmp(replacementsString, this->ShaderReplacementsString.c_str()))
{
this->ShaderReplacementsString = std::string(replacementsString);
this->Modified();
this->UpdateShaderReplacements();
}
}
//----------------------------------------------------------------------------
void vtkGeometryRepresentation::UpdateShaderReplacements()
{
vtkOpenGLPolyDataMapper* glMapper = vtkOpenGLPolyDataMapper::SafeDownCast(this->Mapper);
vtkOpenGLPolyDataMapper* glLODMapper = vtkOpenGLPolyDataMapper::SafeDownCast(this->LODMapper);
if (!glMapper || !glLODMapper)
{
return;
}
glMapper->ClearAllShaderReplacements();
glLODMapper->ClearAllShaderReplacements();
if (!this->UseShaderReplacements || this->ShaderReplacementsString == "")
{
return;
}
Json::CharReaderBuilder builder;
builder["collectComments"] = false;
Json::Value root;
std::unique_ptr<Json::CharReader> reader(builder.newCharReader());
bool success = reader->parse(this->ShaderReplacementsString.c_str(),
this->ShaderReplacementsString.c_str() + this->ShaderReplacementsString.length(), &root,
nullptr);
if (!success)
{
vtkGenericWarningMacro("Unable to parse the replacement Json string!");
return;
}
bool isArray = root.isArray();
size_t nbReplacements = isArray ? root.size() : 1;
std::vector<std::tuple<vtkShader::Type, std::string, std::string> > replacements;
for (size_t index = 0; index < nbReplacements; ++index)
{
const Json::Value& repl = isArray ? root[(int)index] : root;
if (!repl.isMember("type"))
{
vtkErrorMacro("Syntax error in shader replacements: a type is required.");
return;
}
std::string type = repl["type"].asString();
vtkShader::Type shaderType = vtkShader::Unknown;
if (type == "fragment")
{
shaderType = vtkShader::Fragment;
}
else if (type == "vertex")
{
shaderType = vtkShader::Vertex;
}
else if (type == "geometry")
{
shaderType = vtkShader::Geometry;
}
if (shaderType == vtkShader::Unknown)
{
vtkErrorMacro("Unknown shader type for replacement:" << type);
return;
}
if (!repl.isMember("original"))
{
vtkErrorMacro("Syntax error in shader replacements: an original pattern is required.");
return;
}
std::string original = repl["original"].asString();
if (!repl.isMember("replacement"))
{
vtkErrorMacro("Syntax error in shader replacements: a replacement pattern is required.");
return;
}
std::string replacement = repl["replacement"].asString();
replacements.push_back(std::make_tuple(shaderType, original, replacement));
}
for (const auto& r : replacements)
{
glMapper->AddShaderReplacement(std::get<0>(r), std::get<1>(r), true, std::get<2>(r), true);
glLODMapper->AddShaderReplacement(std::get<0>(r), std::get<1>(r), true, std::get<2>(r), true);
}
}
......@@ -288,6 +288,21 @@ public:
vtkGetMacro(UseDataPartitions, bool);
//@}
//@{
/**
* Specify whether or not to shader replacements string must be used.
*/
virtual void SetUseShaderReplacements(bool);
vtkGetMacro(UseShaderReplacements, bool);
//@}
/**
* Specify shader replacements using a Json string.
* Please refer to the XML definition of the property for details about
* the expected Json string format.
*/
virtual void SetShaderReplacements(const char*);
protected:
vtkGeometryRepresentation();
~vtkGeometryRepresentation() override;
......@@ -370,6 +385,11 @@ protected:
*/
void ComputeVisibleDataBounds();
/**
* Update the mapper with the shader replacement strings if feature is enabled.
*/
void UpdateShaderReplacements();
vtkAlgorithm* GeometryFilter;
vtkAlgorithm* MultiBlockMaker;
vtkPVCacheKeeper* CacheKeeper;
......@@ -395,6 +415,9 @@ protected:
bool UseDataPartitions;
bool UseShaderReplacements;
std::string ShaderReplacementsString;
bool BlockAttrChanged = false;
vtkTimeStamp BlockAttributeTime;
bool UpdateBlockAttrLOD = false;
......
......@@ -3793,6 +3793,10 @@
panel_visibility="never" />
<Property name="Triangulate"
panel_visibility="advanced" />
<Property name="UseShaderReplacements"
panel_visibility="advanced" />
<Property name="ShaderReplacements"
panel_visibility="advanced" />
<Property name="NonlinearSubdivisionLevel"
panel_visibility="advanced" />
<Property name="BlockVisibility"
......@@ -11049,6 +11053,47 @@
issues of non-convex polygons. This feature has a processing and memory
cost, it should be enabled only when needed.</Documentation>
</IntVectorProperty>
<IntVectorProperty command="SetUseShaderReplacements"
default_values="0"
name="UseShaderReplacements"
number_of_elements="1">
<BooleanDomain name="bool" />
<Documentation>Enable the use of shader replacements.</Documentation>
</IntVectorProperty>
<StringVectorProperty command="SetShaderReplacements"
default_values=""
name="ShaderReplacements"
number_of_elements="1"
panel_widget="shader_replacements_selector"
panel_visibility="advanced">
<Documentation>
Specify shader replacements using a Json string.
The Json string can be a single node or an array of nodes with the
following properties:&#xa;
"type": specifies the type of shader the replacement is about.
It can be either "vertex", "fragment" or "geometry".&#xa;
"original": specifies the original string to be replaced in the shader code.
This string is generally a pattern defined by the mapper
vtkOpenGLPolyDataMapper at specific locations of the shader
GLSL source code.&#xa;
"replacement": specifies the replacement string in GLSL source code.
Note that the Json parser supports multiple lines entries.&#xa;
Example of a simple shader replacement (draw all the fragments in full red
color without any shading consideration):&#xa;
{&#xa;
"type": "fragment",&#xa;
"original": "//VTK::Light::Impl",&#xa;
"replacement": "gl_FragData[0]=vec4(1.0,0.0,0.0,1.0);"&#xa;
}&#xa;
</Documentation>
<Hints>
<PropertyWidgetDecorator type="GenericDecorator"
mode="visibility"
property="UseShaderReplacements"
value="1" />
<!-- show this widget when UseShaderReplacements is enabled -->
</Hints>
</StringVectorProperty>
<IntVectorProperty command="SetNonlinearSubdivisionLevel"
default_values="1"
name="NonlinearSubdivisionLevel"
......
......@@ -69,6 +69,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqPropertyGroupButton.h"
#include "pqProxyEditorPropertyWidget.h"
#include "pqSeriesEditorPropertyWidget.h"
#include "pqShaderReplacementsSelectorPropertyWidget.h"
#include "pqShowWidgetDecorator.h"
#include "pqSpherePropertyWidget.h"
#include "pqSplinePropertyWidget.h"
......@@ -134,6 +135,10 @@ pqPropertyWidget* pqStandardPropertyWidgetInterface::createWidgetForProperty(
{
return new pqTextureSelectorPropertyWidget(smProxy, parentWidget);
}
else if (name == "shader_replacements_selector")
{
return new pqShaderReplacementsSelectorPropertyWidget(smProxy, smProperty);
}
else if (name == "calculator")
{
return new pqCalculatorWidget(smProxy, smProperty, parentWidget);
......
......@@ -268,6 +268,10 @@ set (Module_SRCS
pqSetBreakpointDialog.h
pqSettingsDialog.cxx
pqSettingsDialog.h
pqShaderReplacementsComboBox.cxx
pqShaderReplacementsComboBox.h
pqShaderReplacementsSelectorPropertyWidget.cxx
pqShaderReplacementsSelectorPropertyWidget.h
pqSignalAdaptorKeyFrameType.cxx
pqSignalAdaptorKeyFrameType.h
pqSignalAdaptorSelectionTreeWidget.cxx
......@@ -437,6 +441,8 @@ set (Module_MOC_HDRS
pqServerLauncher.h
pqSetBreakpointDialog.h
pqSettingsDialog.h
pqShaderReplacementsComboBox.h
pqShaderReplacementsSelectorPropertyWidget.h
pqSignalAdaptorKeyFrameType.h
pqSignalAdaptorSelectionTreeWidget.h
pqSignalAdaptorTreeWidget.h
......
......@@ -149,6 +149,7 @@
<file>Icons/pqPrint22.png</file>
<file>Icons/pqProbeLocation24.png</file>
<file>Icons/pqProgrammableFilter24.png</file>
<file>Icons/pqQuit22.png</file>
<file>Icons/pqRamp16.png</file>
<file>Icons/pqRamp24.png</file>
<file>Icons/pqRectilinearGrid16.png</file>
......
/*=========================================================================
Program: ParaView
Module: pqShaderReplacementsComboBox.cxx
Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
========================================================================*/
#include "pqShaderReplacementsComboBox.h"
// Server Manager Includes.
#include "vtkSMSettings.h"
// Qt Includes.
#include <QDir>
#include <QFileInfo>
#include <QSet>
#include <QStringList>
const char* pqShaderReplacementsComboBox::ShaderReplacementPathsSettings =
"ShaderReplacements.Paths";
//-----------------------------------------------------------------------------
pqShaderReplacementsComboBox::pqShaderReplacementsComboBox(QWidget* _parent)
: Superclass(_parent)
{
this->populate();
}
//-----------------------------------------------------------------------------
int pqShaderReplacementsComboBox::getPathIndex(const QString& path) const
{
for (int i = 1; i < this->count(); i++)
{
if (this->itemData(i).toString() == path)
{
return i;
}
}
return 0;
}
//-----------------------------------------------------------------------------
void pqShaderReplacementsComboBox::setPath(const QString& path)
{
this->setCurrentIndex(this->getPathIndex(path));
}
//-----------------------------------------------------------------------------
void pqShaderReplacementsComboBox::populate()
{
// Refresh the whole content of the combobox
this->blockSignals(true);
this->clear();
// Get and process the preset paths saved in the user settings
QString paths(
vtkSMSettings::GetInstance()
->GetSettingAsString(pqShaderReplacementsComboBox::ShaderReplacementPathsSettings, "")
.c_str());
QStringList plist = paths.split(QDir::listSeparator());
if (plist.size() == 0 || (plist.size() == 1 && plist[0] == ""))
{
this->addItem(tr("(No preset)"), "");
}
else
{
this->addItem(tr("(Select a preset)"), "");
QSet<QString> pathSet;
foreach (QString p, plist)
{
if (p != "" && !pathSet.contains(p))
{
this->addItem(QFileInfo(p).fileName(), QVariant(p));
pathSet.insert(p);
}
}
}
this->blockSignals(false);
}
//-----------------------------------------------------------------------------
void pqShaderReplacementsComboBox::showPopup()
{
this->populate();
QComboBox::showPopup();
}
/*=========================================================================
Program: ParaView
Module: pqShaderReplacementsComboBox.h
Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
========================================================================*/
#ifndef pqShaderReplacementsComboBox_h
#define pqShaderReplacementsComboBox_h
#include "pqComponentsModule.h"
#include <QComboBox>
/**
* This is a ComboBox that is used on the display tab to select available
* ShaderReplacements presets paths saved in vtkSMSettings.
*/
class PQCOMPONENTS_EXPORT pqShaderReplacementsComboBox : public QComboBox
{
Q_OBJECT
typedef QComboBox Superclass;
public:
pqShaderReplacementsComboBox(QWidget* parent = nullptr);
~pqShaderReplacementsComboBox() override = default;
/**
* Return the combobox entry index corresponding to the provided preset path.
* Returned value is 0 if not found.
*/
int getPathIndex(const QString& presetPath) const;
/**
* Select the combobox entry corresponding to the provided path.
*/
void setPath(const QString& presetPath);
/**
* Clear current combobox content and repopulate it with the shader
* replacement presets using the files declared in vtkSMSettings.
*/
void populate();
/**
* Setting name of the variable that stores the paths of the presets.
*/
static const char* ShaderReplacementPathsSettings;
protected:
void showPopup() override;
private:
Q_DISABLE_COPY(pqShaderReplacementsComboBox)
};
#endif
This diff is collapsed.
/*=========================================================================
Program: ParaView
Module: pqShaderReplacementsSelectorPropertyWidget.h
Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
#ifndef _pqShaderReplacementsSelectorPropertyWidget_h
#define _pqShaderReplacementsSelectorPropertyWidget_h
#include "pqComponentsModule.h"
#include "pqPropertyWidget.h"
/**
* Property widget for selecting the ShaderReplacements to apply to a geometry.
*
* To use this widget for a property add 'panel_widget="shader_replacements_selector"'
* to the property's XML.
*/
class PQCOMPONENTS_EXPORT pqShaderReplacementsSelectorPropertyWidget : public pqPropertyWidget
{
Q_OBJECT
public:
pqShaderReplacementsSelectorPropertyWidget(
vtkSMProxy* proxy, vtkSMProperty* property, QWidget* parent = nullptr);
~pqShaderReplacementsSelectorPropertyWidget() override;
protected slots:
void updateShaderReplacements();
void textChangedAndEditingFinished();
void onLoad();
void onDelete();
void onPresetChanged(int index);
protected:
bool loadShaderReplacements(const QString& filename);
void refreshView();
private:
class pqInternal;
pqInternal* Internal;
};
#endif
d2523220140ec70eb2cc40e4aad05834391e711e02ae2ffdc0f0fcc22b250982b4b12fd072fa1b47018861ad797a05ea1577f0f16be86f74ea3ac77501cc0620
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