VTK
dox/VolumeRendering/vtkVolumeOutlineSource.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkVolumeOutlineSource.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00032 #ifndef __vtkVolumeOutlineSource_h
00033 #define __vtkVolumeOutlineSource_h
00034 
00035 #include "vtkPolyDataAlgorithm.h"
00036 
00037 class vtkVolumeMapper;
00038 
00039 class VTK_VOLUMERENDERING_EXPORT vtkVolumeOutlineSource : public vtkPolyDataAlgorithm
00040 {
00041 public:
00042   static vtkVolumeOutlineSource *New();
00043   vtkTypeMacro(vtkVolumeOutlineSource,vtkPolyDataAlgorithm);
00044   void PrintSelf(ostream& os, vtkIndent indent);
00045 
00047 
00050   virtual void SetVolumeMapper(vtkVolumeMapper *mapper);
00051   vtkVolumeMapper *GetVolumeMapper() { return this->VolumeMapper; };
00053 
00055 
00058   vtkSetMacro(GenerateScalars, int);
00059   vtkBooleanMacro(GenerateScalars, int);
00060   vtkGetMacro(GenerateScalars, int);
00062 
00064 
00066   vtkSetMacro(GenerateOutline, int);
00067   vtkBooleanMacro(GenerateOutline, int);
00068   vtkGetMacro(GenerateOutline, int);
00070 
00072 
00075   vtkSetMacro(GenerateFaces, int);
00076   vtkBooleanMacro(GenerateFaces, int);
00077   vtkGetMacro(GenerateFaces, int);
00079 
00081 
00083   vtkSetVector3Macro(Color, double);
00084   vtkGetVector3Macro(Color, double);
00086 
00088 
00091   vtkSetMacro(ActivePlaneId, int);
00092   vtkGetMacro(ActivePlaneId, int);
00094 
00096 
00099   vtkSetVector3Macro(ActivePlaneColor, double);
00100   vtkGetVector3Macro(ActivePlaneColor, double);
00102 
00103 protected:
00104   vtkVolumeOutlineSource();
00105   ~vtkVolumeOutlineSource();
00106 
00107   vtkVolumeMapper *VolumeMapper;
00108   int GenerateScalars;
00109   int GenerateOutline;
00110   int GenerateFaces;
00111   int ActivePlaneId;
00112   double Color[3];
00113   double ActivePlaneColor[3];
00114 
00115   int Cropping;
00116   int CroppingRegionFlags;
00117   double Bounds[6];
00118   double CroppingRegionPlanes[6];
00119 
00120   static int ComputeCubePlanes(double planes[3][4],
00121                                double croppingPlanes[6],
00122                                double bounds[6]);
00123 
00124   static void GeneratePolys(vtkCellArray *polys,
00125                             vtkUnsignedCharArray *scalars,
00126                             unsigned char colors[2][3],
00127                             int activePlane,
00128                             int flags,
00129                             int tolPtId[3][4]);
00130 
00131   static void GenerateLines(vtkCellArray *lines,
00132                             vtkUnsignedCharArray *scalars,
00133                             unsigned char colors[2][3],
00134                             int activePlane,
00135                             int flags,
00136                             int tolPtId[3][4]);
00137 
00138   static void GeneratePoints(vtkPoints *points,
00139                              vtkCellArray *lines,
00140                              vtkCellArray *polys,
00141                              double planes[3][4],
00142                              double tol);
00143 
00144   static void NudgeCropPlanesToBounds(int tolPtId[3][4],
00145                                       double planes[3][4],
00146                                       double tol);
00147 
00148   static void CreateColorValues(unsigned char colors[2][3],
00149                                 double color1[3], double color2[3]);
00150 
00151   virtual int ComputePipelineMTime(vtkInformation* request,
00152                                    vtkInformationVector** inputVector,
00153                                    vtkInformationVector* outputVector,
00154                                    int requestFromOutputPort,
00155                                    unsigned long* mtime);
00156 
00157   virtual int RequestInformation(vtkInformation* request,
00158                                  vtkInformationVector** inputVector,
00159                                  vtkInformationVector* outputVector);
00160 
00161   virtual int RequestData(vtkInformation* request,
00162                           vtkInformationVector** inputVector,
00163                           vtkInformationVector* outputVector);
00164 
00165 private:
00166   vtkVolumeOutlineSource(const vtkVolumeOutlineSource&);  // Not implemented.
00167   void operator=(const vtkVolumeOutlineSource&);  // Not implemented.
00168 };
00169 
00170 #endif