Go to the documentation of this file.
10 #ifndef vtk_m_filter_flow_worklet_streamsurface_h
11 #define vtk_m_filter_flow_worklet_streamsurface_h
36 using ControlSignature = void(CellSetIn, WholeArrayInOut invalidCell, FieldOut ptsPerPolyline);
43 template <
typename CellShapeTag,
typename InVal
idType>
46 InValidType& invalidCell,
51 ptsPerPolyline = numPoints;
54 invalidCell.Set(0, 1);
77 if (numPts0 == numPts1)
78 outConnCount = (numPts0 - 1) * 2 * 3;
79 else if (numPts1 < numPts0)
80 outConnCount = (numPts0 - 1) * 2 * 3 + (numPts1 - numPts0) * 3;
82 outConnCount = (numPts1 - 1) * 2 * 3 + (numPts0 - numPts1) * 3;
100 WholeArrayOut outConn);
102 void(_1 numPts0, _2 numPts1, _3 ptOffset0, _4 offset1, _5 connOffset, _6 outConn);
105 template <
typename OutConnType>
111 OutConnType& outConn)
const
114 vtkm::Id nextToLastIdx0 = numPts0 - 1;
115 vtkm::Id nextToLastIdx1 = numPts1 - 1;
133 while (idx0 < nextToLastIdx0 && idx1 < nextToLastIdx1)
136 outConn.Set(outIdx + 0, offset0 + idx0 + 0);
137 outConn.Set(outIdx + 1, offset1 + idx1 + 0);
138 outConn.Set(outIdx + 2, offset0 + idx0 + 1);
141 outConn.Set(outIdx + 3, offset0 + idx0 + 1);
142 outConn.Set(outIdx + 4, offset1 + idx1 + 0);
143 outConn.Set(outIdx + 5, offset1 + idx1 + 1);
151 if (numPts0 == numPts1)
169 if (idx0 == nextToLastIdx0 && idx1 < nextToLastIdx1)
171 while (idx1 < nextToLastIdx1)
173 outConn.Set(outIdx + 0, offset0 + idx0 + 0);
174 outConn.Set(outIdx + 1, offset1 + idx1 + 0);
175 outConn.Set(outIdx + 2, offset1 + idx1 + 1);
196 while (idx0 < nextToLastIdx0)
198 outConn.Set(outIdx + 0, offset0 + idx0 + 0);
199 outConn.Set(outIdx + 1, offset1 + idx1 + 0);
200 outConn.Set(outIdx + 2, offset0 + idx0 + 1);
221 if (!(coords.
GetData().IsType<ExplCoordsType>() &&
237 countInvoker.Invoke(cellset, invalidCell, ptsPerPolyline);
254 countTriInvoker.Invoke(ptsPerPolyline0, ptsPerPolyline1, triangleConnCount);
258 newPoints = coords.
GetData().AsArrayHandle<ExplCoordsType>();
263 newConnectivity.
Allocate(numConnIds);
266 genCellsDisp.Invoke(ptsPerPolyline0,
282 #endif // vtk_m_filter_flow_worklet_streamsurface_h
Definition: worklet/StreamSurface.h:89
void(FieldIn numPts0, FieldIn numPts1, FieldIn offset0, FieldIn offset1, FieldIn connOffset, WholeArrayOut outConn) ControlSignature
Definition: worklet/StreamSurface.h:100
VTKM_CONT CountPolylines()
Definition: worklet/StreamSurface.h:34
void(FieldIn numPts0, FieldIn numPts1, FieldOut outConnCount) ControlSignature
Definition: worklet/StreamSurface.h:69
VTKM_EXEC void operator()(const CellShapeTag &shapeType, const vtkm::IdComponent &numPoints, InValidType &invalidCell, vtkm::Id &ptsPerPolyline) const
Definition: worklet/StreamSurface.h:44
VTKM_EXEC void operator()(const vtkm::Id &numPts0, const vtkm::Id &numPts1, vtkm::Id &outConnCount) const
Definition: worklet/StreamSurface.h:73
#define VTKM_EXEC
Definition: ExportMacros.h:51
Groups connected points that have the same field value.
Definition: Atomic.h:19
VTKM_CONT void Run(const vtkm::cont::CoordinateSystem &coords, const vtkm::cont::UnknownCellSet &cellset, vtkm::cont::ArrayHandle< vtkm::Vec3f > &newPoints, vtkm::cont::CellSetSingleType<> &newCells)
Definition: worklet/StreamSurface.h:214
void(CellSetIn, WholeArrayInOut invalidCell, FieldOut ptsPerPolyline) ControlSignature
Definition: worklet/StreamSurface.h:36
_1 InputDomain
Definition: worklet/StreamSurface.h:71
ArrayHandleView< ArrayHandleType > make_ArrayHandleView(const ArrayHandleType &array, vtkm::Id startIndex, vtkm::Id numValues)
Definition: ArrayHandleView.h:222
VTKM_CONT bool CanConvert() const
Returns true if this cell set can be retrieved as the given type.
Definition: UnknownCellSet.h:161
VTKM_CONT void Allocate(vtkm::Id numberOfValues, vtkm::CopyFlag preserve, vtkm::cont::Token &token) const
Allocates an array large enough to hold the given number of values.
Definition: ArrayHandle.h:465
A control signature tag for output fields.
Definition: WorkletMapField.h:60
IncidentElementCount PointCount
Definition: WorkletMapTopology.h:267
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
Definition: CastAndCall.h:34
VTKM_EXEC void operator()(const vtkm::Id &numPts0, const vtkm::Id &numPts1, const vtkm::Id &offset0, const vtkm::Id &offset1, const vtkm::Id &connOffset, OutConnType &outConn) const
Definition: worklet/StreamSurface.h:106
A CellSet of an unknown type.
Definition: UnknownCellSet.h:48
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
Definition: CoordinateSystem.h:25
void(_1 numPts0, _2 numPts1, _3 ptOffset0, _4 offset1, _5 connOffset, _6 outConn) ExecutionSignature
Definition: worklet/StreamSurface.h:102
void(CellShape shapeType, PointCount numPoints, _2 isValid, _3 ptsPerPolyline) ExecutionSignature
Definition: worklet/StreamSurface.h:40
VTKM_CONT CountTriangleConn()
Definition: worklet/StreamSurface.h:67
Dispatcher for worklets that inherit from WorkletMapField.
Definition: DispatcherMapField.h:25
Definition: worklet/StreamSurface.h:26
@ CELL_SHAPE_POLY_LINE
Definition: CellShape.h:40
Dispatcher for worklets that inherit from WorkletMapTopology.
Definition: DispatcherMapTopology.h:31
A control signature tag for input fields.
Definition: WorkletMapField.h:49
static VTKM_CONT T ScanExclusive(vtkm::cont::DeviceAdapterId devId, const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< T, COut > &output)
Definition: Algorithm.h:816
_1 InputDomain
Definition: worklet/StreamSurface.h:41
Base class for worklets that map from Points to Cells.
Definition: WorkletMapTopology.h:255
void(_1 numPts0, _2 numPts1, _3 outConnCount) ExecutionSignature
Definition: worklet/StreamSurface.h:70
Definition: worklet/StreamSurface.h:63
#define VTKM_CONT
Definition: ExportMacros.h:57
_1 InputDomain
Definition: worklet/StreamSurface.h:103
VTKM_CONT WritePortalType WritePortal() const
Get an array portal that can be used in the control environment.
Definition: ArrayHandle.h:435
@ CELL_SHAPE_TRIANGLE
Definition: CellShape.h:41
This class is thrown when a VTKm function or method encounters an invalid value that inhibits progres...
Definition: ErrorBadValue.h:25
static VTKM_CONT U Reduce(vtkm::cont::DeviceAdapterId devId, const vtkm::cont::ArrayHandle< T, CIn > &input, U initialValue)
Definition: Algorithm.h:656
VTKM_CONT ReadPortalType ReadPortal() const
Get an array portal that can be used in the control environment.
Definition: ArrayHandle.h:414
Definition: CastAndCall.h:36
VTKM_CONT GenerateCells()
Definition: worklet/StreamSurface.h:93
Definition: worklet/StreamSurface.h:30
VTKM_CONT void Fill(vtkm::Id numPoints, vtkm::UInt8 shapeId, vtkm::IdComponent numberOfPointsPerCell, const vtkm::cont::ArrayHandle< vtkm::Id, ConnectivityStorageTag > &connectivity)
Definition: CellSetSingleType.h:186
VTKM_CONT vtkm::cont::UncertainArrayHandle< vtkm::TypeListFieldVec3, VTKM_DEFAULT_STORAGE_LIST > GetData() const
VTKM_CONT vtkm::Id GetNumberOfCells() const
Definition: UnknownCellSet.h:111
Base class for worklets that do a simple mapping of field arrays.
Definition: WorkletMapField.h:38
VTKM_CONT StreamSurface()
Definition: worklet/StreamSurface.h:211