[vtk-developers] vtkXYPlotActor range fix
Patrick D. Emond
patrickdemond at gmail.com
Wed Jun 27 11:26:11 EDT 2007
Thanks Dean.
There were no build errors or warnings when I ran ctest so I've added
the details to the php bug tracker along with a patch file of my
solution to it.
Patrick
Dean Inglis wrote:
> Hi Patrick,
>
> there are a couple of ways to go about this. One is
> to post this as a bug report to the php bug tracker.
> The other is to have one of the developers check this
> in for you: you need to be granted developer access by
> Kitware to do this on your own. In either case, you need
> to be sure that your fix will not break any dashboards.
> So, checkout the latest cvs of VTK and VTKData, compile
> VTK with Tcl wrapping on and make sure there are no build errors
> or warninngs then run ctest in the root directory
> of your build and make sure all tests pass that could be
> related to vtkXYPlotActor.
>
> Dean
>
>
>
> -----Original Message-----
> From: vtk-developers-bounces+dean.inglis=camris.ca at vtk.org
> [mailto:vtk-developers-bounces+dean.inglis=camris.ca at vtk.org]On Behalf
> Of Patrick D. Emond
> Sent: Tuesday, June 26, 2007 5:59 PM
> To: vtk-developers at vtk.org
> Subject: [vtk-developers] vtkXYPlotActor range fix
>
>
> Hello,
>
> I recently noticed that if vtkXYPlotActor::SetAdjustXLabels( 0 ) is
> called the vtkAxisActor2D objects scale smoothly (with no adjustments)
> but opaque geometry is still rendered using adjusted ranges. I'd like
> to suggest the following fix to this error:
>
> (All I have done is created two ivars in vtkXYPlotActor, AdjustXLabels
> and AdjustYLabels, that are checked when computing the range in
> RenderOpaqueGeometry())
>
>
> Index: vtkXYPlotActor.h
> ===================================================================
> RCS file: /cvsroot/VTK/VTK/Hybrid/vtkXYPlotActor.h,v
> retrieving revision 1.34
> diff -r1.34 vtkXYPlotActor.h
> 339c339
> < int GetAdjustXLabels();
> ---
> > vtkGetMacro( AdjustXLabels, int );
> 341c341
> < int GetAdjustYLabels();
> ---
> > vtkGetMacro( AdjustYLabels, int );
> 547a548,549
> > int AdjustXLabels;
> > int AdjustYLabels;
>
>
> Index: vtkXYPlotActor.cxx
> ===================================================================
> RCS file: /cvsroot/VTK/VTK/Hybrid/vtkXYPlotActor.cxx,v
> retrieving revision 1.67
> diff -r1.67 vtkXYPlotActor.cxx
> 182a183,184
> > this->AdjustXLabels = 1;
> > this->AdjustYLabels = 1;
> 637a640,650
> >
> > if ( this->AdjustXLabels )
> > {
> > vtkAxisActor2D::ComputeRange(range, xRange, this->NumberOfXLabels,
> > numTicks, interval);
> > }
> > else
> > {
> > xRange[0] = range[0];
> > xRange[1] = range[1];
> > }
> 639,640d651
> < vtkAxisActor2D::ComputeRange(range, xRange, this->NumberOfXLabels,
> < numTicks, interval);
> 685,686c696,705
> < vtkAxisActor2D::ComputeRange(yrange, yRange, this->NumberOfYLabels,
> < numTicks, interval);
> ---
> > if ( this->AdjustYLabels )
> > {
> > vtkAxisActor2D::ComputeRange(yrange, yRange, this->NumberOfYLabels,
> > numTicks, interval);
> > }
> > else
> > {
> > yRange[0] = yrange[0];
> > yRange[1] = yrange[1];
> > }
> 980a1000,1003
> > os << indent << "AdjustXLabels: "
> > << this->AdjustXLabels << endl;
> > os << indent << "AdjustYLabels: "
> > << this->AdjustYLabels << endl;
> 2228a2252
> > this->AdjustXLabels = adjust;
> 2233,2238d2256
> < int vtkXYPlotActor::GetAdjustXLabels()
> < {
> < return this->XAxis->GetAdjustLabels();
> < }
> <
> <
> //--------------------------------------------------------------------------
> --
> 2240a2259
> > this->AdjustYLabels = adjust;
> 2245,2250d2263
> < int vtkXYPlotActor::GetAdjustYLabels()
> < {
> < return this->YAxis->GetAdjustLabels();
> < }
> <
> <
> //--------------------------------------------------------------------------
> --
>
>
> I've never contributed to VTK before so I wasn't sure how to go about
> it. If the above diff output isn't suitable please let me know.
>
> Patrick
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
More information about the vtk-developers
mailing list