00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00043 #ifndef __vtkLabeledTreeMapDataMapper_h
00044 #define __vtkLabeledTreeMapDataMapper_h
00045
00046 #include <vtkLabeledDataMapper.h>
00047 class vtkTree;
00048 class vtkPoints;
00049 class vtkCoordinate;
00050 class vtkFloatArray;
00051 class vtkStringArray;
00052 class vtkIdList;
00053
00054 class VTK_INFOVIS_EXPORT vtkLabeledTreeMapDataMapper : public vtkLabeledDataMapper
00055 {
00056 public:
00059 static vtkLabeledTreeMapDataMapper *New();
00060
00061 vtkTypeRevisionMacro(vtkLabeledTreeMapDataMapper,vtkLabeledDataMapper);
00062 void PrintSelf(ostream& os, vtkIndent indent);
00063
00065
00066 virtual void RenderOpaqueGeometry(vtkViewport* viewport, vtkActor2D* actor);
00067 virtual void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor);
00069
00071 virtual vtkTree *GetInputTree();
00072
00074
00075 vtkGetStringMacro(RectanglesFieldName);
00076 vtkSetStringMacro(RectanglesFieldName);
00078
00080
00083 vtkGetMacro(ClipTextMode, int);
00084 vtkSetMacro(ClipTextMode, int);
00086
00088
00089 vtkGetMacro(ChildMotion, int);
00090 vtkSetMacro(ChildMotion, int);
00092
00094
00095 vtkGetMacro(DynamicLevel, int);
00096 vtkSetMacro(DynamicLevel, int);
00098
00100 virtual void ReleaseGraphicsResources(vtkWindow *);
00101
00103
00104 void SetFontSizeRange(int maxSize, int minSize, int delta=4);
00105 void GetFontSizeRange(int range[3]);
00107
00109
00111 void SetLevelRange(int startLevel, int endLevel);
00112 void GetLevelRange(int range[2]);
00114
00115 protected:
00116 vtkLabeledTreeMapDataMapper();
00117 ~vtkLabeledTreeMapDataMapper();
00118 void LabelTree(vtkTree *tree, vtkFloatArray *boxInfo,
00119 vtkDataArray *numericData, vtkStringArray *stringData,
00120 int activeComp, int numComps);
00121 void GetVertexLabel(vtkIdType vertex, vtkDataArray *numericData,
00122 vtkStringArray *stringData, int activeComp, int numComps,
00123 char *string);
00124 void UpdateFontSizes();
00125 int UpdateWindowInfo(vtkViewport *viewport);
00126 int GetStringSize(char *string, int level);
00127
00128 int ConvertToDC(float *origBoxInfo, float *newBoxInfo);
00129
00130
00131 int AnalyseLabel(char * string, int level, float *blimitsDC,
00132 float *textPosWC,
00133 vtkTextProperty **tprop);
00134 int ApplyMasks(int level, float flimits[4], float blimits[4]);
00135 char * RectanglesFieldName;
00136 vtkViewport *CurrentViewPort;
00137 int *FontHeights;
00138 int **FontWidths;
00139 int MaxFontLevel;
00140 int *ChildrenCount;
00141 int MaxTreeLevels;
00142 double BoxTrans[2][2];
00143 double WindowLimits[2][2];
00144
00145 float (*LabelMasks)[4];
00146
00147 vtkIdList *VertexList;
00148 vtkPoints *TextPoints;
00149 vtkCoordinate *VCoord;
00150 int ClipTextMode;
00151 int ChildMotion;
00152 int StartLevel;
00153 int EndLevel;
00154 int DynamicLevel;
00155 vtkTextProperty *VerticalLabelProperty;
00156 vtkTextProperty **HLabelProperties;
00157
00158 private:
00159 vtkLabeledTreeMapDataMapper(const vtkLabeledTreeMapDataMapper&);
00160 void operator=(const vtkLabeledTreeMapDataMapper&);
00161 };
00162
00163
00164 #endif