00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkProjectedTetrahedraMapper.h,v $ 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 =========================================================================*/ 00015 00016 /* 00017 * Copyright 2003 Sandia Corporation. 00018 * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00019 * license for use of this work by or on behalf of the 00020 * U.S. Government. Redistribution and use in source and binary forms, with 00021 * or without modification, are permitted provided that this Notice and any 00022 * statement of authorship are reproduced on all copies. 00023 */ 00024 00044 #ifndef __vtkProjectedTetrahedraMapper_h 00045 #define __vtkProjectedTetrahedraMapper_h 00046 00047 #include "vtkUnstructuredGridVolumeMapper.h" 00048 00049 class vtkVisibilitySort; 00050 class vtkUnsignedCharArray; 00051 class vtkFloatArray; 00052 00053 class VTK_VOLUMERENDERING_EXPORT vtkProjectedTetrahedraMapper : public vtkUnstructuredGridVolumeMapper 00054 { 00055 public: 00056 vtkTypeRevisionMacro(vtkProjectedTetrahedraMapper, 00057 vtkUnstructuredGridVolumeMapper); 00058 static vtkProjectedTetrahedraMapper *New(); 00059 virtual void PrintSelf(ostream &os, vtkIndent indent); 00060 00061 virtual void SetVisibilitySort(vtkVisibilitySort *sort); 00062 vtkGetObjectMacro(VisibilitySort, vtkVisibilitySort); 00063 00065 00075 vtkSetMacro(ScalarMode,int); 00076 vtkGetMacro(ScalarMode,int); 00077 void SetScalarModeToDefault() { 00078 this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT);}; 00079 void SetScalarModeToUsePointData() { 00080 this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_DATA);}; 00081 void SetScalarModeToUseCellData() { 00082 this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_DATA);}; 00083 void SetScalarModeToUsePointFieldData() { 00084 this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);}; 00085 void SetScalarModeToUseCellFieldData() { 00086 this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA);}; 00088 00090 00094 virtual void SelectScalarArray(int arrayNum); 00095 virtual void SelectScalarArray(const char* arrayName); 00097 00099 00100 virtual char* GetArrayName() { return this->ArrayName; } 00101 virtual int GetArrayId() { return this->ArrayId; } 00102 virtual int GetArrayAccessMode() { return this->ArrayAccessMode; } 00104 00106 const char *GetScalarModeAsString(); 00107 00108 virtual void Render(vtkRenderer *renderer, vtkVolume *volume); 00109 00110 virtual void ReleaseGraphicsResources(vtkWindow *window); 00111 00112 static void MapScalarsToColors(vtkDataArray *colors, vtkVolume *volume, 00113 vtkDataArray *scalars); 00114 00115 protected: 00116 vtkProjectedTetrahedraMapper(); 00117 ~vtkProjectedTetrahedraMapper(); 00118 00119 vtkUnsignedCharArray *Colors; 00120 int UsingCellColors; 00121 00122 vtkFloatArray *TransformedPoints; 00123 00124 float MaxCellSize; 00125 vtkTimeStamp InputAnalyzedTime; 00126 vtkTimeStamp OpacityTextureTime; 00127 vtkTimeStamp ColorsMappedTime; 00128 00129 unsigned int OpacityTexture; 00130 00131 vtkVisibilitySort *VisibilitySort; 00132 00133 int ScalarMode; 00134 char *ArrayName; 00135 int ArrayId; 00136 int ArrayAccessMode; 00137 00138 int GaveError; 00139 00140 vtkVolume *LastVolume; 00141 00142 virtual void ProjectTetrahedra(vtkRenderer *renderer, vtkVolume *volume); 00143 00146 virtual void ReportReferences(vtkGarbageCollector *collector); 00147 00148 private: 00149 vtkProjectedTetrahedraMapper(const vtkProjectedTetrahedraMapper &); // Not Implemented. 00150 void operator=(const vtkProjectedTetrahedraMapper &); // Not Implemented. 00151 }; 00152 00153 #endif //__vtkProjectedTetrahedraMapper_h