]> SALOME platform Git repositories - modules/yacs.git/blobdiff - src/genericgui/SceneItem.hxx
Salome HOME
Updated copyright comment
[modules/yacs.git] / src / genericgui / SceneItem.hxx
index d7ce9e038e3e31120b2ea3c25932a57dd57f3b42..53ce8604dab5d31a714c88579371725b213f3d3e 100644 (file)
@@ -1,21 +1,22 @@
-//  Copyright (C) 2006-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2024  CEA, EDF
 //
-//  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 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.
 //
-//  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 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
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef _SCENEITEM_HXX_
 #define _SCENEITEM_HXX_
 
@@ -32,6 +33,13 @@ namespace YACS
 {
   namespace HMI
   {
+    typedef enum
+      {
+        CurrentNode,
+        ChildrenNodes,
+        ElementaryNodes
+      } ShrinkMode;
+    
     class Scene;
 
     class RootSceneItem: public GuiObserver
@@ -66,24 +74,21 @@ namespace YACS
                          QWidget *widget) = 0;
 
       virtual void setTopLeft(QPointF topLeft) = 0;
-      virtual int getLevel();
-      virtual qreal getMargin();
+      int getLevel();
+      void setLevel();
       virtual void checkGeometryChange() = 0;
       virtual void reorganize();
       virtual QString getLabel();
       virtual void addHeader();
+      virtual void addProgressItem();
       virtual qreal getHeaderBottom();
-      virtual qreal getWidth();
-      virtual qreal getHeight();
+      qreal getWidth();
+      qreal getHeight();
       virtual void setWidth(qreal width);
       virtual void setHeight(qreal height);
-      virtual qreal getInternWidth();
-      virtual qreal getInternHeight();
       virtual void popupMenu(QWidget *caller, const QPoint &globalPos) = 0;
       virtual void activateSelection(bool selected);
       virtual void setGeometryOptimization(bool optimize);
-      inline bool hasNml() { return _hasNml; };
-      inline qreal getNml() { return _hasNml*_nml; };
       inline SceneItem* getParent() { return _parent; };
 
     protected:
@@ -93,16 +98,14 @@ namespace YACS
       YACS::HMI::Scene *_scene;
       QString _label;
       int _level;
-      qreal _margin;
-      qreal _nml;
       qreal _width;
       qreal _height;
+      qreal _incHeight;
       QColor _penColor;
       QColor _brushColor;
       QColor _hiPenColor;
       QColor _hiBrushColor;
       bool _hasHeader;
-      bool _hasNml;
       bool _optimize;
       bool _dragable;
       enum Qt::MouseButton _dragButton;
@@ -130,6 +133,15 @@ namespace YACS
       virtual void checkGeometryChange();
       virtual void popupMenu(QWidget *caller, const QPoint &globalPos);
       void setParent(SceneItem* parent);
+      virtual QString getToolTip();
+      void setEventPos(QPointF point);
+      virtual void updateChildItems();
+      virtual void updateLinks();
+      virtual void shrinkExpandLink(bool se);
+      virtual void shrinkExpandRecursive(bool isExpanding, bool fromHere, ShrinkMode theShrinkMode);
+      bool isAncestorShrinked() { return _ancestorShrinked; };
+      bool _blocX;
+      bool _blocY;
 
     protected:
 //       virtual bool sceneEvent(QEvent *event);
@@ -141,6 +153,8 @@ namespace YACS
       virtual QColor getBrushColor();
       QColor hoverColor(QColor origColor);
       bool _hover;
+      bool _ancestorShrinked;
+      QPointF _eventPos;
     };
 
   }