Salome HOME
*** empty log message ***
[modules/geom.git] / src / GEOMBase / GEOMBase_Helper.h
index 64dbd4d222c7804f12d030c2424ab13afbfd84c8..db10f7cc0e63e979376dfa105bb8010497a2bc25 100755 (executable)
@@ -1,49 +1,49 @@
-//  GEOM GEOMGUI : GUI for Geometry component
+// GEOM GEOMGUI : GUI for Geometry component
 //
-//  Copyright (C) 2004  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// Copyright (C) 2004  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. 
+// 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. 
+// 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.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+// File   : GEOMBase_Helper.h
+// Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
 //
-//
-//  File   : GEOMBase_Helper.h
-//  Author : Sergey ANIKIN
-//  Module : GEOM
-//  $Header$
 
 #ifndef GEOMBASE_HELPER_H
 #define GEOMBASE_HELPER_H
 
-#include "GEOM_Displayer.h"
-#include "SALOME_Prs.h"
+#include "GEOM_GEOMBase.hxx"
+
+#include <GEOM_Displayer.h>
+#include <SALOME_ListIO.hxx>
 #include <SALOMEconfig.h>
 #include CORBA_CLIENT_HEADER(GEOM_Gen)
 
-#include <qstring.h>
+#include <QString>
 
 #include <list>
 
 typedef std::list<GEOM::GEOM_Object_ptr> ObjectList;
 
+class SalomeApp_Study;
+class SUIT_Desktop;
+class SUIT_ViewWindow;
+class SALOME_Prs;
 class GEOM_Operation;
-class QAD_Study;
-class TopoDS_Shape;
-class QAD_ViewFrame;
 class TColStd_MapOfInteger;
 
 //================================================================
@@ -53,10 +53,10 @@ class TColStd_MapOfInteger;
 //               performing common operations (display/erase, selection activation,
 //               publication in a study, transaction management)
 //================================================================
-class GEOMBase_Helper
+class GEOMBASE_EXPORT GEOMBase_Helper
 {
 public:
-  GEOMBase_Helper();
+  GEOMBase_Helper( SUIT_Desktop* );
   virtual ~GEOMBase_Helper();
 
 protected:
@@ -72,7 +72,9 @@ protected:
   virtual void displayPreview ( const bool   activate = false, 
                                 const bool   update = true,
                                 const bool   toRemoveFromEngine = true,
-                                const double lineWidth = -1 );
+                                const double lineWidth = -1, 
+                                const int    displayMode = -1,
+                                const int    color  = -1 );
   // This is the easiest way to show preview. It is based on execute() method.
   // It removes temporary GEOM::GEOM_Objects automatically.
 
@@ -80,7 +82,9 @@ protected:
                                  const bool   append = false, 
                                  const bool   activate = false, 
                                  const bool   update = true,
-                                 const double lineWidth = -1 );
+                                 const double lineWidth = -1, 
+                                 const int    displayMode = -1,
+                                 const int    color  = -1 );
   void displayPreview  ( const SALOME_Prs* prs, 
                         const bool append = false, 
                         const bool = true );
@@ -105,8 +109,8 @@ protected:
 
   void updateObjBrowser() const;
   int  getStudyId      () const;
-  QAD_Study* getStudy  () const;
-  bool checkViewFrame  ();
+  SalomeApp_Study* getStudy  () const;
+  bool checkViewWindow ();
 
   bool onAccept( const bool publish = true, const bool useTransaction = true );
   // This method should be called from "OK" button handler.
@@ -126,6 +130,24 @@ protected:
   inline void setPrefix( const QString& prefix ) { myPrefix = prefix; }
   QString getPrefix( GEOM::GEOM_Object_ptr = GEOM::GEOM_Object::_nil() ) const;
 
+  const SALOME_ListIO& selectedIO();
+  // Function returns a list of SALOME_InteractiveObject's from
+  // selection manager in GUI
+
+  int   IObjectCount() ;
+  // Function returns the number of selected objects
+  
+  Handle(SALOME_InteractiveObject) firstIObject() ;
+  // Function returns the first selected object in the list
+  // of selected objects
+
+  Handle(SALOME_InteractiveObject) lastIObject() ;
+  // Function returns the last selected object in the list
+  // of selected objects
+  
+  bool selectObjects( ObjectList& objects );
+  // Selects list of objects 
+
   ////////////////////////////////////////////////////////////////////////////
   // Virtual methods, to be redefined in dialog classes
   ////////////////////////////////////////////////////////////////////////////
@@ -154,6 +176,7 @@ protected:
   bool IsPreview() {return isPreview;}
 
   GEOM_Displayer*             getDisplayer();
+  SUIT_Desktop*               getDesktop() const;
 
 private:
   char* getEntry              ( GEOM::GEOM_Object_ptr ) const;
@@ -166,10 +189,12 @@ private:
   GEOM_Displayer*             myDisplayer;
   GEOM_Operation*             myCommand;
   GEOM::GEOM_IOperations_var  myOperation;
-  QAD_ViewFrame*              myViewFrame;
+  SUIT_ViewWindow*            myViewWindow;
   QString                     myPrefix;
   bool                        isPreview;
+  SALOME_ListIO               mySelected;
+  SUIT_Desktop*               myDesktop;
 
 };
 
-#endif
+#endif // GEOMBASE_HELPER_H