0032400: Visualization, TKIVtk - convert VTK camera to OCC
authorosa <osa@opencascade.com>
Fri, 28 May 2021 14:39:11 +0000 (17:39 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 18 Jun 2021 15:34:02 +0000 (18:34 +0300)
Add new interfaces GetEyePosition(), GetClippingRange(), GetAspectRatio() to IVTK_IView
Add ivtkviewparams command to print current parameters of view
Add ivtkcamera comand to print current camera parameters or manages camera parameters (set ortho or persp projection)

src/IVtk/IVtk_IView.hxx
src/IVtkDraw/IVtkDraw.cxx
src/IVtkOCC/IVtkOCC_ViewerSelector.cxx
src/IVtkOCC/IVtkOCC_ViewerSelector.hxx
src/IVtkVTK/IVtkVTK_View.cxx
src/IVtkVTK/IVtkVTK_View.hxx
src/ViewerTest/ViewerTest_ViewerCommands.cxx
tests/vtk/ivtk/bug32400 [new file with mode: 0644]

index 8b24564ffc8dca019df35ce018c68df4de631559..5cd5b4b065bc44996b5eca4641f3089c50d64a75 100644 (file)
@@ -45,6 +45,9 @@ public:
   //! @return The focal distance of the view
   virtual double  GetDistance() const = 0;
 
+  //! @return The world coordinates of the camera position
+  virtual void    GetEyePosition (double& theX, double& theY, double& theZ) const = 0;
+
   //! @return The world coordinates of the view position
   virtual void    GetPosition (double& theX, double& theY, double& theZ) const = 0;
 
@@ -65,6 +68,12 @@ public:
   //! @return The current view angle (for perspective projection)
   virtual double  GetViewAngle() const = 0;
 
+  //! @return The location of the near and far clipping planes along the direction of projection
+  virtual void    GetClippingRange (double& theZNear, double& theZFar) const = 0;
+
+  //! @return The current view the aspect ratio
+  virtual double  GetAspectRatio() const = 0;
+
   //! @return Two doubles containing the display coordinates of the view window center 
   virtual void    GetViewCenter (double& theX, double& theY) const = 0;
 
index 80cd7f0c8d3cf62cdf57bfdf8939d56832d022f1..4f54a5976275cbe5e93fe24b832499c7777faf9f 100644 (file)
@@ -64,6 +64,7 @@
 #include <vtkImageWriter.h>
 #include <vtkInteractorStyleTrackballCamera.h>
 #include <vtkJPEGWriter.h>
+#include <vtkMatrix4x4.h>
 #include <vtkPNGWriter.h>
 #include <vtkPNMWriter.h>
 #include <vtkPolyDataMapper.h>
@@ -1401,6 +1402,123 @@ static Standard_Integer VtkViewProj (Draw_Interpretor& ,
   return 0;
 }
 
+//=================================================================================================
+//function : VtkViewParams
+//purpose  :
+//=================================================================================================
+static int VtkViewParams (Draw_Interpretor& theDI, Standard_Integer theArgsNb, const char** /*theArgVec*/)
+{
+  if (!GetInteractor()
+   || !GetInteractor()->IsEnabled())
+  {
+    Message::SendFail() << "Error: call ivtkinit before";
+    return 1;
+  }
+  else if (theArgsNb != 1)
+  {
+    Message::SendFail() << "Syntax error: wrong number of arguments";
+    return 1;
+  }
+
+  vtkCamera* aCam = GetRenderer()->GetActiveCamera();
+
+  gp_XYZ aViewUp, aViewProj, aViewEye, aViewAt;
+  aCam->GetViewUp (aViewUp.ChangeCoord(1), aViewUp.ChangeCoord(2), aViewUp.ChangeCoord(3));
+  aCam->GetDirectionOfProjection (aViewProj.ChangeCoord(1), aViewProj.ChangeCoord(2), aViewProj.ChangeCoord(3));
+  aViewProj.Reverse();
+  aCam->GetPosition (aViewEye.ChangeCoord(1), aViewEye.ChangeCoord(2), aViewEye.ChangeCoord(3));
+  aCam->GetFocalPoint (aViewAt.ChangeCoord(1), aViewAt.ChangeCoord(2), aViewAt.ChangeCoord(3));
+  const Standard_Real aViewScale = aCam->GetParallelScale();
+  const Standard_Real aViewAspect = GetRenderer()->GetTiledAspectRatio();
+  vtkMatrix4x4* aProjMat = aCam->GetProjectionTransformMatrix (GetRenderer()->GetTiledAspectRatio(), -1, 1);
+  vtkMatrix4x4* aViewMat = aCam->GetViewTransformMatrix();
+  // print all of the available view parameters
+  char aText[4096];
+  Sprintf (aText,
+           "Scale: %g\n"
+           "Aspect:  %g\n"
+           "Proj:  %12g %12g %12g\n"
+           "Up:    %12g %12g %12g\n"
+           "At:    %12g %12g %12g\n"
+           "Eye:   %12g %12g %12g\n"
+           "ViewMat:       %12g %12g %12g %12g\n"
+           "               %12g %12g %12g %12g\n"
+           "               %12g %12g %12g %12g\n"
+           "               %12g %12g %12g %12g\n"
+           "ProjMat:       %12g %12g %12g %12g\n"
+           "               %12g %12g %12g %12g\n"
+           "               %12g %12g %12g %12g\n"
+           "               %12g %12g %12g %12g\n",
+           aViewScale, aViewAspect,
+           aViewProj.X(), aViewProj.Y(), aViewProj.Z(),
+           aViewUp.X(), aViewUp.Y(), aViewUp.Z(),
+           aViewAt.X(), aViewAt.Y(), aViewAt.Z(),
+           aViewEye.X(), aViewEye.Y(), aViewEye.Z(),
+           aViewMat->GetElement (0, 0), aViewMat->GetElement(0, 1), aViewMat->GetElement(0, 2), aViewMat->GetElement(0, 3),
+           aViewMat->GetElement (1, 0), aViewMat->GetElement(1, 1), aViewMat->GetElement(1, 2), aViewMat->GetElement(1, 3),
+           aViewMat->GetElement (2, 0), aViewMat->GetElement(2, 1), aViewMat->GetElement(2, 2), aViewMat->GetElement(2, 3),
+           aViewMat->GetElement (3, 0), aViewMat->GetElement(3, 1), aViewMat->GetElement(3, 2), aViewMat->GetElement(3, 3),
+           aProjMat->GetElement (0, 0), aProjMat->GetElement(0, 1), aProjMat->GetElement(0, 2), aProjMat->GetElement(0, 3),
+           aProjMat->GetElement (1, 0), aProjMat->GetElement(1, 1), aProjMat->GetElement(1, 2), aProjMat->GetElement(1, 3),
+           aProjMat->GetElement (2, 0), aProjMat->GetElement(2, 1), aProjMat->GetElement(2, 2), aProjMat->GetElement(2, 3),
+           aProjMat->GetElement (3, 0), aProjMat->GetElement(3, 1), aProjMat->GetElement(3, 2), aProjMat->GetElement(3, 3));
+  theDI << aText;
+  return 0;
+}
+
+//=================================================================================================
+//function : VtkCamera
+//purpose  :
+//=================================================================================================
+static int VtkCamera (Draw_Interpretor& theDI, Standard_Integer theArgsNb, const char** theArgVec)
+{
+  if (!GetInteractor()
+   || !GetInteractor()->IsEnabled())
+  {
+    Message::SendFail() << "Error: call ivtkinit before";
+    return 1;
+  }
+
+  vtkCamera* aCamera = GetRenderer()->GetActiveCamera();
+
+  if (theArgsNb < 2)
+  {
+    Standard_Real aZNear = 0.0, aZFar = 0.0;
+    aCamera->GetClippingRange (aZNear, aZFar);
+    theDI << "ProjType:   " << (aCamera->GetParallelProjection() ? "orthographic" : "perspective") << "\n";
+    theDI << "FOVy:       " << aCamera->GetViewAngle() << "\n";
+    theDI << "Distance:   " << aCamera->GetDistance() << "\n";
+    theDI << "ZNear:      " << aZNear << "\n";
+    theDI << "ZFar:       " << aZFar << "\n";
+    return 0;
+  }
+
+  for (Standard_Integer anArgIter = 1; anArgIter < theArgsNb; ++anArgIter)
+  {
+    Standard_CString        anArg = theArgVec[anArgIter];
+    TCollection_AsciiString anArgCase(anArg);
+    anArgCase.LowerCase();
+    if (anArgCase == "-ortho"
+     || anArgCase == "-orthographic")
+    {
+      aCamera->SetParallelProjection (true);
+    }
+    else if (anArgCase == "-persp"
+          || anArgCase == "-perspective")
+    {
+      aCamera->SetParallelProjection (false);
+    }
+    else
+    {
+      Message::SendFail() << "Error: unknown argument '" << anArg << "'";
+      return 1;
+    }
+  }
+  GetRenderer()->ResetCamera();
+  GetInteractor()->Render();
+  return 0;
+}
+
 //===================================================================
 // Fubction  : VtkDump
 // Purpose   :
@@ -1732,6 +1850,20 @@ void IVtkDraw::Commands (Draw_Interpretor& theCommands)
               "ivtksettransparency name 0..1"
       "\n\t\t: Sets transparency to the object with name 'name'.",
     __FILE__, VtkSetTransparency, group);
