Commit e19154de authored by Sebastien Barre's avatar Sebastien Barre

fix some bounds issues

parent 275da681
......@@ -12,7 +12,7 @@ renWin SetSize 600 600
# The Tk render widget
set vtkw [vtkTkRenderWidget .ren -width 600 -height 600 -rw renWin]
set vtkw [vtkTkRenderWidget .ren -width 450 -height 450 -rw renWin]
::vtk::bind_tk_render_widget $vtkw
pack $vtkw -side top -fill both -expand yes
......@@ -145,8 +145,11 @@ proc update_text_actors {dummy} {
if {0} {
add_sphere
add_one_text_actor
ren1 ResetCamera
} {
add_many_text_actors
ren1 ResetCamera
set cam [ren1 GetActiveCamera]
$cam Elevation 30
$cam Dolly 0.3
......@@ -158,7 +161,6 @@ foreach actor $text_actors {
# Interact
ren1 ResetCamera
renWin Render
wm protocol . WM_DELETE_WINDOW ::vtk::cb_exit
......
......@@ -26,7 +26,7 @@
#include "vtkMatrix4x4.h"
#include "vtkMath.h"
vtkCxxRevisionMacro(vtkTextActor3D, "1.3");
vtkCxxRevisionMacro(vtkTextActor3D, "1.4");
vtkStandardNewMacro(vtkTextActor3D);
vtkCxxSetObjectMacro(vtkTextActor3D, TextProperty, vtkTextProperty);
......@@ -35,7 +35,7 @@ vtkCxxSetObjectMacro(vtkTextActor3D, TextProperty, vtkTextProperty);
vtkTextActor3D::vtkTextActor3D()
{
this->Input = NULL;
this->ImageActor = NULL;
this->ImageActor = vtkImageActor::New();
this->ImageData = NULL;
this->TextProperty = NULL;
......@@ -43,6 +43,8 @@ vtkTextActor3D::vtkTextActor3D()
this->SetTextProperty(vtkTextProperty::New());
this->TextProperty->Delete();
this->ImageActor->InterpolateOn();
}
// --------------------------------------------------------------------------
......@@ -86,9 +88,7 @@ double* vtkTextActor3D::GetBounds()
return this->ImageActor->GetBounds();
}
static double unknown_bounds[6];
vtkMath::UninitializeBounds(unknown_bounds);
return unknown_bounds;
return NULL;
}
// --------------------------------------------------------------------------
......@@ -285,27 +285,24 @@ int vtkTextActor3D::UpdateImageActor()
// Associate the image data (should be up to date now) to the image actor
if (!this->ImageActor)
if (this->ImageActor)
{
this->ImageActor = vtkImageActor::New();
this->ImageActor->InterpolateOn();
}
this->ImageActor->SetInput(this->ImageData);
this->ImageActor->SetInput(this->ImageData);
// Position the actor
// Which one is faster ?
// Position the actor
// Which one is faster ?
#if 1
vtkMatrix4x4 *matrix = vtkMatrix4x4::New();
this->GetMatrix(matrix);
this->ImageActor->SetUserMatrix(matrix);
matrix->Delete();
vtkMatrix4x4 *matrix = vtkMatrix4x4::New();
this->GetMatrix(matrix);
this->ImageActor->SetUserMatrix(matrix);
matrix->Delete();
#else
this->ImageActor->SetPosition(this->GetPosition());
this->ImageActor->SetScale(this->GetScale());
this->ImageActor->SetOrientation(this->GetOrientation());
this->ImageActor->SetPosition(this->GetPosition());
this->ImageActor->SetScale(this->GetScale());
this->ImageActor->SetOrientation(this->GetOrientation());
#endif
}
return 1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment