//
// File : OCCViewer_ViewWindow.cxx
// Author :
-//
+
#include "OCCViewer_ViewWindow.h"
#include "OCCViewer_ViewModel.h"
#include "OCCViewer_ViewPort3d.h"
connect(aAction, SIGNAL(triggered()), this, SLOT(onResetView()));
toolMgr()->registerAction( aAction, ResetId );
- // Reset
- aAction = new QtxAction(tr("MNU_CLONE_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_CLONE_VIEW" ) ),
- tr( "MNU_CLONE_VIEW" ), 0, this);
+ // Clone
+ aAction = new QtxAction(tr("MNU_CLONE_VIEW"),
+ aResMgr->loadPixmap("OCCViewer", tr("ICON_OCCVIEWER_CLONE_VIEW")),
+ tr("MNU_CLONE_VIEW"), 0, this);
aAction->setStatusTip(tr("DSC_CLONE_VIEW"));
connect(aAction, SIGNAL(triggered()), this, SLOT(onCloneView()));
toolMgr()->registerAction( aAction, CloneId );
*/
void OCCViewer_ViewWindow::onSetRotationPoint( bool on )
{
- if ( on )
+ if (on)
+ {
+ if (!mySetRotationPointDlg)
{
- if ( !mySetRotationPointDlg )
- {
- mySetRotationPointDlg = new OCCViewer_SetRotationPointDlg( this, myDesktop );
- mySetRotationPointDlg->SetAction( mySetRotationPointAction );
- }
+ mySetRotationPointDlg = new OCCViewer_SetRotationPointDlg (this, myDesktop);
+ mySetRotationPointDlg->SetAction(mySetRotationPointAction);
+ }
- if ( !mySetRotationPointDlg->isVisible() )
+ if (!mySetRotationPointDlg->isVisible())
+ {
+ //if (mySetRotationPointDlg->IsFirstShown())
+ if (myCurrPointType == GRAVITY)
{
- if ( mySetRotationPointDlg->IsFirstShown() )
- {
- Standard_Real Xcenter, Ycenter, Zcenter;
- if ( computeGravityCenter( Xcenter, Ycenter, Zcenter ) )
- mySetRotationPointDlg->setCoords( Xcenter, Ycenter, Zcenter );
- }
- mySetRotationPointDlg->show();
+ Standard_Real Xcenter, Ycenter, Zcenter;
+ if (computeGravityCenter(Xcenter, Ycenter, Zcenter))
+ mySetRotationPointDlg->setCoords(Xcenter, Ycenter, Zcenter);
}
+ mySetRotationPointDlg->show();
}
+ }
else
- {
- if ( mySetRotationPointDlg->isVisible() )
- mySetRotationPointDlg->hide();
- }
+ {
+ if (mySetRotationPointDlg->isVisible())
+ mySetRotationPointDlg->hide();
+ }
}
/*!