+
+  theCommands.Add("ivtkviewparams",
+              "ivtkviewparams: Prints all current view parameters.",
+    __FILE__, VtkViewParams, group);
+
+  theCommands.Add("ivtkcamera",
+              "ivtkcamera [-ortho] [-persp]"
+      "\n\t\t: Manages camera parameters."
+      "\n\t\t: Prints current value when option called without argument."
+      "\n\t\t: Orthographic camera:"
+      "\n\t\t:   -ortho      activate orthographic projection"
+      "\n\t\t: Perspective camera:"
+      "\n\t\t:   -persp      activate perspective  projection",
+    __FILE__, VtkCamera, group);
 }
 
 //================================================================
index d942f50931a600b5c04af1492ee4bd405712263a..f3c124cae65888d2e2932cdfdfc1200cedb1d146 100644 (file)
@@ -40,6 +40,45 @@ IVtkOCC_ViewerSelector::~IVtkOCC_ViewerSelector()
 {
 }
 
+//============================================================================
+// Method: ConvertVtkToOccCamera
+// Purpose:
+//============================================================================
+Handle(Graphic3d_Camera) IVtkOCC_ViewerSelector::ConvertVtkToOccCamera (const IVtk_IView::Handle& theView)
+{
+  Handle(Graphic3d_Camera) aCamera = new Graphic3d_Camera();
+  aCamera->SetZeroToOneDepth (true);
+  Standard_Boolean isOrthographic = !theView->IsPerspective();
+  aCamera->SetProjectionType (isOrthographic ? Graphic3d_Camera::Projection_Orthographic : Graphic3d_Camera::Projection_Perspective);
+  if (isOrthographic)
+  {
+    aCamera->SetScale (2 * theView->GetParallelScale());
+  }
+  else
+  {
+    aCamera->SetFOVy (theView->GetViewAngle());
+  }
+  Standard_Real aZNear = 0.0, aZFar = 0.0;
+  theView->GetClippingRange (aZNear, aZFar);
+  aCamera->SetZRange (aZNear, aZFar);
+  aCamera->SetAspect (theView->GetAspectRatio());
+  gp_XYZ anAxialScale;
+  theView->GetScale (anAxialScale.ChangeCoord (1), anAxialScale.ChangeCoord (2), anAxialScale.ChangeCoord (3));
+  aCamera->SetAxialScale (anAxialScale);
+
+  gp_XYZ anUp, aDir, anEyePos;
+  theView->GetViewUp (anUp.ChangeCoord(1), anUp.ChangeCoord(2), anUp.ChangeCoord(3));
+  theView->GetDirectionOfProjection (aDir.ChangeCoord(1), aDir.ChangeCoord(2), aDir.ChangeCoord(3));
+  theView->GetEyePosition (anEyePos.ChangeCoord(1), anEyePos.ChangeCoord(2), anEyePos.ChangeCoord(3));
+
+  aCamera->SetDistance (theView->GetDistance());
+  aCamera->SetUp (anUp);
+  aCamera->SetDirectionFromEye (aDir.Reversed());
+  aCamera->MoveEyeTo (anEyePos);
+
+  return aCamera;
+}
+
 //============================================================================
 // Method:  Pick
 // Purpose: Implements point picking
