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 "vtkRemotingServerManagerModule.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 
42 {
43 public:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
51  unsigned int GetNumberOfElements() override;
52 
57  void SetNumberOfElements(unsigned int num) override;
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  int AppendElements(const std::vector<std::string>& newvalue);
91 
95  int AppendUncheckedElements(const std::vector<std::string>& newvalue);
96 
100  void GetElements(vtkStringList* list);
101 
105  const char* GetElement(unsigned int idx);
106 
111  unsigned int GetElementIndex(const char* value, int& exists);
112 
114 
122  void SetElementType(unsigned int idx, int type);
123  int GetElementType(unsigned int idx);
125 
132  const char* GetUncheckedElement(unsigned int idx);
133 
139  void SetUncheckedElement(unsigned int idx, const char* value);
140 
142 
145  void GetUncheckedElements(vtkStringList* list);
146  int SetUncheckedElements(vtkStringList* list);
148 
154  unsigned int GetNumberOfUncheckedElements() override;
155 
157  {
160  STRING
161  };
162 
166  void Copy(vtkSMProperty* src) override;
167 
171  const char* GetDefaultValue(int idx);
172 
173  void ClearUncheckedElements() override;
174 
175  bool IsValueDefault() override;
176 
182  void ResetToXMLDefaults() override;
183 
184 protected:
186  ~vtkSMStringVectorProperty() override;
187 
193  void SetNumberOfUncheckedElements(unsigned int num) override;
194 
203  int ReadXMLAttributes(vtkSMProxy* parent, vtkPVXMLElement* element) override;
204 
208  void WriteTo(vtkSMMessage*) override;
209 
213  void ReadFrom(const vtkSMMessage*, int msg_offset, vtkSMProxyLocator*) override;
214 
218  int LoadState(vtkPVXMLElement* element, vtkSMProxyLocator* loader) override;
219 
220  // Save concrete property values into the XML state property declaration
221  void SaveStateValues(vtkPVXMLElement* propElement) override;
222 
223 private:
225  void operator=(const vtkSMStringVectorProperty&) = delete;
226 
227  class vtkInternals;
228  vtkInternals* Internals;
229 };
230 
231 #endif
virtual void SaveStateValues(vtkPVXMLElement *propertyElement)
This method must be overridden 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.
void PrintSelf(ostream &os, vtkIndent indent) override
virtual void SetNumberOfUncheckedElements(unsigned int num)=0
API for setting unchecked element values.
#define VTKREMOTINGSERVERMANAGER_EXPORT
property representing a vector of strings
superclass for all SM properties
void Copy(vtkSMProperty *src) override
Copy all property values.
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...
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.
void ClearUncheckedElements() override=0
API for setting unchecked element values.
virtual void ResetToXMLDefaults()
For properties that support specifying defaults in XML configuration, this method will reset the prop...
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.
int ReadXMLAttributes(vtkSMProxy *parent, vtkPVXMLElement *element) override
Set the appropriate ivars from the 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.
Manages allocation and freeing for a string list.
Definition: vtkStringList.h:30
Class used to retrieve a given message state based on its GlobalID.