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) VTK_OVERRIDE;
40 
49  const char* location,
50  const char* requiredClass=0);
51  //
54 
61  static vtkInformationObjectBaseVectorKey* MakeKey(const char* name, const char* location,
62  const char* requiredClass=0)
63  {
64  return new vtkInformationObjectBaseVectorKey(name, location, requiredClass);
65  }
66 
71 
76  void Resize(vtkInformation* info, int n);
77 
82  int Length(vtkInformation* info){ return this->Size(info); }
83 
88 
94 
96 
101  void Remove(vtkInformation *info, int idx);
102  using Superclass::Remove; // Don't hide base class methods
104 
112  int from,
113  int to,
114  int n);
115 
122  vtkObjectBase **dest,
123  int from,
124  int to,
125  int n);
126 
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) VTK_OVERRIDE;
144 
148  void Print(ostream& os, vtkInformation* info) VTK_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&) VTK_DELETE_FUNCTION;
175 };
176 
177 #endif
a simple class to control print indentation
Definition: vtkIndent.h:40
Superclass for vtkInformation keys.
Key for vtkObjectBase vector values.
void ShallowCopy(vtkInformation *from, vtkInformation *to) override
Copy the entry associated with this key from one information object to another.
void Remove(vtkInformation *info, int idx)
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 Clear(vtkInformation *info)
Clear the vector.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkObjectBase * Get(vtkInformation *info, int idx)
Get the vtkObjectBase at a specific location in the vector.
vtkInformationObjectBaseVectorKey(const char *name, const char *location, const char *requiredClass=0)
The name of the static instance and the class in which it is defined(location) should be passed to th...
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.
void Remove(vtkInformation *info, vtkObjectBase *val)
Remove all instances of val from the list.
void Resize(vtkInformation *info, int n)
Resize (extend) the vector to hold n objects.
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.
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:66
@ location
Definition: vtkX3D.h:406
@ info
Definition: vtkX3D.h:376
@ value
Definition: vtkX3D.h:220
@ name
Definition: vtkX3D.h:219
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)