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
|
/*=========================================================================
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.
=========================================================================*/
// .NAME vtkRotationFilter - Duplicates a data set by rotation about an axis
// .SECTION Description
// 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.
//
// .SECTION Thanks
// Theophane Foggia of The Swiss National Supercomputing Centre (CSCS)
// for creating and contributing this filter
#ifndef __vtkRotationFilter_h
#define __vtkRotationFilter_h
#include "vtkUnstructuredGridAlgorithm.h"
class VTK_GRAPHICS_EXPORT vtkRotationFilter : public vtkUnstructuredGridAlgorithm
{
public:
static vtkRotationFilter *New();
vtkTypeMacro(vtkRotationFilter, vtkUnstructuredGridAlgorithm);
void PrintSelf(ostream &os, vtkIndent indent);
//BTX
enum RotationAxis
{
USE_X = 0,
USE_Y = 1,
USE_Z = 2
};
//ETX
// Description:
// 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); };
// Description:
// Set the rotation angle to use.
vtkSetMacro(Angle, double);
vtkGetMacro(Angle, double);
// Description:
// Set the rotation center coordinates.
vtkSetVector3Macro(Center,double);
vtkGetVector3Macro(Center,double);
// Description:
// 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);
// Description:
// 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();
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
virtual int FillInputPortInformation(int port, vtkInformation *info);
int Axis;
double Angle;
double Center[3];
int NumberOfCopies;
int CopyInput;
private:
vtkRotationFilter(const vtkRotationFilter&); // Not implemented
void operator=(const vtkRotationFilter&); // Not implemented
};
#endif
|