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: vtkRotationFilter.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 vtkRotationFilter
* @brief Duplicates a data set by rotation about an axis
*
* The vtkRotationFilter duplicates a data set by rotation about one of the
* 3 axis of the dataset's reference.
* Since it converts data sets into unstructured grids, it is not efficient
* for structured data sets.
*
* @par Thanks:
* Theophane Foggia of The Swiss National Supercomputing Centre (CSCS)
* for creating and contributing this filter
*/
#ifndef vtkRotationFilter_h
#define vtkRotationFilter_h
#include "vtkFiltersGeneralModule.h" // For export macro
#include "vtkUnstructuredGridAlgorithm.h"
class VTKFILTERSGENERAL_EXPORT vtkRotationFilter : public vtkUnstructuredGridAlgorithm
{
public:
static vtkRotationFilter *New();
vtkTypeMacro(vtkRotationFilter, vtkUnstructuredGridAlgorithm);
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE;
enum RotationAxis
{
USE_X = 0,
USE_Y = 1,
USE_Z = 2
};
//@{
/**
* Set the axis of rotation to use. It is set by default to Z.
*/
vtkSetClampMacro(Axis, int, 0, 2);
vtkGetMacro(Axis, int);
void SetAxisToX() { this->SetAxis(USE_X); };
void SetAxisToY() { this->SetAxis(USE_Y); };
void SetAxisToZ() { this->SetAxis(USE_Z); };
//@}
//@{
/**
* Set the rotation angle to use.
*/
vtkSetMacro(Angle, double);
vtkGetMacro(Angle, double);
//@}
//@{
/**
* Set the rotation center coordinates.
*/
vtkSetVector3Macro(Center,double);
vtkGetVector3Macro(Center,double);
//@}
//@{
/**
* Set the number of copies to create. The source will be rotated N times
* and a new polydata copy of the original created at each angular position
* All copies will be appended to form a single output
*/
vtkSetMacro(NumberOfCopies, int);
vtkGetMacro(NumberOfCopies, int);
//@}
//@{
/**
* If on (the default), copy the input geometry to the output. If off,
* the output will only contain the rotation.
*/
vtkSetMacro(CopyInput, int);
vtkGetMacro(CopyInput, int);
vtkBooleanMacro(CopyInput, int);
//@}
protected:
vtkRotationFilter();
~vtkRotationFilter() VTK_OVERRIDE;
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
int Axis;
double Angle;
double Center[3];
int NumberOfCopies;
int CopyInput;
private:
vtkRotationFilter(const vtkRotationFilter&) VTK_DELETE_FUNCTION;
void operator=(const vtkRotationFilter&) VTK_DELETE_FUNCTION;
};
#endif
|