ParaView
vtkSMTransferFunctionPresets.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMTransferFunctionPresets.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
30 #ifndef vtkSMTransferFunctionPresets_h
31 #define vtkSMTransferFunctionPresets_h
32 
33 #include "vtkPVServerManagerRenderingModule.h" // needed for exports
34 #include "vtkSMObject.h"
35 #include "vtkStdString.h" // needed for vtkStdString.
36 
37 // forward declare Json::Value
38 namespace Json
39 {
40 class Value;
41 class ValueConstIterator;
42 }
43 class vtkPVXMLElement;
44 class VTKPVSERVERMANAGERRENDERING_EXPORT vtkSMTransferFunctionPresets : public vtkSMObject
45 {
46 public:
47  static vtkSMTransferFunctionPresets* New();
49  void PrintSelf(ostream& os, vtkIndent indent);
50 
55  unsigned int GetNumberOfPresets();
56 
61  vtkStdString GetPresetAsString(unsigned int index);
62 
69  bool AddPreset(const char* name, const vtkStdString& preset);
70 
74  bool RemovePreset(unsigned int index);
75 
80  const Json::Value& GetFirstPresetWithName(const char* name);
81 
85  const Json::Value& GetPreset(unsigned int index);
86 
90  vtkStdString GetPresetName(unsigned int index);
91 
95  bool GetPresetHasOpacities(const Json::Value& preset);
96  bool GetPresetHasOpacities(unsigned int index)
97  {
98  return this->GetPresetHasOpacities(this->GetPreset(index));
99  }
100 
104  bool GetPresetHasIndexedColors(const Json::Value& preset);
105  bool GetPresetHasIndexedColors(unsigned int index)
106  {
107  return this->GetPresetHasIndexedColors(this->GetPreset(index));
108  }
109 
113  bool GetPresetHasAnnotations(const Json::Value& preset);
114  bool GetPresetHasAnnotations(unsigned int index)
115  {
116  return this->GetPresetHasAnnotations(this->GetPreset(index));
117  }
118 
122  bool AddPreset(const char* name, const Json::Value& preset);
123 
128  vtkStdString AddUniquePreset(const Json::Value& preset, const char* prefix = NULL);
129 
134  bool IsPresetBuiltin(unsigned int index);
135 
139  bool RenamePreset(unsigned int index, const char* newname);
140 
142 
148  bool ImportPresets(const char* filename);
149  bool ImportPresets(const Json::Value& presets);
151 
152 protected:
155 
156 private:
158  void operator=(const vtkSMTransferFunctionPresets&) VTK_DELETE_FUNCTION;
159 
160  class vtkInternals;
161  vtkInternals* Internals;
162 };
163 
164 #endif
bool GetPresetHasOpacities(unsigned int index)
manages presets for color, opacity, and annotation presets.
superclass for most server manager classes
Definition: vtkSMObject.h:31
bool GetPresetHasIndexedColors(unsigned int index)
bool GetPresetHasAnnotations(unsigned int index)
This is used by vtkPVXMLParser to represent an XML document starting at the root element.