+ //Let's add the captions
+ //First remove all captions:
+ for(unsigned int i=0;i<mLandLabelActors.size();i++) {
+ this->Renderer->RemoveActor2D(mLandLabelActors[i]);
+ //allActors2D->Remove (mLandLabelActors[i]);
+ }
+ mLandLabelActors.clear();
+ //Next add the captions to the displayed points
+ for (vtkIdType id=0; id<mLandClipper->GetOutput()->GetNumberOfPoints(); id++) {
+ double *position = mLandClipper->GetOutput()->GetPoint(id);
+ vtkStdString label = static_cast<vtkStringArray*>(mLandClipper->GetOutput()->GetPointData()->GetAbstractArray("labels"))->GetValue(id);
+ vtkSmartPointer<vtkCaptionActor2D> label_actor = vtkSmartPointer<vtkCaptionActor2D>::New();
+ label_actor->SetCaption(label);
+ label_actor->SetAttachmentPoint(position);
+ label_actor->GetCaptionTextProperty()->SetColor(1,0,0);
+ label_actor->GetCaptionTextProperty()->SetOrientation(33.333333);
+ label_actor->GetCaptionTextProperty()->SetFontFamilyToTimes();
+ label_actor->GetCaptionTextProperty()->SetBold(0);
+ label_actor->GetCaptionTextProperty()->SetFontSize(6);
+ label_actor->BorderOff();
+ label_actor->LeaderOff();
+ label_actor->ThreeDimensionalLeaderOff();
+ mLandLabelActors.push_back(label_actor);
+ this->Renderer->AddActor2D(mLandLabelActors[id]);
+ }