------------------------------------------------------------------------------
| 785 | |
| 786 | //------------------------------------------------------------------------------ |
| 787 | bool vtkLabeledContourMapper::CreateLabels(vtkActor*) |
| 788 | { |
| 789 | typedef std::vector<LabelMetric> MetricVector; |
| 790 | typedef std::vector<LabelInfo> InfoVector; |
| 791 | |
| 792 | std::vector<InfoVector>::const_iterator outerLabels = this->Internal->LabelInfos.begin(); |
| 793 | std::vector<InfoVector>::const_iterator outerLabelsEnd = this->Internal->LabelInfos.end(); |
| 794 | |
| 795 | // count the number of labels: |
| 796 | vtkIdType numLabels = 0; |
| 797 | while (outerLabels != outerLabelsEnd) |
| 798 | { |
| 799 | numLabels += static_cast<vtkIdType>((outerLabels++)->size()); |
| 800 | } |
| 801 | |
| 802 | if (!this->AllocateTextActors(numLabels)) |
| 803 | { |
| 804 | vtkErrorMacro(<< "Error while allocating text actors."); |
| 805 | return false; |
| 806 | } |
| 807 | |
| 808 | outerLabels = this->Internal->LabelInfos.begin(); |
| 809 | MetricVector::const_iterator metrics = this->Internal->LabelMetrics.begin(); |
| 810 | MetricVector::const_iterator metricsEnd = this->Internal->LabelMetrics.end(); |
| 811 | vtkTextActor3D** actor = this->TextActors; |
| 812 | vtkTextActor3D** actorEnd = this->TextActors + this->NumberOfUsedTextActors; |
| 813 | |
| 814 | while (metrics != metricsEnd && outerLabels != outerLabelsEnd && actor != actorEnd) |
| 815 | { |
| 816 | for (InfoVector::const_iterator label = outerLabels->begin(), labelEnd = outerLabels->end(); |
| 817 | label != labelEnd; ++label) |
| 818 | { |
| 819 | this->Internal->BuildLabel(*actor, *metrics, *label); |
| 820 | ++actor; |
| 821 | } |
| 822 | ++metrics; |
| 823 | ++outerLabels; |
| 824 | } |
| 825 | |
| 826 | return true; |
| 827 | } |
| 828 | |
| 829 | //------------------------------------------------------------------------------ |
| 830 | bool vtkLabeledContourMapper::ApplyStencil(vtkRenderer*, vtkActor*) |
no test coverage detected