ParaView
vtkSMStringVectorProperty.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMStringVectorProperty.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 =========================================================================*/
29 #ifndef vtkSMStringVectorProperty_h
30 #define vtkSMStringVectorProperty_h
31 
32 #include "vtkPVServerManagerCoreModule.h" //needed for exports
33 #include "vtkSMVectorProperty.h"
34 
35 #include <string> // needed for std::string
36 #include <vector> // needed for std::vector
37 
38 class vtkStringList;
39 class vtkSMStateLocator;
40 
41 class VTKPVSERVERMANAGERCORE_EXPORT vtkSMStringVectorProperty : public vtkSMVectorProperty
42 {
43 public:
46  void PrintSelf(ostream& os, vtkIndent indent);
47 
51  virtual unsigned int GetNumberOfElements();
52 
57  virtual void SetNumberOfElements(unsigned int num);
58 
64  int SetElement(unsigned int idx, const char* value);
65 
69  int SetElements(const char* values[], unsigned int count);
70 
72 
75  int SetElements(vtkStringList* newvalue);
76  int SetElements(const std::vector<std::string>& newvalue);
78 
80 
83  int SetUncheckedElements(const char* values[], unsigned int count);
84  int SetUncheckedElements(const std::vector<std::string>& newvalue);
86 
90  void GetElements(vtkStringList* list);
91 
95  const char* GetElement(unsigned int idx);
96 
101  unsigned int GetElementIndex(const char* value, int& exists);
102 
104 
112  void SetElementType(unsigned int idx, int type);
113  int GetElementType(unsigned int idx);
115 
122  const char* GetUncheckedElement(unsigned int idx);
123 
129  void SetUncheckedElement(unsigned int idx, const char* value);
130 
132 
135  void GetUncheckedElements(vtkStringList* list);
136  int SetUncheckedElements(vtkStringList* list);
138 
144  virtual unsigned int GetNumberOfUncheckedElements();
145 
147  {
150  STRING
151  };
152 
156  virtual void Copy(vtkSMProperty* src);
157 
161  const char* GetDefaultValue(int idx);
162 
163  virtual void ClearUncheckedElements();
164 
165  virtual bool IsValueDefault();
166 
172  virtual void ResetToXMLDefaults();
173 
174 protected:
177 
183  virtual void SetNumberOfUncheckedElements(unsigned int num);
184 
193  virtual int ReadXMLAttributes(vtkSMProxy* parent, vtkPVXMLElement* element);
194 
198  virtual void WriteTo(vtkSMMessage*);
199 
203  virtual void ReadFrom(const vtkSMMessage*, int msg_offset, vtkSMProxyLocator*);
204 
208  virtual int LoadState(vtkPVXMLElement* element, vtkSMProxyLocator* loader);
209 
210  // Save concrete property values into the XML state property declaration
211  virtual void SaveStateValues(vtkPVXMLElement* propElement);
212 
213 private:
214  vtkSMStringVectorProperty(const vtkSMStringVectorProperty&) VTK_DELETE_FUNCTION;
215  void operator=(const vtkSMStringVectorProperty&) VTK_DELETE_FUNCTION;
216 
217  class vtkInternals;
218  vtkInternals* Internals;
219 };
220 
221 #endif
virtual void SaveStateValues(vtkPVXMLElement *propertyElement)
This method must be overiden by concrete class in order to save the real property data...
virtual void WriteTo(vtkSMMessage *msg)
Let the property write its content into the stream.
virtual int ReadXMLAttributes(vtkSMProxy *parent, vtkPVXMLElement *element)
Set the appropriate ivars from the xml element.
virtual void SetNumberOfUncheckedElements(unsigned int num)=0
API for setting unchecked element values.
property representing a vector of strings
superclass for all SM properties
void PrintSelf(ostream &os, vtkIndent indent)
virtual void SetNumberOfElements(unsigned int num)=0
Sets the size of the vector.
abstract superclass for all vector properties
Header class that setup every thing in order to use Protobuf messages in a transparent manner...
virtual void ClearUncheckedElements()=0
API for setting unchecked element values.
static vtkSMProperty * New()
virtual unsigned int GetNumberOfUncheckedElements()=0
API for setting unchecked element values.
virtual void ReadFrom(const vtkSMMessage *, int vtkNotUsed(message_offset), vtkSMProxyLocator *)
Let the property read and set its content from the stream.
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
is used to locate proxies referred to in state xmls while loading state files.
virtual void ResetToXMLDefaults()
For properties that support specifying defaults in XML configuration, this method will reset the prop...
virtual void Copy(vtkSMProperty *src)
Copy all property values.
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
virtual int LoadState(vtkPVXMLElement *element, vtkSMProxyLocator *loader)
Updates state from an XML element.
virtual bool IsValueDefault()
Returns true if the property&#39;s value is different from the default value.
virtual unsigned int GetNumberOfElements()=0
Returns the size of the vector.
Class used to retreive a given message state based on its GlobalID.