@@ -63,18 +102,13 @@ void IVtkOCC_ViewerSelector::Pick (const Standard_Integer theXPix,
     myToUpdateTol = Standard_False;
   }
 
-  Standard_Integer aWidth = 0, aHeight = 0;
-  Graphic3d_Mat4d aProj, anOrient;
-  Standard_Boolean isOrthographic = Standard_False;
-  Standard_Real aX = RealLast(), aY = RealLast();
-  Standard_Real aVpWidth = RealLast(), aVpHeight = RealLast();
-
-  theView->GetCamera (aProj, anOrient, isOrthographic);
-  mySelectingVolumeMgr.SetCamera (aProj, anOrient, isOrthographic);
+  mySelectingVolumeMgr.SetCamera (ConvertVtkToOccCamera (theView));
 
+  Standard_Integer aWidth = 0, aHeight = 0;
   theView->GetWindowSize (aWidth, aHeight);
   mySelectingVolumeMgr.SetWindowSize (aWidth, aHeight);
-
+  Standard_Real aX = RealLast(), aY = RealLast();
+  Standard_Real aVpWidth = RealLast(), aVpHeight = RealLast();
   theView->GetViewport (aX, aY, aVpWidth, aVpHeight);
   mySelectingVolumeMgr.SetViewport (aX, aY, aVpWidth, aVpHeight);
 
