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 "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 00067 vtkSetMacro(GenerateFaces, int); 00068 vtkBooleanMacro(GenerateFaces, int); 00069 vtkGetMacro(GenerateFaces, int); 00071 00073 00075 vtkSetVector3Macro(Color, double); 00076 vtkGetVector3Macro(Color, double); 00078 00080 00083 vtkSetMacro(ActivePlaneId, int); 00084 vtkGetMacro(ActivePlaneId, int); 00086 00088 00091 vtkSetVector3Macro(ActivePlaneColor, double); 00092 vtkGetVector3Macro(ActivePlaneColor, double); 00094 00095 protected: 00096 vtkVolumeOutlineSource(); 00097 ~vtkVolumeOutlineSource(); 00098 00099 vtkVolumeMapper *VolumeMapper; 00100 int GenerateScalars; 00101 int GenerateFaces; 00102 int ActivePlaneId; 00103 double Color[3]; 00104 double ActivePlaneColor[3]; 00105 00106 int Cropping; 00107 int CroppingRegionFlags; 00108 double Bounds[6]; 00109 double CroppingRegionPlanes[6]; 00110 00111 static int ComputeCubePlanes(double planes[3][4], 00112 double croppingPlanes[6], 00113 double bounds[6]); 00114 00115 static void GeneratePolys(vtkCellArray *polys, 00116 vtkUnsignedCharArray *scalars, 00117 unsigned char colors[2][3], 00118 int activePlane, 00119 int flags, 00120 int tolPtId[3][4]); 00121 00122 static void GenerateLines(vtkCellArray *lines, 00123 vtkUnsignedCharArray *scalars, 00124 unsigned char colors[2][3], 00125 int activePlane, 00126 int flags, 00127 int tolPtId[3][4]); 00128 00129 static void GeneratePoints(vtkPoints *points, 00130 vtkCellArray *lines, 00131 vtkCellArray *polys, 00132 double planes[3][4], 00133 double tol); 00134 00135 static void NudgeCropPlanesToBounds(int tolPtId[3][4], 00136 double planes[3][4], 00137 double tol); 00138 00139 static void CreateColorValues(unsigned char colors[2][3], 00140 double color1[3], double color2[3]); 00141 00142 virtual int ComputePipelineMTime(vtkInformation* request, 00143 vtkInformationVector** inputVector, 00144 vtkInformationVector* outputVector, 00145 int requestFromOutputPort, 00146 unsigned long* mtime); 00147 00148 virtual int RequestInformation(vtkInformation* request, 00149 vtkInformationVector** inputVector, 00150 vtkInformationVector* outputVector); 00151 00152 virtual int RequestData(vtkInformation* request, 00153 vtkInformationVector** inputVector, 00154 vtkInformationVector* outputVector); 00155 00156 private: 00157 vtkVolumeOutlineSource(const vtkVolumeOutlineSource&); // Not implemented. 00158 void operator=(const vtkVolumeOutlineSource&); // Not implemented. 00159 }; 00160 00161 #endif