Commit b8068060 authored by Jeff Baumes's avatar Jeff Baumes

ENH: Revamp label placement

 - Adding new vtkLabelPlacementMapper to replace vtkLabelPlacer.

 - Making vtkLabelPlacementMapper the default in all rendered views.

 - Making label render strategies for freetype and Qt.

 - Fix memory leak in vtkQImageToImageSource.

 - vtkLabelPlacementMapper now supports multiple hierarchy inputs
   by using the new vtkLabelHierarchyCompositeIterator which uses
   round-robin to iterate through sub-iterators.
parent 3c4074c2
......@@ -77,7 +77,7 @@ int TestLabeledGeoView2D(int argc, char* argv[])
imageSource->Initialize();
imageRep->SetSource(imageSource);
view->AddRepresentation(imageRep);
view->SetLabelPlacementModeToLabelPlacer();
view->SetLabelPlacementModeToNoOverlap();
vtkSmartPointer<vtkGeoRandomGraphSource> graphSource =
vtkSmartPointer<vtkGeoRandomGraphSource>::New();
......
......@@ -95,7 +95,10 @@ SET( Kit_SRCS
vtkLabelHierarchy.cxx
vtkLabelHierarchyAlgorithm.cxx
vtkLabelHierarchyIterator.cxx
vtkLabelHierarchyCompositeIterator.cxx
vtkLabelPlacer.cxx
vtkLabelPlacementMapper.cxx
vtkLabelRenderStrategy.cxx
vtkLabelSizeCalculator.cxx
vtkLeaderActor2D.cxx
vtkLightActor.cxx
......@@ -263,6 +266,7 @@ SET_SOURCE_FILES_PROPERTIES(
vtkImageProcessingPass
vtkImporter
vtkInteractorObserver
vtkLabelRenderStrategy
vtkMapper
vtkOpenGLRenderWindow
vtkPainter
......@@ -291,7 +295,10 @@ SET_SOURCE_FILES_PROPERTIES(
# Freetype stuff
SET(KitOpenGL_SRCS ${KitOpenGL_SRCS} vtkOpenGLFreeTypeTextMapper.cxx)
SET(KitOpenGL_SRCS ${KitOpenGL_SRCS}
vtkFreeTypeLabelRenderStrategy.cxx
vtkOpenGLFreeTypeTextMapper.cxx
)
SET(Kit_SRCS ${Kit_SRCS} vtkFreeTypeUtilities.cxx )
SET_SOURCE_FILES_PROPERTIES(vtkFreeTypeUtilities WRAP_EXCLUDE)
......@@ -322,6 +329,7 @@ IF(VTK_USE_QT)
SET( Kit_SRCS ${Kit_SRCS}
vtkQImageToImageSource.cxx
vtkQtLabelMapper.cxx
vtkQtLabelRenderStrategy.cxx
vtkQtLabelSizeCalculator.cxx
vtkQtLabelSurface.cxx
vtkQtTreeRingLabelMapper.cxx
......
......@@ -29,6 +29,9 @@ IF(VTK_USE_DISPLAY)
TestLabelPlacer.cxx
TestLabelPlacer2D.cxx
TestLabelPlacerCoincidentPoints.cxx
TestLabelPlacementMapper.cxx
TestLabelPlacementMapper2D.cxx
TestLabelPlacementMapperCoincidentPoints.cxx
TestLightActor.cxx
TestLODActor.cxx
TestManyActors.cxx
......
/*=========================================================================
Program: Visualization Toolkit
Module: TestLabelPlacementMapper.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME Test of vtkLabelPlacementMapper
// .SECTION Description
// this program tests vtkLabelPlacementMapper which uses a sophisticated algorithm to
// prune labels/icons preventing them from overlapping.
#include "vtkActor.h"
#include "vtkActor2D.h"
#include "vtkLabeledDataMapper.h"
#include "vtkLabelHierarchy.h"
#include "vtkLabelPlacementMapper.h"
#include "vtkPointSetToLabelHierarchy.h"
#include "vtkPoints.h"
#include "vtkPolyData.h"
#include "vtkPolyDataMapper.h"
#include "vtkPolyDataMapper2D.h"
#include "vtkProperty.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkTextProperty.h"
#include "vtkXMLPolyDataReader.h"
#include "vtkXMLPolyDataWriter.h"
#include "vtkPolyData.h"
#include "vtkImageData.h"
#include "vtkSmartPointer.h"
#include "vtkSphereSource.h"
#include "vtkStructuredGrid.h"
#include "vtkUnstructuredGrid.h"
#include "vtkRectilinearGrid.h"
#include <vtkTestUtilities.h>
#include <vtkRegressionTestImage.h>
int TestLabelPlacementMapper(int argc, char *argv[])
{
int maxLevels = 5;
int targetLabels = 32;
double labelRatio = 0.05;
char* fname = vtkTestUtilities::ExpandDataFileName( argc, argv, "Data/uniform-001371-5x5x5.vtp" );
//int iteratorType = vtkLabelHierarchy::FULL_SORT;
int iteratorType = vtkLabelHierarchy::QUEUE;
//int iteratorType = vtkLabelHierarchy::DEPTH_FIRST;
vtkSmartPointer<vtkSphereSource> sphere =
vtkSmartPointer<vtkSphereSource>::New();
vtkSmartPointer<vtkPolyDataMapper> sphereMapper =
vtkSmartPointer<vtkPolyDataMapper>::New();
vtkSmartPointer<vtkActor> sphereActor =
vtkSmartPointer<vtkActor>::New();
sphere->SetRadius( 5.0 );
sphereMapper->SetInputConnection( sphere->GetOutputPort() );
sphereActor->SetMapper( sphereMapper );
vtkSmartPointer<vtkLabelHierarchy> labelHierarchy =
vtkSmartPointer<vtkLabelHierarchy>::New();
vtkSmartPointer<vtkLabelPlacementMapper> labelPlacer =
vtkSmartPointer<vtkLabelPlacementMapper>::New();
vtkSmartPointer<vtkPointSetToLabelHierarchy> pointSetToLabelHierarchy =
vtkSmartPointer<vtkPointSetToLabelHierarchy>::New();
vtkSmartPointer<vtkXMLPolyDataReader> xmlPolyDataReader =
vtkSmartPointer<vtkXMLPolyDataReader>::New();
vtkSmartPointer<vtkPolyDataMapper> polyDataMapper =
vtkSmartPointer<vtkPolyDataMapper>::New();
vtkSmartPointer<vtkActor> actor =
vtkSmartPointer<vtkActor>::New();
vtkSmartPointer<vtkRenderer> renderer =
vtkSmartPointer<vtkRenderer>::New();
vtkSmartPointer<vtkRenderWindow> renWin =
vtkSmartPointer<vtkRenderWindow>::New();
vtkSmartPointer<vtkRenderWindowInteractor> iren =
vtkSmartPointer<vtkRenderWindowInteractor>::New();
vtkSmartPointer<vtkActor2D> textActor = vtkSmartPointer<vtkActor2D>::New();
xmlPolyDataReader->SetFileName( fname );
delete [] fname;
vtkSmartPointer<vtkTextProperty> tprop = vtkSmartPointer<vtkTextProperty>::New();
tprop->SetFontSize( 12 );
tprop->SetFontFamily( vtkTextProperty::GetFontFamilyFromString( "Arial" ) );
tprop->SetColor( 0.0, 0.8, 0.2 );
pointSetToLabelHierarchy->SetTextProperty( tprop );
pointSetToLabelHierarchy->AddInputConnection( xmlPolyDataReader->GetOutputPort() );
pointSetToLabelHierarchy->SetPriorityArrayName( "Priority" );
pointSetToLabelHierarchy->SetLabelArrayName( "PlaceNames" );
pointSetToLabelHierarchy->SetMaximumDepth( maxLevels );
pointSetToLabelHierarchy->SetTargetLabelCount( targetLabels );
labelPlacer->SetInputConnection( pointSetToLabelHierarchy->GetOutputPort() );
labelPlacer->SetIteratorType( iteratorType );
labelPlacer->SetMaximumLabelFraction( labelRatio );
labelPlacer->UseDepthBufferOn();
textActor->SetMapper( labelPlacer );
renderer->AddActor( sphereActor );
renderer->AddActor( textActor );
renWin->SetSize( 300, 300 );
renWin->AddRenderer( renderer );
renderer->SetBackground( 0.0, 0.0, 0.0 );
iren->SetRenderWindow( renWin );
renWin->Render();
renderer->ResetCamera();
renderer->ResetCamera();
renderer->ResetCamera();
int retVal = vtkRegressionTestImage( renWin );
if ( retVal == vtkRegressionTester::DO_INTERACTOR )
{
iren->Start();
}
return !retVal;
}
This diff is collapsed.
/*=========================================================================
Program: Visualization Toolkit
Module: TestLabelPlacementMapperCoincidentPoints.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME Test of vtkLabelPlacer
// .SECTION Description
// this program tests vtkLabelPlacer which uses a sophisticated algorithm to
// prune labels/icons preventing them from overlapping.
#include "vtkActor.h"
#include "vtkActor2D.h"
#include "vtkCamera.h"
#include "vtkCellArray.h"
#include "vtkFloatArray.h"
#include "vtkLabeledDataMapper.h"
#include "vtkLabelHierarchy.h"
#include "vtkLabelPlacementMapper.h"
#include "vtkMath.h"
#include "vtkPointSetToLabelHierarchy.h"
#include "vtkPointData.h"
#include "vtkPoints.h"
#include "vtkPointSet.h"
#include "vtkPolyData.h"
#include "vtkPolyDataMapper.h"
#include "vtkPolyDataMapper2D.h"
#include "vtkProperty.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkStringArray.h"
#include "vtkTextProperty.h"
#include "vtkPolyData.h"
#include "vtkImageData.h"
#include "vtkSmartPointer.h"
#include "vtkStructuredGrid.h"
#include "vtkUnstructuredGrid.h"
#include "vtkRectilinearGrid.h"
#include "vtkSphereSource.h"
#include <vtkTestUtilities.h>
#include <vtkRegressionTestImage.h>
/*
void prtbds( const char* msg, const double* bds )
{
cout << msg << ":";
for ( int i = 0; i < 3; ++ i )
cout << " [ " << bds[2*i] << ", " << bds[2*i+1] << "]";
cout << "\n";
}
*/
int TestLabelPlacementMapperCoincidentPoints(int argc, char *argv[])
{
int maxLevels = 5;
int targetLabels = 7;
double labelRatio = 1.0;
int i = 0;
int iteratorType = vtkLabelHierarchy::QUEUE;
bool showBounds = true;
vtkSmartPointer<vtkLabelHierarchy> labelHierarchy =
vtkSmartPointer<vtkLabelHierarchy>::New();
vtkSmartPointer<vtkLabelPlacementMapper> labelPlacer =
vtkSmartPointer<vtkLabelPlacementMapper>::New();
vtkSmartPointer<vtkPointSetToLabelHierarchy> pointSetToLabelHierarchy =
vtkSmartPointer<vtkPointSetToLabelHierarchy>::New();
vtkSmartPointer<vtkPolyDataMapper> polyDataMapper =
vtkSmartPointer<vtkPolyDataMapper>::New();
vtkSmartPointer<vtkActor> actor =
vtkSmartPointer<vtkActor>::New();
vtkSmartPointer<vtkPolyDataMapper> polyDataMapper2 =
vtkSmartPointer<vtkPolyDataMapper>::New();
vtkSmartPointer<vtkActor> actor2 =
vtkSmartPointer<vtkActor>::New();
vtkSmartPointer<vtkRenderer> renderer =
vtkSmartPointer<vtkRenderer>::New();
vtkSmartPointer<vtkRenderWindow> renWin =
vtkSmartPointer<vtkRenderWindow>::New();
renWin->SetMultiSamples(0); // ensure to have the same test image everywhere
vtkSmartPointer<vtkRenderWindowInteractor> iren =
vtkSmartPointer<vtkRenderWindowInteractor>::New();
vtkSmartPointer<vtkLabeledDataMapper> labeledMapper =
vtkSmartPointer<vtkLabeledDataMapper>::New();
vtkSmartPointer<vtkActor2D> textActor =
vtkSmartPointer<vtkActor2D>::New();
vtkSmartPointer<vtkPoints> points =
vtkSmartPointer<vtkPoints>::New();
//renderer->GetActiveCamera()->ParallelProjectionOn();
vtkMath::RandomSeed(5678);
for(i = 0; i < 29; i++)
{
//points->InsertPoint( i, vtkMath::Random(-1.0, 1.0), vtkMath::Random(-1.0, 1.0), 0. );
points->InsertPoint( i, 0.0, 0.0, 0.0 );
}
points->InsertPoint( 29, 2.2, 2.2, 0.0 );
vtkSmartPointer<vtkCellArray> cells =
vtkSmartPointer<vtkCellArray>::New();
cells->InsertNextCell(30);
for(i = 0; i < 30; i++)
{
cells->InsertCellPoint(i);
}
vtkSmartPointer<vtkPolyData> polyData =
vtkSmartPointer<vtkPolyData>::New();
polyData->SetPoints(points);
polyData->SetVerts(cells);
vtkSmartPointer<vtkStringArray> stringData =
vtkSmartPointer<vtkStringArray>::New();
stringData->SetName("PlaceNames");
stringData->InsertNextValue("Abu Dhabi");
stringData->InsertNextValue("Amsterdam");
stringData->InsertNextValue("Beijing");
stringData->InsertNextValue("Berlin");
stringData->InsertNextValue("Cairo");
stringData->InsertNextValue("Caracas");
stringData->InsertNextValue("Dublin");
stringData->InsertNextValue("Georgetown");
stringData->InsertNextValue("The Hague");
stringData->InsertNextValue("Hanoi");
stringData->InsertNextValue("Islamabad");
stringData->InsertNextValue("Jakarta");
stringData->InsertNextValue("Kiev");
stringData->InsertNextValue("Kingston");
stringData->InsertNextValue("Lima");
stringData->InsertNextValue("London");
stringData->InsertNextValue("Luxembourg City");
stringData->InsertNextValue("Madrid");
stringData->InsertNextValue("Moscow");
stringData->InsertNextValue("Nairobi");
stringData->InsertNextValue("New Delhi");
stringData->InsertNextValue("Ottawa");
stringData->InsertNextValue("Paris");
stringData->InsertNextValue("Prague");
stringData->InsertNextValue("Rome");
stringData->InsertNextValue("Seoul");
stringData->InsertNextValue("Tehran");
stringData->InsertNextValue("Tokyo");
stringData->InsertNextValue("Warsaw");
stringData->InsertNextValue("Washington");
polyData->GetPointData()->AddArray(stringData);
vtkSmartPointer<vtkTextProperty> tprop = vtkSmartPointer<vtkTextProperty>::New();
tprop->SetFontSize( 12 );
tprop->SetFontFamily( vtkTextProperty::GetFontFamilyFromString( "Arial" ) );
tprop->SetColor( 0.0, 0.8, 0.2 );
pointSetToLabelHierarchy->SetInput(polyData);
pointSetToLabelHierarchy->SetTextProperty(tprop);
pointSetToLabelHierarchy->SetPriorityArrayName("Priority");
pointSetToLabelHierarchy->SetLabelArrayName("PlaceNames");
pointSetToLabelHierarchy->SetMaximumDepth( maxLevels );
pointSetToLabelHierarchy->SetTargetLabelCount( targetLabels );
labelPlacer->SetInputConnection( pointSetToLabelHierarchy->GetOutputPort() );
labelPlacer->SetIteratorType( iteratorType );
labelPlacer->SetMaximumLabelFraction( labelRatio );
//labelPlacer->SetIteratorType(1); // Quadtree is only available type for 2-D.
polyDataMapper->SetInput(polyData);
//polyDataMapper2->SetInputConnection(labelPlacer->GetOutputPort(2));
actor->SetMapper(polyDataMapper);
//actor2->SetMapper(polyDataMapper2);
//labelPlacer->Update();
textActor->SetMapper(labelPlacer);
//renderer->AddActor(actor);
//renderer->AddActor(actor2);
renderer->AddActor(textActor);
renWin->SetSize(600, 600);
renWin->AddRenderer(renderer);
renderer->SetBackground(0.0, 0.0, 0.0);
iren->SetRenderWindow(renWin);
//labelPlacer->Update();
//cout << "Pre-reset-camera bounds of...\n";
//prtbds( "output 0", labelPlacer->GetOutput( 0 )->GetBounds() );
//prtbds( "output 1", labelPlacer->GetOutput( 1 )->GetBounds() );
//prtbds( "output 2", labelPlacer->GetOutput( 2 )->GetBounds() );
/*
renWin->Render();
renderer->ResetCamera();
renderer->ResetCamera();
renderer->ResetCamera();
renWin->Render();
*/
//cout << "Post-reset-camera Bounds of...\n";
//prtbds( "output 0", labelPlacer->GetOutput( 0 )->GetBounds() );
//prtbds( "output 1", labelPlacer->GetOutput( 1 )->GetBounds() );
//prtbds( "output 2", labelPlacer->GetOutput( 2 )->GetBounds() );
renWin->Render();
int retVal = vtkRegressionTestImage( renWin );
if ( retVal == vtkRegressionTester::DO_INTERACTOR)
{
iren->Start();
}
return !retVal;
}
/*=========================================================================
Program: Visualization Toolkit
Module: TestLabelPlacer2D.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkActor.h"
#include "vtkActor2D.h"
#include "vtkCamera.h"
......
/*=========================================================================
Program: Visualization Toolkit
Module: vtkFreeTypeLabelRenderStrategy.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkFreeTypeLabelRenderStrategy.h"
#include "vtkActor2D.h"
#include "vtkFreeTypeUtilities.h"
#include "vtkObjectFactory.h"
#include "vtkRenderer.h"
#include "vtkSmartPointer.h"
#include "vtkTextMapper.h"
#include "vtkTextProperty.h"
vtkCxxRevisionMacro(vtkFreeTypeLabelRenderStrategy, "1.1");
vtkStandardNewMacro(vtkFreeTypeLabelRenderStrategy);
//----------------------------------------------------------------------------
vtkFreeTypeLabelRenderStrategy::vtkFreeTypeLabelRenderStrategy()
{
this->FreeTypeUtilities = vtkFreeTypeUtilities::New();
this->Mapper = vtkTextMapper::New();
this->Actor = vtkActor2D::New();
this->Actor->SetMapper(this->Mapper);
}
//----------------------------------------------------------------------------
vtkFreeTypeLabelRenderStrategy::~vtkFreeTypeLabelRenderStrategy()
{
this->FreeTypeUtilities->Delete();
this->Mapper->Delete();
this->Actor->Delete();
}
//----------------------------------------------------------------------------
void vtkFreeTypeLabelRenderStrategy::ComputeLabelBounds(
vtkTextProperty* tprop, vtkUnicodeString label, double bds[4])
{
// Check for empty string.
vtkStdString str;
label.utf8_str(str);
if (str.length() == 0)
{
bds[0] = 0;
bds[1] = 0;
bds[2] = 0;
bds[3] = 0;
return;
}
if (!tprop)
{
tprop = this->DefaultTextProperty;
}
vtkSmartPointer<vtkTextProperty> copy = tprop;
if (tprop->GetOrientation() != 0.0)
{
copy = vtkSmartPointer<vtkTextProperty>::New();
copy->ShallowCopy(tprop);
copy->SetOrientation(0.0);
}
int bbox[4];
this->FreeTypeUtilities->GetBoundingBox(copy, label.utf8_str(), bbox);
// Take line offset into account
bds[0] = bbox[0];
bds[1] = bbox[1];
bds[2] = bbox[2] - tprop->GetLineOffset();
bds[3] = bbox[3] - tprop->GetLineOffset();
// Take justification into account
double sz[2] = {bds[1] - bds[0], bds[3] - bds[2]};
switch (tprop->GetJustification())
{
case VTK_TEXT_LEFT:
break;
case VTK_TEXT_CENTERED:
bds[0] -= sz[0]/2;
bds[1] -= sz[0]/2;
break;
case VTK_TEXT_RIGHT:
bds[0] -= sz[0];
bds[1] -= sz[0];
break;
}
switch (tprop->GetVerticalJustification())
{
case VTK_TEXT_BOTTOM:
break;
case VTK_TEXT_CENTERED:
bds[2] -= sz[1]/2;
bds[3] -= sz[1]/2;
break;
case VTK_TEXT_TOP:
bds[2] -= sz[1];
bds[3] -= sz[1];
break;
}
}
//----------------------------------------------------------------------------
void vtkFreeTypeLabelRenderStrategy::RenderLabel(
double x[3], vtkTextProperty* tprop, vtkUnicodeString label)
{
if (!this->Renderer)
{
vtkErrorMacro("Renderer must be set before rendering labels.");
return;
}
if (!tprop)
{
tprop = this->DefaultTextProperty;
}
this->Mapper->SetTextProperty(tprop);
this->Mapper->SetInput(label.utf8_str());
this->Actor->GetPositionCoordinate()->SetCoordinateSystemToWorld();
this->Actor->GetPositionCoordinate()->SetValue(x);
this->Mapper->RenderOverlay(this->Renderer, this->Actor);
}
//----------------------------------------------------------------------------
void vtkFreeTypeLabelRenderStrategy::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
}
/*=========================================================================
Program: Visualization Toolkit
Module: vtkFreeTypeLabelRenderStrategy.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkFreeTypeLabelRenderStrategy - Renders labels with freetype
//
// .SECTION Description
// Uses the FreeType to render labels and compute label sizes.
// This strategy may be used with vtkLabelPlacementMapper.
#ifndef __vtkFreeTypeLabelRenderStrategy_h
#define __vtkFreeTypeLabelRenderStrategy_h
#include "vtkLabelRenderStrategy.h"
class vtkActor2D;
class vtkFreeTypeUtilities;
class vtkTextMapper;
class VTK_RENDERING_EXPORT vtkFreeTypeLabelRenderStrategy : public vtkLabelRenderStrategy
{
public:
void PrintSelf(ostream& os, vtkIndent indent);
vtkTypeRevisionMacro(vtkFreeTypeLabelRenderStrategy, vtkLabelRenderStrategy);
static vtkFreeTypeLabelRenderStrategy* New();
// Description:
// The free type render strategy currently does not support rotation.
virtual bool SupportsRotation()
{ return false; }
//BTX
// Description:
// Compute the bounds of a label. Must be performed after the renderer is set.
virtual void ComputeLabelBounds(vtkTextProperty* tprop, vtkUnicodeString label, double bds[4]);
// Description:
// Render a label at a location in world coordinates.
// Must be performed between StartFrame() and EndFrame() calls.
virtual void RenderLabel(double x[3], vtkTextProperty* tprop, vtkUnicodeString label);
//ETX
protected:
vtkFreeTypeLabelRenderStrategy();
~vtkFreeTypeLabelRenderStrategy();
vtkFreeTypeUtilities* FreeTypeUtilities;
vtkTextMapper* Mapper;
vtkActor2D* Actor;
private:
vtkFreeTypeLabelRenderStrategy(const vtkFreeTypeLabelRenderStrategy&); // Not implemented.
void operator=(const vtkFreeTypeLabelRenderStrategy&); // Not implemented.
};
#endif
......@@ -40,6 +40,7 @@
#include "vtkPythagoreanQuadruples.h"
#include "vtkRenderer.h"
#include "vtkSmartPointer.h"
#include "vtkTextProperty.h"
#include <octree/octree>
#include <vtkstd/deque>
......@@ -73,7 +74,6 @@
//
vtkLabelHierarchy* vtkLabelHierarchy::Implementation::Current;
//----------------------------------------------------------------------------
// vtkLabelHierarchyFrustumIterator - an iterator with no-initial processing
//
......@@ -122,7 +122,7 @@ protected:
vtkIdType PreviousLabelIter;
};
vtkCxxRevisionMacro(vtkLabelHierarchyFrustumIterator,"1.42");
vtkCxxRevisionMacro(vtkLabelHierarchyFrustumIterator,"1.43");
vtkStandardNewMacro(vtkLabelHierarchyFrustumIterator);
vtkCxxSetObjectMacro(vtkLabelHierarchyFrustumIterator, Camera, vtkCamera);
vtkLabelHierarchyFrustumIterator::vtkLabelHierarchyFrustumIterator()
......@@ -553,7 +553,7 @@ protected:
int NodesTraversed;
};
vtkCxxRevisionMacro(vtkLabelHierarchyFullSortIterator,"1.42");
vtkCxxRevisionMacro(vtkLabelHierarchyFullSortIterator,"1.43");
vtkStandardNewMacro(vtkLabelHierarchyFullSortIterator);
vtkCxxSetObjectMacro(vtkLabelHierarchyFullSortIterator, Camera, vtkCamera);
void vtkLabelHierarchyFullSortIterator::Prepare( vtkLabelHierarchy* hier, vtkCamera* cam,
......@@ -806,7 +806,7 @@ protected:
int NodesQueued;
};
vtkCxxRevisionMacro(vtkLabelHierarchyQuadtreeIterator,"1.42");
vtkCxxRevisionMacro(vtkLabelHierarchyQuadtreeIterator,"1.43");
vtkStandardNewMacro(vtkLabelHierarchyQuadtreeIterator);
vtkCxxSetObjectMacro(vtkLabelHierarchyQuadtreeIterator,Camera,vtkCamera);
vtkCxxSetObjectMacro(vtkLabelHierarchyQuadtreeIterator,Renderer,vtkRenderer);
......@@ -1127,7 +1127,7 @@ protected:
int NodesQueued;
};
vtkCxxRevisionMacro(vtkLabelHierarchyOctreeQueueIterator,"1.42");
vtkCxxRevisionMacro(vtkLabelHierarchyOctreeQueueIterator,"1.43");
vtkStandardNewMacro(vtkLabelHierarchyOctreeQueueIterator);
vtkCxxSetObjectMacro(vtkLabelHierarchyOctreeQueueIterator,Camera,vtkCamera);
vtkCxxSetObjectMacro(vtkLabelHierarchyOctreeQueueIterator,Renderer,vtkRenderer);
......@@ -1493,7 +1493,7 @@ protected:
int DidRoot;
};
vtkCxxRevisionMacro(vtkLabelHierarchy3DepthFirstIterator,"1.42");