VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Rendering/OpenGL2/vtkCompositePolyDataMapper2.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkCompositePolyDataMapper2.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 =========================================================================*/
00028 #ifndef vtkCompositePolyDataMapper2_h
00029 #define vtkCompositePolyDataMapper2_h
00030 
00031 #include "vtkRenderingOpenGL2Module.h" // For export macro
00032 #include "vtkGenericCompositePolyDataMapper2.h"
00033 
00034 class vtkCompositePolyDataMapper2Internal;
00035 
00036 class VTKRENDERINGOPENGL2_EXPORT vtkCompositePolyDataMapper2 : public vtkGenericCompositePolyDataMapper2
00037 {
00038 public:
00039   static vtkCompositePolyDataMapper2* New();
00040   vtkTypeMacro(vtkCompositePolyDataMapper2, vtkGenericCompositePolyDataMapper2);
00041   void PrintSelf(ostream& os, vtkIndent indent);
00042 
00044   virtual void Render(vtkRenderer *ren, vtkActor *act);
00045 
00046   virtual void RenderPiece(vtkRenderer *ren, vtkActor *act);
00047   virtual void RenderPieceDraw(vtkRenderer *ren, vtkActor *act);
00048   virtual void RenderEdges(vtkRenderer *ren, vtkActor *act);
00049 
00050 protected:
00051   vtkCompositePolyDataMapper2();
00052   ~vtkCompositePolyDataMapper2();
00053 
00055 
00056   virtual void BuildBufferObjects(vtkRenderer *ren, vtkActor *act);
00057   virtual void AppendOneBufferObject(vtkRenderer *ren,
00058     vtkActor *act, vtkPolyData *pd, unsigned int flat_index);
00060 
00061   std::vector<unsigned int> VertexOffsets;
00062   std::vector<unsigned int> IndexOffsets;
00063   std::vector<unsigned int> IndexArray;
00064   std::vector<unsigned int> EdgeIndexArray;
00065   std::vector<unsigned int> EdgeIndexOffsets;
00066   unsigned int MaximumFlatIndex;
00067 
00068   class RenderValue
00069     {
00070     public:
00071       unsigned int StartVertex;
00072       unsigned int StartIndex;
00073       unsigned int StartEdgeIndex;
00074       unsigned int EndVertex;
00075       unsigned int EndIndex;
00076       unsigned int EndEdgeIndex;
00077       double Opacity;
00078       bool Visibility;
00079       vtkColor3d Color;
00080       unsigned int PickId;
00081     };
00082 
00083   std::vector<RenderValue> RenderValues;
00084   vtkTimeStamp RenderValuesBuildTime;
00085 
00086   bool UseGeneric;  // use the generic render
00087   vtkTimeStamp GenericTestTime;
00088 
00089   // free up memory
00090   void FreeStructures();
00091 
00092   void BuildRenderValues(vtkRenderer *renderer,
00093     vtkActor *actor,
00094     vtkDataObject *dobj,
00095     unsigned int &flat_index,
00096     unsigned int &lastVertex,
00097     unsigned int &lastIndex,
00098     unsigned int &lastEdgeIndex);
00099 
00100 private:
00101   vtkCompositePolyDataMapper2(
00102     const vtkCompositePolyDataMapper2&); // Not implemented.
00103   void operator=(const vtkCompositePolyDataMapper2&); // Not implemented.
00104 };
00105 
00106 #endif