VTK
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 "vtkInformationKey.h"
30 #include "vtkCommonInformationKeyManager.h" // Manage instances of this type.
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* location,
50  const char* requiredClass=nullptr);
51  //
54 
61  static vtkInformationObjectBaseVectorKey* MakeKey(const char* name, const char* location,
62  const char* requiredClass=nullptr)
63  {
64  return new vtkInformationObjectBaseVectorKey(name, location, requiredClass);
65  }
66 
70  void Clear(vtkInformation* info);
71 
76  void Resize(vtkInformation* info, int n);
77 
81  int Size(vtkInformation* info);
82  int Length(vtkInformation* info){ return this->Size(info); }
83 
87  void Append(vtkInformation* info, vtkObjectBase *value);
88 
93  void Set(vtkInformation* info, vtkObjectBase *value, int i);
94 
96 
100  void Remove(vtkInformation *info, vtkObjectBase *val);
101  void Remove(vtkInformation *info, int idx);
102  using Superclass::Remove; // Don't hide base class methods
104 
110  void SetRange(vtkInformation* info,
112  int from,
113  int to,
114  int n);
115 
121  void GetRange(vtkInformation *info,
122  vtkObjectBase **dest,
123  int from,
124  int to,
125  int n);
126 
130  vtkObjectBase *Get(vtkInformation* info, int idx);
131 
132  // _escription:
133  // Get a pointer to the first vtkObjectBase in the vector. We are
134  // uysing a vector of smart pointers so this is not easy to
135  // implement.
136  // vtkObjectBase **Get(vtkInformation* info);
137 
143  void ShallowCopy(vtkInformation* from, vtkInformation* to) override;
144 
148  void Print(ostream& os, vtkInformation* info) override;
149 
150 protected:
151  // The type required of all objects stored with this key.
152  const char* RequiredClass;
153 
154 private:
159  void CreateObjectBase();
164  bool ValidateDerivedType(vtkInformation* info,vtkObjectBase* aValue);
170  vtkInformationObjectBaseVectorValue *GetObjectBaseVector(vtkInformation *info);
171 
172  //
174  void operator=(const vtkInformationObjectBaseVectorKey&) = delete;
175 };
176 
177 #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:65
Key for vtkObjectBase vector values.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)