VTK
|
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 "vtkRenderingVolumeModule.h" // For export macro 00036 #include "vtkPolyDataAlgorithm.h" 00037 00038 class vtkVolumeMapper; 00039 00040 class VTKRENDERINGVOLUME_EXPORT vtkVolumeOutlineSource : public vtkPolyDataAlgorithm 00041 { 00042 public: 00043 static vtkVolumeOutlineSource *New(); 00044 vtkTypeMacro(vtkVolumeOutlineSource,vtkPolyDataAlgorithm); 00045 void PrintSelf(ostream& os, vtkIndent indent); 00046 00048 00051 virtual void SetVolumeMapper(vtkVolumeMapper *mapper); 00052 vtkVolumeMapper *GetVolumeMapper() { return this->VolumeMapper; }; 00054 00056 00059 vtkSetMacro(GenerateScalars, int); 00060 vtkBooleanMacro(GenerateScalars, int); 00061 vtkGetMacro(GenerateScalars, int); 00063 00065 00067 vtkSetMacro(GenerateOutline, int); 00068 vtkBooleanMacro(GenerateOutline, int); 00069 vtkGetMacro(GenerateOutline, int); 00071 00073 00076 vtkSetMacro(GenerateFaces, int); 00077 vtkBooleanMacro(GenerateFaces, int); 00078 vtkGetMacro(GenerateFaces, int); 00080 00082 00084 vtkSetVector3Macro(Color, double); 00085 vtkGetVector3Macro(Color, double); 00087 00089 00092 vtkSetMacro(ActivePlaneId, int); 00093 vtkGetMacro(ActivePlaneId, int); 00095 00097 00100 vtkSetVector3Macro(ActivePlaneColor, double); 00101 vtkGetVector3Macro(ActivePlaneColor, double); 00103 00104 protected: 00105 vtkVolumeOutlineSource(); 00106 ~vtkVolumeOutlineSource(); 00107 00108 vtkVolumeMapper *VolumeMapper; 00109 int GenerateScalars; 00110 int GenerateOutline; 00111 int GenerateFaces; 00112 int ActivePlaneId; 00113 double Color[3]; 00114 double ActivePlaneColor[3]; 00115 00116 int Cropping; 00117 int CroppingRegionFlags; 00118 double Bounds[6]; 00119 double CroppingRegionPlanes[6]; 00120 00121 static int ComputeCubePlanes(double planes[3][4], 00122 double croppingPlanes[6], 00123 double bounds[6]); 00124 00125 static void GeneratePolys(vtkCellArray *polys, 00126 vtkUnsignedCharArray *scalars, 00127 unsigned char colors[2][3], 00128 int activePlane, 00129 int flags, 00130 int tolPtId[3][4]); 00131 00132 static void GenerateLines(vtkCellArray *lines, 00133 vtkUnsignedCharArray *scalars, 00134 unsigned char colors[2][3], 00135 int activePlane, 00136 int flags, 00137 int tolPtId[3][4]); 00138 00139 static void GeneratePoints(vtkPoints *points, 00140 vtkCellArray *lines, 00141 vtkCellArray *polys, 00142 double planes[3][4], 00143 double tol); 00144 00145 static void NudgeCropPlanesToBounds(int tolPtId[3][4], 00146 double planes[3][4], 00147 double tol); 00148 00149 static void CreateColorValues(unsigned char colors[2][3], 00150 double color1[3], double color2[3]); 00151 00152 virtual int ComputePipelineMTime(vtkInformation* request, 00153 vtkInformationVector** inputVector, 00154 vtkInformationVector* outputVector, 00155 int requestFromOutputPort, 00156 unsigned long* mtime); 00157 00158 virtual int RequestInformation(vtkInformation* request, 00159 vtkInformationVector** inputVector, 00160 vtkInformationVector* outputVector); 00161 00162 virtual int RequestData(vtkInformation* request, 00163 vtkInformationVector** inputVector, 00164 vtkInformationVector* outputVector); 00165 00166 private: 00167 vtkVolumeOutlineSource(const vtkVolumeOutlineSource&); // Not implemented. 00168 void operator=(const vtkVolumeOutlineSource&); // Not implemented. 00169 }; 00170 00171 #endif