VTK  9.1.0
vtkInformationObjectBaseVectorKey.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkInformationObjectBaseVectorKey.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm 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 vtkInformationObjectBaseVectorKey_h
26#define vtkInformationObjectBaseVectorKey_h
27
28#include "vtkCommonCoreModule.h" // For export macro
29#include "vtkCommonInformationKeyManager.h" // Manage instances of this type.
30#include "vtkInformationKey.h"
31
32class vtkInformationObjectBaseVectorValue;
33
34class VTKCOMMONCORE_EXPORT vtkInformationObjectBaseVectorKey : public vtkInformationKey
35{
36public:
38 void PrintSelf(ostream& os, vtkIndent indent) override;
40
49 const char* name, const char* location, const char* requiredClass = nullptr);
50 //
53
61 const char* name, const char* location, const char* requiredClass = nullptr)
62 {
63 return new vtkInformationObjectBaseVectorKey(name, location, requiredClass);
64 }
65
70
76
81 int Length(vtkInformation* info) { return this->Size(info); }
82
87
93
95
100 void Remove(vtkInformation* info, int idx);
101 using Superclass::Remove; // Don't hide base class methods
103
109 void SetRange(vtkInformation* info, vtkObjectBase** source, int from, int to, int n);
110
116 void GetRange(vtkInformation* info, vtkObjectBase** dest, int from, int to, int n);
117
122
123 // _escription:
124 // Get a pointer to the first vtkObjectBase in the vector. We are
125 // uysing a vector of smart pointers so this is not easy to
126 // implement.
127 // vtkObjectBase **Get(vtkInformation* info);
128
135
139 void Print(ostream& os, vtkInformation* info) override;
140
141protected:
142 // The type required of all objects stored with this key.
143 const char* RequiredClass;
144
145private:
150 void CreateObjectBase();
155 bool ValidateDerivedType(vtkInformation* info, vtkObjectBase* aValue);
161 vtkInformationObjectBaseVectorValue* GetObjectBaseVector(vtkInformation* info);
162
163 //
165 void operator=(const vtkInformationObjectBaseVectorKey&) = delete;
166};
167
168#endif
a simple class to control print indentation
Definition: vtkIndent.h:113
Superclass for vtkInformation keys.
Key for vtkObjectBase vector values.
void ShallowCopy(vtkInformation *source, vtkInformation *dest) override
Copy the entry associated with this key from one information object to another.
void Remove(vtkInformation *info, int idx)
Remove all instances of val from the list.
void GetRange(vtkInformation *info, vtkObjectBase **dest, int from, int to, int n)
Copy n values from the range in this vector defined by [from from+n-1] into the range in the destinat...
void Resize(vtkInformation *info, int size)
Resize (extend) the vector to hold size objects.
void Clear(vtkInformation *info)
Clear the vector.
vtkInformationObjectBaseVectorKey(const char *name, const char *location, const char *requiredClass=nullptr)
The name of the static instance and the class in which it is defined(location) should be passed to th...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int Size(vtkInformation *info)
Get the vector's length.
void Append(vtkInformation *info, vtkObjectBase *value)
Put the value on the back of the vector, with ref counting.
~vtkInformationObjectBaseVectorKey() override
The name of the static instance and the class in which it is defined(location) should be passed to th...
void Remove(vtkInformation *info, vtkObjectBase *val)
Remove all instances of val from the list.
void Print(ostream &os, vtkInformation *info) override
Print the key's value in an information object to a stream.
void Set(vtkInformation *info, vtkObjectBase *value, int i)
Set element i of the vector to value.
static vtkInformationObjectBaseVectorKey * MakeKey(const char *name, const char *location, const char *requiredClass=nullptr)
This method simply returns a new vtkInformationObjectBaseVectorKey, given a name, location and option...
vtkObjectBase * Get(vtkInformation *info, int idx)
Get the vtkObjectBase at a specific location in the vector.
void SetRange(vtkInformation *info, vtkObjectBase **source, int from, int to, int n)
Copy n values from the range in source defined by [from from+n-1] into the range in this vector defin...
Store vtkAlgorithm input/output information.
abstract base class for most VTK objects
Definition: vtkObjectBase.h:70
@ location
Definition: vtkX3D.h:412
@ info
Definition: vtkX3D.h:382
@ value
Definition: vtkX3D.h:226
@ name
Definition: vtkX3D.h:225
@ size
Definition: vtkX3D.h:259
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)