23 #ifndef __vtkDataArrayTemplate_h
24 #define __vtkDataArrayTemplate_h
41 void PrintSelf(ostream& os,
vtkIndent indent);
51 Iterator
Begin() {
return Iterator(this->GetVoidPointer(0)); }
56 Iterator
End() {
return Iterator(this->GetVoidPointer(this->MaxId + 1)); }
110 void GetTuple(
vtkIdType i,
double* tuple);
111 void GetTupleValue(
vtkIdType i, T* tuple);
116 void SetTuple(
vtkIdType i,
const float* tuple);
117 void SetTuple(
vtkIdType i,
const double* tuple);
118 void SetTupleValue(
vtkIdType i,
const T* tuple);
124 void InsertTuple(
vtkIdType i,
const float* tuple);
125 void InsertTuple(
vtkIdType i,
const double* tuple);
126 void InsertTupleValue(
vtkIdType i,
const T* tuple);
132 vtkIdType InsertNextTuple(
const float* tuple);
133 vtkIdType InsertNextTuple(
const double* tuple);
134 vtkIdType InsertNextTupleValue(
const T* tuple);
142 double doubleRange[2];
143 this->ComputeRange(doubleRange, comp);
144 range[0] =
static_cast<T
>(doubleRange[0]);
145 range[1] =
static_cast<T
>(doubleRange[1]);
149 this->GetValueRange(this->ValueRange, comp);
150 return this->ValueRange;
158 {
return this->GetValueRange(0); }
160 { this->GetValueRange(range, 0); }
164 void Squeeze() { this->ResizeAndExtend (this->MaxId+1); }
178 { assert(
id >= 0 && id < this->Size);
return this->Array[
id]; }
180 { assert(
id >= 0 && id < this->Size);
return this->Array[
id]; }
187 { assert(
id >= 0 && id < this->Size); this->Array[
id] =
value;};
193 void SetNumberOfValues(
vtkIdType number);
210 virtual void RemoveFirstTuple();
211 virtual void RemoveLastTuple();
223 void SetComponent(
vtkIdType i,
int j,
double c);
228 virtual void InsertComponent(
vtkIdType i,
int j,
double c);
236 {
return this->WritePointer(
id, number); }
252 VTK_DATA_ARRAY_DELETE
268 { this->SetArray(array, size, save, VTK_DATA_ARRAY_FREE); }
270 { this->SetArray(static_cast<T*>(array), size, save); }
276 this->SetArray(static_cast<T*>(array), size, save, deleteMethod);
283 virtual void ExportToVoidPointer(
void *out_ptr);
295 {
return this->LookupValue(value); }
297 { this->LookupValue(value, ids); }
306 virtual void DataChanged();
311 virtual void DataElementChanged(
vtkIdType id);
316 virtual void ClearLookup();
336 virtual void ComputeScalarRange(
double range[2],
int comp);
337 virtual void ComputeVectorRange(
double range[2]);
349 #if !defined(VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION)
350 # define VTK_DATA_ARRAY_TEMPLATE_INSTANTIATE(T) \
351 template class VTKCOMMONCORE_EXPORT vtkDataArrayTemplate< T >
353 # include "vtkDataArrayTemplateImplicit.txx"
354 # define VTK_DATA_ARRAY_TEMPLATE_INSTANTIATE(T)
360 #define vtkCreateWrappedArrayInterface(T) \
362 void GetTupleValue(vtkIdType i, T* tuple); \
363 void SetTupleValue(vtkIdType i, const T* tuple); \
364 void InsertTupleValue(vtkIdType i, const T* tuple); \
365 vtkIdType InsertNextTupleValue(const T* tuple); \
366 T GetValue(vtkIdType id); \
367 void SetValue(vtkIdType id, T value); \
368 void SetNumberOfValues(vtkIdType number); \
369 void InsertValue(vtkIdType id, T f); \
370 vtkIdType InsertNextValue(T f); \
371 T *GetValueRange(int comp); \
372 T *GetValueRange(); \
373 T* WritePointer(vtkIdType id, vtkIdType number); \
374 T* GetPointer(vtkIdType id)
386 #endif // !defined(__vtkDataArrayTemplate_h)
391 #if defined(VTK_DATA_ARRAY_TEMPLATE_TYPE)
392 # if defined(VTK_BUILD_SHARED_LIBS) && defined(_MSC_VER)
393 # pragma warning (push)
394 # pragma warning (disable: 4091) // warning C4091: 'extern ' :
396 # pragma warning (disable: 4231) // Compiler-specific extension warning.
409 # pragma warning (disable: 4910) // extern and dllexport incompatible
414 # pragma warning (pop)
416 # 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)
GLsizei const GLfloat * 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()
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