VTK
vtkTypedArray.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTypedArray.h
5 
6 -------------------------------------------------------------------------
7  Copyright 2008 Sandia Corporation.
8  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9  the U.S. Government retains certain rights in this software.
10 -------------------------------------------------------------------------
11 
12  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13  All rights reserved.
14  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
15 
16  This software is distributed WITHOUT ANY WARRANTY; without even
17  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
18  PURPOSE. See the above copyright notice for more information.
19 
20 =========================================================================*/
21 
49 #ifndef vtkTypedArray_h
50 #define vtkTypedArray_h
51 
52 #include "vtkArray.h"
53 #include "vtkTypeTemplate.h"
54 
56 
57 template<typename T>
58 class vtkTypedArray : public vtkTypeTemplate<vtkTypedArray<T>, vtkArray>
59 {
60 public:
62  typedef typename vtkArray::SizeT SizeT;
63 
66 
67  void PrintSelf(ostream &os, vtkIndent indent);
68 
69  // vtkArray API
70  virtual vtkVariant GetVariantValue(const vtkArrayCoordinates& coordinates);
72  virtual void SetVariantValue(const vtkArrayCoordinates& coordinates, const vtkVariant& value);
73  virtual void SetVariantValueN(const SizeT n, const vtkVariant& value);
74  virtual void CopyValue(vtkArray* source, const vtkArrayCoordinates& source_coordinates, const vtkArrayCoordinates& target_coordinates);
75  virtual void CopyValue(vtkArray* source, const SizeT source_index, const vtkArrayCoordinates& target_coordinates);
76  virtual void CopyValue(vtkArray* source, const vtkArrayCoordinates& source_coordinates, const SizeT target_index);
77 
79 
82  virtual const T& GetValue(CoordinateT i) = 0;
83  virtual const T& GetValue(CoordinateT i, CoordinateT j) = 0;
84  virtual const T& GetValue(CoordinateT i, CoordinateT j, CoordinateT k) = 0;
85  virtual const T& GetValue(const vtkArrayCoordinates& coordinates) = 0;
87 
93  virtual const T& GetValueN(const SizeT n) = 0;
94 
96 
99  virtual void SetValue(CoordinateT i, const T& value) = 0;
100  virtual void SetValue(CoordinateT i, CoordinateT j, const T& value) = 0;
101  virtual void SetValue(CoordinateT i, CoordinateT j, CoordinateT k, const T& value) = 0;
102  virtual void SetValue(const vtkArrayCoordinates& coordinates, const T& value) = 0;
104 
110  virtual void SetValueN(const SizeT n, const T& value) = 0;
111 
112 protected:
115 
116 private:
117  vtkTypedArray(const vtkTypedArray&); // Not implemented
118  void operator=(const vtkTypedArray&); // Not implemented
119 };
120 
121 #include "vtkTypedArray.txx"
122 
123 #endif
124 
125 // VTK-HeaderTest-Exclude: vtkTypedArray.h
vtkTypedArray::CoordinateT
vtkArray::CoordinateT CoordinateT
Definition: vtkTypedArray.h:61
vtkArray::SizeT
vtkArrayExtents::SizeT SizeT
Definition: vtkArray.h:77
vtkTypedArray::CopyValue
virtual void CopyValue(vtkArray *source, const SizeT source_index, const vtkArrayCoordinates &target_coordinates)
vtkTypedArray::GetValue
virtual const T & GetValue(CoordinateT i, CoordinateT j, CoordinateT k)=0
vtkgl::n
GLclampd n
Definition: vtkgl.h:14370
vtkTypedArray::~vtkTypedArray
~vtkTypedArray()
Definition: vtkTypedArray.h:114
vtkTypedArray::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkTypeTemplate.h
vtkTypedArray::GetValue
virtual const T & GetValue(const vtkArrayCoordinates &coordinates)=0
vtkTypedArray::SetValue
virtual void SetValue(const vtkArrayCoordinates &coordinates, const T &value)=0
source
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:821
vtkTypedArray::GetValue
virtual const T & GetValue(CoordinateT i)=0
vtkTypedArray::SetVariantValue
virtual void SetVariantValue(const vtkArrayCoordinates &coordinates, const vtkVariant &value)
vtkTypedArray::vtkTypedArray
vtkTypedArray()
Definition: vtkTypedArray.h:113
vtkgl::value
GLsizei const GLfloat * value
Definition: vtkgl.h:12021
vtkTypedArray
Provides a type-specific interface to N-way arrays.
Definition: vtkTypedArray.h:59
vtkTypedArray::GetVariantValueN
virtual vtkVariant GetVariantValueN(const SizeT n)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkTypedArray::SetVariantValueN
virtual void SetVariantValueN(const SizeT n, const vtkVariant &value)
vtkVariant
A atomic type representing the union of many types.
Definition: vtkVariant.h:79
vtkTypedArray::GetValue
virtual const T & GetValue(CoordinateT i, CoordinateT j)=0
vtkArray
Abstract interface for N-dimensional arrays.
Definition: vtkArray.h:70
vtkTypedArray::GetVariantValue
virtual vtkVariant GetVariantValue(const vtkArrayCoordinates &coordinates)
vtkTypedArray::SetValue
virtual void SetValue(CoordinateT i, CoordinateT j, const T &value)=0
vtkTypedArray::CopyValue
virtual void CopyValue(vtkArray *source, const vtkArrayCoordinates &source_coordinates, const SizeT target_index)
vtkTypedArray::SetValueN
virtual void SetValueN(const SizeT n, const T &value)=0
vtkTypedArray::SetValue
virtual void SetValue(CoordinateT i, CoordinateT j, CoordinateT k, const T &value)=0
vtkTypedArray::CopyValue
virtual void CopyValue(vtkArray *source, const vtkArrayCoordinates &source_coordinates, const vtkArrayCoordinates &target_coordinates)
vtkTypedArray::SizeT
vtkArray::SizeT SizeT
Definition: vtkTypedArray.h:62
vtkTypedArray::SetValue
virtual void SetValue(CoordinateT i, const T &value)=0
vtkArray::CoordinateT
vtkArrayExtents::CoordinateT CoordinateT
Definition: vtkArray.h:75
vtkTypedArray::GetValueN
virtual const T & GetValueN(const SizeT n)=0
vtkArray.h
vtkArrayCoordinates
Stores coordinate into an N-way array.
Definition: vtkArrayCoordinates.h:57
vtkTypeTemplate
Provides the equivalent of vtkTypeMacro for use with template classes.
Definition: vtkTypeTemplate.h:40