Commit 047a1db2 authored by Philippe Pebay's avatar Philippe Pebay Committed by Kitware Robot
Browse files

Merge topic 'FixBugsInAxes'

ec56c582 Fixed bug where axes opposite to major one where drawn sometimes
b35f5e00 Correct title
f59e977e Documentation
515cf505 Testing additional options which were not verified so far
parents c4e2b86e ec56c582
......@@ -12,13 +12,8 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// This example illustrates how one may explicitly specify the range of each
// axes that's used to define the prop, while displaying data with a different
// set of bounds (unlike cubeAxes2.tcl). This example allows you to separate
// the notion of extent of the axes in physical space (bounds) and the extent
// of the values it represents. In other words, you can have the ticks and
// labels show a different range.
// .SECTION Thanks
// This test was written by Philippe Pebay, Kitware SAS 2011
#include "vtkBYUReader.h"
#include "vtkCamera.h"
......@@ -36,8 +31,7 @@
#include "vtkRenderWindowInteractor.h"
#include "vtkSmartPointer.h"
#include "vtkTestUtilities.h"
#include "vtkTextProperty.h"
//----------------------------------------------------------------------------
int TestCubeAxesWithGridLines( int argc, char * argv [] )
......@@ -83,15 +77,18 @@ int TestCubeAxesWithGridLines( int argc, char * argv [] )
vtkNew<vtkRenderWindow> renWin;
renWin->SetMultiSamples(0);
renWin->AddRenderer(ren2.GetPointer());
renWin->SetWindowName("VTK - Cube Axes custom range");
renWin->SetWindowName("Cube Axes with Outer Grid Lines");
renWin->SetSize(600, 600);
renWin->SetMultiSamples(0);
vtkNew<vtkRenderWindowInteractor> iren;
iren->SetRenderWindow(renWin.GetPointer());
ren2->AddViewProp(foheActor.GetPointer());
ren2->AddViewProp(outlineActor.GetPointer());
ren2->SetBackground(0.1, 0.2, 0.4);
ren2->SetGradientBackground( true );
ren2->SetBackground(.1,.1,.1);
ren2->SetBackground2(.8,.8,.8);
normals->Update();
......@@ -106,10 +103,27 @@ int TestCubeAxesWithGridLines( int argc, char * argv [] )
axes2->SetScreenSize(15.0);
axes2->SetFlyModeToClosestTriad();
axes2->SetCornerOffset(0.0);
// Draw all (outer) grid lines
axes2->SetDrawXGridlines(1);
axes2->SetDrawYGridlines(1);
axes2->SetDrawZGridlines(1);
// Use red color for X gridlines, title, and labels
axes2->GetXAxesGridlinesProperty()->SetColor(1., 0., 0.);
axes2->GetTitleTextProperty(0)->SetColor(1., 0., 0.);
axes2->GetLabelTextProperty(0)->SetColor(1., 0., 0.);
// Use green color for Y gridlines, title, and labels
axes2->GetYAxesGridlinesProperty()->SetColor(0., 1., 0.);
axes2->GetTitleTextProperty(1)->SetColor(0., 1., 0.);
axes2->GetLabelTextProperty(1)->SetColor(0., 1., 0.);
// Use blue color for Z gridlines, title, and labels
axes2->GetZAxesGridlinesProperty()->SetColor(0., 0., 1.);
axes2->GetTitleTextProperty(2)->SetColor(0., 0., 1.);
axes2->GetLabelTextProperty(2)->SetColor(0., 0., 1.);
ren2->AddViewProp(axes2.GetPointer());
renWin->Render();
......
......@@ -12,13 +12,8 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// This example illustrates how one may explicitly specify the range of each
// axes that's used to define the prop, while displaying data with a different
// set of bounds (unlike cubeAxes2.tcl). This example allows you to separate
// the notion of extent of the axes in physical space (bounds) and the extent
// of the values it represents. In other words, you can have the ticks and
// labels show a different range.
// .SECTION Thanks
// This test was written by Philippe Pebay, Kitware SAS 2011
#include "vtkBYUReader.h"
#include "vtkCamera.h"
......
......@@ -12,13 +12,8 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// This example illustrates how one may explicitly specify the range of each
// axes that's used to define the prop, while displaying data with a different
// set of bounds (unlike cubeAxes2.tcl). This example allows you to separate
// the notion of extent of the axes in physical space (bounds) and the extent
// of the values it represents. In other words, you can have the ticks and
// labels show a different range.
// .SECTION Thanks
// This test was written by Philippe Pebay, Kitware SAS 2011
#include "vtkBYUReader.h"
#include "vtkCamera.h"
......
......@@ -12,13 +12,8 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// This example illustrates how one may explicitly specify the range of each
// axes that's used to define the prop, while displaying data with a different
// set of bounds (unlike cubeAxes2.tcl). This example allows you to separate
// the notion of extent of the axes in physical space (bounds) and the extent
// of the values it represents. In other words, you can have the ticks and
// labels show a different range.
// .SECTION Thanks
// This test was written by Philippe Pebay, Kitware SAS 2011
#include "vtkBYUReader.h"
#include "vtkCamera.h"
......
......@@ -12,13 +12,8 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// This example illustrates how one may explicitly specify the range of each
// axes that's used to define the prop, while displaying data with a different
// set of bounds (unlike cubeAxes2.tcl). This example allows you to separate
// the notion of extent of the axes in physical space (bounds) and the extent
// of the values it represents. In other words, you can have the ticks and
// labels show a different range.
// .SECTION Thanks
// This test was written by Philippe Pebay, Kitware SAS 2011
#include "vtkBYUReader.h"
#include "vtkCamera.h"
......
......@@ -12,13 +12,8 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// This example illustrates how one may explicitly specify the range of each
// axes that's used to define the prop, while displaying data with a different
// set of bounds (unlike cubeAxes2.tcl). This example allows you to separate
// the notion of extent of the axes in physical space (bounds) and the extent
// of the values it represents. In other words, you can have the ticks and
// labels show a different range.
// .SECTION Thanks
// This test was written by Philippe Pebay, Kitware SAS 2011
#include "vtkBYUReader.h"
#include "vtkCamera.h"
......
......@@ -12,13 +12,8 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// This example illustrates how one may explicitly specify the range of each
// axes that's used to define the prop, while displaying data with a different
// set of bounds (unlike cubeAxes2.tcl). This example allows you to separate
// the notion of extent of the axes in physical space (bounds) and the extent
// of the values it represents. In other words, you can have the ticks and
// labels show a different range.
// .SECTION Thanks
// This test was written by Philippe Pebay, Kitware SAS 2011
#include "vtkBYUReader.h"
#include "vtkCamera.h"
......
......@@ -13,7 +13,7 @@
=========================================================================*/
// .SECTION Thanks
// This test was written by Philippe Pbay, Kitware SAS 2011
// This test was written by Philippe Pebay, Kitware SAS 2011
#include "vtkBYUReader.h"
#include "vtkCamera.h"
......
......@@ -1787,7 +1787,7 @@ void vtkCubeAxesActor::DetermineRenderAxes(vtkViewport *viewport)
this->RenderAxesX[0] = 0;
this->RenderAxesY[0] = 0;
this->RenderAxesZ[0] = 0;
if (this->DrawXGridlines || this->DrawXInnerGridlines ||this->DrawXGridpolys)
if ( this->DrawXGridlines )
{
this->RenderAxesX[1] = 2;
this->NumberOfAxesX = 2;
......@@ -1800,7 +1800,7 @@ void vtkCubeAxesActor::DetermineRenderAxes(vtkViewport *viewport)
{
this->NumberOfAxesX = 1;
}
if (this->DrawYGridlines || this->DrawYInnerGridlines || this->DrawYGridpolys)
if ( this->DrawYGridlines )
{
this->RenderAxesY[1] = 2;
this->NumberOfAxesY = 2;
......@@ -1813,7 +1813,7 @@ void vtkCubeAxesActor::DetermineRenderAxes(vtkViewport *viewport)
{
this->NumberOfAxesY = 1;
}
if (this->DrawZGridlines || this->DrawZInnerGridlines || this->DrawZGridpolys)
if ( this->DrawZGridlines )
{
this->RenderAxesZ[1] = 2;
this->NumberOfAxesZ = 2;
......@@ -1984,22 +1984,23 @@ void vtkCubeAxesActor::DetermineRenderAxes(vtkViewport *viewport)
break;
}
}//else boundary edges fly mode
} // else boundary edges fly mode
this->InertiaLocs[0] = xloc;
this->InertiaLocs[1] = yloc;
this->InertiaLocs[2] = zloc;
} //inertia
} // inertia
else
{
// don't change anything, use locations from last render
// Do not change anything, use locations from last render
xloc = this->InertiaLocs[0];
yloc = this->InertiaLocs[1];
zloc = this->InertiaLocs[2];
}
// Set axes to be rendered
this->RenderAxesX[0] = xloc % NUMBER_OF_ALIGNED_AXIS;
if (this->DrawXGridlines || this->DrawXInnerGridlines || this->DrawXGridpolys)
if ( this->DrawXGridlines )
{
this->RenderAxesX[1] = (xloc + 2) % NUMBER_OF_ALIGNED_AXIS;
this->NumberOfAxesX = 2;
......@@ -2014,7 +2015,7 @@ void vtkCubeAxesActor::DetermineRenderAxes(vtkViewport *viewport)
}
this->RenderAxesY[0] = yloc % NUMBER_OF_ALIGNED_AXIS;
if (this->DrawYGridlines || this->DrawYInnerGridlines || this->DrawYGridpolys)
if ( this->DrawYGridlines )
{
this->RenderAxesY[1] = (yloc + 2) % NUMBER_OF_ALIGNED_AXIS;
this->NumberOfAxesY = 2;
......@@ -2029,7 +2030,7 @@ void vtkCubeAxesActor::DetermineRenderAxes(vtkViewport *viewport)
}
this->RenderAxesZ[0] = zloc % NUMBER_OF_ALIGNED_AXIS;
if (this->DrawZGridlines || this->DrawZInnerGridlines || this->DrawZGridpolys)
if ( this->DrawZGridlines )
{
this->RenderAxesZ[1] = (zloc + 2) % NUMBER_OF_ALIGNED_AXIS;
this->NumberOfAxesZ = 2;
......@@ -2042,9 +2043,8 @@ void vtkCubeAxesActor::DetermineRenderAxes(vtkViewport *viewport)
{
this->NumberOfAxesZ = 1;
}
//
// Make sure that the primary axis visibility flags are set correctly.
//
this->XAxes[RenderAxesX[0]]->SetLabelVisibility(this->XAxisLabelVisibility);
this->XAxes[RenderAxesX[0]]->SetTitleVisibility(this->XAxisLabelVisibility);
this->XAxes[RenderAxesX[0]]->SetTickVisibility(this->XAxisTickVisibility);
......
Supports Markdown
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