OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I386LINUX / util / I386LINUX / include / vtk / vtkImageClip.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkImageClip.h,v $
5   Language:  C++
6   Date:      $Date: 2002/01/22 15:32:02 $
7   Version:   $Revision: 1.35 $
8
9   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
10   All rights reserved.
11   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
12
13      This software is distributed WITHOUT ANY WARRANTY; without even 
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15      PURPOSE.  See the above copyright notice for more information.
16
17 =========================================================================*/
18 // .NAME vtkImageClip - Reduces the image extent of the input.
19 // .SECTION Description
20 // vtkImageClip  will make an image smaller.  The output must have
21 // an image extent which is the subset of the input.  The filter has two 
22 // modes of operation: 
23 // 1: By default, the data is not copied in this filter. 
24 // Only the whole extent is modified.  
25 // 2: If ClipDataOn is set, then you will get no more that the clipped
26 // extent.
27 #ifndef __vtkImageClip_h
28 #define __vtkImageClip_h
29
30 // I did not make this a subclass of in place filter because
31 // the references on the data do not matter. I make no modifications
32 // to the data.
33 #include "vtkImageToImageFilter.h"
34
35 class VTK_IMAGING_EXPORT vtkImageClip : public vtkImageToImageFilter
36 {
37 public:
38   static vtkImageClip *New();
39   vtkTypeRevisionMacro(vtkImageClip,vtkImageToImageFilter);
40   void PrintSelf(ostream& os, vtkIndent indent);
41
42   // Description:
43   // The whole extent of the output has to be set explicitly.
44   void SetOutputWholeExtent(int extent[6]);
45   void SetOutputWholeExtent(int minX, int maxX, int minY, int maxY, 
46                             int minZ, int maxZ);
47   void GetOutputWholeExtent(int extent[6]);
48   int *GetOutputWholeExtent() {return this->OutputWholeExtent;}
49
50   void ResetOutputWholeExtent();
51
52   // Description:
53   // By default, ClipData is off, and only the WholeExtent is modified.
54   // the data's extent may actually be larger.  When this flag is on,
55   // the data extent will be no more than the OutputWholeExtent.
56   vtkSetMacro(ClipData, int);
57   vtkGetMacro(ClipData, int);
58   vtkBooleanMacro(ClipData, int);
59
60   // Description:
61   // Hack set output by piece
62   void SetOutputWholeExtent(int piece, int numPieces);
63
64 protected:
65   vtkImageClip();
66   ~vtkImageClip() {};
67
68   // Time when OutputImageExtent was computed.
69   vtkTimeStamp CTime;
70   int Initialized; // Set the OutputImageExtent for the first time.
71   int OutputWholeExtent[6];
72
73   int ClipData;
74   
75   void ExecuteInformation(vtkImageData *inData, vtkImageData *outData);
76   void ExecuteInformation(){this->vtkImageToImageFilter::ExecuteInformation();};
77   void CopyData(vtkImageData *inData, vtkImageData *outData, int *ext);
78
79   int SplitExtentTmp(int piece, int numPieces, int *ext);
80
81   virtual void ExecuteData(vtkDataObject *out);
82 private:
83   vtkImageClip(const vtkImageClip&);  // Not implemented.
84   void operator=(const vtkImageClip&);  // Not implemented.
85 };
86
87
88
89 #endif
90
91
92