pqMaterialEditor.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 #ifndef pqMaterialEditor_h
5 #define pqMaterialEditor_h
6 
8 
9 #include <QWidget>
10 
11 #include <string> // for std::string
12 
13 class vtkOSPRayMaterialLibrary;
14 class vtkSMProxy;
15 class QDockWidget;
16 
27 {
28  Q_OBJECT
29  typedef QWidget Superclass;
30 
31 public:
32  pqMaterialEditor(QWidget* parent = nullptr, QDockWidget* dockWidget = nullptr);
33  ~pqMaterialEditor() override;
34 
38  void updateMaterialList();
39 
43  QString currentMaterialName();
44 
48  std::vector<std::string> availableParameters();
49 
55  {
56  PropertyValue = Qt::UserRole + 1
57  };
58 
59 protected Q_SLOTS:
60  void updateCurrentMaterial(const std::string&);
61  void updateCurrentMaterialWithIndex(int index);
62 
63  void loadMaterials();
64 
65  void addMaterial();
66  void removeMaterial();
67  void attachMaterial();
68  void saveMaterials();
69 
70  void addProperty();
71 
72  void propertyChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
73 
74 protected:
82  std::string generateValidMaterialName(const std::string& name);
83 
87  void showEvent(QShowEvent* event) override;
88 
89 private:
90  Q_DISABLE_COPY(pqMaterialEditor)
91  class pqInternals;
92  pqInternals* Internals;
93  friend class pqInternals;
94 
95  bool HasWarnedUser = true;
96 };
97 
98 #endif
#define PQAPPLICATIONCOMPONENTS_EXPORT
pqMaterialEditor is a widget that can be used to edit the OSPRay materials.
name
ExtendedItemDataRole
Strong type extension of the existing Qt::ItemDataRole.
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
index