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
00048 class vtkTree;
00049 class vtkPoints;
00050 class vtkCoordinate;
00051 class vtkFloatArray;
00052 class vtkStringArray;
00053 class vtkIdList;
00054
00055 class VTK_RENDERING_EXPORT vtkLabeledTreeMapDataMapper : public vtkLabeledDataMapper
00056 {
00057 public:
00058 static vtkLabeledTreeMapDataMapper *New();
00059 vtkTypeMacro(vtkLabeledTreeMapDataMapper,vtkLabeledDataMapper);
00060 void PrintSelf(ostream& os, vtkIndent indent);
00061
00063
00064 virtual void RenderOpaqueGeometry(vtkViewport* viewport, vtkActor2D* actor);
00065 virtual void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor);
00067
00069 virtual vtkTree *GetInputTree();
00070
00072 virtual void SetRectanglesArrayName(const char* name);
00073
00075
00078 vtkGetMacro(ClipTextMode, int);
00079 vtkSetMacro(ClipTextMode, int);
00081
00083
00084 vtkGetMacro(ChildMotion, int);
00085 vtkSetMacro(ChildMotion, int);
00087
00089
00090 vtkGetMacro(DynamicLevel, int);
00091 vtkSetMacro(DynamicLevel, int);
00093
00095 virtual void ReleaseGraphicsResources(vtkWindow *);
00096
00098
00099 void SetFontSizeRange(int maxSize, int minSize, int delta=4);
00100 void GetFontSizeRange(int range[3]);
00102
00104
00106 void SetLevelRange(int startLevel, int endLevel);
00107 void GetLevelRange(int range[2]);
00109
00110 protected:
00111 vtkLabeledTreeMapDataMapper();
00112 ~vtkLabeledTreeMapDataMapper();
00113 void LabelTree(vtkTree *tree, vtkFloatArray *boxInfo,
00114 vtkDataArray *numericData, vtkStringArray *stringData,
00115 int activeComp, int numComps);
00116 void GetVertexLabel(vtkIdType vertex, vtkDataArray *numericData,
00117 vtkStringArray *stringData, int activeComp, int numComps,
00118 char *string);
00119 void UpdateFontSizes();
00120 int UpdateWindowInfo(vtkViewport *viewport);
00121 int GetStringSize(char *string, int level);
00122
00123 int ConvertToDC(float *origBoxInfo, float *newBoxInfo);
00124
00125
00126 int AnalyseLabel(char * string, int level, float *blimitsDC,
00127 float *textPosWC,
00128 vtkTextProperty **tprop);
00129 int ApplyMasks(int level, float flimits[4], float blimits[4]);
00130 vtkViewport *CurrentViewPort;
00131 int *FontHeights;
00132 int **FontWidths;
00133 int MaxFontLevel;
00134 int *ChildrenCount;
00135 int MaxTreeLevels;
00136 double BoxTrans[2][2];
00137 double WindowLimits[2][2];
00138
00139 float (*LabelMasks)[4];
00140
00141 vtkIdList *VertexList;
00142 vtkPoints *TextPoints;
00143 vtkCoordinate *VCoord;
00144 int ClipTextMode;
00145 int ChildMotion;
00146 int StartLevel;
00147 int EndLevel;
00148 int DynamicLevel;
00149 vtkTextProperty *VerticalLabelProperty;
00150 vtkTextProperty **HLabelProperties;
00151
00152 private:
00153 vtkLabeledTreeMapDataMapper(const vtkLabeledTreeMapDataMapper&);
00154 void operator=(const vtkLabeledTreeMapDataMapper&);
00155 };
00156
00157
00158 #endif