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 
103 
106  const std::vector<std::string>& GetElements() const;
107  const std::vector<std::string>& GetUncheckedElements() const;
109 
113  const char* GetElement(unsigned int idx);
114 
119  unsigned int GetElementIndex(const char* value, int& exists);
120 
122 
130  void SetElementType(unsigned int idx, int type);
131  int GetElementType(unsigned int idx);
133 
140  const char* GetUncheckedElement(unsigned int idx);
141 
147  void SetUncheckedElement(unsigned int idx, const char* value);
148 
150 
153  void GetUncheckedElements(vtkStringList* list);
154  int SetUncheckedElements(vtkStringList* list);
156 
162  unsigned int GetNumberOfUncheckedElements() override;
163 
165  {
168  STRING
169  };
170 
174  void Copy(vtkSMProperty* src) override;
175 
179  const char* GetDefaultValue(int idx);
180 
181  void ClearUncheckedElements() override;
182 
183  bool IsValueDefault() override;
184 
190  void ResetToXMLDefaults() override;
191 
192 protected:
194  ~vtkSMStringVectorProperty() override;
195 
201  void SetNumberOfUncheckedElements(unsigned int num) override;
202 
211  int ReadXMLAttributes(vtkSMProxy* parent, vtkPVXMLElement* element) override;
212 
216  void WriteTo(vtkSMMessage*) override;
217 
221  void ReadFrom(const vtkSMMessage*, int msg_offset, vtkSMProxyLocator*) override;
222 
226  int LoadState(vtkPVXMLElement* element, vtkSMProxyLocator* loader) override;
227 
228  // Save concrete property values into the XML state property declaration
229  void SaveStateValues(vtkPVXMLElement* propElement) override;
230 
231 private:
233  void operator=(const vtkSMStringVectorProperty&) = delete;
234 
235  class vtkInternals;
236  vtkInternals* Internals;
237 };
238 
239 #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.