Index: vtkImplicitPlaneWidget.cxx
===================================================================
RCS file: /cvsroot/VTK/VTK/Widgets/vtkImplicitPlaneWidget.cxx,v
retrieving revision 1.9.2.1
diff -u -8 -p -r1.9.2.1 vtkImplicitPlaneWidget.cxx
--- vtkImplicitPlaneWidget.cxx	16 Jun 2008 16:28:01 -0000	1.9.2.1
+++ vtkImplicitPlaneWidget.cxx	3 Mar 2009 20:14:39 -0000
@@ -46,16 +46,20 @@ vtkImplicitPlaneWidget::vtkImplicitPlane
 {
   this->DiagonalRatio = 0.3;
   this->State = vtkImplicitPlaneWidget::Start;
   this->EventCallbackCommand->SetCallback(vtkImplicitPlaneWidget::ProcessEvents);
 
   this->NormalToXAxis = 0;
   this->NormalToYAxis = 0;
   this->NormalToZAxis = 0;
+  
+  this->RotateAboutXAxis = 0;
+  this->RotateAboutYAxis = 0;
+  this->RotateAboutZAxis = 0;
 
   // Build the representation of the widget
   //
   this->Plane = vtkPlane::New();
   this->Plane->SetNormal(0,0,1);
   this->Plane->SetOrigin(0,0,0);
 
   this->Box = vtkImageData::New();
@@ -787,16 +791,18 @@ void vtkImplicitPlaneWidget::Rotate(int 
   v[1] = p2[1] - p1[1];
   v[2] = p2[2] - p1[2];
 
   double *origin = this->Plane->GetOrigin();
   double *normal = this->Plane->GetNormal();
 
   // Create axis of rotation and angle of rotation
   vtkMath::Cross(vpn,v,axis);
+    
+  
   if ( vtkMath::Normalize(axis) == 0.0 )
     {
     return;
     }
   int *size = this->CurrentRenderer->GetSize();
   double l2 = (X-this->Interactor->GetLastEventPosition()[0])
              *(X-this->Interactor->GetLastEventPosition()[0])
              +(Y-this->Interactor->GetLastEventPosition()[1])
@@ -807,16 +813,29 @@ void vtkImplicitPlaneWidget::Rotate(int 
   this->Transform->Identity();
   this->Transform->Translate(origin[0],origin[1],origin[2]);
   this->Transform->RotateWXYZ(theta,axis);
   this->Transform->Translate(-origin[0],-origin[1],-origin[2]);
 
   //Set the new normal
   double nNew[3];
   this->Transform->TransformNormal(normal,nNew);
+  if(this->RotateAboutXAxis == 1)
+    {
+    nNew[0] = 0;
+    }
+  else if(this->RotateAboutYAxis == 1)
+    {
+    nNew[1] = 0;
+    }
+  else if(this->RotateAboutZAxis == 1)
+    {
+    nNew[2] = 0;
+    }
+      
   this->Plane->SetNormal(nNew);
 
   this->UpdateRepresentation();
 }
 
 //----------------------------------------------------------------------------
 // Loop through all points and translate them
 void vtkImplicitPlaneWidget::TranslatePlane(double *p1, double *p2)
@@ -1131,16 +1150,57 @@ void vtkImplicitPlaneWidget::SetDrawPlan
       }
     else
       {
       this->CurrentRenderer->RemoveActor(this->CutActor);
       }
     this->Interactor->Render();
     }
 }
+//----------------------------------------------------------------------------
+void vtkImplicitPlaneWidget::SetRotateAboutXAxis (int var)
+{
+  if (this->RotateAboutXAxis != var)
+    {
+      this->RotateAboutXAxis = var;
+    }
+  if (var)
+    {
+      this->RotateAboutYAxisOff();
+      this->RotateAboutZAxisOff();
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkImplicitPlaneWidget::SetRotateAboutYAxis (int var)
+{
+  if (this->RotateAboutYAxis != var)
+    {
+      this->RotateAboutYAxis = var;
+    }
+  if (var)
+    {
+      this->RotateAboutXAxisOff();
+      this->RotateAboutZAxisOff();
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkImplicitPlaneWidget::SetRotateAboutZAxis (int var)
+{
+  if (this->RotateAboutZAxis != var)
+    {
+      this->RotateAboutZAxis = var;
+    }
+  if (var)
+    {
+      this->RotateAboutXAxisOff();
+      this->RotateAboutYAxisOff();
+    }
+}
 
 //----------------------------------------------------------------------------
 void vtkImplicitPlaneWidget::SetNormalToXAxis (int var)
 {
   if (this->NormalToXAxis != var)
     {
     this->NormalToXAxis = var;
     this->Modified();
Index: vtkImplicitPlaneWidget.h
===================================================================
RCS file: /cvsroot/VTK/VTK/Widgets/vtkImplicitPlaneWidget.h,v
retrieving revision 1.7
diff -u -8 -p -r1.7 vtkImplicitPlaneWidget.h
--- vtkImplicitPlaneWidget.h	7 Dec 2007 13:49:01 -0000	1.7
+++ vtkImplicitPlaneWidget.h	3 Mar 2009 20:14:39 -0000
@@ -129,16 +129,32 @@ public:
   void SetNormalToYAxis(int);
   vtkGetMacro(NormalToYAxis,int);
   vtkBooleanMacro(NormalToYAxis,int);
   void SetNormalToZAxis(int);
   vtkGetMacro(NormalToZAxis,int);
   vtkBooleanMacro(NormalToZAxis,int);
 
   // Description:
+  // Force the plane widget rotate about one of the x-y-z axes.
+  // If one axis is set on, the other two will be set off.
+  // Remember that when the state changes, a ModifiedEvent is invoked.
+  // This can be used to snap the plane to the axes if it is orginally
+  // not aligned.
+  void SetRotateAboutXAxis(int);
+  vtkGetMacro(RotateAboutXAxis,int);
+  vtkBooleanMacro(RotateAboutXAxis,int);
+  void SetRotateAboutYAxis(int);
+  vtkGetMacro(RotateAboutYAxis,int);
+  vtkBooleanMacro(RotateAboutYAxis,int);
+  void SetRotateAboutZAxis(int);
+  vtkGetMacro(RotateAboutZAxis,int);
+  vtkBooleanMacro(RotateAboutZAxis,int);
+  
+  // Description:
   // Turn on/off tubing of the wire outline of the plane. The tube thickens
   // the line by wrapping with a vtkTubeFilter.
   vtkSetMacro(Tubing,int);
   vtkGetMacro(Tubing,int);
   vtkBooleanMacro(Tubing,int);
 
   // Description:
   // Enable/disable the drawing of the plane. In some cases the plane
@@ -261,16 +277,20 @@ protected:
   void OnMouseMove();
 
   // Controlling ivars
   int NormalToXAxis;
   int NormalToYAxis;
   int NormalToZAxis;
   void UpdateRepresentation();
 
+  int RotateAboutXAxis;
+  int RotateAboutYAxis;
+  int RotateAboutZAxis;
+  
   // The actual plane which is being manipulated
   vtkPlane *Plane;
 
   // The bounding box is represented by a single voxel image data
   vtkImageData      *Box;
   vtkOutlineFilter  *Outline;
   vtkPolyDataMapper *OutlineMapper;
   vtkActor          *OutlineActor;
