From 28124bc2dd22481a5a915b2b96b835ef5323a6f6 Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 3 Nov 2005 07:19:33 +0000 Subject: [PATCH] This file is given from DESCARTES project --- src/GLViewer/GLViewer.h | 23 +++- src/GLViewer/GLViewer_AspectLine.cxx | 23 +++- src/GLViewer/GLViewer_AspectLine.h | 23 +++- src/GLViewer/GLViewer_BaseDrawers.cxx | 23 +++- src/GLViewer/GLViewer_BaseDrawers.h | 23 +++- src/GLViewer/GLViewer_BaseObjects.cxx | 21 ++++ src/GLViewer/GLViewer_BaseObjects.h | 23 +++- src/GLViewer/GLViewer_Compass.cxx | 23 +++- src/GLViewer/GLViewer_Compass.h | 23 +++- src/GLViewer/GLViewer_Context.cxx | 53 ++++++-- src/GLViewer/GLViewer_Context.h | 25 +++- src/GLViewer/GLViewer_CoordSystem.cxx | 23 +++- src/GLViewer/GLViewer_CoordSystem.h | 23 +++- src/GLViewer/GLViewer_Defs.h | 28 ++++- src/GLViewer/GLViewer_Drawer.cxx | 175 +++++++++++++++----------- src/GLViewer/GLViewer_Drawer.h | 65 ++++++++-- src/GLViewer/GLViewer_Geom.cxx | 21 ++++ src/GLViewer/GLViewer_Geom.h | 23 +++- src/GLViewer/GLViewer_Grid.cxx | 23 +++- src/GLViewer/GLViewer_Grid.h | 23 +++- src/GLViewer/GLViewer_Group.cxx | 23 +++- src/GLViewer/GLViewer_Group.h | 23 +++- src/GLViewer/GLViewer_MimeSource.cxx | 21 ++++ src/GLViewer/GLViewer_MimeSource.h | 23 +++- src/GLViewer/GLViewer_Object.cxx | 21 ++++ src/GLViewer/GLViewer_Object.h | 23 +++- src/GLViewer/GLViewer_Selector.cxx | 23 +++- src/GLViewer/GLViewer_Selector.h | 23 +++- src/GLViewer/GLViewer_Selector2d.cxx | 25 +++- src/GLViewer/GLViewer_Selector2d.h | 23 +++- src/GLViewer/GLViewer_Text.cxx | 21 ++++ src/GLViewer/GLViewer_Text.h | 23 +++- src/GLViewer/GLViewer_ToolTip.cxx | 23 +++- src/GLViewer/GLViewer_ToolTip.h | 23 +++- src/GLViewer/GLViewer_Tools.cxx | 26 +++- src/GLViewer/GLViewer_Tools.h | 23 +++- src/GLViewer/GLViewer_ViewFrame.cxx | 23 +++- src/GLViewer/GLViewer_ViewFrame.h | 23 +++- src/GLViewer/GLViewer_ViewManager.cxx | 23 +++- src/GLViewer/GLViewer_ViewManager.h | 23 +++- src/GLViewer/GLViewer_ViewPort.cxx | 23 +++- src/GLViewer/GLViewer_ViewPort.h | 23 +++- src/GLViewer/GLViewer_ViewPort2d.cxx | 23 +++- src/GLViewer/GLViewer_ViewPort2d.h | 23 +++- src/GLViewer/GLViewer_Viewer.cxx | 23 +++- src/GLViewer/GLViewer_Viewer.h | 23 +++- src/GLViewer/GLViewer_Viewer2d.cxx | 27 +++- src/GLViewer/GLViewer_Viewer2d.h | 23 +++- src/GLViewer/GLViewer_Widget.cxx | 23 +++- src/GLViewer/GLViewer_Widget.h | 23 +++- 50 files changed, 1198 insertions(+), 182 deletions(-) diff --git a/src/GLViewer/GLViewer.h b/src/GLViewer/GLViewer.h index f0e020c66..2f4ed3dcc 100644 --- a/src/GLViewer/GLViewer.h +++ b/src/GLViewer/GLViewer.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 //! Macro for exports #ifdef WNT diff --git a/src/GLViewer/GLViewer_AspectLine.cxx b/src/GLViewer/GLViewer_AspectLine.cxx index 5399081db..4df6041b3 100644 --- a/src/GLViewer/GLViewer_AspectLine.cxx +++ b/src/GLViewer/GLViewer_AspectLine.cxx @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_AspectLine.cxx // Created: 26/05/2005 3:17:00 PM -// Author: Alexander BORODIN -// Copyright (C) CEA 2005 //================================================================ // Class : GLViewer_AspectLine diff --git a/src/GLViewer/GLViewer_AspectLine.h b/src/GLViewer/GLViewer_AspectLine.h index 7fb8b7e39..800b166bb 100644 --- a/src/GLViewer/GLViewer_AspectLine.h +++ b/src/GLViewer/GLViewer_AspectLine.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_AspectLine.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 #ifndef GLVIEWER_ASPECTLINE_H #define GLVIEWER_ASPECTLINE_H diff --git a/src/GLViewer/GLViewer_BaseDrawers.cxx b/src/GLViewer/GLViewer_BaseDrawers.cxx index 85f54061b..a43a5930e 100644 --- a/src/GLViewer/GLViewer_BaseDrawers.cxx +++ b/src/GLViewer/GLViewer_BaseDrawers.cxx @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_BaseDrawers.cxx // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 //#include #include "GLViewer_BaseDrawers.h" diff --git a/src/GLViewer/GLViewer_BaseDrawers.h b/src/GLViewer/GLViewer_BaseDrawers.h index 43c5a98ef..ce98aa867 100644 --- a/src/GLViewer/GLViewer_BaseDrawers.h +++ b/src/GLViewer/GLViewer_BaseDrawers.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_BaseDrawers.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 #ifndef GLVIEWER_BASEDRAWERS_H #define GLVIEWER_BASEDRAWERS_H diff --git a/src/GLViewer/GLViewer_BaseObjects.cxx b/src/GLViewer/GLViewer_BaseObjects.cxx index 759736136..79c32e3f8 100644 --- a/src/GLViewer/GLViewer_BaseObjects.cxx +++ b/src/GLViewer/GLViewer_BaseObjects.cxx @@ -1,3 +1,24 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + /*************************************************************************** ** Class: GLViewer_BaseObjects ** Descr: Internal OpenGL Objects diff --git a/src/GLViewer/GLViewer_BaseObjects.h b/src/GLViewer/GLViewer_BaseObjects.h index fdd1f75fc..6e464ef04 100644 --- a/src/GLViewer/GLViewer_BaseObjects.h +++ b/src/GLViewer/GLViewer_BaseObjects.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_BaseObjects.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 #ifndef GLVIEWER_BASEOBJECTS_H #define GLVIEWER_BASEOBJECTS_H diff --git a/src/GLViewer/GLViewer_Compass.cxx b/src/GLViewer/GLViewer_Compass.cxx index 097a6edf8..919641e7c 100644 --- a/src/GLViewer/GLViewer_Compass.cxx +++ b/src/GLViewer/GLViewer_Compass.cxx @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Compass.cxx // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 //================================================================ // Class : GLViewer_Compass diff --git a/src/GLViewer/GLViewer_Compass.h b/src/GLViewer/GLViewer_Compass.h index dafa45619..abdec0e01 100644 --- a/src/GLViewer/GLViewer_Compass.h +++ b/src/GLViewer/GLViewer_Compass.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Compass.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 #ifndef GLVIEWER_COMPASS_H #define GLVIEWER_COMPASS_H diff --git a/src/GLViewer/GLViewer_Context.cxx b/src/GLViewer/GLViewer_Context.cxx index 264a5657f..ef4f57850 100644 --- a/src/GLViewer/GLViewer_Context.cxx +++ b/src/GLViewer/GLViewer_Context.cxx @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Context.cxx // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 //================================================================ // Class : GLViewer_AspectLine @@ -141,15 +160,13 @@ int GLViewer_Context::MoveTo( int xi, int yi, bool byCircle ) else if( myLastPicked && isHigh ) { //cout << 3 << endl; - //myLastPicked->highlight( x, y, myTolerance, byCircle ); + myLastPicked->highlight( x, y, myTolerance, byCircle ); + anUpdatedObjects.append( myLastPicked ); if( myLastPicked != lastPicked ) { myLastPicked->unhighlight(); - if( myLastPicked != lastPicked ) - { - myLastPicked = lastPicked; - anUpdatedObjects.append( myLastPicked ); - } + myLastPicked = lastPicked; + anUpdatedObjects.append( myLastPicked ); } } @@ -202,6 +219,17 @@ int GLViewer_Context::Select( bool Append, bool byCircle ) status = SS_GlobalChanged; mySelectedObjects.clear(); } + else if( myLastPicked->isSelected() && status != SS_LocalChanged ) + { + mySelectedObjects.remove( myLastPicked ); + myLastPicked->unselect(); + myGLViewer2d->updateAll(); + + if( mySelectedObjects.count() != 0 && status == SS_Invalid ) + status = SS_GlobalChanged; + + return status; + } if ( myLastPicked->select( myXhigh, myYhigh, myTolerance, GLViewer_Rect(), false, byCircle, Append ) && mySelectedObjects.findIndex( myLastPicked ) == -1 ) @@ -537,13 +565,14 @@ void GLViewer_Context::updateScales( GLfloat scX, GLfloat scY ) // Function: clearHighlighted // Purpose : //======================================================================= -void GLViewer_Context::clearHighlighted() +void GLViewer_Context::clearHighlighted( bool updateViewer ) { if( myHFlag && myLastPicked ) { - myLastPicked->unhighlight(); - myLastPicked = 0; - + myLastPicked->unhighlight(); + myLastPicked = 0; + + if( updateViewer ) myGLViewer2d->updateAll(); } } diff --git a/src/GLViewer/GLViewer_Context.h b/src/GLViewer/GLViewer_Context.h index 603e183cf..f8c76eb50 100644 --- a/src/GLViewer/GLViewer_Context.h +++ b/src/GLViewer/GLViewer_Context.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Context.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 /*! Class GLViewer_Context @@ -119,7 +138,7 @@ public: GLViewer_Object* getFirstObject() { return *( myActiveObjects.begin() ); } //! A function clear highlighted object information - void clearHighlighted(); + void clearHighlighted( bool updateViewer ); //! A function clear selection object information void clearSelected( bool updateViewer ); //! A function make theObject as selected object and update viewer if updateViewer = true diff --git a/src/GLViewer/GLViewer_CoordSystem.cxx b/src/GLViewer/GLViewer_CoordSystem.cxx index 0fbcb3b6b..947ac6036 100644 --- a/src/GLViewer/GLViewer_CoordSystem.cxx +++ b/src/GLViewer/GLViewer_CoordSystem.cxx @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Context.cxx // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 //================================================================ // Class : GLViewer_CoordSystem diff --git a/src/GLViewer/GLViewer_CoordSystem.h b/src/GLViewer/GLViewer_CoordSystem.h index dbc2b9202..ca571daab 100644 --- a/src/GLViewer/GLViewer_CoordSystem.h +++ b/src/GLViewer/GLViewer_CoordSystem.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_CoordSystem.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 /*! Class GLViewer_CoordSystem * Class implementing mathematical model of 2D coordinate system diff --git a/src/GLViewer/GLViewer_Defs.h b/src/GLViewer/GLViewer_Defs.h index 0ef2cb4d1..68d1f7d3f 100644 --- a/src/GLViewer/GLViewer_Defs.h +++ b/src/GLViewer/GLViewer_Defs.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Defs.h // Created: March, 2005 -// Author: OCC team -// Copyright (C) CEA 2005 #ifndef GLVIEWER_DEFS_H #define GLVIEWER_DEFS_H @@ -24,8 +43,9 @@ static const int SELECTION_RECT_GAP = 50; //! Display Text Format of Objects enum DisplayTextFormat { - DTF_TEXTURE = 0, - DTF_BITMAP = 1 + DTF_TEXTURE = 0, + DTF_TEXTURE_SCALABLE = 1, + DTF_BITMAP = 2 }; enum SelectionStatus diff --git a/src/GLViewer/GLViewer_Drawer.cxx b/src/GLViewer/GLViewer_Drawer.cxx index 9231804f0..05cec9698 100644 --- a/src/GLViewer/GLViewer_Drawer.cxx +++ b/src/GLViewer/GLViewer_Drawer.cxx @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Drawer.cxx // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 //#include #include "GLViewer_Drawer.h" @@ -70,14 +89,17 @@ GLViewer_TexFont::GLViewer_TexFont() } myTexFontWidth = 0; - myTexFontHeight = 0; + myTexFontHeight = 0; + myIsResizeable = false; + //myMinMagFilter = GL_NEAREST; + myMinMagFilter = GL_LINEAR_ATTENUATION ; } //====================================================================== // Function: GLViewer_TexFont // Purpose : //======================================================================= -GLViewer_TexFont::GLViewer_TexFont( QFont* theFont, int theSeparator ) +GLViewer_TexFont::GLViewer_TexFont( QFont* theFont, int theSeparator, bool theIsResizeable, GLuint theMinMagFilter ) { myQFont = *theFont; QFontMetrics aFM( myQFont ); @@ -93,6 +115,8 @@ GLViewer_TexFont::GLViewer_TexFont( QFont* theFont, int theSeparator ) myTexFontWidth = 0; myTexFontHeight = 0; + myIsResizeable = theIsResizeable; + myMinMagFilter = theMinMagFilter; } @@ -182,11 +206,18 @@ void GLViewer_TexFont::generateTexture() glBindTexture(GL_TEXTURE_2D, myTexFont); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, myMinMagFilter); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, myMinMagFilter); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - glTexImage2D(GL_TEXTURE_2D, 0, 2, myTexFontWidth, - myTexFontHeight, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, pixels); + glTexImage2D(GL_TEXTURE_2D, + 0, + GL_INTENSITY, + myTexFontWidth, + myTexFontHeight, + 0, + GL_LUMINANCE_ALPHA, + GL_UNSIGNED_BYTE, + pixels); delete[] pixels; @@ -205,41 +236,62 @@ void GLViewer_TexFont::generateTexture() //======================================================================= void GLViewer_TexFont::drawString( QString theStr, GLdouble theX , GLdouble theY ) { + double aXScale = 1., aYScale = 1.; + // store attributes + glPushAttrib( GL_ENABLE_BIT | GL_TEXTURE_BIT ); + + if ( !myIsResizeable ) + { + glGetDoublev (GL_MODELVIEW_MATRIX, modelMatrix); + aXScale = modelMatrix[0]; + aYScale = modelMatrix[5]; + } + glEnable(GL_TEXTURE_2D); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, myMinMagFilter); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, myMinMagFilter); + glPixelTransferi(GL_MAP_COLOR, 0); - glAlphaFunc(GL_GEQUAL, 0.5F); + + glAlphaFunc(GL_GEQUAL, 0.05F); glEnable(GL_ALPHA_TEST); + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + glBindTexture(GL_TEXTURE_2D, myTexFont); glBegin(GL_QUADS); - QFontMetrics aFM( myQFont ); - int pixelsHeight = aFM.height(); - - theY = theY - myTexFontHeight + pixelsHeight; + theY = theY - ( myTexFontHeight - QFontMetrics( myQFont ).height() ) / aYScale; - for( int i = 0, aGap = 0; i < theStr.length(); i++ ) + double aLettBegin, aLettEnd, aDY = ( myTexFontHeight - 1 ) / aYScale, aDX; + char aLetter; + int aLettIndex; + for( int i = 0; i < theStr.length(); i++ ) { - char aLetter = theStr.data()[i]; - int aLettIndex = (int)aLetter - FirstSymbolNumber; + aLetter = theStr.data()[i]; + aLettIndex = (int)aLetter - FirstSymbolNumber; - float aLettBegin = (float)myPositions[aLettIndex]; - float aLettEnd = aLettBegin + myWidths[aLettIndex]-1; + aLettBegin = (double)myPositions[aLettIndex] / ( (double)myTexFontWidth - 1. ); + aLettEnd = aLettBegin + ( (double)myWidths[aLettIndex] - 1. ) / ( (double)myTexFontWidth - 1. ); - aLettBegin = aLettBegin / myTexFontWidth; - aLettEnd = aLettEnd / myTexFontWidth; + aDX = ( (double)myWidths[aLettIndex] - 1. ) / aXScale; - glTexCoord2f( aLettBegin, 0.0 ); glVertex3f( theX + aGap, theY, 1.0 ); - glTexCoord2f( aLettBegin, 1.0 ); glVertex3f( theX + aGap, theY + myTexFontHeight, 1.0 ); - glTexCoord2f( aLettEnd, 1.0 ); glVertex3f( theX + aGap + myWidths[aLettIndex]-1, theY + myTexFontHeight, 1.0 ); - glTexCoord2f( aLettEnd, 0.0 ); glVertex3f( theX + aGap + myWidths[aLettIndex]-1, theY, 1.0 ); + glTexCoord2d( aLettBegin, 0.0 ); glVertex3d( theX, theY, 1.0 ); + glTexCoord2d( aLettBegin, 1.0 ); glVertex3d( theX, theY + aDY, 1.0 ); + glTexCoord2d( aLettEnd, 1.0 ); glVertex3d( theX + aDX, theY + aDY, 1.0 ); + glTexCoord2d( aLettEnd, 0.0 ); glVertex3d( theX + aDX, theY, 1.0 ); - aGap += myWidths[aLettIndex]-1 + mySeparator; + theX += aDX + mySeparator / aXScale; } glEnd(); - glDisable(GL_ALPHA_TEST); - glDisable(GL_TEXTURE_2D); + // restore attributes + glPopAttrib(); } //====================================================================== @@ -385,12 +437,14 @@ static GLuint displayListBase( QFont* theFont ) // Purpose : //======================================================================= GLViewer_Drawer::GLViewer_Drawer() +: myFont( "Helvetica", 10, QFont::Bold ) { myXScale = myYScale = 0.0; myObjects.clear(); myTextList = 0/*-1*/; myObjectType = "GLViewer_Object"; myPriority = 0; + myTextFormat = DTF_BITMAP; } //====================================================================== @@ -496,8 +550,8 @@ GLuint GLViewer_Drawer::loadTexture( const QString& fileName ) glPixelStorei( GL_UNPACK_ALIGNMENT, 1 ); glGenTextures( 1, &texture ); glBindTexture( GL_TEXTURE_2D, texture ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, size, size, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels ); @@ -515,16 +569,14 @@ void GLViewer_Drawer::drawTexture( GLuint texture, GLint size, GLfloat x, GLfloa if( !texture ) return; - glColor4f( 1.0, 1.0, 1.0, 1.0 ); - glEnable( GL_TEXTURE_2D ); - glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); - glAlphaFunc( GL_GREATER, 0.95F ); - glEnable( GL_ALPHA_TEST ); + glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE ); + bool hasAlpha = glIsEnabled( GL_ALPHA_TEST ); + glDisable( GL_ALPHA_TEST ); glBindTexture( GL_TEXTURE_2D, texture ); glBegin( GL_QUADS ); - + glTexCoord2f( 0.0, 0.0 ); glVertex3f( x-size/2., y-size/2., 0.0 ); @@ -538,9 +590,9 @@ void GLViewer_Drawer::drawTexture( GLuint texture, GLint size, GLfloat x, GLfloa glVertex3f( x+size/2., y-size/2., 0.0 ); glEnd(); - glFlush(); - glDisable( GL_ALPHA_TEST ); + if ( hasAlpha ) + glEnable( GL_ALPHA_TEST ); glDisable( GL_TEXTURE_2D ); } @@ -551,41 +603,18 @@ void GLViewer_Drawer::drawTexture( GLuint texture, GLint size, GLfloat x, GLfloa void GLViewer_Drawer::drawText( const QString& text, GLfloat xPos, GLfloat yPos, const QColor& color, QFont* theFont, int theSeparator, DisplayTextFormat theFormat ) { - if( theFormat == DTF_TEXTURE ) + glColor3f( ( GLfloat )color.red() / 255, + ( GLfloat )color.green() / 255, + ( GLfloat )color.blue() / 255 ); + + if( theFormat != DTF_BITMAP ) { - GLViewer_TexFont aTexFont( theFont, theSeparator ); + GLViewer_TexFont aTexFont( theFont, theSeparator, theFormat == DTF_TEXTURE_SCALABLE, GL_LINEAR ); aTexFont.generateTexture(); - - glGetIntegerv (GL_VIEWPORT, viewport); - glGetDoublev (GL_MODELVIEW_MATRIX, modelMatrix); - glGetDoublev (GL_PROJECTION_MATRIX, projMatrix); - status = gluProject (xPos, yPos, 0, modelMatrix, projMatrix, viewport, &winx, &winy, &winz); - - glPushAttrib( GL_TRANSFORM_BIT | GL_VIEWPORT_BIT | GL_LIST_BIT ); - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); - glOrtho(0,viewport[2],0,viewport[3],-100,100); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glLoadIdentity(); - - glColor3f( ( GLfloat )color.red() / 255, - ( GLfloat )color.green() / 255, - ( GLfloat )color.blue() / 255 ); - - aTexFont.drawString( text, winx, winy ); - - glPopMatrix(); - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glPopAttrib(); + aTexFont.drawString( text, xPos, yPos ); } - else if( theFormat == DTF_BITMAP ) + else { - glColor3f( ( GLfloat )color.red() / 255, - ( GLfloat )color.green() / 255, - ( GLfloat )color.blue() / 255 ); glRasterPos2f( xPos, yPos ); glListBase( displayListBase( theFont ) ); glCallLists( text.length(), GL_UNSIGNED_BYTE, text.local8Bit().data() ); @@ -619,13 +648,13 @@ void GLViewer_Drawer::drawText( GLViewer_Object* theObject ) void GLViewer_Drawer::drawGLText( QString text, float x, float y, int hPosition, int vPosition, QColor color, bool smallFont ) { - QFont aFont( "Arial", 10, QFont::Bold ); + QFont aFont( myFont ); if( smallFont ) - aFont.setPointSize( 8 ); + aFont.setPointSize( aFont.pointSize() * 0.8 ); QFontMetrics aFontMetrics( aFont ); - float width = aFontMetrics.width( text ) / myXScale; - float height = aFontMetrics.height() / myXScale; + float width = myTextFormat == DTF_TEXTURE_SCALABLE ? aFontMetrics.width( text ) : aFontMetrics.width( text ) / myXScale; + float height = myTextFormat == DTF_TEXTURE_SCALABLE ? aFontMetrics.height() : aFontMetrics.height() / myYScale; float gap = 5 / myXScale; switch( hPosition ) @@ -644,7 +673,7 @@ void GLViewer_Drawer::drawGLText( QString text, float x, float y, default : break; } - drawText( text, x, y, color, &aFont, 2, DTF_BITMAP ); // DTF_BITMAP or DTF_TEXTURE + drawText( text, x, y, color, &aFont, 2, myTextFormat ); } //====================================================================== diff --git a/src/GLViewer/GLViewer_Drawer.h b/src/GLViewer/GLViewer_Drawer.h index 0a1379cbd..86ba2a45f 100644 --- a/src/GLViewer/GLViewer_Drawer.h +++ b/src/GLViewer/GLViewer_Drawer.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Drawer.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 #ifndef GLVIEWER_DRAWER_H #define GLVIEWER_DRAWER_H @@ -78,10 +97,15 @@ public: GLViewer_TexFont(); //! A constructor /* - * \param theFont - a base font - * \param theSeparator - separator between letters + * \param theFont - a base font + * \param theSeparator - separator between letters + * \param theIsResizeable - specifies whether text drawn by this object can be scaled along with the scene + * \param theMinMagFilter - min/mag filter, affects text sharpness */ - GLViewer_TexFont( QFont* theFont, int theSeparator = 2 ); + GLViewer_TexFont( QFont* theFont, + int theSeparator = 2, + bool theIsResizeable = false, + GLuint theMinMagFilter = GL_LINEAR/*_ATTENUATION*/ ); //! A destructor ~GLViewer_TexFont(); @@ -123,6 +147,10 @@ protected: int myTexFontHeight; //! Separator between letters int mySeparator; + //! Flag controlling scalability of this texmapped font + bool myIsResizeable; + //! Min/mag filter + GLuint myMinMagFilter; }; /*************************************************************************** @@ -188,8 +216,8 @@ public: //! Returns object priority int getPriority() const { return myPriority; } - //! The function enables and disables antialiasing in Open GL (for points, lines and polygons). - void setAntialiasing(const bool on); + //! The function enables and disables antialiasing in Open GL (for points, lines and polygons). + void setAntialiasing(const bool on); //! Clears all generated textures static void destroyAllTextures(); @@ -270,6 +298,24 @@ public: QColor color = Qt::black, bool smallFont = false ); + //! Sets a default font to be used by drawGLText method + /*! + *\param font - the default font + */ + inline void setFont( const QFont& font ) { myFont = font; } + + //! Returns a default font used by drawGLText method + inline QFont font() const { return myFont; } + + //! Sets a default text displaying format to be used by drawGLText method + /*! + *\param format - the default text displaying format + */ + inline void setTextFormat( DisplayTextFormat format ) { myTextFormat = format; } + + //! Returns a default text displaying format used by drawGLText method + inline DisplayTextFormat textFormat() const { return myTextFormat; } + //! Draw rectangle with predefined color static void drawRectangle( GLViewer_Rect* theRect, QColor = Qt::black ); @@ -291,6 +337,11 @@ protected: QString myObjectType; //! Dislay priority int myPriority; + + //! Default font for drawGLText() method + QFont myFont; + //! Default text displaying format for drawGLText() method + DisplayTextFormat myTextFormat; }; #ifdef WNT diff --git a/src/GLViewer/GLViewer_Geom.cxx b/src/GLViewer/GLViewer_Geom.cxx index a5b81c077..cd0ef5cae 100644 --- a/src/GLViewer/GLViewer_Geom.cxx +++ b/src/GLViewer/GLViewer_Geom.cxx @@ -1,3 +1,24 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + /*************************************************************************** ** Class: GLViewer_Geom ** Descr: diff --git a/src/GLViewer/GLViewer_Geom.h b/src/GLViewer/GLViewer_Geom.h index 40a28797f..ccd3bab19 100644 --- a/src/GLViewer/GLViewer_Geom.h +++ b/src/GLViewer/GLViewer_Geom.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Geom.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 #ifndef GLVIEWER_GEOM_H #define GLVIEWER_GEOM_H diff --git a/src/GLViewer/GLViewer_Grid.cxx b/src/GLViewer/GLViewer_Grid.cxx index e93e17ce7..85dfac4ba 100644 --- a/src/GLViewer/GLViewer_Grid.cxx +++ b/src/GLViewer/GLViewer_Grid.cxx @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Grid.cxx // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 //#include #include "GLViewer_Grid.h" diff --git a/src/GLViewer/GLViewer_Grid.h b/src/GLViewer/GLViewer_Grid.h index 4440802d0..39858916b 100644 --- a/src/GLViewer/GLViewer_Grid.h +++ b/src/GLViewer/GLViewer_Grid.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Grid.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 #ifndef GLVIEWER_GRID_H #define GLVIEWER_GRID_H diff --git a/src/GLViewer/GLViewer_Group.cxx b/src/GLViewer/GLViewer_Group.cxx index d4fc449f9..6377e9ecd 100644 --- a/src/GLViewer/GLViewer_Group.cxx +++ b/src/GLViewer/GLViewer_Group.cxx @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Group.xx // Created: March, 2005 -// Author: OCC team -// Copyright (C) CEA 2005 //#include "GLViewerAfx.h" #include "GLViewer_Group.h" diff --git a/src/GLViewer/GLViewer_Group.h b/src/GLViewer/GLViewer_Group.h index 1384a0bae..8856166a5 100644 --- a/src/GLViewer/GLViewer_Group.h +++ b/src/GLViewer/GLViewer_Group.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Group.h // Created: March, 2005 -// Author: OCC team -// Copyright (C) CEA 2005 #ifndef GLVIEWER_GROUP_H #define GLVIEWER_GROUP_H diff --git a/src/GLViewer/GLViewer_MimeSource.cxx b/src/GLViewer/GLViewer_MimeSource.cxx index 3304e90dd..e43ee5f51 100644 --- a/src/GLViewer/GLViewer_MimeSource.cxx +++ b/src/GLViewer/GLViewer_MimeSource.cxx @@ -1,3 +1,24 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + /*************************************************************************** ** Class: GLViewer_MimeSource ** Descr: Needs for a work with QClipboard diff --git a/src/GLViewer/GLViewer_MimeSource.h b/src/GLViewer/GLViewer_MimeSource.h index 440fc4155..4fca3c9d7 100644 --- a/src/GLViewer/GLViewer_MimeSource.h +++ b/src/GLViewer/GLViewer_MimeSource.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_MimeSource.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 #ifndef GLVIEWER_MIMESOURCE_H #define GLVIEWER_MIMESOURCE_H diff --git a/src/GLViewer/GLViewer_Object.cxx b/src/GLViewer/GLViewer_Object.cxx index 5cc8685b7..d2aaf4e97 100644 --- a/src/GLViewer/GLViewer_Object.cxx +++ b/src/GLViewer/GLViewer_Object.cxx @@ -1,3 +1,24 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + /*************************************************************************** ** Class: GLViewer_Object ** Descr: OpenGL Object diff --git a/src/GLViewer/GLViewer_Object.h b/src/GLViewer/GLViewer_Object.h index 334563466..39c9d9883 100644 --- a/src/GLViewer/GLViewer_Object.h +++ b/src/GLViewer/GLViewer_Object.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Object.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 #ifndef GLVIEWER_OBJECT_H #define GLVIEWER_OBJECT_H diff --git a/src/GLViewer/GLViewer_Selector.cxx b/src/GLViewer/GLViewer_Selector.cxx index 1329e4fc7..5df29eb89 100644 --- a/src/GLViewer/GLViewer_Selector.cxx +++ b/src/GLViewer/GLViewer_Selector.cxx @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Selector.cxx // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 /**************************************************************************** ** Class: GLViewer_Selector diff --git a/src/GLViewer/GLViewer_Selector.h b/src/GLViewer/GLViewer_Selector.h index 74af33e1f..ad40ab124 100644 --- a/src/GLViewer/GLViewer_Selector.h +++ b/src/GLViewer/GLViewer_Selector.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Selector.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 /**************************************************************************** ** Class: GLViewer_Selector diff --git a/src/GLViewer/GLViewer_Selector2d.cxx b/src/GLViewer/GLViewer_Selector2d.cxx index 14d17722d..e8a414d46 100644 --- a/src/GLViewer/GLViewer_Selector2d.cxx +++ b/src/GLViewer/GLViewer_Selector2d.cxx @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Selector2d.cxx // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 /**************************************************************************** ** Class: GLViewer_Selector2d @@ -62,7 +81,7 @@ void GLViewer_Selector2d::undetectAll() if( !vp->inherits( "GLViewer_ViewPort2d" ) ) return; - myGLContext->clearHighlighted(); + myGLContext->clearHighlighted( true ); } void GLViewer_Selector2d::select( bool append ) diff --git a/src/GLViewer/GLViewer_Selector2d.h b/src/GLViewer/GLViewer_Selector2d.h index 18df15994..cce3cc37e 100644 --- a/src/GLViewer/GLViewer_Selector2d.h +++ b/src/GLViewer/GLViewer_Selector2d.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Selector2d.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 /**************************************************************************** ** Class: GLViewer_Selector2d diff --git a/src/GLViewer/GLViewer_Text.cxx b/src/GLViewer/GLViewer_Text.cxx index 6dda7b8cf..bafa33ec1 100644 --- a/src/GLViewer/GLViewer_Text.cxx +++ b/src/GLViewer/GLViewer_Text.cxx @@ -1,3 +1,24 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + /*************************************************************************** ** Class: GLViewer_Text ** Descr: Substitution of Prs3d_Text for OpenGL diff --git a/src/GLViewer/GLViewer_Text.h b/src/GLViewer/GLViewer_Text.h index 16ec3ec43..ef3512ca9 100644 --- a/src/GLViewer/GLViewer_Text.h +++ b/src/GLViewer/GLViewer_Text.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Text.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 #ifndef GLVIEWER_TEXT_H #define GLVIEWER_TEXT_H diff --git a/src/GLViewer/GLViewer_ToolTip.cxx b/src/GLViewer/GLViewer_ToolTip.cxx index ad55671c3..0521ff19f 100644 --- a/src/GLViewer/GLViewer_ToolTip.cxx +++ b/src/GLViewer/GLViewer_ToolTip.cxx @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_ToolTip.xx // Created: March, 2005 -// Author: OCC team -// Copyright (C) CEA 2005 //#include "GLViewerAfx.h" #include "GLViewer_Context.h" diff --git a/src/GLViewer/GLViewer_ToolTip.h b/src/GLViewer/GLViewer_ToolTip.h index 8ed8d7cd0..9dcb71f68 100644 --- a/src/GLViewer/GLViewer_ToolTip.h +++ b/src/GLViewer/GLViewer_ToolTip.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_ToolTip.h // Created: March, 2005 -// Author: OCC team -// Copyright (C) CEA 2005 #ifndef GLVIEWER_TOOLTIP_H #define GLVIEWER_TOOLTIP_H diff --git a/src/GLViewer/GLViewer_Tools.cxx b/src/GLViewer/GLViewer_Tools.cxx index 5af5cd9bb..a54ad837f 100644 --- a/src/GLViewer/GLViewer_Tools.cxx +++ b/src/GLViewer/GLViewer_Tools.cxx @@ -1,15 +1,33 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Tools.cxx // Created: April, 2005 -// Author: OCC team //#include "GLViewerAfx.h" #include "GLViewer_Tools.h" #include -#include - -using namespace std; +#include /**************************************************************************** ** Class: GLViewer_LineList diff --git a/src/GLViewer/GLViewer_Tools.h b/src/GLViewer/GLViewer_Tools.h index 9f267e767..3acdd879b 100644 --- a/src/GLViewer/GLViewer_Tools.h +++ b/src/GLViewer/GLViewer_Tools.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Tools.h // Created: April, 2005 -// Author: OCC team -// Copyright (C) CEA 2005 #ifndef GLVIEWER_TOOLS_H #define GLVIEWER_TOOLS_H diff --git a/src/GLViewer/GLViewer_ViewFrame.cxx b/src/GLViewer/GLViewer_ViewFrame.cxx index 87a0b62dd..6600bb35f 100644 --- a/src/GLViewer/GLViewer_ViewFrame.cxx +++ b/src/GLViewer/GLViewer_ViewFrame.cxx @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_ViewFrame.cxx // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 /*************************************************************************** ** Class: GLViewer_ViewFrame diff --git a/src/GLViewer/GLViewer_ViewFrame.h b/src/GLViewer/GLViewer_ViewFrame.h index 6c7353316..d90dfd3f5 100644 --- a/src/GLViewer/GLViewer_ViewFrame.h +++ b/src/GLViewer/GLViewer_ViewFrame.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_ViewFrame.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 /*************************************************************************** ** Class: GLViewer_ViewFrame diff --git a/src/GLViewer/GLViewer_ViewManager.cxx b/src/GLViewer/GLViewer_ViewManager.cxx index c9f9de07b..91150147a 100644 --- a/src/GLViewer/GLViewer_ViewManager.cxx +++ b/src/GLViewer/GLViewer_ViewManager.cxx @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_ViewManager.cxx // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 //#include #include "GLViewer_ViewManager.h" diff --git a/src/GLViewer/GLViewer_ViewManager.h b/src/GLViewer/GLViewer_ViewManager.h index 1fac2ab22..82038d8d6 100644 --- a/src/GLViewer/GLViewer_ViewManager.h +++ b/src/GLViewer/GLViewer_ViewManager.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_ViewManager.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 #ifndef GLVIEWER_VIEWMANAGER_H #define GLVIEWER_VIEWMANAGER_H diff --git a/src/GLViewer/GLViewer_ViewPort.cxx b/src/GLViewer/GLViewer_ViewPort.cxx index 8a7dc29f7..973342f84 100644 --- a/src/GLViewer/GLViewer_ViewPort.cxx +++ b/src/GLViewer/GLViewer_ViewPort.cxx @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_ViewPort.cxx // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 /*************************************************************************** ** Class: GLViewer_ViewPort diff --git a/src/GLViewer/GLViewer_ViewPort.h b/src/GLViewer/GLViewer_ViewPort.h index 9553fcf24..02ef4edaf 100644 --- a/src/GLViewer/GLViewer_ViewPort.h +++ b/src/GLViewer/GLViewer_ViewPort.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_ViewPort.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 /*************************************************************************** ** Class: GLViewer_ViewPort diff --git a/src/GLViewer/GLViewer_ViewPort2d.cxx b/src/GLViewer/GLViewer_ViewPort2d.cxx index 59604a176..17d9d68da 100644 --- a/src/GLViewer/GLViewer_ViewPort2d.cxx +++ b/src/GLViewer/GLViewer_ViewPort2d.cxx @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_ViewPort2d.cxx // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 /* GLViewer_ViewPort2d Source File */ diff --git a/src/GLViewer/GLViewer_ViewPort2d.h b/src/GLViewer/GLViewer_ViewPort2d.h index a022b11b9..128cdbe06 100644 --- a/src/GLViewer/GLViewer_ViewPort2d.h +++ b/src/GLViewer/GLViewer_ViewPort2d.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_ViewPort2d.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 #ifndef GLVIEWER_VIEWPORT2D_H #define GLVIEWER_VIEWPORT2D_H diff --git a/src/GLViewer/GLViewer_Viewer.cxx b/src/GLViewer/GLViewer_Viewer.cxx index f492cc399..9ca9ed73e 100644 --- a/src/GLViewer/GLViewer_Viewer.cxx +++ b/src/GLViewer/GLViewer_Viewer.cxx @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Viewer.cxx // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 /*************************************************************************** ** Class: GLViewer_Viewer diff --git a/src/GLViewer/GLViewer_Viewer.h b/src/GLViewer/GLViewer_Viewer.h index ec64dc496..dfd16c2fa 100644 --- a/src/GLViewer/GLViewer_Viewer.h +++ b/src/GLViewer/GLViewer_Viewer.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Viewer.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 #ifndef GLVIEWER_VIEWER_H #define GLVIEWER_VIEWER_H diff --git a/src/GLViewer/GLViewer_Viewer2d.cxx b/src/GLViewer/GLViewer_Viewer2d.cxx index bbd6533e5..74114b3f4 100644 --- a/src/GLViewer/GLViewer_Viewer2d.cxx +++ b/src/GLViewer/GLViewer_Viewer2d.cxx @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Viewer2d.cxx // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 /*************************************************************************** ** Class: GLViewer_Viewer2d @@ -131,7 +150,11 @@ void GLViewer_Viewer2d::updateBorders() for ( int i = 0, n = views.count(); i < n; i++ ) { GLViewer_Rect* border = ( ( GLViewer_ViewPort2d* )((GLViewer_ViewFrame*)views[i])->getViewPort() )->getBorder(); + if ( !border ) + continue; border->setIsEmpty( true ); + // initialise border by default values to avoid old values + border->setCoords( 0, 0, 0, 0 ); for ( ObjList::Iterator it = beginIt; it != endIt; ++it ) { GLViewer_Object* anObject = *it; diff --git a/src/GLViewer/GLViewer_Viewer2d.h b/src/GLViewer/GLViewer_Viewer2d.h index 289d1e141..94a5bd254 100644 --- a/src/GLViewer/GLViewer_Viewer2d.h +++ b/src/GLViewer/GLViewer_Viewer2d.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Viewer2d.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 /*************************************************************************** ** Class: GLViewer_Viewer2d diff --git a/src/GLViewer/GLViewer_Widget.cxx b/src/GLViewer/GLViewer_Widget.cxx index 3ec22e82f..b29a9fb52 100644 --- a/src/GLViewer/GLViewer_Widget.cxx +++ b/src/GLViewer/GLViewer_Widget.cxx @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Widget.cxx // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 //================================================================ // Class : GLViewer_Widget diff --git a/src/GLViewer/GLViewer_Widget.h b/src/GLViewer/GLViewer_Widget.h index 917391c24..c580a9a84 100644 --- a/src/GLViewer/GLViewer_Widget.h +++ b/src/GLViewer/GLViewer_Widget.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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. +// +// 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 +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Widget.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 /*! Class GLViewer_Widget * Class for visualization OpenGL scene (widget) for GLViewer -- 2.39.2