@@ -113,12 +147,10 @@ void IVtkOCC_ViewerSelector::Pick (const Standard_Integer    theXMin,
 
   Standard_Integer aWidth = 0, aHeight = 0;
   Graphic3d_Mat4d aProj, anOrient;
-  Standard_Boolean isOrthographic = Standard_False;
   Standard_Real aX = RealLast(), aY = RealLast();
   Standard_Real aVpWidth = RealLast(), aVpHeight = RealLast();
 
-  theView->GetCamera (aProj, anOrient, isOrthographic);
-  mySelectingVolumeMgr.SetCamera (aProj, anOrient, isOrthographic);
+  mySelectingVolumeMgr.SetCamera (ConvertVtkToOccCamera (theView));
 
   theView->GetWindowSize (aWidth, aHeight);
   mySelectingVolumeMgr.SetWindowSize (aWidth, aHeight);
@@ -162,12 +194,10 @@ void IVtkOCC_ViewerSelector::Pick (double**                  thePoly,
 
   Standard_Integer aWidth = 0, aHeight = 0;
   Graphic3d_Mat4d aProj, anOrient;
-  Standard_Boolean isOrthographic = Standard_False;
   Standard_Real aX = RealLast(), aY = RealLast();
   Standard_Real aVpWidth = RealLast(), aVpHeight = RealLast();
 
-  theView->GetCamera (aProj, anOrient, isOrthographic);
-  mySelectingVolumeMgr.SetCamera (aProj, anOrient, isOrthographic);
+  mySelectingVolumeMgr.SetCamera (ConvertVtkToOccCamera (theView));
 
   theView->GetWindowSize (aWidth, aHeight);
   mySelectingVolumeMgr.SetWindowSize (aWidth, aHeight);
index a818f9fcd400bda34e68c18b7c6dcdbce1ca8969..2e24bd3257f19b0543dc7fcf3e51ede49ded442e 100644 (file)
@@ -57,6 +57,9 @@ public:
   //! Deactivate the given selection
   void Deactivate (const Handle(SelectMgr_Selection)& theSelection);
 
+  //! Converts VTK camera defiened for input view to OCC camera
+  static Handle(Graphic3d_Camera) ConvertVtkToOccCamera (const IVtk_IView::Handle& theView);
+
   DEFINE_STANDARD_RTTIEXT(IVtkOCC_ViewerSelector,SelectMgr_ViewerSelector)
 
 private:
index 1544edfa6439b4a26e97ebaead1c6ad3b7a034ec..8116fe004427a8aabd253c352175f26d82d5a9e5 100644 (file)
@@ -77,6 +77,15 @@ double IVtkVTK_View::GetDistance() const
   return myRenderer->GetActiveCamera()->GetDistance();
 }
 
+//================================================================
+// Function : GetEyePosition
+// Purpose  : 
+//================================================================
+void IVtkVTK_View::GetEyePosition (double& theX, double& theY, double& theZ) const
+{
+  myRenderer->GetActiveCamera()->GetPosition (theX, theY, theZ);
+}
+
 //================================================================
 // Function : GetPosition
 // Purpose  : 
@@ -141,6 +150,24 @@ double IVtkVTK_View::GetViewAngle() const
   return myRenderer->GetActiveCamera()->GetViewAngle();
 }
 
