VTK  9.2.6
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 
69  void Clear(vtkInformation* info);
70 
75  void Resize(vtkInformation* info, int size);
76 
80  int Size(vtkInformation* info);
81  int Length(vtkInformation* info) { return this->Size(info); }
82 
86  void Append(vtkInformation* info, vtkObjectBase* value);
87 
92  void Set(vtkInformation* info, vtkObjectBase* value, int i);
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 
121  vtkObjectBase* Get(vtkInformation* info, int idx);
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* source, vtkInformation* dest) 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
virtual void ShallowCopy(vtkInformation *from, vtkInformation *to)=0
Copy the entry associated with this key from one information object to another.
Store vtkAlgorithm input/output information.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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...
void Print(vtkInformation *info)
Print the key's value in an information object to a stream.
Superclass for vtkInformation keys.
virtual void Remove(vtkInformation *info)
Remove this key from the given information object.
a simple class to control print indentation
Definition: vtkIndent.h:39
abstract base class for most VTK objects
Definition: vtkObjectBase.h:73
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define VTK_NEWINSTANCE
Key for vtkObjectBase vector values.