File: vtkLassoStencilSource.h

package info (click to toggle)
paraview 4.0.1-1~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 526,572 kB
  • sloc: cpp: 2,284,430; ansic: 816,374; python: 239,936; xml: 70,162; tcl: 48,295; fortran: 39,116; yacc: 5,466; java: 3,518; perl: 3,107; lex: 1,620; sh: 1,555; makefile: 932; asm: 471; pascal: 228
file content (107 lines) | stat: -rw-r--r-- 3,444 bytes parent folder | download | duplicates (4)
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
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkLassoStencilSource.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 vtkLassoStencilSource - Create a stencil from a contour
// .SECTION Description
// vtkLassoStencilSource will create an image stencil from a
// set of points that define a contour.  Its output can be
// used with vtkImageStecil or other vtk classes that apply
// a stencil to an image.
// .SECTION See Also
// vtkROIStencilSource vtkPolyDataToImageStencil
// .SECTION Thanks
// Thanks to David Gobbi for contributing this class to VTK.

#ifndef __vtkLassoStencilSource_h
#define __vtkLassoStencilSource_h


#include "vtkImagingStencilModule.h" // For export macro
#include "vtkImageStencilSource.h"

class vtkPoints;
class vtkSpline;
class vtkLSSPointMap;

class VTKIMAGINGSTENCIL_EXPORT vtkLassoStencilSource : public vtkImageStencilSource
{
public:
  static vtkLassoStencilSource *New();
  vtkTypeMacro(vtkLassoStencilSource, vtkImageStencilSource);
  void PrintSelf(ostream& os, vtkIndent indent);

//BTX
  enum {
    POLYGON = 0,
    SPLINE = 1
  };
//ETX

  // Description:
  // The shape to use, default is "Polygon".  The spline is a
  // cardinal spline.  Bezier splines are not yet supported.
  vtkGetMacro(Shape, int);
  vtkSetClampMacro(Shape, int, POLYGON, SPLINE);
  void SetShapeToPolygon() { this->SetShape(POLYGON); };
  void SetShapeToSpline() { this->SetShape(SPLINE); };
  virtual const char *GetShapeAsString();

  // Description:
  // The points that make up the lassoo.  The loop does not
  // have to be closed, the last point will automatically be
  // connected to the first point by a straight line segment.
  virtual void SetPoints(vtkPoints *points);
  vtkGetObjectMacro(Points, vtkPoints);

  // Description:
  // The slice orientation.  The default is 2, which is XY.
  // Other values are 0, which is YZ, and 1, which is XZ.
  vtkGetMacro(SliceOrientation, int);
  vtkSetClampMacro(SliceOrientation, int, 0, 2);

  // Description:
  // The points for a particular slice.  This will override the
  // points that were set by calling SetPoints() for the slice.
  // To clear the setting, call SetSlicePoints(slice, NULL).
  virtual void SetSlicePoints(int i, vtkPoints *points);
  virtual vtkPoints *GetSlicePoints(int i);

  // Description:
  // Remove points from all slices.
  virtual void RemoveAllSlicePoints();

  // Description:
  // Overload GetMTime() to include the timestamp on the points.
  unsigned long GetMTime();

protected:
  vtkLassoStencilSource();
  ~vtkLassoStencilSource();

  virtual int RequestData(vtkInformation *, vtkInformationVector **,
                          vtkInformationVector *);

  int Shape;
  int SliceOrientation;
  vtkPoints *Points;
  vtkSpline *SplineX;
  vtkSpline *SplineY;
  vtkLSSPointMap *PointMap;

private:
  vtkLassoStencilSource(const vtkLassoStencilSource&);  // Not implemented.
  void operator=(const vtkLassoStencilSource&);  // Not implemented.
};

#endif