ParaView
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 =========================================================================*/
28 #ifndef vtkSMEnumerationDomain_h
29 #define vtkSMEnumerationDomain_h
30 
31 #include "vtkPVServerManagerCoreModule.h" //needed for exports
32 #include "vtkSMDomain.h"
33 
34 struct vtkSMEnumerationDomainInternals;
35 
36 class VTKPVSERVERMANAGERCORE_EXPORT vtkSMEnumerationDomain : public vtkSMDomain
37 {
38 public:
39  static vtkSMEnumerationDomain* New();
41  void PrintSelf(ostream& os, vtkIndent indent);
42 
49  virtual int IsInDomain(vtkSMProperty* property);
50 
55  int IsInDomain(int val, unsigned int& idx);
56 
60  unsigned int GetNumberOfEntries();
61 
65  int GetEntryValue(unsigned int idx);
66 
70  const char* GetEntryText(unsigned int idx);
71 
75  const char* GetEntryTextForValue(int value);
76 
80  int HasEntryText(const char* text);
81 
86  int GetEntryValueForText(const char* text);
87 
93  int GetEntryValue(const char* text, int& valid);
94 
98  void AddEntry(const char* text, int value);
99 
103  void RemoveAllEntries();
104 
109  virtual void Update(vtkSMProperty* property);
110 
112 
116  virtual int SetDefaultValues(vtkSMProperty*, bool use_unchecked_values);
117 
118 protected:
122 
127  virtual int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* element);
128 
129  virtual void ChildSaveState(vtkPVXMLElement* domainElement);
130 
131  vtkSMEnumerationDomainInternals* EInternals;
132 
133 private:
134  vtkSMEnumerationDomain(const vtkSMEnumerationDomain&) VTK_DELETE_FUNCTION;
135  void operator=(const vtkSMEnumerationDomain&) VTK_DELETE_FUNCTION;
136 };
137 
138 #endif
virtual void ChildSaveState(vtkPVXMLElement *domainElement)
Add the header and creates a new vtkPVXMLElement for the domain, fills it up with the common attribut...
virtual void Update(vtkSMProperty *requestingProperty)
Update self based on the "unchecked" values of all required properties.
Definition: vtkSMDomain.h:65
virtual int IsInDomain(vtkSMProperty *property)=0
Is the (unchecked) value of the property in the domain? Overwritten by sub-classes.
superclass for all SM properties
vtkSMEnumerationDomainInternals * EInternals
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:85
represents the possible values a property can have
Definition: vtkSMDomain.h:48
virtual int ReadXMLAttributes(vtkSMProperty *prop, vtkPVXMLElement *elem)
Set the appropriate ivars from the xml element.
list of integers with associated strings
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
void PrintSelf(ostream &os, vtkIndent indent)
static vtkSMSessionObject * New()