Go to the documentation of this file.
23 #ifndef vtkDataArrayTemplate_h
24 #define vtkDataArrayTemplate_h
152 double doubleRange[2];
153 this->ComputeRange(doubleRange, comp);
154 range[0] =
static_cast<T
>(doubleRange[0]);
155 range[1] =
static_cast<T
>(doubleRange[1]);
159 this->GetValueRange(this->ValueRange, comp);
160 return this->ValueRange;
168 {
return this->GetValueRange(0); }
170 { this->GetValueRange(
range, 0); }
174 void Squeeze() { this->ResizeAndExtend (this->MaxId+1); }
188 { assert(
id >= 0 && id < this->Size);
return this->Array[
id]; }
190 { assert(
id >= 0 && id < this->Size);
return this->Array[
id]; }
197 { assert(
id >= 0 && id < this->Size); this->Array[
id] =
value;};
246 {
return this->WritePointer(
id, number); }
262 VTK_DATA_ARRAY_DELETE
278 { this->SetArray(array,
size,
save, VTK_DATA_ARRAY_FREE); }
280 { this->SetArray(
static_cast<T*
>(array),
size,
save); }
286 this->SetArray(
static_cast<T*
>(array),
size,
save, deleteMethod);
305 {
return this->LookupValue(
value); }
359 #if !defined(VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION)
360 # define VTK_DATA_ARRAY_TEMPLATE_INSTANTIATE(T) \
361 template class VTKCOMMONCORE_EXPORT vtkDataArrayTemplate< T >
363 # include "vtkDataArrayTemplateImplicit.txx"
364 # define VTK_DATA_ARRAY_TEMPLATE_INSTANTIATE(T)
370 #define vtkCreateWrappedArrayInterface(T) \
372 void GetTupleValue(vtkIdType i, T* tuple); \
373 void SetTupleValue(vtkIdType i, const T* tuple); \
374 void InsertTupleValue(vtkIdType i, const T* tuple); \
375 vtkIdType InsertNextTupleValue(const T* tuple); \
376 T GetValue(vtkIdType id); \
377 void SetValue(vtkIdType id, T value); \
378 void SetNumberOfValues(vtkIdType number); \
379 void InsertValue(vtkIdType id, T f); \
380 vtkIdType InsertNextValue(T f); \
381 T *GetValueRange(int comp); \
382 T *GetValueRange(); \
383 T* WritePointer(vtkIdType id, vtkIdType number); \
384 T* GetPointer(vtkIdType id)
396 #endif // !defined(vtkDataArrayTemplate_h)
401 #if defined(VTK_DATA_ARRAY_TEMPLATE_TYPE) && !defined(VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION)
402 # if defined(VTK_BUILD_SHARED_LIBS) && defined(_MSC_VER)
403 # pragma warning (push)
404 # pragma warning (disable: 4091) // warning C4091: 'extern ' :
406 # pragma warning (disable: 4231) // Compiler-specific extension warning.
419 # pragma warning (disable: 4910) // extern and dllexport incompatible
424 # pragma warning (pop)
426 # undef VTK_DATA_ARRAY_TEMPLATE_TYPE
void SetComponent(vtkIdType i, int j, double c)
#define VTK_DATA_ARRAY_TEMPLATE_INSTANTIATE(T)
#define VTK_DATA_ARRAY_TEMPLATE_TYPE
void InsertValue(vtkIdType id, T f)
virtual vtkArrayIterator * NewIterator()
void LookupTypedValue(T value, vtkIdList *ids)
#define VTKCOMMONCORE_EXPORT
virtual void * WriteVoidPointer(vtkIdType id, vtkIdType number)
virtual void RemoveFirstTuple()
virtual vtkIdType LookupValue(vtkVariant value)
int Allocate(vtkIdType sz, vtkIdType ext=1000)
void GetValueRange(T range[2])
virtual void RemoveLastTuple()
void SetTupleValue(vtkIdType i, const T *tuple)
virtual void RemoveTuple(vtkIdType id)
vtkIdType LookupValue(T value)
T * Realloc(vtkIdType sz)
void save(Archiver &ar, const vtkUnicodeString &str, const unsigned int vtkNotUsed(version))
virtual void DataChanged()
static vtkDataArrayTemplate< T > * FastDownCast(vtkAbstractArray *src)
void LookupValue(T value, vtkIdList *ids)
virtual int Resize(vtkIdType numTuples)
virtual void InsertTuples(vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray *source)
virtual void DataElementChanged(vtkIdType id)
void SetTuple(vtkIdType i, const float *tuple)
void GetTupleValue(vtkIdType i, T *tuple)
void GetTuple(vtkIdType i, double *tuple)
void SetTuple(vtkIdType i, const double *tuple)
void GetValueRange(T range[2], int comp)
void SetArray(T *array, vtkIdType size, int save, int deleteMethod)
vtkIdType InsertNextTupleValue(const T *tuple)
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
T * GetPointer(vtkIdType id)
virtual void ClearLookup()
GLsizei const GLfloat * value
void InsertTuple(vtkIdType i, const double *tuple)
virtual void SetVoidArray(void *array, vtkIdType size, int save, int deleteMethod)
void PrintSelf(ostream &os, vtkIndent indent)
virtual void InsertComponent(vtkIdType i, int j, double c)
virtual int GetArrayType()
virtual void InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source)
vtkIdType InsertNextValue(T f)
vtkIdType InsertNextTuple(const double *tuple)
T * GetValueRange(int comp)
a simple class to control print indentation
virtual bool ComputeVectorRange(double range[2])
vtkIdType LookupTypedValue(T value)
A atomic type representing the union of many types.
list of point or cell ids
Implementation template for vtkDataArray.
void InsertTuple(vtkIdType i, const float *tuple)
virtual void * GetVoidPointer(vtkIdType id)
Abstract superclass for all arrays.
double * GetTuple(vtkIdType i)
void InsertTupleValue(vtkIdType i, const T *tuple)
Abstract superclass to iterate over elements in an vtkAbstractArray.
virtual void ExportToVoidPointer(void *out_ptr)
Superclass::ValueType ValueType
virtual void SetVoidArray(void *array, vtkIdType size, int save)
vtkTypedDataArray< T > Superclass
virtual vtkIdType InsertNextTuple(vtkIdType j, vtkAbstractArray *source)
void SetValue(vtkIdType id, T value)
STL-style random access iterator for vtkTypedDataArrays.
void SetVariantValue(vtkIdType id, vtkVariant value)
virtual void InsertTuples(vtkIdList *destIds, vtkIdList *srcIds, vtkAbstractArray *source)
T & GetValueReference(vtkIdType id)
void SetArray(T *array, vtkIdType size, int save)
vtkIdType InsertNextTuple(const float *tuple)
void SetNumberOfValues(vtkIdType number)
T * ResizeAndExtend(vtkIdType sz)
T * WritePointer(vtkIdType id, vtkIdType number)
virtual void SetTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source)
void SetNumberOfTuples(vtkIdType number)
double GetComponent(vtkIdType i, int j)
virtual void LookupValue(vtkVariant value, vtkIdList *ids)
virtual bool ComputeScalarRange(double *ranges)
Provides the equivalent of vtkTypeMacro for use with template classes.