VTK  9.0.1
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 
32 class vtkInformationObjectBaseVectorValue;
33 
34 class VTKCOMMONCORE_EXPORT vtkInformationObjectBaseVectorKey : public vtkInformationKey
35 {
36 public:
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 
75  void Resize(vtkInformation* info, int n);
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 
134  void ShallowCopy(vtkInformation* from, vtkInformation* to) override;
135 
139  void Print(ostream& os, vtkInformation* info) override;
140 
141 protected:
142  // The type required of all objects stored with this key.
143  const char* RequiredClass;
144 
145 private:
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
vtkCommonInformationKeyManager.h
vtkX3D::value
@ value
Definition: vtkX3D.h:226
vtkInformationObjectBaseVectorKey::Remove
void Remove(vtkInformation *info, int idx)
vtkInformationObjectBaseVectorKey::SetRange
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...
vtkInformationObjectBaseVectorKey::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkInformationObjectBaseVectorKey::ShallowCopy
void ShallowCopy(vtkInformation *from, vtkInformation *to) override
Copy the entry associated with this key from one information object to another.
vtkInformationObjectBaseVectorKey::Remove
void Remove(vtkInformation *info, vtkObjectBase *val)
Remove all instances of val from the list.
vtkInformationObjectBaseVectorKey::Resize
void Resize(vtkInformation *info, int n)
Resize (extend) the vector to hold n objects.
vtkInformationObjectBaseVectorKey::Length
int Length(vtkInformation *info)
Definition: vtkInformationObjectBaseVectorKey.h:81
vtkObjectBase
abstract base class for most VTK objects
Definition: vtkObjectBase.h:64
vtkInformationObjectBaseVectorKey::RequiredClass
const char * RequiredClass
Definition: vtkInformationObjectBaseVectorKey.h:143
vtkInformationObjectBaseVectorKey::vtkInformationObjectBaseVectorKey
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...
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkInformationObjectBaseVectorKey
Key for vtkObjectBase vector values.
Definition: vtkInformationObjectBaseVectorKey.h:35
vtkInformationObjectBaseVectorKey::Print
void Print(ostream &os, vtkInformation *info) override
Print the key's value in an information object to a stream.
vtkX3D::name
@ name
Definition: vtkX3D.h:225
vtkInformationObjectBaseVectorKey::Get
vtkObjectBase * Get(vtkInformation *info, int idx)
Get the vtkObjectBase at a specific location in the vector.
vtkInformationObjectBaseVectorKey::Append
void Append(vtkInformation *info, vtkObjectBase *value)
Put the value on the back of the vector, with ref counting.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:65
vtkInformationObjectBaseVectorKey::MakeKey
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...
Definition: vtkInformationObjectBaseVectorKey.h:60
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkInformationObjectBaseVectorKey::GetRange
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...
vtkX3D::location
@ location
Definition: vtkX3D.h:412
vtkInformationObjectBaseVectorKey::Clear
void Clear(vtkInformation *info)
Clear the vector.
vtkInformationObjectBaseVectorKey::Size
int Size(vtkInformation *info)
Get the vector's length.
source
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:959
vtkInformationObjectBaseVectorKey::Set
void Set(vtkInformation *info, vtkObjectBase *value, int i)
Set element i of the vector to value.
vtkInformationKey.h
vtkInformationKey
Superclass for vtkInformation keys.
Definition: vtkInformationKey.h:39
vtkInformationObjectBaseVectorKey::~vtkInformationObjectBaseVectorKey
~vtkInformationObjectBaseVectorKey() override