vtkSMIdTypeVectorProperty.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMIdTypeVectorProperty.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 =========================================================================*/
25 #ifndef vtkSMIdTypeVectorProperty_h
26 #define vtkSMIdTypeVectorProperty_h
27 
28 #include "vtkRemotingServerManagerModule.h" //needed for exports
29 #include "vtkSMVectorProperty.h"
30 
31 #include <vector> // for std::vector
32 
33 class vtkSMStateLocator;
34 
36 {
37 public:
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
45  unsigned int GetNumberOfElements() override;
46 
51  void SetNumberOfElements(unsigned int num) override;
52 
58  int SetElement(unsigned int idx, vtkIdType value);
59 
61 
68  int SetElements(const vtkIdType* values);
69  int SetElements(const vtkIdType* values, unsigned int numValues);
71 
73 
76  int SetUncheckedElements(const vtkIdType* values);
77  int SetUncheckedElements(const vtkIdType* values, unsigned int numValues);
79 
86  int SetElements1(vtkIdType value0);
87 
94  int SetElements2(vtkIdType value0, vtkIdType value1);
95 
102  int SetElements3(vtkIdType value0, vtkIdType value1, vtkIdType value2);
103 
107  int AppendElements(const vtkIdType* values, unsigned int numValues);
108 
112  int AppendUncheckedElements(const vtkIdType* values, unsigned int numValues);
113 
117  vtkIdType GetElement(unsigned int idx);
118 
125  vtkIdType GetUncheckedElement(unsigned int idx);
126 
132  void SetUncheckedElement(unsigned int idx, vtkIdType value);
133 
139  unsigned int GetNumberOfUncheckedElements() override;
140 
142 
145  const std::vector<vtkIdType>& GetElements() const;
146  const std::vector<vtkIdType>& GetUncheckedElements() const;
148 
150 
162  vtkGetMacro(ArgumentIsArray, int);
163  vtkSetMacro(ArgumentIsArray, int);
164  vtkBooleanMacro(ArgumentIsArray, int);
166 
170  void Copy(vtkSMProperty* src) override;
171 
172  void ClearUncheckedElements() override;
173 
179  void ResetToXMLDefaults() override;
180 
181 protected:
183  ~vtkSMIdTypeVectorProperty() override;
184 
188  void WriteTo(vtkSMMessage*) override;
189 
193  void ReadFrom(const vtkSMMessage*, int msg_offset, vtkSMProxyLocator*) override;
194 
195  int ReadXMLAttributes(vtkSMProxy* parent, vtkPVXMLElement* element) override;
196 
198 
204  void SetNumberOfUncheckedElements(unsigned int num) override;
205 
209  int LoadState(vtkPVXMLElement* element, vtkSMProxyLocator* loader) override;
210 
211  // Save concrete property values into the XML state property declaration
212  void SaveStateValues(vtkPVXMLElement* propElement) override;
213 
214 private:
216  void operator=(const vtkSMIdTypeVectorProperty&) = delete;
217 
218  class vtkInternals;
219  vtkInternals* Internals;
220 };
221 
222 #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
int vtkIdType
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...
property representing a vector of integers
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 unsigned int GetNumberOfElements()=0
Returns the size of the vector.
Class used to retrieve a given message state based on its GlobalID.