27 #ifndef vtkTypedDataArray_h
28 #define vtkTypedDataArray_h
32 #include "vtkCommonCoreModule.h"
35 VTK_ABI_NAMESPACE_BEGIN
36 template <
class Scalar>
39 template <
class Scalar>
179 VTK_ABI_NAMESPACE_END
182 VTK_ABI_NAMESPACE_BEGIN
183 template <
class Scalar>
189 template <
class Scalar>
195 VTK_ABI_NAMESPACE_END
196 #include "vtkTypedDataArray.txx"
198 #endif // vtkTypedDataArray_h
200 #ifdef VTK_TYPED_VALUERANGE_INSTANTIATING
203 #define VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
204 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
205 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
206 template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
207 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
208 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
209 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
210 template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
211 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
213 #define VTK_INSTANTIATE_VALUERANGE_VALUETYPE(ValueType) \
214 VTK_INSTANTIATE_VALUERANGE_ARRAYTYPE(vtkTypedDataArray<ValueType>, double)
216 #elif defined(VTK_USE_EXTERN_TEMPLATE) // VTK_IMPLICIT_VALUERANGE_INSTANTIATING
218 #ifndef VTK_IMPLICIT_TEMPLATE_EXTERN
219 #define VTK_IMPLICIT_TEMPLATE_EXTERN
221 #pragma warning(push)
224 #pragma warning(disable : 4910) // extern and dllexport incompatible
229 VTK_ABI_NAMESPACE_BEGIN
230 template <
typename A,
typename R,
typename T>
232 A*, R*, T,
const unsigned char* ghosts,
unsigned char ghostsToSkip);
233 template <
typename A,
typename R>
235 A*, R[2], AllValues,
const unsigned char* ghosts,
unsigned char ghostsToSkip);
236 template <
typename A,
typename R>
238 A*, R[2], FiniteValues,
const unsigned char* ghosts,
unsigned char ghostsToSkip);
239 VTK_ABI_NAMESPACE_END
242 #define VTK_DECLARE_VALUERANGE_ARRAYTYPE(ArrayType, ValueType) \
243 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange( \
244 ArrayType*, ValueType*, vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
245 extern template VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(ArrayType*, ValueType*, \
246 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char); \
247 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
248 vtkDataArrayPrivate::AllValues, const unsigned char*, unsigned char); \
249 extern template VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(ArrayType*, ValueType[2], \
250 vtkDataArrayPrivate::FiniteValues, const unsigned char*, unsigned char);
252 #define VTK_DECLARE_VALUERANGE_VALUETYPE(ValueType) \
253 VTK_DECLARE_VALUERANGE_ARRAYTYPE(vtkTypedDataArray<ValueType>, double)
257 VTK_ABI_NAMESPACE_BEGIN
271 VTK_ABI_NAMESPACE_END
274 #undef VTK_DECLARE_VALUERANGE_VALUETYPE
275 #undef VTK_DECLARE_VALUERANGE_ARRAYTYPE
280 #endif // VTK_IMPLICIT_TEMPLATE_EXTERN
282 #endif // VTK_TYPED_VALUERANGE_INSTANTIATING
virtual ValueType GetValue(vtkIdType idx) const =0
Get the data at a particular index.
virtual ValueType GetTypedComponent(vtkIdType tupleIdx, int comp) const
virtual vtkIdType InsertNextTypedTuple(const ValueType *t)=0
Insert (memory allocation performed) the tuple onto the end of the array.
int GetDataType() const override
Return the VTK data type held by this array.
Abstract superclass for all arrays.
VTKCOMMONCORE_EXPORT bool DoComputeScalarRange(A *, R *, T, const unsigned char *ghosts, unsigned char ghostsToSkip)
VTKCOMMONCORE_EXPORT bool DoComputeVectorRange(A *, R[2], AllValues, const unsigned char *ghosts, unsigned char ghostsToSkip)
virtual vtkIdType InsertNextValue(ValueType v)=0
Insert data at the end of the array.
virtual bool ReallocateTuples(vtkIdType numTuples)
Needed for vtkGenericDataArray API, but just aborts.
static vtkTypedDataArray< Scalar > * FastDownCast(vtkAbstractArray *source)
Perform a fast, safe cast from a vtkAbstractArray to a vtkTypedDataArray.
~vtkTypedDataArray() override
Base interface for all typed vtkDataArray subclasses.
int GetDataTypeSize() const override
Return the size of the element type in bytes.
vtkTypeBool Resize(vtkIdType numTuples) override=0
Resize the array to the requested number of tuples and preserve data.
virtual void InsertValue(vtkIdType idx, ValueType v)=0
Insert data at a specified position in the array.
Iterator End()
Return an iterator initialized to first element past the end of the data.
virtual void SetTypedComponent(vtkIdType tupleIdx, int comp, ValueType v)
virtual void GetTypedTuple(vtkIdType idx, ValueType *t) const =0
Copy the tuple value into a user-provided array.
virtual void InsertTypedTuple(vtkIdType i, const ValueType *t)=0
Insert (memory allocation performed) the tuple into the ith location in the array.
Iterator Begin()
Return an iterator initialized to the first element of the data.
virtual bool AllocateTuples(vtkIdType numTuples)
Needed for vtkGenericDataArray API, but just aborts.
int GetArrayType() const override
Method for type-checking in FastDownCast implementations.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
virtual ValueType & GetValueReference(vtkIdType idx)=0
Get a reference to the scalar value at a particular index.
#define VTK_DECLARE_VALUERANGE_VALUETYPE(ValueType)
Extend vtkDataArray with abstract type-specific API.
virtual void SetTypedTuple(vtkIdType i, const ValueType *t)=0
Set the tuple value at the ith location in the array.
vtkArrayDownCast_TemplateFastCastMacro(vtkTypedDataArray)
Superclass::ValueType ValueType
vtkTemplateTypeMacro(vtkTypedDataArray< Scalar >, GenericDataArrayType)
virtual void SetValue(vtkIdType idx, ValueType value)=0
Set the data at a particular index.
vtkTypeBool Allocate(vtkIdType size, vtkIdType ext=1000) override=0
Allocate memory for this array.
STL-style random access iterator for vtkTypedDataArrays.
Template defining traits of native types used by VTK.
vtkTypedDataArrayIterator< ValueType > Iterator
Typedef to a suitable iterator class.