Salome HOME
Update French translations
[modules/geom.git] / src / GEOMGUI / GEOM_Displayer.h
index 751622dd2de46c4fa2ee2f1050207947a432dc28..07305f66b15d2c4fc349c5633c82e06e6899602a 100644 (file)
@@ -1,23 +1,23 @@
-//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  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-2007  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.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 // GEOM GEOMGUI : GUI for Geometry component
@@ -41,6 +41,7 @@ class SALOME_OCCViewType;
 #include <TopoDS_Shape.hxx>
 #include <Quantity_Color.hxx>
 #include <LightApp_Displayer.h>
+#include <LightApp_Study.h>
 #include <Aspect_TypeOfMarker.hxx>
 
 #include <QList>
@@ -97,6 +98,9 @@ public:
                             const bool forced = false,
                             const bool updateViewer = true );
 
+  void          EraseWithChildren(const Handle(SALOME_InteractiveObject)& theIO,
+                                 const bool eraseOnlyChildren = false);
+
   /* Display/Erase list of objects methods */
 
   void          Display   ( const SALOME_ListIO& theIOList,
@@ -119,12 +123,22 @@ public:
   void          UnsetColor();
   int           GetColor  () const;
   bool          HasColor  () const;
+  
+  /* Set texture for shape displaying. */
+  void          SetTexture  ( const std::string& );
+  bool          HasTexture  () const;
+  std::string   GetTexture  () const;
 
   /* Set width for shape displaying. If it is equal -1 then default width is used. */
   void          SetWidth  ( const double );
   void          UnsetWidth();
   double        GetWidth  () const;
   bool          HasWidth  () const;
+
+  /* Set width for iso-lines displaying. If it is equal -1 then default width is used. */
+  void          SetIsosWidth  ( const int );
+  int           GetIsosWidth  () const;
+  bool          HasIsosWidth  () const;
   
   /* Set display mode shape displaying. If it is equal -1 then display mode is used. */
   int           SetDisplayMode( const int );
@@ -139,8 +153,8 @@ public:
   /* Reimplemented from SALOME_Displayer */
   virtual void  Update( SALOME_OCCPrs* );
   virtual void  Update( SALOME_VTKPrs* );
-  virtual void  BeforeDisplay( SALOME_View*, const SALOME_OCCViewType& );
-  virtual void  AfterDisplay ( SALOME_View*, const SALOME_OCCViewType& );
+  virtual void  BeforeDisplay( SALOME_View*, const SALOME_OCCPrs* );
+  virtual void  AfterDisplay ( SALOME_View*, const SALOME_OCCPrs* );
 
   /* This methos is used for activisation/deactivisation of objects to be displayed*/
   void          SetToActivate( const bool );
@@ -156,6 +170,20 @@ public:
 
   static SALOMEDS::Color getUniqueColor( const QList<SALOMEDS::Color>& );
 
+  static PropMap getDefaultPropertyMap(const QString& viewer_type);
+  
+  static bool MergePropertyMaps(PropMap& theOrigin, PropMap& theDefault);
+  
+  /*Get color of the geom object*/
+  static SALOMEDS::Color getColor(GEOM::GEOM_Object_var aGeomObject, bool& hasColor);
+
+  /* Get minimum or maximum enclosed shape type */
+  static int getMinMaxShapeType( const TopoDS_Shape& shape, bool ismin );
+
+  /* Check if the object is a vertex or a compound of vertices */
+  static bool isCompoundOfVertices( const TopoDS_Shape& theShape );
+
+
   /* Builds presentation of not published object */
   virtual SALOME_Prs* buildSubshapePresentation(const TopoDS_Shape& aShape,
                                                 const QString&,
@@ -184,6 +212,7 @@ protected:
   Handle(SALOME_InteractiveObject) myIO;
   TopoDS_Shape                     myShape;
   std::string                      myName;
+  std::string                      myTexture;
   int                              myType;
   SALOME_View*                     myViewFrame;
 
@@ -191,6 +220,7 @@ protected:
   Quantity_Color                   myShadingColor;
   int                              myColor;
   double                           myWidth;
+  int                              myIsosWidth;
   bool                             myToActivate;
   int                              myDisplayMode;
   Aspect_TypeOfMarker              myTypeOfMarker;