vtkSMEnumerationDomain.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
58 #ifndef vtkSMEnumerationDomain_h
59 #define vtkSMEnumerationDomain_h
60 
61 #include "vtkRemotingServerManagerModule.h" //needed for exports
62 #include "vtkSMDomain.h"
63 
64 #include <utility> // for std::pair
65 #include <vector> // for std::vector
66 
68 {
69 public:
70  static vtkSMEnumerationDomain* New();
72  void PrintSelf(ostream& os, vtkIndent indent) override;
73 
80  int IsInDomain(vtkSMProperty* property) override;
81 
86  int IsInDomain(int val, unsigned int& idx);
87 
91  unsigned int GetNumberOfEntries();
92 
96  int GetEntryValue(unsigned int idx);
97 
101  const char* GetEntryText(unsigned int idx);
102 
106  const char* GetEntryTextForValue(int value);
107 
111  int HasEntryText(const char* text);
112 
117  int GetEntryValueForText(const char* text);
118 
124  int GetEntryValue(const char* text, int& valid);
125 
132  const char* GetInfoText(unsigned int idx);
133 
137  void AddEntry(const char* text, int value, const char* info = nullptr);
138 
142  void RemoveAllEntries();
143 
148  void Update(vtkSMProperty* property) override;
149 
151 
155  int SetDefaultValues(vtkSMProperty*, bool use_unchecked_values) override;
156 
157 protected:
159  ~vtkSMEnumerationDomain() override;
161 
166  int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* element) override;
167 
168  void ChildSaveState(vtkPVXMLElement* domainElement) override;
169 
170 private:
172  void operator=(const vtkSMEnumerationDomain&) = delete;
173 
174  struct vtkEDInternals;
175  vtkEDInternals* EInternals;
176 };
177 
178 #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:91
represents the possible values a property can have
Definition: vtkSMDomain.h:37
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:64
list of integers with associated strings
static vtkSMDomain * New()
This is used by vtkPVXMLParser to represent an XML document starting at the root element.