31 #ifndef vtkSOADataArrayTemplate_h
32 #define vtkSOADataArrayTemplate_h
34 #include "vtkCommonCoreModule.h"
40 template <
class ValueTypeT>
49 typedef typename Superclass::ValueType
ValueType;
67 this->GetTupleIndexFromValueIndex(valueIdx, tupleIdx, comp);
80 this->GetTupleIndexFromValueIndex(valueIdx, tupleIdx, comp);
90 for (
size_t cc=0; cc < this->Data.size(); cc++)
92 tuple[cc] = this->Data[cc]->GetBuffer()[tupleIdx];
101 for (
size_t cc=0; cc < this->Data.size(); ++cc)
103 this->Data[cc]->GetBuffer()[tupleIdx] = tuple[cc];
112 return this->Data[comp]->GetBuffer()[tupleIdx];
120 this->Data[comp]->GetBuffer()[tupleIdx] =
value;
137 bool updateMaxId =
false,
bool save=
false,
138 int deleteMethod=VTK_DATA_ARRAY_FREE);
170 switch (
source->GetArrayType())
173 if (vtkDataTypesCompare(
source->GetDataType(),
187 void SetNumberOfComponents(
int numComps) VTK_OVERRIDE;
197 { this->Superclass::InsertTuples(dstIds, srcIds,
source); }
218 double NumberOfComponentsReciprocal;
224 inline
void GetTupleIndexFromValueIndex(
vtkIdType valueIdx,
227 tupleIdx =
static_cast<vtkIdType>(valueIdx *
228 this->NumberOfComponentsReciprocal);
245 #ifdef VTK_SOA_DATA_ARRAY_TEMPLATE_INSTANTIATING
246 #define VTK_SOA_DATA_ARRAY_TEMPLATE_INSTANTIATE(T) \
247 template class VTKCOMMONCORE_EXPORT vtkSOADataArrayTemplate< T >
248 #elif defined(VTK_USE_EXTERN_TEMPLATE)
249 #ifndef VTK_SOA_DATA_ARRAY_TEMPLATE_EXTERN
250 #define VTK_SOA_DATA_ARRAY_TEMPLATE_EXTERN
252 #pragma warning (push)
255 #pragma warning (disable: 4910)
260 #pragma warning (pop)
265 #elif defined(_MSC_VER) && !defined(VTK_BUILD_SHARED_LIBS)
266 #pragma warning (push)
269 #pragma warning (disable: 4091)
272 #pragma warning (disable: 4231)
285 #pragma warning (disable: 4910)
292 #pragma warning (pop)
Abstract superclass for all arrays.
Abstract superclass to iterate over elements in an vtkAbstractArray.
internal storage class used by vtkSOADataArrayTemplate, vtkAOSDataArrayTemplate, and others.
abstract superclass for arrays of numeric data
Base interface for all typed vtkDataArray subclasses.
vtkTemplateTypeMacro(SelfType, vtkDataArray) enum
Compile time access to the VTK type identifier.
list of point or cell ids
Struct-Of-Arrays implementation of vtkGenericDataArray.
void ExportToVoidPointer(void *ptr) override
Export a copy of the data in AoS ordering to the preallocated memory buffer.
void * GetVoidPointer(vtkIdType valueIdx) override
Use of this method is discouraged, it creates a deep copy of the data into a contiguous AoS-ordered b...
ValueType GetTypedComponent(vtkIdType tupleIdx, int comp) const
Get component comp of the tuple at tupleIdx.
void SetValue(vtkIdType valueIdx, ValueType value)
Set the value at valueIdx to value.
void SetTypedComponent(vtkIdType tupleIdx, int comp, ValueType value)
Set component comp of the tuple at tupleIdx to value.
ValueType GetValue(vtkIdType valueIdx) const
Get the value at valueIdx.
~vtkSOADataArrayTemplate() override
int GetArrayType() override
Method for type-checking in FastDownCast implementations.
vtkSOADataArrayTemplate()
vtkSOADataArrayTemplate< ValueTypeT > SelfType
static vtkSOADataArrayTemplate< ValueType > * FastDownCast(vtkAbstractArray *source)
Perform a fast, safe cast from a vtkAbstractArray to a vtkDataArray.
void GetTypedTuple(vtkIdType tupleIdx, ValueType *tuple) const
Copy the tuple at tupleIdx into tuple.
void SetArray(int comp, ValueType *array, vtkIdType size, bool updateMaxId=false, bool save=false, int deleteMethod=VTK_DATA_ARRAY_FREE)
Use this API to pass externally allocated memory to this instance.
static vtkSOADataArrayTemplate * New()
void SetTypedTuple(vtkIdType tupleIdx, const ValueType *tuple)
Set this array's tuple at tupleIdx to the values in tuple.
VTK_NEWINSTANCE vtkArrayIterator * NewIterator() override
Subclasses must override this method and provide the right kind of templated vtkArrayIteratorTemplate...
ValueType * GetComponentArrayPointer(int comp)
Return a pointer to a contiguous block of memory containing all values for a particular components (i...
void SetTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType value)
Set component compIdx of the tuple at tupleIdx to value.
ValueType GetTypedComponent(vtkIdType tupleIdx, int compIdx) const
Get component compIdx of the tuple at tupleIdx.
Template defining traits of native types used by VTK.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define vtkExternTemplateMacro(decl)
A macro to declare extern templates for all numerical types.
#define vtkInstantiateTemplateMacro(decl)
A macro to instantiate a template over all numerical types.
vtkArrayDownCast_TemplateFastCastMacro(vtkTypedDataArray) template< class Scalar > inline typename vtkTypedDataArray< Scalar >
void save(Archiver &ar, const vtkUnicodeString &str, const unsigned int vtkNotUsed(version))