vtkSMIntVectorProperty.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
13 #ifndef vtkSMIntVectorProperty_h
14 #define vtkSMIntVectorProperty_h
15 
16 #include "vtkRemotingServerManagerModule.h" //needed for exports
17 #include "vtkSMVectorProperty.h"
18 
19 class vtkSMStateLocator;
20 
22 {
23 public:
24  static vtkSMIntVectorProperty* New();
26  void PrintSelf(ostream& os, vtkIndent indent) override;
27 
31  unsigned int GetNumberOfElements() override;
32 
37  void SetNumberOfElements(unsigned int num) override;
38 
44  int SetElement(unsigned int idx, int value);
45 
47 
54  int SetElements(const int* values);
55  int SetElements(const int* values, unsigned int numElems);
56  int* GetElements();
58 
60 
63  int SetUncheckedElements(const int* values);
64  int SetUncheckedElements(const int* values, unsigned int numValues);
65  int* GetUnCheckedElements();
67 
74  int SetElements1(int value0);
75 
82  int SetElements2(int value0, int value1);
83 
90  int SetElements3(int value0, int value1, int value2);
91 
95  int AppendElements(const int* values, unsigned int numValues);
96 
100  int AppendUncheckedElements(const int* values, unsigned int numValues);
101 
105  int GetElement(unsigned int idx);
106 
113  int GetUncheckedElement(unsigned int idx);
114 
120  void SetUncheckedElement(unsigned int idx, int value);
121 
127  unsigned int GetNumberOfUncheckedElements() override;
128 
130 
142  vtkGetMacro(ArgumentIsArray, int);
143  vtkSetMacro(ArgumentIsArray, int);
144  vtkBooleanMacro(ArgumentIsArray, int);
146 
150  void Copy(vtkSMProperty* src) override;
151 
155  int GetDefaultValue(int idx);
156 
157  void ClearUncheckedElements() override;
158 
159  bool IsValueDefault() override;
160 
166  void ResetToXMLDefaults() override;
167 
168 protected:
170  ~vtkSMIntVectorProperty() override;
171 
175  void WriteTo(vtkSMMessage*) override;
176 
180  void ReadFrom(const vtkSMMessage*, int msg_offset, vtkSMProxyLocator*) override;
181 
182  // Handle XML with int type for default values.
183  int ReadXMLAttributes(vtkSMProxy* parent, vtkPVXMLElement* element) override;
184 
185  class vtkInternals;
186  vtkInternals* Internals;
187 
189 
195  void SetNumberOfUncheckedElements(unsigned int num) override;
196 
200  int LoadState(vtkPVXMLElement* element, vtkSMProxyLocator* loader) override;
201 
202  // Save concrete property values into the XML state property declaration
203  void SaveStateValues(vtkPVXMLElement* propElement) override;
204 
205 private:
207  void operator=(const vtkSMIntVectorProperty&) = delete;
208 };
209 
210 #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
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.
property representing a vector of integers
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's value is different from the default value.
virtual unsigned int GetNumberOfElements()=0
Returns the size of the vector.
Class used to retrieve a given message state based on its GlobalID.