VTK  9.1.0
vtkContour3DLinearGrid.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkContour3DLinearGrid.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
113 #ifndef vtkContour3DLinearGrid_h
114 #define vtkContour3DLinearGrid_h
115 
116 #include "vtkContourValues.h" // Needed for inline methods
117 #include "vtkDataObjectAlgorithm.h"
118 #include "vtkFiltersCoreModule.h" // For export macro
119 
120 class vtkPolyData;
121 class vtkUnstructuredGrid;
122 class vtkScalarTree;
123 struct vtkScalarTreeMap;
124 
125 class VTKFILTERSCORE_EXPORT vtkContour3DLinearGrid : public vtkDataObjectAlgorithm
126 {
127 public:
129 
134  void PrintSelf(ostream& os, vtkIndent indent) override;
136 
138 
141  void SetValue(int i, double value);
142  double GetValue(int i);
143  double* GetValues();
144  void GetValues(double* contourValues);
145  void SetNumberOfContours(int number);
146  vtkIdType GetNumberOfContours();
147  void GenerateValues(int numContours, double range[2]);
148  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
150 
152 
157  vtkSetMacro(MergePoints, vtkTypeBool);
158  vtkGetMacro(MergePoints, vtkTypeBool);
159  vtkBooleanMacro(MergePoints, vtkTypeBool);
161 
163 
167  vtkSetMacro(InterpolateAttributes, vtkTypeBool);
168  vtkGetMacro(InterpolateAttributes, vtkTypeBool);
169  vtkBooleanMacro(InterpolateAttributes, vtkTypeBool);
171 
173 
178  vtkSetMacro(ComputeNormals, vtkTypeBool);
179  vtkGetMacro(ComputeNormals, vtkTypeBool);
180  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
182 
184 
190  vtkSetMacro(ComputeScalars, vtkTypeBool);
191  vtkGetMacro(ComputeScalars, vtkTypeBool);
192  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
194 
196 
201  void SetOutputPointsPrecision(int precision);
204 
209  vtkMTimeType GetMTime() override;
210 
212 
217  vtkSetMacro(UseScalarTree, vtkTypeBool);
218  vtkGetMacro(UseScalarTree, vtkTypeBool);
219  vtkBooleanMacro(UseScalarTree, vtkTypeBool);
221 
223 
227  virtual void SetScalarTree(vtkScalarTree*);
228  vtkGetObjectMacro(ScalarTree, vtkScalarTree);
230 
232 
240  vtkSetMacro(SequentialProcessing, vtkTypeBool);
241  vtkGetMacro(SequentialProcessing, vtkTypeBool);
242  vtkBooleanMacro(SequentialProcessing, vtkTypeBool);
244 
249  int GetNumberOfThreadsUsed() { return this->NumberOfThreadsUsed; }
250 
259  bool GetLargeIds() { return this->LargeIds; }
260 
267  static bool CanFullyProcessDataObject(vtkDataObject* object, const char* scalarArrayName);
268 
269 protected:
272 
281  bool LargeIds; // indicate whether integral ids are large(==true) or not
282 
283  // Manage scalar trees, including mapping scalar tree to input dataset
286  struct vtkScalarTreeMap* ScalarTreeMap;
287 
288  // Process the data: input unstructured grid and output polydata
289  void ProcessPiece(vtkUnstructuredGrid* input, vtkDataArray* inScalars, vtkPolyData* output);
290 
292  vtkInformationVector* outputVector) override;
293  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
294  vtkInformationVector* outputVector) override;
296 
297 private:
299  void operator=(const vtkContour3DLinearGrid&) = delete;
300 };
301 
306 inline void vtkContour3DLinearGrid::SetValue(int i, double value)
307 {
308  this->ContourValues->SetValue(i, value);
309 }
310 
315 {
316  return this->ContourValues->GetValue(i);
317 }
318 
324 {
325  return this->ContourValues->GetValues();
326 }
327 
333 inline void vtkContour3DLinearGrid::GetValues(double* contourValues)
334 {
335  this->ContourValues->GetValues(contourValues);
336 }
337 
344 {
345  this->ContourValues->SetNumberOfContours(number);
346 }
347 
352 {
353  return this->ContourValues->GetNumberOfContours();
354 }
355 
360 inline void vtkContour3DLinearGrid::GenerateValues(int numContours, double range[2])
361 {
362  this->ContourValues->GenerateValues(numContours, range);
363 }
364 
370  int numContours, double rangeStart, double rangeEnd)
371 {
372  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
373 }
374 
375 #endif
vtkContour3DLinearGrid::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkContour3DLinearGrid::RequestData
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
vtkContourValues::GetValues
double * GetValues()
Return a pointer to a list of contour values.
vtkContourValues::GetNumberOfContours
int GetNumberOfContours()
Return the number of contours in the.
vtkContour3DLinearGrid::MergePoints
vtkTypeBool MergePoints
Definition: vtkContour3DLinearGrid.h:275
vtkContour3DLinearGrid::NumberOfThreadsUsed
int NumberOfThreadsUsed
Definition: vtkContour3DLinearGrid.h:280
vtkX3D::value
@ value
Definition: vtkX3D.h:226
vtkContour3DLinearGrid::GetValues
double * GetValues()
Get a pointer to an array of contour values.
Definition: vtkContour3DLinearGrid.h:323
vtkIdType
int vtkIdType
Definition: vtkType.h:332
vtkContour3DLinearGrid::SetNumberOfContours
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Definition: vtkContour3DLinearGrid.h:343
vtkContour3DLinearGrid::~vtkContour3DLinearGrid
~vtkContour3DLinearGrid() override
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkDataObjectAlgorithm
Superclass for algorithms that produce only data object as output.
Definition: vtkDataObjectAlgorithm.h:63
vtkContour3DLinearGrid::InterpolateAttributes
vtkTypeBool InterpolateAttributes
Definition: vtkContour3DLinearGrid.h:276
vtkX3D::range
@ range
Definition: vtkX3D.h:244
vtkContour3DLinearGrid::UseScalarTree
vtkTypeBool UseScalarTree
Definition: vtkContour3DLinearGrid.h:284
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:159
vtkContour3DLinearGrid::SetValue
void SetValue(int i, double value)
Methods to set / get contour values.
Definition: vtkContour3DLinearGrid.h:306
vtkContour3DLinearGrid::SetScalarTree
virtual void SetScalarTree(vtkScalarTree *)
Specify the scalar tree to use.
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkContour3DLinearGrid::LargeIds
bool LargeIds
Definition: vtkContour3DLinearGrid.h:281
vtkContour3DLinearGrid::ComputeScalars
vtkTypeBool ComputeScalars
Definition: vtkContour3DLinearGrid.h:278
vtkContour3DLinearGrid::ScalarTreeMap
struct vtkScalarTreeMap * ScalarTreeMap
Definition: vtkContour3DLinearGrid.h:286
vtkContour3DLinearGrid::CanFullyProcessDataObject
static bool CanFullyProcessDataObject(vtkDataObject *object, const char *scalarArrayName)
Returns true if the data object passed in is fully supported by this filter, i.e.,...
vtkContour3DLinearGrid::GetNumberOfThreadsUsed
int GetNumberOfThreadsUsed()
Return the number of threads actually used during execution.
Definition: vtkContour3DLinearGrid.h:249
vtkContour3DLinearGrid::GetLargeIds
bool GetLargeIds()
Inform the user as to whether large ids were used during filter execution.
Definition: vtkContour3DLinearGrid.h:259
vtkContour3DLinearGrid::GetValue
double GetValue(int i)
Get the ith contour value.
Definition: vtkContour3DLinearGrid.h:314
vtkContourValues
helper object to manage setting and generating contour values
Definition: vtkContourValues.h:55
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkContour3DLinearGrid::GetOutputPointsPrecision
int GetOutputPointsPrecision() const
Set/get the desired precision for the output types.
vtkContourValues::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
vtkContourValues::GetValue
double GetValue(int i)
Get the ith contour value.
vtkContourValues::SetValue
void SetValue(int i, double value)
Set the ith contour value.
vtkContour3DLinearGrid
fast generation of isosurface from 3D linear cells
Definition: vtkContour3DLinearGrid.h:126
vtkContour3DLinearGrid::SetOutputPointsPrecision
void SetOutputPointsPrecision(int precision)
Set/get the desired precision for the output types.
vtkContour3DLinearGrid::OutputPointsPrecision
int OutputPointsPrecision
Definition: vtkContour3DLinearGrid.h:274
vtkContour3DLinearGrid::RequestDataObject
int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
vtkContourValues.h
vtkContour3DLinearGrid::vtkContour3DLinearGrid
vtkContour3DLinearGrid()
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkContour3DLinearGrid::ScalarTree
vtkScalarTree * ScalarTree
Definition: vtkContour3DLinearGrid.h:285
vtkContour3DLinearGrid::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for construction, type info, and printing.
vtkContour3DLinearGrid::New
static vtkContour3DLinearGrid * New()
Standard methods for construction, type info, and printing.
vtkContour3DLinearGrid::ProcessPiece
void ProcessPiece(vtkUnstructuredGrid *input, vtkDataArray *inScalars, vtkPolyData *output)
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
vtkContour3DLinearGrid::GetMTime
vtkMTimeType GetMTime() override
Overloaded GetMTime() because of delegation to the internal vtkContourValues class.
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:204
vtkDataObjectAlgorithm.h
vtkContour3DLinearGrid::ContourValues
vtkContourValues * ContourValues
Definition: vtkContour3DLinearGrid.h:273
vtkContour3DLinearGrid::ComputeNormals
vtkTypeBool ComputeNormals
Definition: vtkContour3DLinearGrid.h:277
vtkContour3DLinearGrid::SequentialProcessing
vtkTypeBool SequentialProcessing
Definition: vtkContour3DLinearGrid.h:279
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:169
vtkScalarTree
organize data according to scalar values (used to accelerate contouring operations)
Definition: vtkScalarTree.h:55
vtkContourValues::SetNumberOfContours
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
vtkContour3DLinearGrid::GetNumberOfContours
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition: vtkContour3DLinearGrid.h:351
vtkContour3DLinearGrid::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
Definition: vtkContour3DLinearGrid.h:360
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287