myView->SetWindow (theWindow, theContext);
MyViewer->SetViewOn (this);
SetRatio();
- Redraw();
+ if (myImmediateUpdate)
+ {
+ Redraw();
+ }
}
//=============================================================================
myAutoZFitIsOn = theIsOn;
}
-// ========================================================================
-// function : AutoZFitMode
-// purpose :
-// ========================================================================
-Standard_Boolean V3d_View::AutoZFitMode() const
-{
- return myAutoZFitIsOn;
-}
-
-// ========================================================================
-// function : AutoZFitScaleFactor
-// purpose :
-// ========================================================================
-Standard_Real V3d_View::AutoZFitScaleFactor() const
-{
- return myAutoZFitScaleFactor;
-}
-
//=============================================================================
//function : AutoZFit
//purpose :
myView->Resized();
SetRatio();
-
- Redraw();
+ if (myImmediateUpdate)
+ {
+ Redraw();
+ }
}
//=============================================================================
//function : SetProj
//purpose :
//=============================================================================
-void V3d_View::SetProj( const V3d_TypeOfOrientation Orientation )
+void V3d_View::SetProj (const V3d_TypeOfOrientation theOrientation,
+ const Standard_Boolean theIsYup)
{
- Standard_Real Xpn=0;
- Standard_Real Ypn=0;
- Standard_Real Zpn=0;
-
- switch (Orientation) {
- case V3d_Zpos :
- Ypn = 1.;
- break;
- case V3d_Zneg :
- Ypn = -1.;
- break;
- default:
- Zpn = 1.;
+ Graphic3d_Vec3d anUp = theIsYup ? Graphic3d_Vec3d (0.0, 1.0, 0.0) : Graphic3d_Vec3d (0.0, 0.0, 1.0);
+ if (theIsYup)
+ {
+ if (theOrientation == V3d_Ypos
+ || theOrientation == V3d_Yneg)
+ {
+ anUp.SetValues (0.0, 0.0, -1.0);
+ }
+ }
+ else
+ {
+ if (theOrientation == V3d_Zpos)
+ {
+ anUp.SetValues (0.0, 1.0, 0.0);
+ }
+ else if (theOrientation == V3d_Zneg)
+ {
+ anUp.SetValues (0.0, -1.0, 0.0);
+ }
}
- const gp_Dir aBck = V3d::GetProjAxis (Orientation);
+ const gp_Dir aBck = V3d::GetProjAxis (theOrientation);
// retain camera panning from origin when switching projection
- Handle(Graphic3d_Camera) aCamera = Camera();
-
- gp_Pnt anOriginVCS = aCamera->ConvertWorld2View (gp::Origin());
- Standard_Real aPanX = anOriginVCS.X();
- Standard_Real aPanY = anOriginVCS.Y();
+ const Handle(Graphic3d_Camera)& aCamera = Camera();
+ const gp_Pnt anOriginVCS = aCamera->ConvertWorld2View (gp::Origin());
aCamera->SetCenter (gp_Pnt (0, 0, 0));
aCamera->SetDirection (gp_Dir (aBck.X(), aBck.Y(), aBck.Z()).Reversed());
- aCamera->SetUp (gp_Dir (Xpn, Ypn, Zpn));
+ aCamera->SetUp (gp_Dir (anUp.x(), anUp.y(), anUp.z()));
aCamera->OrthogonalizeUp();
- Panning (aPanX, aPanY);
+ Panning (anOriginVCS.X(), anOriginVCS.Y());
AutoZFit();
ImmediateUpdate();
}
-//=============================================================================
-//function : WindowFitAll
-//purpose :
-//=============================================================================
-void V3d_View::WindowFitAll(const Standard_Integer Xmin,
- const Standard_Integer Ymin,
- const Standard_Integer Xmax,
- const Standard_Integer Ymax)
-{
- WindowFit(Xmin,Ymin,Xmax,Ymax);
-}
-
//=======================================================================
//function : WindowFit
//purpose :
Z = aCameraEye.Z();
}
-//=============================================================================
-//function : FocalReferencePoint
-//purpose :
-//=============================================================================
-void V3d_View::FocalReferencePoint(Standard_Real& X, Standard_Real& Y,Standard_Real& Z) const
-{
- Eye (X,Y,Z);
-}
-
//=============================================================================
//function : ProjReferenceAxe
//purpose :
return static_cast<V3d_TypeOfVisualization> (myView->VisualizationType());
}
-//=============================================================================
-//function : Viewer
-//purpose :
-//=============================================================================
-Handle(V3d_Viewer) V3d_View::Viewer() const
-{
- return MyViewer;
-}
-
//=============================================================================
//function : IfWindow
//purpose :
return myView->IsDefined();
}
-//=============================================================================
-//function : Window
-//purpose :
-//=============================================================================
-Handle(Aspect_Window) V3d_View::Window() const
-{
- return MyWindow;
-}
-
//=============================================================================
//function : Type
//purpose :
return aCamera->Distance() * 2.0 * Tan (aCamera->FOVy() * M_PI / 360.0);
}
-//=============================================================================
-//function : View
-//purpose :
-//=============================================================================
-Handle(Graphic3d_CView) V3d_View::View() const
-{
- return myView;
-}
-
//=============================================================================
//function : screenAxis
//purpose :
}
// =======================================================================
-// function : IsCullingEnabled
+// function : DiagnosticInformation
// purpose :
// =======================================================================
-Standard_Boolean V3d_View::IsCullingEnabled() const
+void V3d_View::DiagnosticInformation (TColStd_IndexedDataMapOfStringString& theDict,
+ Graphic3d_DiagnosticInfo theFlags) const
{
- return myView->IsCullingEnabled();
+ myView->DiagnosticInformation (theDict, theFlags);
}
-// =======================================================================
-// function : SetFrustumCulling
-// purpose :
-// =======================================================================
-void V3d_View::SetFrustumCulling (const Standard_Boolean theToClip)
+//=======================================================================
+//function : StatisticInformation
+//purpose :
+//=======================================================================
+void V3d_View::StatisticInformation (TColStd_IndexedDataMapOfStringString& theDict) const
{
- myView->SetCullingEnabled (theToClip);
+ myView->StatisticInformation (theDict);
}
// =======================================================================
-// function : DiagnosticInformation
+// function : StatisticInformation
// purpose :
// =======================================================================
-void V3d_View::DiagnosticInformation (TColStd_IndexedDataMapOfStringString& theDict,
- Graphic3d_DiagnosticInfo theFlags) const
+TCollection_AsciiString V3d_View::StatisticInformation() const
{
- myView->DiagnosticInformation (theDict, theFlags);
+ return myView->StatisticInformation();
}
//=============================================================================