+//================================================================
+// Function : GetAspectRatio
+// Purpose  : 
+//================================================================
+double IVtkVTK_View::GetAspectRatio() const
+{
+  return myRenderer->GetTiledAspectRatio();
+}
+
+//================================================================
+// Function : GetClippingRange
+// Purpose  : 
+//================================================================
+void IVtkVTK_View::GetClippingRange (double& theZNear, double& theZFar) const
+{
+  myRenderer->GetActiveCamera()->GetClippingRange (theZNear, theZFar);
+}
+
 //================================================================
 // Function : GetViewCenter
 // Purpose  : 
index 50104af2765d115ee118c909cea5c251244f91bd..fc9ef0107883a43f794472014f27f8a79d6f3f4b 100644 (file)
@@ -47,6 +47,9 @@ public:
   //! @return The focal distance of the view
   Standard_EXPORT virtual double  GetDistance() const Standard_OVERRIDE;
 
+  //! @return The world coordinates of the camera position
+  Standard_EXPORT virtual void    GetEyePosition (double& theX, double& theY, double& theZ) const Standard_OVERRIDE;
+
   //! @return The world coordinates of the view position
   Standard_EXPORT virtual void    GetPosition (double& theX, double& theY, double& theZ) const Standard_OVERRIDE;
 
@@ -67,6 +70,12 @@ public:
   //! @return The current view angle (for perspective projection)
   Standard_EXPORT virtual double  GetViewAngle() const Standard_OVERRIDE;
 
+  //! @return The location of the near and far clipping planes along the direction of projection
+  Standard_EXPORT virtual void    GetClippingRange (double& theZNear, double& theZFar) const Standard_OVERRIDE;
+
+  //! @return The current view the aspect ratio
+  Standard_EXPORT virtual double  GetAspectRatio() const Standard_OVERRIDE;
+
   //! @return Two doubles containing the display coordinates of the view window center 
   Standard_EXPORT virtual void    GetViewCenter (double& theX, double& theY) const Standard_OVERRIDE;
 
