Salome HOME
Bug 0020228: [CEA 331] the geompy.RemoveExtraEdges crash with the attached brep shape...
[modules/geom.git] / src / GEOMGUI / GEOM_Displayer.h
index 8d081a0ddd5f261637fa8c7730a185b4888ddf10..8ab6b3f202f11dcdbaac1ba231a90b1280ded296 100644 (file)
@@ -1,40 +1,44 @@
-//  GEOM GEOMGUI : GUI for Geometry component
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  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 distributed in the hope that it will be useful, 
+//  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 
+//  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  GEOM GEOMGUI : GUI for Geometry component
 //  File   : GEOM_Displayer.h
 //  Author : Vadim SANDLER
 //  Module : GEOM
 //  $Header$
-
+//
 #if !defined (__GEOM_DISPLAYER_H)
 #define __GEOM_DISPLAYER_H
 
+#include "GEOM_GEOMGUI.hxx"
+
 #include "SALOME_Prs.h"
 #include "SALOME_InteractiveObject.hxx"
 #include "SALOME_ListIO.hxx"
 #include <TopoDS_Shape.hxx>
 #include <Quantity_Color.hxx>
 #include <LightApp_Displayer.h>
+#include <Aspect_TypeOfMarker.hxx>
+
+#include <qvaluelist.h>
 
 #include <list>
 
@@ -55,37 +59,27 @@ class SalomeApp_Application;
 class SUIT_SelectionFilter;
 //class SALOME_Selection;
 
-//#ifdef WNT
-//#include <SALOME_WNT.hxx>
-//#else
-//#define SALOME_WNT_EXPORT
-//#endif
-#if defined WNT && defined WIN32 && defined SALOME_WNT_EXPORTS
-#define GEOMGUI_WNT_EXPORT __declspec( dllexport )
-#else
-#define GEOMGUI_WNT_EXPORT
-#endif
-
-class GEOMGUI_WNT_EXPORT GEOM_Displayer : public LightApp_Displayer
+class GEOMGUI_EXPORT GEOM_Displayer : public LightApp_Displayer
 {
-    
+
 public:
   /* Constructor */
   GEOM_Displayer( SalomeApp_Study* app );
   /* Destructor */
   virtual ~GEOM_Displayer();
 
-  /* Display/Erase object methods */
+  virtual bool canBeDisplayed( const QString& /*entry*/, const QString& /*viewer_type*/ ) const;
 
+  /* Display/Erase object methods */
   void          Display   ( const Handle(SALOME_InteractiveObject)& theIO,
                             const bool updateViewer = true,
                            SALOME_View* theViewFrame = 0 );
 
   // This overloaded Display() method can be useful for operations
   // not using dialog boxes.
-  void          Display   ( GEOM::GEOM_Object_ptr theObj, 
+  void          Display   ( GEOM::GEOM_Object_ptr theObj,
                            const bool updateViewer = true );
-                         
+
   void          Redisplay ( const Handle(SALOME_InteractiveObject)& theIO,
                             const bool updateViewer = true );
 
@@ -96,17 +90,17 @@ public:
 
   void          Erase     ( GEOM::GEOM_Object_ptr theObj,
                             const bool forced = false,
-                            const bool updateViewer = true );                            
+                            const bool updateViewer = true );
 
   /* Display/Erase list of objects methods */
-  
+
   void          Display   ( const SALOME_ListIO& theIOList,
                             const bool updateViewer = true );
-                            
+
   void          Erase     ( const SALOME_ListIO& theIOList,
                             const bool forced = false,
                             const bool updateViewer = true );
-                            
+
   void          Redisplay ( const SALOME_ListIO& theIOList,
                             const bool updateViewer = true );
 
@@ -126,6 +120,11 @@ public:
   void          UnsetWidth();
   double        GetWidth  () const;
   bool          HasWidth  () const;
+  
+  /* Set display mode shape displaying. If it is equal -1 then display mode is used. */
+  int           SetDisplayMode( const int );
+  int           GetDisplayMode() const;
+  int           UnsetDisplayMode();
 
 
   /* Sets name - for temporary objects only */
@@ -146,32 +145,35 @@ public:
   void         LocalSelection( const Handle(SALOME_InteractiveObject)&, const int );
   void         LocalSelection( const SALOME_ListIO& theIOList, const int );
   void         GlobalSelection( const int = GEOM_ALLOBJECTS, const bool = false );
-  void         GlobalSelection( const TColStd_MapOfInteger&, const bool = false );
+  void         GlobalSelection( const TColStd_MapOfInteger&, const bool = false, const QValueList<int>* = 0 );
 
   SalomeApp_Study* getStudy() const;
 
+  static SALOMEDS::Color getUniqueColor( const QValueList<SALOMEDS::Color>& );
+
 protected:
   /* internal methods */
   /* Builds presentation accordint to the current viewer type */
   virtual SALOME_Prs* buildPresentation( const QString&, SALOME_View* = 0 );
-  
+
   /* Sets interactive object */
   void        setIO( const Handle(SALOME_InteractiveObject)& theIO );
-  
+
   /* Sets shape */
   void        setShape( const TopoDS_Shape& theShape );
-  
+
   /* Resets internal data */
   void        internalReset();
 
   void        clearTemporary( LightApp_SelectionMgr* theSelMgr );
 
   SUIT_SelectionFilter* getFilter( const int theMode );
-  
+  SUIT_SelectionFilter* getComplexFilter(const QValueList<int>* );
+
 protected:
   Handle(SALOME_InteractiveObject) myIO;
   TopoDS_Shape                     myShape;
-  string                           myName;
+  std::string                      myName;
   int                              myType;
   SALOME_View*                     myViewFrame;
 
@@ -181,6 +183,8 @@ protected:
   double                           myWidth;
   bool                             myToActivate;
   int                              myDisplayMode;
+  Aspect_TypeOfMarker              myTypeOfMarker;
+  double                           myScaleOfMarker;
 
 private:
   SalomeApp_Application* myApp;