00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00037 #ifndef __vtkLabelPlacementMapper_h
00038 #define __vtkLabelPlacementMapper_h
00039
00040 #include "vtkMapper2D.h"
00041
00042 class vtkCoordinate;
00043 class vtkLabelRenderStrategy;
00044 class vtkSelectVisiblePoints;
00045
00046 class VTK_RENDERING_EXPORT vtkLabelPlacementMapper : public vtkMapper2D
00047 {
00048 public:
00049 static vtkLabelPlacementMapper *New();
00050 vtkTypeRevisionMacro(vtkLabelPlacementMapper, vtkMapper2D);
00051 void PrintSelf(ostream& os, vtkIndent indent);
00052
00054 void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor);
00055
00057
00058 virtual void SetRenderStrategy(vtkLabelRenderStrategy* s);
00059 vtkGetObjectMacro(RenderStrategy, vtkLabelRenderStrategy);
00061
00063
00065 vtkSetClampMacro(MaximumLabelFraction,double,0.,1.);
00066 vtkGetMacro(MaximumLabelFraction,double);
00068
00070
00072 vtkSetMacro(IteratorType,int);
00073 vtkGetMacro(IteratorType,int);
00075
00077
00078 vtkSetMacro(UseUnicodeStrings,bool);
00079 vtkGetMacro(UseUnicodeStrings,bool);
00080 vtkBooleanMacro(UseUnicodeStrings,bool);
00082
00084
00088 vtkGetMacro(PositionsAsNormals,bool);
00089 vtkSetMacro(PositionsAsNormals,bool);
00090 vtkBooleanMacro(PositionsAsNormals,bool);
00092
00094
00096 vtkGetMacro(GeneratePerturbedLabelSpokes,bool);
00097 vtkSetMacro(GeneratePerturbedLabelSpokes,bool);
00098 vtkBooleanMacro(GeneratePerturbedLabelSpokes,bool);
00100
00102
00105 vtkGetMacro(UseDepthBuffer,bool);
00106 vtkSetMacro(UseDepthBuffer,bool);
00107 vtkBooleanMacro(UseDepthBuffer,bool);
00109
00111
00113 vtkSetMacro(PlaceAllLabels, bool);
00114 vtkGetMacro(PlaceAllLabels, bool);
00115 vtkBooleanMacro(PlaceAllLabels, bool);
00117
00119
00120 vtkSetMacro(OutputTraversedBounds, bool);
00121 vtkGetMacro(OutputTraversedBounds, bool);
00122 vtkBooleanMacro(OutputTraversedBounds, bool);
00124
00125
00126 enum LabelShape {
00127 NONE,
00128 RECT,
00129 ROUNDED_RECT,
00130 NUMBER_OF_LABEL_SHAPES
00131 };
00132
00133
00135
00137 vtkSetClampMacro(Shape, int, 0, NUMBER_OF_LABEL_SHAPES-1);
00138 vtkGetMacro(Shape, int);
00139 virtual void SetShapeToNone()
00140 { this->SetShape(NONE); }
00141 virtual void SetShapeToRect()
00142 { this->SetShape(RECT); }
00143 virtual void SetShapeToRoundedRect()
00144 { this->SetShape(ROUNDED_RECT); }
00146
00147
00148 enum LabelStyle {
00149 FILLED,
00150 OUTLINE,
00151 NUMBER_OF_LABEL_STYLES
00152 };
00153
00154
00156
00158 vtkSetClampMacro(Style, int, 0, NUMBER_OF_LABEL_STYLES-1);
00159 vtkGetMacro(Style, int);
00160 virtual void SetStyleToFilled()
00161 { this->SetStyle(FILLED); }
00162 virtual void SetStyleToOutline()
00163 { this->SetStyle(OUTLINE); }
00165
00167
00168 vtkSetMacro(Margin, double);
00169 vtkGetMacro(Margin, double);
00171
00173
00174 vtkSetVector3Macro(BackgroundColor, double);
00175 vtkGetVector3Macro(BackgroundColor, double);
00177
00179
00180 vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
00181 vtkGetMacro(BackgroundOpacity, double);
00183
00185
00186 vtkGetObjectMacro(AnchorTransform,vtkCoordinate);
00188
00189 protected:
00190 vtkLabelPlacementMapper();
00191 ~vtkLabelPlacementMapper();
00192
00193 virtual void SetAnchorTransform( vtkCoordinate* );
00194
00195 virtual int FillInputPortInformation( int port, vtkInformation* info );
00196
00197
00198 class Internal;
00199 Internal* Buckets;
00200
00201
00202 vtkLabelRenderStrategy* RenderStrategy;
00203 vtkCoordinate* AnchorTransform;
00204 vtkSelectVisiblePoints* VisiblePoints;
00205 double MaximumLabelFraction;
00206 bool PositionsAsNormals;
00207 bool GeneratePerturbedLabelSpokes;
00208 bool UseDepthBuffer;
00209 bool UseUnicodeStrings;
00210 bool PlaceAllLabels;
00211 bool OutputTraversedBounds;
00212
00213 int LastRendererSize[2];
00214 double LastCameraPosition[3];
00215 double LastCameraFocalPoint[3];
00216 double LastCameraViewUp[3];
00217 double LastCameraParallelScale;
00218 int IteratorType;
00219
00220 int Style;
00221 int Shape;
00222 double Margin;
00223 double BackgroundOpacity;
00224 double BackgroundColor[3];
00225
00226 private:
00227 vtkLabelPlacementMapper(const vtkLabelPlacementMapper&);
00228 void operator=(const vtkLabelPlacementMapper&);
00229 };
00230
00231 #endif
00232