23 #ifndef vtkDataArrayTemplate_h
24 #define vtkDataArrayTemplate_h
43 void PrintSelf(ostream& os,
vtkIndent indent);
53 Iterator
Begin() {
return Iterator(this->GetVoidPointer(0)); }
58 Iterator
End() {
return Iterator(this->GetVoidPointer(this->MaxId + 1)); }
120 void GetTuple(
vtkIdType i,
double* tuple);
121 void GetTupleValue(
vtkIdType i, T* tuple);
126 void SetTuple(
vtkIdType i,
const float* tuple);
127 void SetTuple(
vtkIdType i,
const double* tuple);
128 void SetTupleValue(
vtkIdType i,
const T* tuple);
134 void InsertTuple(
vtkIdType i,
const float* tuple);
135 void InsertTuple(
vtkIdType i,
const double* tuple);
136 void InsertTupleValue(
vtkIdType i,
const T* tuple);
142 vtkIdType InsertNextTuple(
const float* tuple);
143 vtkIdType InsertNextTuple(
const double* tuple);
144 vtkIdType InsertNextTupleValue(
const T* tuple);
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;};
203 void SetNumberOfValues(
vtkIdType number);
220 virtual void RemoveFirstTuple();
221 virtual void RemoveLastTuple();
233 void SetComponent(
vtkIdType i,
int j,
double c);
238 virtual void InsertComponent(
vtkIdType i,
int j,
double c);
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);
293 virtual void ExportToVoidPointer(
void *out_ptr);
305 {
return this->LookupValue(value); }
307 { this->LookupValue(value, ids); }
316 virtual void DataChanged();
321 virtual void DataElementChanged(
vtkIdType id);
326 virtual void ClearLookup();
346 virtual bool ComputeScalarRange(
double* ranges);
347 virtual bool ComputeVectorRange(
double range[2]);
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
T * GetValueRange(int comp)
void LookupTypedValue(T value, vtkIdList *ids)
Provides the equivalent of vtkTypeMacro for use with template classes.
virtual void SetVoidArray(void *array, vtkIdType size, int save, int deleteMethod)
Implementation template for vtkDataArray.
Abstract superclass for all arrays.
#define VTKCOMMONCORE_EXPORT
void SetValue(vtkIdType id, T value)
A atomic type representing the union of many types.
vtkTypedDataArray< T > Superclass
T & GetValueReference(vtkIdType id)
a simple class to control print indentation
#define VTK_DATA_ARRAY_TEMPLATE_TYPE
virtual void * GetVoidPointer(vtkIdType id)
list of point or cell ids
virtual int GetArrayType()
static void InsertTuples(vtkDataArray *dst, vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray *source)
Abstract superclass to iterate over elements in an vtkAbstractArray.
virtual void SetVoidArray(void *array, vtkIdType size, int save)
void GetValueRange(T range[2])
T * GetPointer(vtkIdType id)
void save(Archiver &ar, const vtkUnicodeString &str, const unsigned int vtkNotUsed(version))
void SetArray(T *array, vtkIdType size, int save)
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
void GetValueRange(T range[2], int comp)
vtkIdType LookupTypedValue(T value)
virtual void * WriteVoidPointer(vtkIdType id, vtkIdType number)
#define VTK_DATA_ARRAY_TEMPLATE_INSTANTIATE(T)
Superclass::ValueType ValueType