File: vtkCPMappedVectorArrayTemplate.h

package info (click to toggle)
paraview 5.13.2%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 544,220 kB
  • sloc: cpp: 3,374,605; ansic: 1,332,409; python: 150,381; xml: 122,166; sql: 65,887; sh: 7,317; javascript: 5,262; yacc: 4,417; java: 3,977; perl: 2,363; lex: 1,929; f90: 1,397; makefile: 170; objc: 153; tcl: 59; pascal: 50; fortran: 29
file content (105 lines) | stat: -rw-r--r-- 4,647 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
// SPDX-License-Identifier: BSD-3-Clause

// .NAME vtkCPMappedVectorArrayTemplate - Map native data arrays into
// the vtkDataArray interface.
//
// .SECTION Description
// Map native simulation code data arrays into the vtkDataArray interface.
// This is based on the vtkCPExodusIIResultsArrayTemplate.h class in VTK.

#ifndef vtkCPMappedVectorArrayTemplate_h
#define vtkCPMappedVectorArrayTemplate_h

#include "vtkMappedDataArray.h"

#include "vtkObjectFactory.h" // for vtkStandardNewMacro

template <class Scalar>
class vtkCPMappedVectorArrayTemplate : public vtkMappedDataArray<Scalar>
{
public:
  vtkAbstractTemplateTypeMacro(vtkCPMappedVectorArrayTemplate<Scalar>, vtkMappedDataArray<Scalar>);
  vtkMappedDataArrayNewInstanceMacro(vtkCPMappedVectorArrayTemplate<Scalar>);
  static vtkCPMappedVectorArrayTemplate* New();
  void PrintSelf(ostream& os, vtkIndent indent) override;

  typedef typename Superclass::ValueType ValueType;

  // Description:
  // Set the raw scalar arrays for the coordinate set. This class takes
  // ownership of the arrays and deletes them with delete[].
  void SetVectorArray(Scalar* array, vtkIdType numPoints);

  // Reimplemented virtuals -- see superclasses for descriptions:
  void Initialize() override;
  void GetTuples(vtkIdList* ptIds, vtkAbstractArray* output) override;
  void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray* output) override;
  void Squeeze() override;
  vtkArrayIterator* NewIterator() override;
  vtkIdType LookupValue(vtkVariant value) override;
  void LookupValue(vtkVariant value, vtkIdList* ids) override;
  vtkVariant GetVariantValue(vtkIdType idx) override;
  void ClearLookup() override;
  double* GetTuple(vtkIdType i) override;
  void GetTuple(vtkIdType i, double* tuple) override;
  vtkIdType LookupTypedValue(Scalar value) override;
  void LookupTypedValue(Scalar value, vtkIdList* idse) override;
  ValueType GetValue(vtkIdType idx) const override;
  Scalar& GetValueReference(vtkIdType idx) override;
  void GetTypedTuple(vtkIdType idx, Scalar* t) const override;

  // Description:
  // This container is read only -- this method does nothing but print a
  // warning.
  int Allocate(vtkIdType sz, vtkIdType ext) override;
  int Resize(vtkIdType numTuples) override;
  void SetNumberOfTuples(vtkIdType number) override;
  void SetTuple(vtkIdType i, vtkIdType j, vtkAbstractArray* source) override;
  void SetTuple(vtkIdType i, const float* source) override;
  void SetTuple(vtkIdType i, const double* source) override;
  void InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray* source) override;
  void InsertTuple(vtkIdType i, const float* source) override;
  void InsertTuple(vtkIdType i, const double* source) override;
  void InsertTuples(vtkIdList* dstIds, vtkIdList* srcIds, vtkAbstractArray* source) override;
  void InsertTuples(
    vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray* source) override;
  vtkIdType InsertNextTuple(vtkIdType j, vtkAbstractArray* source) override;
  vtkIdType InsertNextTuple(const float* source) override;
  vtkIdType InsertNextTuple(const double* source) override;
  void DeepCopy(vtkAbstractArray* aa) override;
  void DeepCopy(vtkDataArray* da) override;
  void InterpolateTuple(
    vtkIdType i, vtkIdList* ptIndices, vtkAbstractArray* source, double* weights) override;
  void InterpolateTuple(vtkIdType i, vtkIdType id1, vtkAbstractArray* source1, vtkIdType id2,
    vtkAbstractArray* source2, double t) override;
  void SetVariantValue(vtkIdType idx, vtkVariant value) override;
  void InsertVariantValue(vtkIdType idx, vtkVariant value) override;
  void RemoveTuple(vtkIdType id) override;
  void RemoveFirstTuple() override;
  void RemoveLastTuple() override;
  void SetTypedTuple(vtkIdType i, const Scalar* t) override;
  void InsertTypedTuple(vtkIdType i, const Scalar* t) override;
  vtkIdType InsertNextTypedTuple(const Scalar* t) override;
  void SetValue(vtkIdType idx, Scalar value) override;
  vtkIdType InsertNextValue(Scalar v) override;
  void InsertValue(vtkIdType idx, Scalar v) override;

protected:
  vtkCPMappedVectorArrayTemplate();
  ~vtkCPMappedVectorArrayTemplate();

  Scalar* Array;

private:
  vtkCPMappedVectorArrayTemplate(const vtkCPMappedVectorArrayTemplate&) = delete;
  void operator=(const vtkCPMappedVectorArrayTemplate&) = delete;

  vtkIdType Lookup(const Scalar& val, vtkIdType startIndex);
  double TempDoubleArray[3];
};

#include "vtkCPMappedVectorArrayTemplate.txx"

#endif // vtkCPMappedVectorArrayTemplate_h