// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-
#include <IVtkVTK_View.hxx>
+
+// prevent disabling some MSVC warning messages by VTK headers
+#ifdef _MSC_VER
+#pragma warning(push)
+#endif
#include <vtkAutoInit.h>
#include <vtkCamera.h>
#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
#include <vtkTransform.h>
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+IMPLEMENT_STANDARD_RTTIEXT(IVtkVTK_View,IVtk_IView)
// Initialization of VTK object factories.
// Since VTK 6 the factory methods require "auto-initialization" depending on
// what modules are enabled at VTK configure time.
// Some defines are needed in order to make the factories work properly.
-VTK_MODULE_INIT(vtkRenderingOpenGL);
-VTK_MODULE_INIT(vtkInteractionStyle);
+#ifdef VTK_OPENGL2_BACKEND
+VTK_MODULE_INIT(vtkRenderingOpenGL2)
+#else
+VTK_MODULE_INIT(vtkRenderingOpenGL)
+#endif
+VTK_MODULE_INIT(vtkInteractionStyle)
// Handle implementation
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 :
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 :
myRenderer->SetDisplayPoint (theDisplayPnt.X(), theDisplayPnt.Y(), 0.0);
myRenderer->DisplayToWorld();
- vtkFloatingPointType* const aCoords = myRenderer->GetWorldPoint();
+ double* const aCoords = myRenderer->GetWorldPoint();
if (aCoords[3] == 0.0) // Point at infinity in homogeneous coordinates
{
return false;
}
- theWorldPnt = gp_XYZ (aCoords[0] / aCoords[3], aCoords[1] / aCoords[3], aCoords[2] / aCoords[3]);
+ theWorldPnt = gp_XYZ (aCoords[0] / aCoords[3],
+ aCoords[1] / aCoords[3], aCoords[2] / aCoords[3]);
return true;
}
theIsOrtho = !IsPerspective();
vtkMatrix4x4* aCompositeProj =
- myRenderer->GetActiveCamera()->GetCompositeProjectionTransformMatrix (myRenderer->GetTiledAspectRatio(),
- 0,
- 1);
+ myRenderer->GetActiveCamera()->
+ GetCompositeProjectionTransformMatrix (myRenderer->GetTiledAspectRatio(),
+ 0,
+ 1);
for (Standard_Integer aRow = 0; aRow < 4; ++aRow)
{
for (Standard_Integer aCol = 0; aCol < 4; ++aCol)