[vtkusers] vtkCubeAxes exponent visibility
Frable
zemitis.janis at inbox.lv
Fri Jul 8 14:04:45 EDT 2011
Will check about different formatting when back at work, thanks.
However, I don't think that will solve my problem.
Trying to figure out the best way how to explain it, let's give it another
shot,shall we?
When converting my volume into a vtkImage I had to manually boost my
spacings from 0,006 to something bigger as otherwise the Volume rendering
showed a transparent,incorrect, result. So I made the program adjust the
spacings to one number in front of the comma, in this case it would be 6.0,
when converting. That fixed the visualization problem, however, the Axis, if
without formatting, would now show up to 1600, instead of 1,6 (what would be
the actual size of the volume in mm).
Using formatting, you can achieve that it shows the correct 1,6, but, you
get a (10^3) behind your AxisTitle text. This is the exponent, you can not
get rid of.
Turning of the Title and just adding them with a different actor seemed to
be an option, tough by turning off the Title, you loose the numbers at the
Axis as well, leaving you only with the Major and minor ticks.
As far as I saw in the sourcecode of vtkCubeAxesActor, the calculation and
formatting (adding of the exponent to the Title) take place in the same
function, which is private.
A hack around this problem, that I used atm. is:
You derive a new class of vtkCubeAxesActor, now via pointer you can access
the vtkAxisActor Objects that are protected in the parent class. Make a new
method NoExponent() and in there
for (int i=0;i<4;1++)
{
this->XAxis[i]->SetTitle("X-Axis");
this->YAxis[i]...
this ->ZAxis[i]...
}
in your pipeline add it smth like :
//newAxes - derived class of vtkCubeAxesActor
newAxes *axes=newAxes::New();
axes->SetBounds();
axes->...
Renderer->AddActor(axes);
Renderer->Render();
axes->NoExponent();
However ,you will have to call Render() and NoExponent() (in that
order)whenever you change anything about the axes. Is it only hiding and
showing the axis again.Otherwise the draw process will overwrite your Title
with the exponent one again.
Will check that formatting when back at work and try to find a solution
instead of the hack when I get some free time again. This solution does it
for me atm.
--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkCubeAxes-exponent-visibility-tp4563966p4565766.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list