X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGLViewer%2FGLViewer_Selector2d.cxx;h=ae2cef91a8992158a79bb337b027519271d2c3c7;hb=797f7c8b3ebf8d8a1eabc9082f8bd79f6f7ea413;hp=e8a414d464425ddd34b3a3d855d89de0d72babe2;hpb=28124bc2dd22481a5a915b2b96b835ef5323a6f6;p=modules%2Fgui.git diff --git a/src/GLViewer/GLViewer_Selector2d.cxx b/src/GLViewer/GLViewer_Selector2d.cxx index e8a414d46..ae2cef91a 100644 --- a/src/GLViewer/GLViewer_Selector2d.cxx +++ b/src/GLViewer/GLViewer_Selector2d.cxx @@ -1,40 +1,39 @@ -// Copyright (C) 2005 OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // -// 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. +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// 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, or (at your option) any later version. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// Author : OPEN CASCADE +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// Author : OPEN CASCADE // File: GLViewer_Selector2d.cxx // Created: November, 2004 - -/**************************************************************************** -** Class: GLViewer_Selector2d -** Descr: OpenGL Selector 2D -** Module: GLViewer -** Created: UI team, 20.09.02 -*****************************************************************************/ - //#include +// #include "GLViewer_Selector2d.h" #include "GLViewer_Viewer2d.h" #include "GLViewer_Context.h" -#include "GLViewer_ViewPort2d.h" +#include "GLViewer_ViewPort.h" +#include "GLViewer_ViewFrame.h" +/*! + Constructor +*/ GLViewer_Selector2d::GLViewer_Selector2d( GLViewer_Viewer2d* v2d, GLViewer_Context* glc ) : GLViewer_Selector( v2d ), myGLContext( glc ) @@ -43,20 +42,35 @@ myGLContext( glc ) // myGLContext->SetSelectionColor( Quantity_NOC_RED ); } +/*! + Destructor +*/ GLViewer_Selector2d::~GLViewer_Selector2d() { } +/*! + Changes hilight color of context + \param color - new hilight color +*/ void GLViewer_Selector2d::setHilightColor( Quantity_NameOfColor color ) { myGLContext->SetHighlightColor( color ); } +/*! + Changes selection color of context + \param color - new selection color +*/ void GLViewer_Selector2d::setSelectColor( Quantity_NameOfColor color ) { myGLContext->SetSelectionColor( color ); } +/*! + Detects object at point + \param x, y - point co-ordinates +*/ void GLViewer_Selector2d::detect( int x, int y ) { //cout << "GLViewer_Selector2d : detect ( " << x << " , " << y << " )" << endl; @@ -71,6 +85,9 @@ void GLViewer_Selector2d::detect( int x, int y ) myGLContext->MoveTo( x, y ); } +/*! + Undetects all objects +*/ void GLViewer_Selector2d::undetectAll() { if ( myLocked || !myGLContext || !myViewer || !myViewer->getActiveView() || @@ -84,6 +101,10 @@ void GLViewer_Selector2d::undetectAll() myGLContext->clearHighlighted( true ); } +/*! + Selects previously hilighted objects + \param append - append objects to selection +*/ void GLViewer_Selector2d::select( bool append ) { //cout << "GLViewer_Selector2d : select ( " << (int)append << " )" << endl; @@ -104,6 +125,11 @@ void GLViewer_Selector2d::select( bool append ) checkSelection( selBefore, append, status ); } +/*! + Selects objects in rectangle + \param selRect - selection rectangle + \param append - append objects to selection +*/ void GLViewer_Selector2d::select( const QRect& selRect, bool append ) { GLViewer_Viewer::SelectionMode selMode = myViewer->getSelectionMode(); @@ -123,6 +149,9 @@ void GLViewer_Selector2d::select( const QRect& selRect, bool append ) checkSelection( selBefore, append, aStatus ); } +/*! + Unselects all objects +*/ void GLViewer_Selector2d::unselectAll() { if ( myLocked || !myViewer ) @@ -137,8 +166,10 @@ void GLViewer_Selector2d::unselectAll() if ( hadSelection ) emit selSelectionCancel(); } -/* Checks selection state and emits 'selSelectionDone' or 'selSelectionCancel' - Should be called by after non-interactive selection. */ +/*! + Checks selection state and emits 'selSelectionDone' or 'selSelectionCancel' + Should be called by after non-interactive selection. +*/ void GLViewer_Selector2d::checkSelection( int selBefore, bool append, int aStatus ) { int selAfter = numSelected(); @@ -158,6 +189,9 @@ void GLViewer_Selector2d::checkSelection( int selBefore, bool append, int aStatu } } +/*! + \return number of selected objects +*/ int GLViewer_Selector2d::numSelected() const { return myGLContext->NbSelected();