Attached Files | incorrect_range_vtkXYPlotActor.patch [^] (6,706 bytes) 1969-12-31 19:00 [Show Content] [Hide Content]Index: vtkXYPlotActor.cxx
===================================================================
RCS file: /cvsroot/VTK/VTK/Hybrid/vtkXYPlotActor.cxx,v
retrieving revision 1.67
diff -C5 -r1.67 vtkXYPlotActor.cxx
*** vtkXYPlotActor.cxx 5 Mar 2007 13:50:12 -0000 1.67
--- vtkXYPlotActor.cxx 27 Jun 2007 15:16:54 -0000
***************
*** 178,187 ****
--- 178,189 ----
n->Delete();
this->CachedSize[0] = 0;
this->CachedSize[1] = 0;
+ this->AdjustXLabels = 1;
+ this->AdjustYLabels = 1;
this->AdjustTitlePosition = 1;
this->TitlePosition[0] = 0.5;
this->TitlePosition[1] = 0.9;
}
***************
*** 633,645 ****
if ( this->XRange[0] < this->XRange[1] )
{
range[0] = this->XRange[0];
range[1] = this->XRange[1];
}
- vtkAxisActor2D::ComputeRange(range, xRange, this->NumberOfXLabels,
- numTicks, interval);
if ( !this->ExchangeAxes )
{
this->XComputedRange[0] = xRange[0];
this->XComputedRange[1] = xRange[1];
if ( this->ReverseXAxis )
--- 635,656 ----
if ( this->XRange[0] < this->XRange[1] )
{
range[0] = this->XRange[0];
range[1] = this->XRange[1];
}
+
+ if ( this->AdjustXLabels )
+ {
+ vtkAxisActor2D::ComputeRange(range, xRange, this->NumberOfXLabels,
+ numTicks, interval);
+ }
+ else
+ {
+ xRange[0] = range[0];
+ xRange[1] = range[1];
+ }
if ( !this->ExchangeAxes )
{
this->XComputedRange[0] = xRange[0];
this->XComputedRange[1] = xRange[1];
if ( this->ReverseXAxis )
***************
*** 680,691 ****
else
{
yrange[0] = this->YRange[0];
yrange[1] = this->YRange[1];
}
! vtkAxisActor2D::ComputeRange(yrange, yRange, this->NumberOfYLabels,
! numTicks, interval);
if ( !this->ExchangeAxes )
{
this->YComputedRange[0] = yRange[0];
this->YComputedRange[1] = yRange[1];
--- 691,710 ----
else
{
yrange[0] = this->YRange[0];
yrange[1] = this->YRange[1];
}
! if ( this->AdjustYLabels )
! {
! vtkAxisActor2D::ComputeRange(yrange, yRange, this->NumberOfYLabels,
! numTicks, interval);
! }
! else
! {
! yRange[0] = yrange[0];
! yRange[1] = yrange[1];
! }
if ( !this->ExchangeAxes )
{
this->YComputedRange[0] = yRange[0];
this->YComputedRange[1] = yRange[1];
***************
*** 976,985 ****
--- 995,1008 ----
os << indent << "Legend Actor:";
this->LegendActor->PrintSelf( os << endl, i2);
os << indent << "Glyph Source:";
this->GlyphSource->PrintSelf( os << endl, i2);
+ os << indent << "AdjustXLabels: "
+ << this->AdjustXLabels << endl;
+ os << indent << "AdjustYLabels: "
+ << this->AdjustYLabels << endl;
os << indent << "AdjustTitlePosition: "
<< this->AdjustTitlePosition << endl;
os << indent << "TitlePosition: "
<< this->TitlePosition[0] << " "
<< this->TitlePosition[1] << " "
***************
*** 2224,2255 ****
}
//----------------------------------------------------------------------------
void vtkXYPlotActor::SetAdjustXLabels(int adjust)
{
this->XAxis->SetAdjustLabels(adjust);
}
//----------------------------------------------------------------------------
- int vtkXYPlotActor::GetAdjustXLabels()
- {
- return this->XAxis->GetAdjustLabels();
- }
-
- //----------------------------------------------------------------------------
void vtkXYPlotActor::SetAdjustYLabels(int adjust)
{
this->YAxis->SetAdjustLabels(adjust);
}
//----------------------------------------------------------------------------
- int vtkXYPlotActor::GetAdjustYLabels()
- {
- return this->YAxis->GetAdjustLabels();
- }
-
- //----------------------------------------------------------------------------
void vtkXYPlotActor::SetLabelFormat(const char* _arg)
{
this->SetXLabelFormat(_arg);
this->SetYLabelFormat(_arg);
}
--- 2247,2268 ----
}
//----------------------------------------------------------------------------
void vtkXYPlotActor::SetAdjustXLabels(int adjust)
{
+ this->AdjustXLabels = adjust;
this->XAxis->SetAdjustLabels(adjust);
}
//----------------------------------------------------------------------------
void vtkXYPlotActor::SetAdjustYLabels(int adjust)
{
+ this->AdjustYLabels = adjust;
this->YAxis->SetAdjustLabels(adjust);
}
//----------------------------------------------------------------------------
void vtkXYPlotActor::SetLabelFormat(const char* _arg)
{
this->SetXLabelFormat(_arg);
this->SetYLabelFormat(_arg);
}
Index: vtkXYPlotActor.h
===================================================================
RCS file: /cvsroot/VTK/VTK/Hybrid/vtkXYPlotActor.h,v
retrieving revision 1.34
diff -C5 -r1.34 vtkXYPlotActor.h
*** vtkXYPlotActor.h 5 Mar 2007 13:50:12 -0000 1.34
--- vtkXYPlotActor.h 27 Jun 2007 15:16:54 -0000
***************
*** 334,346 ****
// adjusted for "nice" numerical values to make it easier to read
// the labels. The adjustment is based in the Range instance variable.
// Call GetAdjustedRange and GetAdjustedNumberOfLabels to get the adjusted
// range and number of labels.
void SetAdjustXLabels(int adjust);
! int GetAdjustXLabels();
void SetAdjustYLabels(int adjust);
! int GetAdjustYLabels();
// Description:
// Set/Get the position of the title of X or Y axis.
void SetXTitlePosition(double position);
double GetXTitlePosition();
--- 334,346 ----
// adjusted for "nice" numerical values to make it easier to read
// the labels. The adjustment is based in the Range instance variable.
// Call GetAdjustedRange and GetAdjustedNumberOfLabels to get the adjusted
// range and number of labels.
void SetAdjustXLabels(int adjust);
! vtkGetMacro( AdjustXLabels, int );
void SetAdjustYLabels(int adjust);
! vtkGetMacro( AdjustYLabels, int );
// Description:
// Set/Get the position of the title of X or Y axis.
void SetXTitlePosition(double position);
double GetXTitlePosition();
***************
*** 543,552 ****
--- 543,554 ----
int PlotCurveLines;
int PlotCurvePoints;
int ExchangeAxes;
int ReverseXAxis;
int ReverseYAxis;
+ int AdjustXLabels;
+ int AdjustYLabels;
int AdjustTitlePosition;
double TitlePosition[2];
vtkTextMapper *TitleMapper;
vtkActor2D *TitleActor;
|