index ac31f4e44af0c16e0a160f0696b967dbc7ad2e85..566fd78023a981ac5575ef86b36bfb075d00625b 100644 (file)
@@ -7476,6 +7476,7 @@ static int VViewParams (Draw_Interpretor& theDi, Standard_Integer theArgsNb, con
   Standard_Boolean toSetSize     = Standard_False;
   Standard_Boolean toSetCenter2d = Standard_False;
   Standard_Real    aViewScale = aView->Scale();
+  Standard_Real    aViewAspect = aView->Camera()->Aspect();
   Standard_Real    aViewSize  = 1.0;
   Graphic3d_Vec2i  aCenter2d;
   gp_XYZ aViewProj, aViewUp, aViewAt, aViewEye;
@@ -7483,21 +7484,40 @@ static int VViewParams (Draw_Interpretor& theDi, Standard_Integer theArgsNb, con
   aView->Up   (aViewUp  .ChangeCoord (1), aViewUp  .ChangeCoord (2), aViewUp  .ChangeCoord (3));
   aView->At   (aViewAt  .ChangeCoord (1), aViewAt  .ChangeCoord (2), aViewAt  .ChangeCoord (3));
   aView->Eye  (aViewEye .ChangeCoord (1), aViewEye .ChangeCoord (2), aViewEye .ChangeCoord (3));
+  const Graphic3d_Mat4d& anOrientMat = aView->Camera()->OrientationMatrix();
+  const Graphic3d_Mat4d& aProjMat = aView->Camera()->ProjectionMatrix();
   if (theArgsNb == 1)
   {
     // print all of the available view parameters
     char aText[4096];
     Sprintf (aText,
-             "Scale: %g\n"
-             "Proj:  %12g %12g %12g\n"
-             "Up:    %12g %12g %12g\n"
-             "At:    %12g %12g %12g\n"
-             "Eye:   %12g %12g %12g\n",
-              aViewScale,
+             "Scale:  %g\n"
+             "Aspect: %g\n"
+             "Proj:   %12g %12g %12g\n"
+             "Up:     %12g %12g %12g\n"
+             "At:     %12g %12g %12g\n"
+             "Eye:    %12g %12g %12g\n"
+             "OrientMat:    %12g %12g %12g %12g\n"
+             "              %12g %12g %12g %12g\n"
+             "              %12g %12g %12g %12g\n"
+             "              %12g %12g %12g %12g\n"
+             "ProjMat:      %12g %12g %12g %12g\n"
+             "              %12g %12g %12g %12g\n"
+             "              %12g %12g %12g %12g\n"
+             "              %12g %12g %12g %12g\n",
+              aViewScale, aViewAspect,
               aViewProj.X(), aViewProj.Y(), aViewProj.Z(),
               aViewUp.X(),   aViewUp.Y(),   aViewUp.Z(),
               aViewAt.X(),   aViewAt.Y(),   aViewAt.Z(),
-              aViewEye.X(),  aViewEye.Y(),  aViewEye.Z());
+              aViewEye.X(),  aViewEye.Y(),  aViewEye.Z(),
+              anOrientMat.GetValue (0, 0), anOrientMat.GetValue (0, 1), anOrientMat.GetValue (0, 2), anOrientMat.GetValue (0, 3),
+              anOrientMat.GetValue (1, 0), anOrientMat.GetValue (1, 1), anOrientMat.GetValue (1, 2), anOrientMat.GetValue (1, 3),
+              anOrientMat.GetValue (2, 0), anOrientMat.GetValue (2, 1), anOrientMat.GetValue (2, 2), anOrientMat.GetValue (2, 3),
+              anOrientMat.GetValue (3, 0), anOrientMat.GetValue (3, 1), anOrientMat.GetValue (3, 2), anOrientMat.GetValue (3, 3),
+              aProjMat.GetValue (0, 0), aProjMat.GetValue (0, 1), aProjMat.GetValue (0, 2), aProjMat.GetValue (0, 3),
+              aProjMat.GetValue (1, 0), aProjMat.GetValue (1, 1), aProjMat.GetValue (1, 2), aProjMat.GetValue (1, 3),
+              aProjMat.GetValue (2, 0), aProjMat.GetValue (2, 1), aProjMat.GetValue (2, 2), aProjMat.GetValue (2, 3),
+              aProjMat.GetValue (3, 0), aProjMat.GetValue (3, 1), aProjMat.GetValue (3, 2), aProjMat.GetValue (3, 3));
     theDi << aText;
     return 0;
   }
@@ -9536,6 +9556,8 @@ static int VCamera (Draw_Interpretor& theDI,
     theDI << "IODType:    " << (aCamera->GetIODType() == Graphic3d_Camera::IODType_Absolute   ? "absolute" : "relative") << "\n";
     theDI << "ZFocus:     " << aCamera->ZFocus() << "\n";
     theDI << "ZFocusType: " << (aCamera->ZFocusType() == Graphic3d_Camera::FocusType_Absolute ? "absolute" : "relative") << "\n";
+    theDI << "ZNear:      " << aCamera->ZNear() << "\n";
+    theDI << "ZFar:       " << aCamera->ZFar() << "\n";
     return 0;
   }
 
diff --git a/tests/vtk/ivtk/bug32400 b/tests/vtk/ivtk/bug32400
new file mode 100644 (file)
index 0000000..b9a0397
--- /dev/null
@@ -0,0 +1,35 @@
+puts "============"
+puts "0032400: Visualization, TKIVtk - convert VTK camera to OCC"
+puts "============"
+puts ""
+
+pload MODELING VIS
+box b 1 1 1
+ivtkinit
+ivtkdisplay b
+ivtkmoveto 100 100
+
+
+psphere ss 2
+box bb -min -1 -1 2 -max 1 1 4
+ivtkinit
+ivtkdisplay bb
+ivtksetdispmode bb 1
+ivtkdisplay ss
+ivtksetdispmode ss 1
+ivtkcamera -ortho
+ivtktop
+ivtkfit
+
+ivtkcamera
+ivtkviewparams
+set point [ivtkmoveto 200 200]
+regexp {([-0-9.+eE]+ [-0-9.+eE]+ [-0-9.+eE]+)} ${point} full p
+checkpoint "point_ortho" $p {-0.090334585045725627 0.07055554071451263 4} 0.001
+ivtkdump $imagedir/${casename}_ortho.png
+
+ivtkcamera -persp
+set point [ivtkmoveto 200 200]
+regexp {([-0-9.+eE]+ [-0-9.+eE]+ [-0-9.+eE]+)} ${point} full p
+checkpoint "point_persp" $p {-0.075846060294573109 0.059286688130282886 3.9999999999999996} 0.001
+ivtkdump $imagedir/${casename}_persp.png