vtkSMStringVectorProperty.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
17 #ifndef vtkSMStringVectorProperty_h
18 #define vtkSMStringVectorProperty_h
19 
20 #include "vtkRemotingServerManagerModule.h" //needed for exports
21 #include "vtkSMVectorProperty.h"
22 
23 #include <string> // needed for std::string
24 #include <vector> // needed for std::vector
25 
26 class vtkStringList;
27 class vtkSMStateLocator;
28 
30 {
31 public:
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
39  unsigned int GetNumberOfElements() override;
40 
45  void SetNumberOfElements(unsigned int num) override;
46 
52  int SetElement(unsigned int idx, const char* value);
53 
57  int SetElements(const char* values[], unsigned int count);
58 
60 
63  int SetElements(vtkStringList* newvalue);
64  int SetElements(const std::vector<std::string>& newvalue);
66 
68 
71  int SetUncheckedElements(const char* values[], unsigned int count);
72  int SetUncheckedElements(const std::vector<std::string>& newvalue);
74 
78  int AppendElements(const std::vector<std::string>& newvalue);
79 
83  int AppendUncheckedElements(const std::vector<std::string>& newvalue);
84 
88  void GetElements(vtkStringList* list);
89 
91 
94  const std::vector<std::string>& GetElements() const;
95  const std::vector<std::string>& GetUncheckedElements() const;
97 
101  const char* GetElement(unsigned int idx);
102 
107  unsigned int GetElementIndex(const char* value, int& exists);
108 
110 
118  void SetElementType(unsigned int idx, int type);
119  int GetElementType(unsigned int idx);
121 
128  const char* GetUncheckedElement(unsigned int idx);
129 
135  void SetUncheckedElement(unsigned int idx, const char* value);
136 
138 
141  void GetUncheckedElements(vtkStringList* list);
142  int SetUncheckedElements(vtkStringList* list);
144 
150  unsigned int GetNumberOfUncheckedElements() override;
151 
153  {
156  STRING
157  };
158 
162  void Copy(vtkSMProperty* src) override;
163 
167  const char* GetDefaultValue(int idx);
168 
169  void ClearUncheckedElements() override;
170 
171  bool IsValueDefault() override;
172 
178  void ResetToXMLDefaults() override;
179 
180 protected:
182  ~vtkSMStringVectorProperty() override;
183 
189  void SetNumberOfUncheckedElements(unsigned int num) override;
190 
199  int ReadXMLAttributes(vtkSMProxy* parent, vtkPVXMLElement* element) override;
200 
204  void WriteTo(vtkSMMessage*) override;
205 
209  void ReadFrom(const vtkSMMessage*, int msg_offset, vtkSMProxyLocator*) override;
210 
214  int LoadState(vtkPVXMLElement* element, vtkSMProxyLocator* loader) override;
215 
216  // Save concrete property values into the XML state property declaration
217  void SaveStateValues(vtkPVXMLElement* propElement) override;
218 
219 private:
221  void operator=(const vtkSMStringVectorProperty&) = delete;
222 
223  class vtkInternals;
224  vtkInternals* Internals;
225 };
226 
227 #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:140
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:18
Class used to retrieve a given message state based on its GlobalID.