VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkLabelPlacer.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 =========================================================================*/ 00015 /*------------------------------------------------------------------------- 00016 Copyright 2008 Sandia Corporation. 00017 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00018 the U.S. Government retains certain rights in this software. 00019 -------------------------------------------------------------------------*/ 00044 #ifndef vtkLabelPlacer_h 00045 #define vtkLabelPlacer_h 00046 00047 #include "vtkRenderingLabelModule.h" // For export macro 00048 #include "vtkPolyDataAlgorithm.h" 00049 00050 class vtkRenderer; 00051 class vtkCoordinate; 00052 class vtkSelectVisiblePoints; 00053 00054 class VTKRENDERINGLABEL_EXPORT vtkLabelPlacer : public vtkPolyDataAlgorithm 00055 { 00056 public: 00057 static vtkLabelPlacer* New(); 00058 vtkTypeMacro(vtkLabelPlacer,vtkPolyDataAlgorithm); 00059 virtual void PrintSelf( ostream& os, vtkIndent indent ); 00060 00061 vtkGetObjectMacro(Renderer,vtkRenderer); 00062 virtual void SetRenderer( vtkRenderer* ); 00063 00064 vtkGetObjectMacro(AnchorTransform,vtkCoordinate); 00065 00066 //BTX 00068 enum LabelGravity 00069 { 00070 VerticalBottomBit = 1, 00071 VerticalBaselineBit = 2, 00072 VerticalCenterBit = 4, 00073 VerticalTopBit = 8, 00074 HorizontalLeftBit = 16, 00075 HorizontalCenterBit = 32, 00076 HorizontalRightBit = 64, 00077 VerticalBitMask = 15, 00078 HorizontalBitMask = 112, 00079 00080 LowerLeft=17, 00081 LowerCenter=33, 00082 LowerRight=65, 00083 00084 BaselineLeft=18, 00085 BaselineCenter=34, 00086 BaselineRight=66, 00087 00088 CenterLeft=20, 00089 CenterCenter=36, 00090 CenterRight=68, 00091 00092 UpperLeft=24, 00093 UpperCenter=40, 00094 UpperRight=72 00095 }; 00096 00098 enum OutputCoordinates 00099 { 00100 WORLD=0, 00101 DISPLAY=1 00102 }; 00103 //ETX 00104 00106 00107 virtual void SetGravity( int gravity ); 00108 vtkGetMacro(Gravity,int); 00110 00112 00114 vtkSetClampMacro(MaximumLabelFraction,double,0.,1.); 00115 vtkGetMacro(MaximumLabelFraction,double); 00117 00119 00121 vtkSetMacro(IteratorType,int); 00122 vtkGetMacro(IteratorType,int); 00124 00126 00127 vtkSetMacro(UseUnicodeStrings,bool); 00128 vtkGetMacro(UseUnicodeStrings,bool); 00129 vtkBooleanMacro(UseUnicodeStrings,bool); 00131 00132 virtual unsigned long GetMTime(); 00133 00135 00139 vtkGetMacro(PositionsAsNormals,bool); 00140 vtkSetMacro(PositionsAsNormals,bool); 00141 vtkBooleanMacro(PositionsAsNormals,bool); 00143 00145 00147 vtkGetMacro(GeneratePerturbedLabelSpokes,bool); 00148 vtkSetMacro(GeneratePerturbedLabelSpokes,bool); 00149 vtkBooleanMacro(GeneratePerturbedLabelSpokes,bool); 00151 00153 00156 vtkGetMacro(UseDepthBuffer,bool); 00157 vtkSetMacro(UseDepthBuffer,bool); 00158 vtkBooleanMacro(UseDepthBuffer,bool); 00160 00162 00164 vtkGetMacro(OutputTraversedBounds,bool); 00165 vtkSetMacro(OutputTraversedBounds,bool); 00166 vtkBooleanMacro(OutputTraversedBounds,bool); 00168 00170 00173 vtkGetMacro(OutputCoordinateSystem,int); 00174 vtkSetClampMacro(OutputCoordinateSystem,int,WORLD,DISPLAY); 00175 void OutputCoordinateSystemWorld() { this->SetOutputCoordinateSystem( vtkLabelPlacer::WORLD ); } 00176 void OutputCoordinateSystemDisplay() { this->SetOutputCoordinateSystem( vtkLabelPlacer::DISPLAY ); } 00178 00179 protected: 00180 vtkLabelPlacer(); 00181 virtual ~vtkLabelPlacer(); 00182 00183 virtual void SetAnchorTransform( vtkCoordinate* ); 00184 00185 int FillInputPortInformation( int port, vtkInformation* info ); 00186 virtual int RequestData( vtkInformation* request, 00187 vtkInformationVector** inputVector, vtkInformationVector* outputVector ); 00188 00189 //BTX 00190 class Internal; 00191 Internal* Buckets; 00192 //ETX 00193 00194 vtkRenderer* Renderer; 00195 vtkCoordinate* AnchorTransform; 00196 vtkSelectVisiblePoints* VisiblePoints; 00197 int Gravity; 00198 double MaximumLabelFraction; 00199 bool PositionsAsNormals; 00200 bool OutputTraversedBounds; 00201 bool GeneratePerturbedLabelSpokes; 00202 bool UseDepthBuffer; 00203 bool UseUnicodeStrings; 00204 00205 int LastRendererSize[2]; 00206 double LastCameraPosition[3]; 00207 double LastCameraFocalPoint[3]; 00208 double LastCameraViewUp[3]; 00209 double LastCameraParallelScale; 00210 int IteratorType; 00211 int OutputCoordinateSystem; 00212 00213 private: 00214 vtkLabelPlacer( const vtkLabelPlacer& ); // Not implemented. 00215 void operator = ( const vtkLabelPlacer& ); // Not implemented. 00216 }; 00217 00218 #endif // vtkLabelPlacer_h