| 26 | vtkStandardNewMacro(vtkLabeledTreeMapDataMapper); |
| 27 | |
| 28 | vtkLabeledTreeMapDataMapper::vtkLabeledTreeMapDataMapper() |
| 29 | : CurrentViewPort(nullptr) |
| 30 | , FontHeights(nullptr) |
| 31 | , FontWidths(nullptr) |
| 32 | , MaxFontLevel(0) |
| 33 | , MaxTreeLevels(100) |
| 34 | , ClipTextMode(0) |
| 35 | , ChildMotion(0) |
| 36 | , StartLevel(0) |
| 37 | , EndLevel(-1) |
| 38 | , DynamicLevel(0) |
| 39 | { |
| 40 | this->BoxTrans[0][0] = this->BoxTrans[1][0] = 0.0; |
| 41 | this->BoxTrans[0][1] = this->BoxTrans[1][1] = 1.0; |
| 42 | this->WindowLimits[0][0] = this->WindowLimits[1][0] = 0.0; |
| 43 | this->WindowLimits[0][1] = this->WindowLimits[1][1] = 1.0; |
| 44 | this->VCoord = vtkCoordinate::New(); |
| 45 | this->VertexList = vtkIdList::New(); |
| 46 | this->VertexList->SetNumberOfIds(this->NumberOfLabelsAllocated); |
| 47 | this->TextPoints = vtkPoints::New(); |
| 48 | this->TextPoints->Allocate(this->NumberOfLabelsAllocated); |
| 49 | this->VerticalLabelProperty = vtkTextProperty::New(); |
| 50 | this->VerticalLabelProperty->SetFontSize(12); |
| 51 | this->VerticalLabelProperty->SetBold(1); |
| 52 | this->VerticalLabelProperty->SetItalic(1); |
| 53 | this->VerticalLabelProperty->SetShadow(1); |
| 54 | this->VerticalLabelProperty->SetFontFamilyToArial(); |
| 55 | this->VerticalLabelProperty->SetJustificationToCentered(); |
| 56 | this->GetLabelTextProperty()->SetJustificationToCentered(); |
| 57 | this->VerticalLabelProperty->SetVerticalJustificationToCentered(); |
| 58 | this->GetLabelTextProperty()->SetVerticalJustificationToCentered(); |
| 59 | this->VerticalLabelProperty->SetOrientation(90.0); |
| 60 | this->VerticalLabelProperty->SetColor(1, 1, 1); |
| 61 | this->GetLabelTextProperty()->SetColor(1, 1, 1); |
| 62 | this->GetLabelTextProperty()->SetFontSize(12); |
| 63 | this->SetFontSizeRange(24, 10); |
| 64 | this->ChildrenCount = new int[this->MaxTreeLevels + 1]; |
| 65 | this->LabelMasks = new float[this->MaxTreeLevels + 1][4]; |
| 66 | this->SetRectanglesArrayName("area"); |
| 67 | this->SetLabelFormat("{:s}"); |
| 68 | |
| 69 | // Take control of the TextMappers array. |
| 70 | // The superclass just created new TextMapper instances |
| 71 | // up to the currently allocated amount (default 50). |
| 72 | // Instead, we will store nullptr values until we need them. |
| 73 | // This class will manage the maintenance and deletion of |
| 74 | // this array. |
| 75 | for (int i = 0; i < this->NumberOfLabelsAllocated; i++) |
| 76 | { |
| 77 | this->TextMappers[i]->Delete(); |
| 78 | this->TextMappers[i] = nullptr; |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | vtkLabeledTreeMapDataMapper::~vtkLabeledTreeMapDataMapper() |
| 83 | { |
nothing calls this directly
no test coverage detected