vtkSMEnumerationDomain.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMEnumerationDomain.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 =========================================================================*/
70 #ifndef vtkSMEnumerationDomain_h
71 #define vtkSMEnumerationDomain_h
72 
73 #include "vtkRemotingServerManagerModule.h" //needed for exports
74 #include "vtkSMDomain.h"
75 
76 #include <utility> // for std::pair
77 #include <vector> // for std::vector
78 
80 {
81 public:
82  static vtkSMEnumerationDomain* New();
84  void PrintSelf(ostream& os, vtkIndent indent) override;
85 
92  int IsInDomain(vtkSMProperty* property) override;
93 
98  int IsInDomain(int val, unsigned int& idx);
99 
103  unsigned int GetNumberOfEntries();
104 
108  int GetEntryValue(unsigned int idx);
109 
113  const char* GetEntryText(unsigned int idx);
114 
118  const char* GetEntryTextForValue(int value);
119 
123  int HasEntryText(const char* text);
124 
129  int GetEntryValueForText(const char* text);
130 
136  int GetEntryValue(const char* text, int& valid);
137 
144  const char* GetInfoText(unsigned int idx);
145 
149  void AddEntry(const char* text, int value, const char* info = nullptr);
150 
154  void RemoveAllEntries();
155 
160  void Update(vtkSMProperty* property) override;
161 
163 
167  int SetDefaultValues(vtkSMProperty*, bool use_unchecked_values) override;
168 
169 protected:
171  ~vtkSMEnumerationDomain() override;
173 
178  int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* element) override;
179 
180  void ChildSaveState(vtkPVXMLElement* domainElement) override;
181 
182 private:
184  void operator=(const vtkSMEnumerationDomain&) = delete;
185 
186  struct vtkEDInternals;
187  vtkEDInternals* EInternals;
188 };
189 
190 #endif
virtual void ChildSaveState(vtkPVXMLElement *domainElement)
Add the header and creates a new vtkPVXMLElement for the domain, fills it up with the common attribut...
#define VTKREMOTINGSERVERMANAGER_EXPORT
virtual void Update(vtkSMProperty *requestingProperty)
Update self based on the "unchecked" values of all required properties.
superclass for all SM properties
virtual int SetDefaultValues(vtkSMProperty *, bool vtkNotUsed(use_unchecked_values))
A vtkSMProperty is often defined with a default value in the XML itself.
Definition: vtkSMDomain.h:103
represents the possible values a property can have
Definition: vtkSMDomain.h:49
void PrintSelf(ostream &os, vtkIndent indent) override
virtual int ReadXMLAttributes(vtkSMProperty *prop, vtkPVXMLElement *elem)
Set the appropriate ivars from the xml element.
virtual int IsInDomain(vtkSMProperty *vtkNotUsed(property))
Is the (unchecked) value of the property in the domain? Overwritten by sub-classes.
Definition: vtkSMDomain.h:76
list of integers with associated strings
static vtkSMDomain * New()
This is used by vtkPVXMLParser to represent an XML document starting at the root element.