1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkTypedArray.txx
-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
the U.S. Government retains certain rights in this software.
-------------------------------------------------------------------------
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkVariantCast.h"
#include "vtkVariantCreate.h"
template<typename T>
void vtkTypedArray<T>::PrintSelf(ostream &os, vtkIndent indent)
{
this->vtkTypedArray<T>::Superclass::PrintSelf(os, indent);
}
template<typename T>
vtkVariant vtkTypedArray<T>::GetVariantValue(const vtkArrayCoordinates& coordinates)
{
return vtkVariantCreate<T>(this->GetValue(coordinates));
}
template<typename T>
vtkVariant vtkTypedArray<T>::GetVariantValueN(const SizeT n)
{
return vtkVariantCreate<T>(this->GetValueN(n));
}
template<typename T>
void vtkTypedArray<T>::SetVariantValue(const vtkArrayCoordinates& coordinates, const vtkVariant& value)
{
this->SetValue(coordinates, vtkVariantCast<T>(value));
}
template<typename T>
void vtkTypedArray<T>::SetVariantValueN(const SizeT n, const vtkVariant& value)
{
this->SetValueN(n, vtkVariantCast<T>(value));
}
template<typename T>
void vtkTypedArray<T>::CopyValue(vtkArray* source, const vtkArrayCoordinates& source_coordinates, const vtkArrayCoordinates& target_coordinates)
{
if(!source->IsA(this->GetClassName()))
{
vtkWarningMacro("source and target array data types do not match");
return;
}
this->SetValue(target_coordinates, static_cast<vtkTypedArray<T>*>(source)->GetValue(source_coordinates));
}
template<typename T>
void vtkTypedArray<T>::CopyValue(vtkArray* source, const SizeT source_index, const vtkArrayCoordinates& target_coordinates)
{
if(!source->IsA(this->GetClassName()))
{
vtkWarningMacro("source and target array data types do not match");
return;
}
this->SetValue(target_coordinates, static_cast<vtkTypedArray<T>*>(source)->GetValueN(source_index));
}
template<typename T>
void vtkTypedArray<T>::CopyValue(vtkArray* source, const vtkArrayCoordinates& source_coordinates, const SizeT target_index)
{
if(!source->IsA(this->GetClassName()))
{
vtkWarningMacro("source and target array data types do not match");
return;
}
this->SetValueN(target_index, static_cast<vtkTypedArray<T>*>(source)->GetValue(source_coordinates));
}
|