-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
/*!
\brief Checks whether the interactive operation is in progress.
- \return TRUE if the interaction is performed on IO object meaning
+ \return \c true if the interaction is performed on IO object meaning
that no other operations in viewer should be processed.
*/
bool OCCViewer_ClipPlaneInteractor::isPerforming() const
/*!
\brief Checks whether the interactive plane can be clicked.
- \return TRUE if the click interaction is supported for the plane.
+ \return \c true if the click interaction is supported for the plane.
*/
bool OCCViewer_ClipPlaneInteractor::isClickable( const Handle(AIS_Plane)& thePlane )
{
Handle(AIS_InteractiveContext) anAISContext = myViewer->getAISContext();
- if ( anAISContext->IsSelected( thePlane ) )
+ if ( anAISContext->IsSelected( Handle(AIS_InteractiveObject)::DownCast(thePlane) ) )
{
return false;
}
/*!
\brief Checks whether the interactive plane can be dragged.
- \return TRUE if the dragging interaction is supported for the plane.
+ \return \c true if the dragging interaction is supported for the plane.
*/
bool OCCViewer_ClipPlaneInteractor::isDraggable( const Handle(AIS_Plane)& thePlane )
{
Handle(AIS_InteractiveContext) anAISContext = myViewer->getAISContext();
- if ( !anAISContext->IsSelected( thePlane ) )
+ if ( !anAISContext->IsSelected( Handle(AIS_InteractiveObject)::DownCast(thePlane) ) )
{
return false;
}
thePlane->SetToUpdate();
thePlane->UpdateSelection();
- myViewer->getAISContext()->Update( thePlane );
+ myViewer->getAISContext()->Update( thePlane , Standard_True );
}
break;
thePlane->SetToUpdate();
thePlane->UpdateSelection();
- myViewer->getAISContext()->Update( thePlane );
+ myViewer->getAISContext()->Update( thePlane , Standard_True );
}
break;
}
Handle(AIS_InteractiveContext) anAISContext = myViewer->getAISContext();
// check detection of plane
- anAISContext->MoveTo( theEvent->x(), theEvent->y(), aView3D );
+ anAISContext->MoveTo( theEvent->x(), theEvent->y(), aView3D , Standard_True );
if ( !anAISContext->HasDetected() )
{
myIsClickable = isClickable( aPlane );
// process mouse click on the object
- if ( myIsClickable );
+ if ( myIsClickable )
{
- myViewer->getAISContext()->SetSelected( aPlane );
+ myViewer->getAISContext()->SetSelected( Handle(AIS_InteractiveObject)::DownCast(aPlane) , Standard_True );
emit planeClicked( aPlane );
}