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 
7 #include "pqApplicationComponentsModule.h"
8 
9 #include <QWidget>
10 
11 #include <string> // for std::string
12 
13 class vtkOSPRayMaterialLibrary;
14 class vtkSMProxy;
15 class QDockWidget;
16 
26 class PQAPPLICATIONCOMPONENTS_EXPORT pqMaterialEditor : public QWidget
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 
53  vtkOSPRayMaterialLibrary* getMaterialLibrary() const;
54 
60  {
61  PropertyValue = Qt::UserRole + 1
62  };
63 
64 protected Q_SLOTS:
65  void updateCurrentMaterial(const std::string&);
66  void updateCurrentMaterialWithIndex(int index);
67 
68  void loadMaterials();
69 
70  void addMaterial();
71  void removeMaterial();
72  void attachMaterial();
73  void saveMaterials();
74 
75  void addProperty();
76 
77  void propertyChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
78 
79 protected:
87  std::string generateValidMaterialName(const std::string& name);
88 
92  void showEvent(QShowEvent* event) override;
93 
94 private:
95  Q_DISABLE_COPY(pqMaterialEditor)
96  class pqInternals;
97  pqInternals* Internals;
98  friend class pqInternals;
99 
100  bool HasWarnedUser = true;
101 };
102 
103 #endif
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