Salome HOME
Typo-fix by Kunda
[modules/geom.git] / src / GEOMGUI / GEOM_Displayer.h
old mode 100644 (file)
new mode 100755 (executable)
index 7061a58..712fe83
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  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
@@ -28,6 +28,7 @@
 #define GEOM_DISPLAYER_H
 
 #include "GEOM_GEOMGUI.hxx"
+#include <GEOM_AISShape.hxx>
 
 #include <SALOME_InteractiveObject.hxx>
 
@@ -45,7 +46,7 @@ class SALOME_OCCViewType;
 #include <LightApp_Study.h>
 #include <Aspect_TypeOfMarker.hxx>
 #include <TCollection_AsciiString.hxx>
-#include <Basics_OCCTVersion.hxx>
+#include <TColStd_MapOfInteger.hxx>
 #include <QList>
 
 #include <list>
@@ -60,14 +61,11 @@ class SALOME_OCCViewType;
 
 typedef std::list<GEOM::GEOM_Object_ptr> ObjectList;
 
-class TColStd_MapOfInteger;
 class LightApp_SelectionMgr;
 class SalomeApp_Study;
 class SalomeApp_Application;
 class SUIT_SelectionFilter;
-class Handle_GEOM_AISShape;
 class gp_Ax3;
-//class SALOME_Selection;
 
 class GEOMGUI_EXPORT GEOM_Displayer : public LightApp_Displayer
 {
@@ -128,7 +126,10 @@ public:
                             const bool theUpdateViewer,
                             SALOME_View* theViewFrame );
 
-  /* build presentation accordint to the current viewer type*/
+  /* Update visibility state */
+  void          UpdateVisibility( SALOME_View*, const SALOME_Prs*, bool );
+
+  /* build presentation according to the current viewer type*/
   SALOME_Prs*   BuildPrs  ( GEOM::GEOM_Object_ptr );
   SALOME_Prs*   BuildPrs  ( const TopoDS_Shape& );
 
@@ -159,7 +160,20 @@ public:
   void          SetIsosWidth  ( const int );
   int           GetIsosWidth  () const;
   bool          HasIsosWidth  () const;
+  /* Set nb iso-libes for displaying. Use -1 to set default values. */
+  int           SetNbIsos( const int );
+  int           UnsetNbIsos();
+  int           GetNbIsos() const;
+  bool          HasNbIsos() const;
   
+  /* Set color for iso-lines displaying. If it is equal -1 then default color is used.
+     Available values are from Quantity_NameOfColor enumeration */
+  int           SetIsosColor  ( const int );
+  int           UnsetIsosColor();
+  int           GetIsosColor  () const;
+  bool          HasIsosColor  () const;
   /* Set display mode shape displaying. If it is equal -1 then display mode is used. */
   int           SetDisplayMode( const int );
   int           GetDisplayMode() const;
@@ -175,17 +189,17 @@ public:
   virtual void  Update( SALOME_VTKPrs* );
   virtual void  BeforeDisplay( SALOME_View*, const SALOME_OCCPrs* );
   virtual void  AfterDisplay ( SALOME_View*, const SALOME_OCCPrs* );
-#if OCC_VERSION_LARGE > 0x06070000
   virtual void  BeforeErase  ( SALOME_View*, const SALOME_OCCPrs* );
-#endif
   virtual void  AfterErase   ( SALOME_View*, const SALOME_OCCPrs* );
 
-  /* This methos is used for activisation/deactivisation of objects to be displayed*/
+  /* This methods is used for activisation/deactivisation of objects to be displayed*/
   void          SetToActivate( const bool );
   bool          ToActivate() const;
 
   /* Activate/Deactivate selection*/
+  void         LocalSelection( const Handle(SALOME_InteractiveObject)&, const std::list<int> );
   void         LocalSelection( const Handle(SALOME_InteractiveObject)&, const int );
+  void         LocalSelection( const SALOME_ListIO& theIOList, const std::list<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, const QList<int>* = 0 );
@@ -211,7 +225,8 @@ public:
                                                 SALOME_View* = 0);
 
   /* Update visibility and parameters of the currently selected field step's color scale */
-  void UpdateColorScale( const bool theIsRedisplayFieldSteps = false, const bool updateViewer = true );
+  void UpdateColorScale();
+  bool SetUpdateColorScale(bool);
 
 protected:
   /* internal methods */
@@ -245,6 +260,7 @@ protected:
   void           updateShapeProperties( const Handle(GEOM_AISShape)&, bool );
   void           updateActorProperties( GEOM_Actor*, bool );
   void           updateDimensions( const Handle(SALOME_InteractiveObject)&, SALOME_OCCPrs*, const gp_Ax3& );
+  void           updateShapeAnnotations( const Handle(SALOME_InteractiveObject)&, SALOME_OCCPrs*, const gp_Ax3& );
 
   PropMap getObjectProperties( SalomeApp_Study*, const QString&, SALOME_View* = 0 );
   PropMap getDefaultPropertyMap();
@@ -257,18 +273,6 @@ protected:
                                   double& theFieldStepRangeMin,
                                   double& theFieldStepRangeMax );
 
-  // Note: the method is copied from Aspect_ColorScale class
-  static Standard_Integer HueFromValue( const Standard_Integer aValue,
-                                        const Standard_Integer aMin,
-                                        const Standard_Integer aMax );
-
-  // Note: the method is copied from Aspect_ColorScale class
-  static Standard_Boolean FindColor( const Standard_Real aValue, 
-                                     const Standard_Real aMin,
-                                     const Standard_Real aMax,
-                                     const Standard_Integer ColorsCount,
-                                     Quantity_Color& aColor );
-
 protected:
   Handle(SALOME_InteractiveObject) myIO;
   TopoDS_Shape                     myShape;
@@ -282,19 +286,22 @@ protected:
   std::string                      myTexture;
   int                              myType;
   SALOME_View*                     myViewFrame;
+  bool                             myUpdateColorScale; // IPAL54049
 
   // Attributes
   Quantity_Color                   myShadingColor;
   int                              myColor;
   double                           myWidth;
   int                              myIsosWidth;
+  int                              myNbIsos;
+  int                              myIsosColor;
   bool                             myToActivate;
   int                              myDisplayMode;
   bool                             myHasDisplayMode;
   Aspect_TypeOfMarker              myTypeOfMarker;
   double                           myScaleOfMarker;
   double                           myTransparency;
-  bool                             myHasTransparency;
+  bool                             myIsRedisplayed;
 
 private:
   SalomeApp_Application* myApp;