VTK
9.2.6
|
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate. More...
Namespaces | |
namespace | detail |
namespace | hypertreegrid |
Classes | |
class | CompositeDataSetNodeReference |
A reference proxy into a vtkCompositeDataSet, obtained by dereferencing an iterator from the vtk::Range(vtkCompositeDataSet*) overloads. More... |
Typedefs | |
using | ComponentIdType = int |
using | TupleIdType = vtkIdType |
using | ValueIdType = vtkIdType |
template<typename ArrayType, typename = detail::EnableIfVtkDataArray<ArrayType>> | |
using | GetAPIType = typename detail::GetAPITypeImpl<ArrayType>::APIType |
template<typename ArrayType> | |
using | IsAOSDataArray = std::integral_constant<bool, detail::IsAOSDataArrayImpl<ArrayType>::value> |
Enumerations | |
enum class | CompositeDataSetOptions : unsigned int { None = 0 , SkipEmptyNodes = 1 << 1 } |
enum class | DataObjectTreeOptions : unsigned int { None = 0 , SkipEmptyNodes = 1 << 1 , VisitOnlyLeaves = 1 << 2 , TraverseSubTree = 1 << 3 } |
Functions | |
template<ComponentIdType TupleSize = detail::DynamicTupleSize, typename ArrayTypePtr = vtkDataArray*> | |
VTK_ITER_INLINE auto | DataArrayTupleRange (const ArrayTypePtr &array, TupleIdType start=-1, TupleIdType end=-1) -> typename detail::SelectTupleRange< ArrayTypePtr, TupleSize >::type |
Generate an stl and for-range compatible range of tuple iterators from a vtkDataArray. | |
template<ComponentIdType TupleSize = detail::DynamicTupleSize, typename ArrayTypePtr = vtkDataArray*> | |
VTK_ITER_INLINE auto | DataArrayValueRange (const ArrayTypePtr &array, ValueIdType start=-1, ValueIdType end=-1) -> typename detail::SelectValueRange< ArrayTypePtr, TupleSize >::type |
Generate an stl and for-range compatible range of flat AOS iterators from a vtkDataArray. | |
template<typename IterablePtr, typename... Options> | |
auto | Range (IterablePtr iterable, Options &&... opts) -> typename detail::IterableTraits< typename detail::StripPointers< IterablePtr >::type >::RangeType |
Generate an iterable STL proxy object for a VTK container. | |
template<typename T> | |
vtkSmartPointer< T > | MakeSmartPointer (T *obj) |
Construct a vtkSmartPointer<T> containing obj. | |
template<typename T> | |
vtkSmartPointer< T > | TakeSmartPointer (T *obj) |
Construct a vtkSmartPointer<T> containing obj. | |
template<typename T> | |
vtkWeakPointer< T > | TakeWeakPointer (T *obj) |
Construct a vtkWeakPointer<T> containing obj. |
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.
Compare smart pointer values.
Specialization of value ranges and iterators for vtkAOSDataArrayTemplate.
Generic implementation of value ranges and iterators, suitable for vtkDataArray and all subclasses.
using vtk::ComponentIdType = int |
Definition at line 68 of file vtkDataArrayMeta.h.
using vtk::TupleIdType = vtkIdType |
Definition at line 69 of file vtkDataArrayMeta.h.
using vtk::ValueIdType = vtkIdType |
Definition at line 70 of file vtkDataArrayMeta.h.
using vtk::GetAPIType = typename detail::GetAPITypeImpl<ArrayType>::APIType |
Definition at line 188 of file vtkDataArrayMeta.h.
using vtk::IsAOSDataArray = std::integral_constant<bool, detail::IsAOSDataArrayImpl<ArrayType>::value> |
Definition at line 206 of file vtkDataArrayMeta.h.
|
strong |
Enumerator | |
---|---|
None | |
SkipEmptyNodes |
Definition at line 32 of file vtkCompositeDataSetRange.h.
|
strong |
Enumerator | |
---|---|
None | |
SkipEmptyNodes | |
VisitOnlyLeaves | |
TraverseSubTree |
Definition at line 32 of file vtkDataObjectTreeRange.h.
VTK_ITER_INLINE auto vtk::DataArrayTupleRange | ( | const ArrayTypePtr & | array, |
TupleIdType | start = -1, | ||
TupleIdType | end = -1 ) -> typename detail::SelectTupleRange<ArrayTypePtr, TupleSize>::type |
Generate an stl and for-range compatible range of tuple iterators from a vtkDataArray.
This function returns a TupleRange object that is compatible with C++11 for-range syntax. As an example usage, consider a function that takes some instance of vtkDataArray (or a subclass) and prints the magnitude of each tuple:
Note that ArrayType is generic in the above function. When vtk::DataArrayTupleRange is given a vtkDataArray pointer, the generated code produces iterators and reference proxies that rely on the vtkDataArray API. However, when a more derived ArrayType is passed in (for example, vtkFloatArray), specialized implementations are used that generate highly optimized code.
Performance can be further improved when the number of components in the array is known. By passing a compile-time-constant integer as a template parameter, e.g. vtk::DataArrayTupleRange<3>(array), specializations are enabled that allow the compiler to perform additional optimizations.
vtk::DataArrayTupleRange takes an additional two arguments that can be used to restrict the range of tuples to [start, end).
There is a compiler definition / CMake option called VTK_DEBUG_RANGE_ITERATORS that enables checks for proper usage of the range/iterator/reference classes. This slows things down significantly, but is useful for diagnosing problems.
In some situations, developers may want to build in Debug mode while still maintaining decent performance for data-heavy computations. For these usecases, an additional CMake option VTK_ALWAYS_OPTIMIZE_ARRAY_ITERATORS may be enabled to force optimization of code using these iterators. This option will force inlining and enable -O3 (or equivalent) optimization level for iterator code when compiling on platforms that support these features. This option has no effect when VTK_DEBUG_RANGE_ITERATORS is enabled.
To mitigate this, the following types are defined on the range object:
These can be accessed via the range objects, e.g.:
Definition at line 258 of file vtkDataArrayRange.h.
VTK_ITER_INLINE auto vtk::DataArrayValueRange | ( | const ArrayTypePtr & | array, |
ValueIdType | start = -1, | ||
ValueIdType | end = -1 ) -> typename detail::SelectValueRange<ArrayTypePtr, TupleSize>::type |
Generate an stl and for-range compatible range of flat AOS iterators from a vtkDataArray.
This function returns a ValueRange object that is compatible with C++11 for-range syntax. The array is traversed as if calling vtkGenericDataArray::GetValue with consecutive, increasing indices. As an example usage, consider a function that takes some instance of vtkDataArray (or a subclass) and sums the values it contains:
These ranges may also be used with STL algorithms:
Note that ArrayType is generic in the above function. When vtk::DataArrayValueRange is given a vtkDataArray pointer, the generated code produces iterators and reference proxies that rely on the vtkDataArray API. However, when a more derived ArrayType is passed in (for example, vtkFloatArray), specialized implementations are used that generate highly optimized code.
Performance can be further improved when the number of components in the array is known. By passing a compile-time-constant integer as a template parameter, e.g. vtk::DataArrayValueRange<3>(array), specializations are enabled that allow the compiler to perform additional optimizations.
vtk::DataArrayValueRange takes an additional two arguments that can be used to restrict the range of values to [start, end).
There is a compiler definition / CMake option called VTK_DEBUG_RANGE_ITERATORS that enables checks for proper usage of the range/iterator/reference classes. This slows things down significantly, but is useful for diagnosing problems.
In some situations, developers may want to build in Debug mode while still maintaining decent performance for data-heavy computations. For these usecases, an additional CMake option VTK_ALWAYS_OPTIMIZE_ARRAY_ITERATORS may be enabled to force optimization of code using these iterators. This option will force inlining and enable -O3 (or equivalent) optimization level for iterator code when compiling on platforms that support these features. This option has no effect when VTK_DEBUG_RANGE_ITERATORS is enabled.
To mitigate this, the following types are defined on the range object:
These can be accessed via the range objects, e.g.:
Definition at line 368 of file vtkDataArrayRange.h.
auto vtk::Range | ( | IterablePtr | iterable, |
Options &&... | opts ) -> typename detail::IterableTraits<typename detail::StripPointers<IterablePtr>::type>::RangeType |
Generate an iterable STL proxy object for a VTK container.
Currently supports:
Usage:
Definition at line 85 of file vtkRange.h.
vtkSmartPointer< T > vtk::MakeSmartPointer | ( | T * | obj | ) |
Construct a vtkSmartPointer<T> containing obj.
A new reference is added to obj.
Definition at line 346 of file vtkSmartPointer.h.
vtkSmartPointer< T > vtk::TakeSmartPointer | ( | T * | obj | ) |
Construct a vtkSmartPointer<T> containing obj.
obj's reference count is not changed.
Definition at line 354 of file vtkSmartPointer.h.
vtkWeakPointer< T > vtk::TakeWeakPointer | ( | T * | obj | ) |
Construct a vtkWeakPointer<T> containing obj.
obj's reference count is not changed.
Definition at line 303 of file vtkWeakPointer.h.