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 106 107 108 109 110 111 112 113 114 115 116 117
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkVolumeOfRevolutionFilter.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkVolumeOfRevolutionFilter
* @brief sweep data about a line to create a volume
*
* vtkVolumeOfRevolutionFilter is a modeling filter. It takes a 2-dimensional
* dataset as input and generates an unstructured grid on output. The input
* dataset is swept around the axis of rotation to create dimension-elevated
* primitives. For example, sweeping a vertex creates a series of lines;
* sweeping a line creates a series of quads, etc.
*
* @warning
* The user must take care to ensure that the axis of revolution does not cross
* through the geometry, otherwise there will be intersecting cells in the
* output.
*
* @sa
* vtkRotationalExtrusionFilter
*/
#ifndef vtkVolumeOfRevolutionFilter_h
#define vtkVolumeOfRevolutionFilter_h
#include "vtkFiltersModelingModule.h" // For export macro
#include "vtkUnstructuredGridAlgorithm.h"
class VTKFILTERSMODELING_EXPORT vtkVolumeOfRevolutionFilter :
public vtkUnstructuredGridAlgorithm
{
public:
vtkTypeMacro(vtkVolumeOfRevolutionFilter,vtkUnstructuredGridAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
/**
* Create object with sweep angle of 360 degrees, resolution = 12,
* axis position (0,0,0) and axis direction (0,0,1).
*/
static vtkVolumeOfRevolutionFilter *New();
//@{
/**
* Set/Get resolution of sweep operation. Resolution controls the number
* of intermediate node points.
*/
vtkSetClampMacro(Resolution,int,1,VTK_INT_MAX);
vtkGetMacro(Resolution,int);
//@}
//@{
/**
* Set/Get angle of rotation in degrees.
*/
vtkSetClampMacro(SweepAngle,double,-360.,360.);
vtkGetMacro(SweepAngle,double);
//@}
//@{
/**
* Set/Get the position of the axis of revolution.
*/
vtkSetVector3Macro(AxisPosition,double);
vtkGetVector3Macro(AxisPosition,double);
//@}
//@{
/**
* Set/Get the direction of the axis of revolution.
*/
vtkSetVector3Macro(AxisDirection,double);
vtkGetVector3Macro(AxisDirection,double);
//@}
//@{
/**
* Set/get the desired precision for the output types. See the documentation
* for the vtkAlgorithm::DesiredOutputPrecision enum for an explanation of
* the available precision settings.
*/
vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION,
DEFAULT_PRECISION);
vtkGetMacro(OutputPointsPrecision, int);
//@}
protected:
vtkVolumeOfRevolutionFilter();
~vtkVolumeOfRevolutionFilter();
int RequestData(vtkInformation *, vtkInformationVector **,
vtkInformationVector *);
int FillInputPortInformation(int, vtkInformation *);
int Resolution;
double SweepAngle;
double AxisPosition[3];
double AxisDirection[3];
int OutputPointsPrecision;
private:
vtkVolumeOfRevolutionFilter(const vtkVolumeOfRevolutionFilter&) VTK_DELETE_FUNCTION;
void operator=(const vtkVolumeOfRevolutionFilter&) VTK_DELETE_FUNCTION;
};
#endif
|