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);
223 virtual void RemoveFirstTuple();
224 virtual void RemoveLastTuple();
236 void SetComponent(
vtkIdType i,
int j,
double c);
241 virtual void InsertComponent(
vtkIdType i,
int j,
double c);
249 {
return this->WritePointer(
id, number); }
265 VTK_DATA_ARRAY_DELETE
281 { this->SetArray(array, size, save, VTK_DATA_ARRAY_FREE); }
283 { this->SetArray(static_cast<T*>(array), size, save); }
289 this->SetArray(static_cast<T*>(array), size, save, deleteMethod);
296 virtual void ExportToVoidPointer(
void *out_ptr);
308 {
return this->LookupValue(value); }
310 { this->LookupValue(value, ids); }
319 virtual void DataChanged();
324 virtual void DataElementChanged(
vtkIdType id);
329 virtual void ClearLookup();
349 virtual bool ComputeScalarRange(
double* ranges);
350 virtual bool ComputeVectorRange(
double range[2]);
362 #define VTK_DATA_ARRAY_TEMPLATE_INSTANTIATE(T) \
363 template class VTKCOMMONCORE_EXPORT vtkDataArrayTemplate< T >
368 #define vtkCreateWrappedArrayInterface(T) \
370 void GetTupleValue(vtkIdType i, T* tuple); \
371 void SetTupleValue(vtkIdType i, const T* tuple); \
372 void InsertTupleValue(vtkIdType i, const T* tuple); \
373 vtkIdType InsertNextTupleValue(const T* tuple); \
374 T GetValue(vtkIdType id); \
375 void SetValue(vtkIdType id, T value); \
376 void SetNumberOfValues(vtkIdType number); \
377 void InsertValue(vtkIdType id, T f); \
378 vtkIdType InsertNextValue(T f); \
379 T *GetValueRange(int comp); \
380 T *GetValueRange(); \
381 T* WritePointer(vtkIdType id, vtkIdType number); \
382 T* GetPointer(vtkIdType id)
394 #endif // !defined(vtkDataArrayTemplate_h)
399 #if defined(VTK_DATA_ARRAY_TEMPLATE_TYPE)
400 # if defined(VTK_BUILD_SHARED_LIBS) && defined(_MSC_VER)
401 # pragma warning (push)
402 # pragma warning (disable: 4091) // warning C4091: 'extern ' :
404 # pragma warning (disable: 4231) // Compiler-specific extension warning.
417 # pragma warning (disable: 4910) // extern and dllexport incompatible
422 # pragma warning (pop)
424 # 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
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)
#define VTK_DATA_ARRAY_TEMPLATE_TYPE
virtual void * WriteVoidPointer(vtkIdType id, vtkIdType number)
#define VTK_DATA_ARRAY_TEMPLATE_INSTANTIATE(T)
Superclass::ValueType ValueType