VTK  9.2.6
vtkStreamingTessellator.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkStreamingTessellator.h
5 Language: C++
6
7 Copyright 2003 Sandia Corporation.
8 Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
9 license for use of this work by or on behalf of the
10 U.S. Government. Redistribution and use in source and binary forms, with
11 or without modification, are permitted provided that this Notice and any
12 statement of authorship are reproduced on all copies.
13
14=========================================================================*/
77
78#ifndef vtkStreamingTessellator_h
79#define vtkStreamingTessellator_h
80
81#include "vtkFiltersCoreModule.h" // For export macro
82#include "vtkObject.h"
83
84#undef PARAVIEW_DEBUG_TESSELLATOR
85
87
88class VTKFILTERSCORE_EXPORT vtkStreamingTessellator : public vtkObject
89{
90public:
93 void PrintSelf(ostream& os, vtkIndent indent) override;
94
95 typedef void (*VertexProcessorFunction)(
96 const double*, vtkEdgeSubdivisionCriterion*, void*, const void*);
97 typedef void (*EdgeProcessorFunction)(
98 const double*, const double*, vtkEdgeSubdivisionCriterion*, void*, const void*);
100 const double*, const double*, const double*, vtkEdgeSubdivisionCriterion*, void*, const void*);
101 typedef void (*TetrahedronProcessorFunction)(const double*, const double*, const double*,
102 const double*, vtkEdgeSubdivisionCriterion*, void*, const void*);
103
104 enum
105 {
107 };
108
110
116
118
124
126
132
134
140
142
145 virtual void SetPrivateData(void* Private);
146 virtual void* GetPrivateData() const;
148
149 // can't wrap const private data because python wrapper will try to cast it to void*, not const
150 // void*
151
153
156 virtual void SetConstPrivateData(const void* ConstPrivate);
157 virtual const void* GetConstPrivateData() const;
159
161
171
173
175
187 virtual void SetEmbeddingDimension(int k, int d);
188 int GetEmbeddingDimension(int k) const;
190
192
221 virtual void SetFieldSize(int k, int s);
222 int GetFieldSize(int k) const;
224
226
229 virtual void SetMaximumNumberOfSubdivisions(int num_subdiv_in);
232
234
253 void AdaptivelySample3FacetLinear(double* v0, double* v1, double* v2, double* v3) const;
254 void AdaptivelySample2FacetLinear(double* v0, double* v1, double* v2) const;
255 void AdaptivelySample1FacetLinear(double* v0, double* v1) const;
256
257 void AdaptivelySample3Facet(double* v0, double* v1, double* v2, double* v3) const;
258 void AdaptivelySample2Facet(double* v0, double* v1, double* v2) const;
259 void AdaptivelySample1Facet(double* v0, double* v1) const;
260 void AdaptivelySample0Facet(double* v0) const;
262
264
277 {
278#ifdef PARAVIEW_DEBUG_TESSELLATOR
279 for (int i = 0; i < 11; ++i)
280 {
281 this->CaseCounts[i] = 0;
282 for (int j = 0; j < 51; ++j)
283 {
284 this->SubcaseCounts[i][j] = 0;
285 }
286 }
287#endif // PARAVIEW_DEBUG_TESSELLATOR
288 }
290 {
291#ifdef PARAVIEW_DEBUG_TESSELLATOR
292 return this->CaseCounts[c];
293#else
294 (void)c;
295 return 0;
296#endif // PARAVIEW_DEBUG_TESSELLATOR
297 }
298 vtkIdType GetSubcaseCount(int casenum, int sub)
299 {
300#ifdef PARAVIEW_DEBUG_TESSELLATOR
301 return this->SubcaseCounts[casenum][sub];
302#else
303 (void)casenum;
304 (void)sub;
305 return 0;
306#endif // PARAVIEW_DEBUG_TESSELLATOR
307 }
308
309
310protected:
314
316 const void* ConstPrivateData;
318
323#ifdef PARAVIEW_DEBUG_TESSELLATOR
324 mutable vtkIdType CaseCounts[11];
325 mutable vtkIdType SubcaseCounts[11][51];
326#endif // PARAVIEW_DEBUG_TESSELLATOR
327
337
344
349
352
353 void AdaptivelySample3Facet(double* v0, double* v1, double* v2, double* v3, int maxDepth) const;
354 void AdaptivelySample2Facet(double* v0, double* v1, double* v2, int maxDepth, int move = 7) const;
355 void AdaptivelySample1Facet(double* v0, double* v1, int maxDepth) const;
356
357 int BestTets(int*, double**, int, int) const;
358
359private:
361 void operator=(const vtkStreamingTessellator&) = delete;
362};
363
365 double* v0, double* v1, double* v2, double* v3) const
366{
367 this->AdaptivelySample3Facet(v0, v1, v2, v3, this->MaximumNumberOfSubdivisions);
368}
370 double* v0, double* v1, double* v2) const
371{
373}
374inline void vtkStreamingTessellator::AdaptivelySample1Facet(double* v0, double* v1) const
375{
377}
378
380{
381 if (k <= 0 || k >= 4)
382 return -1;
383 return this->EmbeddingDimension[k];
384}
385
387{
388 if (k <= 0 || k >= 4)
389 return -1;
390 return this->PointDimension[k] - this->EmbeddingDimension[k] - 3;
391}
392
397
398#endif // vtkStreamingTessellator_h
how to decide whether a linear approximation to nonlinear geometry or field should be subdivided
a simple class to control print indentation
Definition vtkIndent.h:40
virtual TetrahedronProcessorFunction GetTetrahedronCallback() const
Get/Set the function called for each output tetrahedron (3-facet).
void(* VertexProcessorFunction)(const double *, vtkEdgeSubdivisionCriterion *, void *, const void *)
virtual const void * GetConstPrivateData() const
Get/Set a constant void pointer passed to the simplex output functions.
~vtkStreamingTessellator() override
void AdaptivelySample3FacetLinear(double *v0, double *v1, double *v2, double *v3) const
This will adaptively subdivide the tetrahedron (3-facet), triangle (2-facet), or edge (1-facet) until...
void AdaptivelySample1Facet(double *v0, double *v1, int maxDepth) const
vtkIdType GetCaseCount(int c)
Reset/access the histogram of subdivision cases encountered.
static int EdgeCodesToCaseCodesPlusPermutation[64][2]
void AdaptivelySample2Facet(double *v0, double *v1, double *v2) const
This will adaptively subdivide the tetrahedron (3-facet), triangle (2-facet), or edge (1-facet) until...
virtual void SetSubdivisionAlgorithm(vtkEdgeSubdivisionCriterion *)
Get/Set the algorithm used to determine whether an edge should be subdivided or left as-is.
virtual void SetMaximumNumberOfSubdivisions(int num_subdiv_in)
Get/Set the maximum number of subdivisions that may occur.
TriangleProcessorFunction Callback2
void AdaptivelySample3Facet(double *v0, double *v1, double *v2, double *v3) const
This will adaptively subdivide the tetrahedron (3-facet), triangle (2-facet), or edge (1-facet) until...
virtual void SetFieldSize(int k, int s)
Get/Set the number of field value coordinates associated with each input and output point.
virtual VertexProcessorFunction GetVertexCallback() const
Get/Set the function called for each output line segment (1-facet).
int BestTets(int *, double **, int, int) const
VertexProcessorFunction Callback0
EdgeProcessorFunction Callback1
virtual const vtkEdgeSubdivisionCriterion * GetSubdivisionAlgorithm() const
static vtkIdType TetrahedralDecompositions[]
void AdaptivelySample0Facet(double *v0) const
This will adaptively subdivide the tetrahedron (3-facet), triangle (2-facet), or edge (1-facet) until...
int PointDimension[4]
PointDimension is the length of each double* array associated with each point passed to a subdivision...
virtual void SetVertexCallback(VertexProcessorFunction)
Get/Set the function called for each output line segment (1-facet).
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkEdgeSubdivisionCriterion * Algorithm
virtual vtkEdgeSubdivisionCriterion * GetSubdivisionAlgorithm()
Get/Set the algorithm used to determine whether an edge should be subdivided or left as-is.
int GetMaximumNumberOfSubdivisions()
Get/Set the maximum number of subdivisions that may occur.
virtual void SetEdgeCallback(EdgeProcessorFunction)
Get/Set the function called for each output line segment (1-facet).
int GetFieldSize(int k) const
Get/Set the number of field value coordinates associated with each input and output point.
virtual void * GetPrivateData() const
Get/Set a void pointer passed to the triangle and edge output functions.
void(* EdgeProcessorFunction)(const double *, const double *, vtkEdgeSubdivisionCriterion *, void *, const void *)
void ResetCounts()
Reset/access the histogram of subdivision cases encountered.
void(* TriangleProcessorFunction)(const double *, const double *, const double *, vtkEdgeSubdivisionCriterion *, void *, const void *)
void AdaptivelySample1Facet(double *v0, double *v1) const
This will adaptively subdivide the tetrahedron (3-facet), triangle (2-facet), or edge (1-facet) until...
TetrahedronProcessorFunction Callback3
virtual void SetTetrahedronCallback(TetrahedronProcessorFunction)
Get/Set the function called for each output tetrahedron (3-facet).
void AdaptivelySample1FacetLinear(double *v0, double *v1) const
This will adaptively subdivide the tetrahedron (3-facet), triangle (2-facet), or edge (1-facet) until...
void AdaptivelySample2FacetLinear(double *v0, double *v1, double *v2) const
This will adaptively subdivide the tetrahedron (3-facet), triangle (2-facet), or edge (1-facet) until...
void AdaptivelySample3Facet(double *v0, double *v1, double *v2, double *v3, int maxDepth) const
static vtkIdType PermutationsFromIndex[24][14]
static vtkStreamingTessellator * New()
virtual void SetPrivateData(void *Private)
Get/Set a void pointer passed to the triangle and edge output functions.
virtual TriangleProcessorFunction GetTriangleCallback() const
Get/Set the function called for each output triangle (2-facet).
virtual void SetEmbeddingDimension(int k, int d)
Get/Set the number of parameter-space coordinates associated with each input and output point.
void(* TetrahedronProcessorFunction)(const double *, const double *, const double *, const double *, vtkEdgeSubdivisionCriterion *, void *, const void *)
virtual void SetConstPrivateData(const void *ConstPrivate)
Get/Set a constant void pointer passed to the simplex output functions.
vtkIdType GetSubcaseCount(int casenum, int sub)
Reset/access the histogram of subdivision cases encountered.
int EmbeddingDimension[4]
The parametric dimension of each point passed to the subdivision algorithm.
virtual void SetTriangleCallback(TriangleProcessorFunction)
Get/Set the function called for each output triangle (2-facet).
int MaximumNumberOfSubdivisions
The number of subdivisions allowed.
virtual EdgeProcessorFunction GetEdgeCallback() const
Get/Set the function called for each output line segment (1-facet).
int GetEmbeddingDimension(int k) const
Get/Set the number of parameter-space coordinates associated with each input and output point.
void AdaptivelySample2Facet(double *v0, double *v1, double *v2, int maxDepth, int move=7) const
int vtkIdType
Definition vtkType.h:332