VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkCompositePainter.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 =========================================================================*/ 00024 #ifndef __vtkCompositePainter_h 00025 #define __vtkCompositePainter_h 00026 00027 #include "vtkRenderingCoreModule.h" // For export macro 00028 #include "vtkPainter.h" 00029 #include "vtkColor.h" // needed for vtkColor3d 00030 #include <stack> // needed for RenderBlockState. 00031 00032 class vtkCompositeDataDisplayAttributes; 00033 class vtkInformationObjectBaseKey; 00034 class vtkProperty; 00035 class vtkRenderWindow; 00036 00037 class VTKRENDERINGCORE_EXPORT vtkCompositePainter : public vtkPainter 00038 { 00039 public: 00040 static vtkCompositePainter* New(); 00041 vtkTypeMacro(vtkCompositePainter, vtkPainter); 00042 void PrintSelf(ostream& os, vtkIndent indent); 00043 00046 virtual vtkDataObject* GetOutput(); 00047 00050 static vtkInformationObjectBaseKey* DISPLAY_ATTRIBUTES(); 00051 00053 00056 void SetCompositeDataDisplayAttributes(vtkCompositeDataDisplayAttributes *attributes); 00057 vtkGetObjectMacro(CompositeDataDisplayAttributes, vtkCompositeDataDisplayAttributes) 00059 00060 //BTX 00061 protected: 00062 vtkCompositePainter(); 00063 ~vtkCompositePainter(); 00064 00066 virtual void ReportReferences(vtkGarbageCollector *collector); 00067 00070 virtual void ProcessInformation(vtkInformation* information); 00071 00073 00078 virtual void RenderInternal(vtkRenderer* renderer, vtkActor* actor, 00079 unsigned long typeflags, bool forceCompileOnly); 00081 00082 class RenderBlockState 00083 { 00084 public: 00085 std::stack<bool> Visibility; 00086 std::stack<double> Opacity; 00087 std::stack<vtkColor3d> AmbientColor; 00088 std::stack<vtkColor3d> DiffuseColor; 00089 std::stack<vtkColor3d> SpecularColor; 00090 00091 double RenderedOpacity; 00092 vtkColor3d RenderedAmbientColor; 00093 vtkColor3d RenderedDiffuseColor; 00094 vtkColor3d RenderedSpecularColor; 00095 }; 00096 00097 void RenderBlock(vtkRenderer *renderer, 00098 vtkActor *actor, 00099 unsigned long typeflags, 00100 bool forceCompileOnly, 00101 vtkDataObject *dobj, 00102 unsigned int &flat_index, 00103 RenderBlockState &state); 00104 00106 00107 virtual void UpdateRenderingState( 00108 vtkRenderWindow*, vtkProperty*, RenderBlockState&) {} 00110 00111 vtkDataObject* OutputData; 00112 vtkCompositeDataDisplayAttributes *CompositeDataDisplayAttributes; 00113 private: 00114 vtkCompositePainter(const vtkCompositePainter&); // Not implemented. 00115 void operator=(const vtkCompositePainter&); // Not implemented. 00116 //ETX 00117 }; 00118 00119 #endif 00120 00121