VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkLabeledContourMapper.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 =========================================================================*/ 00031 #ifndef __vtkLabeledContourMapper_h 00032 #define __vtkLabeledContourMapper_h 00033 00034 #include "vtkRenderingCoreModule.h" // For export macro 00035 00036 #include "vtkMapper.h" 00037 #include "vtkNew.h" // For vtkNew 00038 #include "vtkSmartPointer.h" // For vtkSmartPointer 00039 00040 class vtkTextActor3D; 00041 class vtkTextProperty; 00042 class vtkTextPropertyCollection; 00043 class vtkPolyData; 00044 class vtkPolyDataMapper; 00045 00046 class VTKRENDERINGCORE_EXPORT vtkLabeledContourMapper : public vtkMapper 00047 { 00048 public: 00049 static vtkLabeledContourMapper *New(); 00050 vtkTypeMacro(vtkLabeledContourMapper, vtkMapper) 00051 void PrintSelf(ostream& os, vtkIndent indent); 00052 00053 virtual void Render(vtkRenderer *ren, vtkActor *act); 00054 00056 00057 void SetInputData(vtkPolyData *in); 00058 vtkPolyData *GetInput(); 00060 00062 00064 virtual double *GetBounds(); 00065 virtual void GetBounds(double bounds[6]); 00067 00073 virtual void SetTextProperty(vtkTextProperty *tprop); 00074 00076 00084 virtual void SetTextProperties(vtkTextPropertyCollection *coll); 00085 virtual vtkTextPropertyCollection *GetTextProperties(); 00087 00089 00092 vtkSetMacro(LabelVisibility, bool) 00093 vtkGetMacro(LabelVisibility, bool) 00094 vtkBooleanMacro(LabelVisibility, bool) 00096 00098 00099 vtkGetNewMacro(PolyDataMapper, vtkPolyDataMapper) 00101 00102 protected: 00103 vtkLabeledContourMapper(); 00104 ~vtkLabeledContourMapper(); 00105 00106 virtual void ComputeBounds(); 00107 00108 virtual int FillInputPortInformation(int, vtkInformation*); 00109 00110 void Reset(); 00111 00112 bool CheckInputs(vtkRenderer *ren); 00113 bool CheckRebuild(vtkRenderer *ren, vtkActor *act); 00114 bool PrepareRender(vtkRenderer *ren, vtkActor *act); 00115 bool PlaceLabels(); 00116 bool ResolveLabels(); 00117 bool CreateLabels(); 00118 bool BuildStencilQuads(); 00119 virtual bool ApplyStencil(vtkRenderer *ren, vtkActor *act); 00120 bool RenderPolyData(vtkRenderer *ren, vtkActor *act); 00121 virtual bool RemoveStencil(); 00122 bool RenderLabels(vtkRenderer *ren, vtkActor *act); 00123 00124 bool AllocateTextActors(vtkIdType num); 00125 bool FreeTextActors(); 00126 00127 vtkTextProperty* GetTextPropertyForCellId(vtkIdType cellId) const; 00128 00129 bool LabelVisibility; 00130 vtkIdType NumberOfTextActors; 00131 vtkIdType NumberOfUsedTextActors; 00132 vtkTextActor3D **TextActors; 00133 00134 vtkNew<vtkPolyDataMapper> PolyDataMapper; 00135 vtkSmartPointer<vtkTextPropertyCollection> TextProperties; 00136 00137 float *StencilQuads; 00138 vtkIdType StencilQuadsSize; 00139 unsigned int *StencilQuadIndices; 00140 vtkIdType StencilQuadIndicesSize; 00141 void FreeStencilQuads(); 00142 00143 vtkTimeStamp BuildTime; 00144 00145 private: 00146 vtkLabeledContourMapper(const vtkLabeledContourMapper&); // Not implemented. 00147 void operator=(const vtkLabeledContourMapper&); // Not implemented. 00148 00149 struct Private; 00150 Private *Internal; 00151 }; 00152 00153 #endif