it is impossible to release "Select Point from View" button...
setEnabled(myGroupBoxCoord,!myIsBBCenter->isChecked());
if ( myIsBBCenter->isChecked() )
+ {
+ if ( mySelectPoint->state() == QButton::On )
+ mySelectPoint->toggle();
myView->activateSetRotationGravity();
+ }
else
myView->activateSetRotationSelected(myX->text().toDouble(),
myY->text().toDouble(),
OCCViewer_SetRotationPointDlg
::onToOrigin()
{
+ if ( mySelectPoint->state() == QButton::On )
+ mySelectPoint->toggle();
setCoords();
myView->activateSetRotationSelected(myX->text().toDouble(),
myY->text().toDouble(),
::onCoordChanged()
{
if ( !myIsBBCenter->isChecked() )
+ {
+ if ( mySelectPoint->state() == QButton::On
+ &&
+ ( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) )
+ mySelectPoint->toggle();
myView->activateSetRotationSelected(myX->text().toDouble(),
myY->text().toDouble(),
myZ->text().toDouble());
+ }
}
void
if ( !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
{
gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( ic->SelectedShape() ) );
- if ( mySetRotationPointDlg ) mySetRotationPointDlg->setCoords(aPnt.X(), aPnt.Y(), aPnt.Z());
+ if ( mySetRotationPointDlg )
+ {
+ myRotationPointSelection = false;
+ mySetRotationPointDlg->setCoords(aPnt.X(), aPnt.Y(), aPnt.Z());
+ }
}
else
{
*/
void OCCViewer_ViewWindow::activateSetRotationGravity()
{
+ if ( myRotationPointSelection )
+ {
+ Handle(AIS_InteractiveContext) ic = myModel->getAISContext();
+ ic->CloseAllContexts();
+ myOperation = NOTHING;
+ setCursor( myCursor );
+ myCursorIsHand = false;
+ myRotationPointSelection = false;
+ }
+
myPrevPointType = myCurrPointType;
myCurrPointType = GRAVITY;
*/
void OCCViewer_ViewWindow::activateSetRotationSelected(double theX, double theY, double theZ)
{
+ if ( myRotationPointSelection )
+ {
+ Handle(AIS_InteractiveContext) ic = myModel->getAISContext();
+ ic->CloseAllContexts();
+ myOperation = NOTHING;
+ setCursor( myCursor );
+ myCursorIsHand = false;
+ myRotationPointSelection = false;
+ }
+
myPrevPointType = myCurrPointType;
myCurrPointType = SELECTED;
mySelectedPoint.SetCoord(theX,theY,theZ);
*/
void OCCViewer_ViewWindow::onSetRotationPoint( bool on )
{
- SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
-
if ( on )
{
if ( !mySetRotationPointDlg )
// invoke event for update coordinates in SVTK_SetRotationPointDlg
InvokeEvent(SVTK::RotationPointChanged,(void*)aCoords);
-
- myHighlightRotationPointActor->SetVisibility( false );
- if(GetCurrentRenderer() != NULL)
- GetCurrentRenderer()->RemoveActor( myHighlightRotationPointActor.GetPointer() );
}
else
{
myCurrRotationPointType = myPrevRotationPointType;
}
+ myHighlightRotationPointActor->SetVisibility( false );
+ if(GetCurrentRenderer() != NULL)
+ GetCurrentRenderer()->RemoveActor( myHighlightRotationPointActor.GetPointer() );
+
GetRenderWidget()->setCursor(myDefCursor);
}
else
return;
case SVTK::SetRotateGravity:
+ if ( self->myCurrRotationPointType == SVTK::StartPointSelection )
+ {
+ self->myHighlightRotationPointActor->SetVisibility( false );
+ if( self->GetCurrentRenderer() != NULL )
+ self->GetCurrentRenderer()->RemoveActor( self->myHighlightRotationPointActor.GetPointer() );
+ self->GetRenderWidget()->setCursor(self->myDefCursor);
+ }
self->myPrevRotationPointType = self->myCurrRotationPointType;
self->myCurrRotationPointType = SVTK::SetRotateGravity;
if ( ComputeBBCenter(self->GetCurrentRenderer(),aCenter) )
return;
case SVTK::ChangeRotationPoint:
+ if ( self->myCurrRotationPointType == SVTK::StartPointSelection )
+ {
+ self->myHighlightRotationPointActor->SetVisibility( false );
+ if( self->GetCurrentRenderer() != NULL )
+ self->GetCurrentRenderer()->RemoveActor( self->myHighlightRotationPointActor.GetPointer() );
+ self->GetRenderWidget()->setCursor(self->myDefCursor);
+ }
self->myPrevRotationPointType = self->myCurrRotationPointType;
self->myCurrRotationPointType = SVTK::SetRotateSelected;
aSelectedPoint = (vtkFloatingPointType*)callData;
setEnabled(myGroupBoxCoord,!myIsBBCenter->isChecked());
if ( myIsBBCenter->isChecked() )
- { // activate mode : the rotation point is the center of the bounding box
+ {
+ if ( mySelectPoint->state() == QButton::On )
+ mySelectPoint->toggle();
+ // activate mode : the rotation point is the center of the bounding box
// send the data to the SVTK_InteractorStyle: set the type of the rotation point
// calculate coordinates of the rotation point
myMainWindow->activateSetRotationGravity();
SVTK_SetRotationPointDlg
::onToOrigin()
{
+ if ( mySelectPoint->state() == QButton::On )
+ mySelectPoint->toggle();
myX->setText(QString::number(0.0));
myY->setText(QString::number(0.0));
myZ->setText(QString::number(0.0));
::onCoordChanged()
{
if ( !myIsBBCenter->isChecked() ) {
+ if ( mySelectPoint->state() == QButton::On
+ &&
+ ( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) )
+ mySelectPoint->toggle();
vtkFloatingPointType aCenter[3] = {myX->text().toDouble(),
myY->text().toDouble(),
myZ->text().toDouble()};