]> SALOME platform Git repositories - modules/gui.git/blobdiff - src/Prs/SALOME_Prs.h
Salome HOME
Copyright update 2022
[modules/gui.git] / src / Prs / SALOME_Prs.h
old mode 100755 (executable)
new mode 100644 (file)
index ebef97a..8f7e5ad
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  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
 #define PRS_EXPORT
 #endif
 
+#include <string>
+#include <list>
+
+#include <Standard_DefineHandle.hxx>
+
 class SALOME_View;
 class SALOME_Displayer;
 class SALOME_ListIO;
-class Handle_SALOME_InteractiveObject;
+class SALOME_InteractiveObject;
 
 /*!
  \class SALOME_Prs
@@ -48,11 +53,14 @@ class PRS_EXPORT SALOME_Prs
 {
 public:
   //! Constructor
-  SALOME_Prs() : myIsClippable (true) {};
-
+  explicit SALOME_Prs( const char* );
   //! Destructor
   virtual ~SALOME_Prs() {}
 
+  //! Get entry
+  const char* GetEntry() const;
+
   //! Key method for double dispatch of display operation
   virtual void DisplayIn( SALOME_View* ) const = 0;
 
@@ -79,6 +87,7 @@ public:
 
   //! Key method for double dispatch of activation of sub-shapes selection
   virtual void LocalSelectionIn( SALOME_View*, const int ) const = 0;
+  virtual void LocalSelectionIn( SALOME_View*, const std::list<int> ) const;
 
     // checks if shape is clippable
   inline bool IsClippable() const
@@ -93,7 +102,7 @@ public:
   }
 
 protected:
-
+  std::string myEntry;
   bool myIsClippable;
 };
 
@@ -106,6 +115,9 @@ protected:
 class PRS_EXPORT SALOME_OCCPrs : public SALOME_Prs
 {
 public:
+  //! Constructor
+  explicit SALOME_OCCPrs(const char* e) : SALOME_Prs(e) {}
+
   //! It uses double dispatch in order to
   //! invoke Display() method corresponding to the actual type of presentation.
   virtual void DisplayIn( SALOME_View* ) const;
@@ -136,6 +148,7 @@ public:
 
   //! Key method for double dispatch of activation of sub-shapes selection
   virtual void LocalSelectionIn( SALOME_View*, const int ) const;
+  virtual void LocalSelectionIn( SALOME_View*, const std::list<int> ) const;
 };
 
 /*!
@@ -146,6 +159,9 @@ public:
 class PRS_EXPORT SALOME_VTKPrs : public SALOME_Prs
 {
 public:
+  //! Constructor
+  explicit SALOME_VTKPrs(const char* e) : SALOME_Prs(e) {}
+
   //! It uses double dispatch in order to
   //! invoke Display() method corresponding to the actual type of presentation.
   virtual void DisplayIn( SALOME_View* ) const;
@@ -185,6 +201,9 @@ public:
 class PRS_EXPORT SALOME_Prs2d : public SALOME_Prs
 {
 public:
+  //! Constructor
+  explicit SALOME_Prs2d(const char* e) : SALOME_Prs(e) {}
+
   //! It uses double dispatch in order to
   //! invoke Display() method corresponding to the actual type of presentation.
   virtual void DisplayIn( SALOME_View* ) const;
@@ -233,17 +252,22 @@ public:
   //! This Display() method should be called to display given presentation
   //! created anywhere by anybody. It simply passes control to SALOME_Prs object
   //! so that it could perform double dispatch.
-  void Display( const SALOME_Prs* );
+  void Display( SALOME_Displayer*, const SALOME_Prs* );
 
   //! This Erase() method should be called to erase given presentation
   //! created anywhere by anybody. It simply passes control to SALOME_Prs object
   //! so that it could perform double dispatch.
-  void Erase( const SALOME_Prs*, const bool = false );
+  void Erase( SALOME_Displayer*, const SALOME_Prs*, const bool = false );
+
+  //! This EraseAll() method should be called to erase all presentations
+  //! created anywhere by anybody.
+  virtual void EraseAll( SALOME_Displayer*, const bool = false );
 
   //! This LocalSelection() method should be called to activate sub-shapes selection
   //! created anywhere by anybody. It simply passes control to SALOME_Prs object
   //! so that it could perform double dispatch.
   void LocalSelection( const SALOME_Prs*, const int );
+  void LocalSelection( const SALOME_Prs*, const std::list<int> );
 
   // Interface for derived views
 
@@ -257,13 +281,13 @@ public:
   virtual void Erase( const SALOME_OCCPrs*, const bool = false );//!< Erase SALOME_OCCPrs
   virtual void Erase( const SALOME_VTKPrs*, const bool = false );//!< Erase SALOME_VTKPrs
   virtual void Erase( const SALOME_Prs2d*,  const bool = false );//!< Erase SALOME_Prs2d
-  virtual void EraseAll( const bool = false );
   // Add new Erase() methods here...
 
   // LocalSelection() methods for ALL kinds of presentation should appear here
-  virtual void LocalSelection( const SALOME_OCCPrs*, const int );//!< Local selection SALOME_OCCPrs
-  virtual void LocalSelection( const SALOME_VTKPrs*, const int );//!< Local selection SALOME_VTKPrs
-  virtual void LocalSelection( const SALOME_Prs2d* , const int );//!< Local selection SALOME_Prs2d
+  virtual void LocalSelection( const SALOME_OCCPrs*, const int );           //!< Local selection SALOME_OCCPrs
+  virtual void LocalSelection( const SALOME_OCCPrs*, const std::list<int> );//!< Multiple local selection SALOME_OCCPrs
+  virtual void LocalSelection( const SALOME_VTKPrs*, const int );           //!< Local selection SALOME_VTKPrs
+  virtual void LocalSelection( const SALOME_Prs2d* , const int );           //!< Local selection SALOME_Prs2d
 
   //! Deactivates selection of sub-shapes (must be redefined with OCC viewer)
   virtual void GlobalSelection( const bool = false ) const;
@@ -281,9 +305,9 @@ public:
 
   // New methods (asv)
   //! \retval Return false.
-  virtual bool isVisible( const Handle_SALOME_InteractiveObject& ){ return false; }
+  virtual bool isVisible( const Handle(SALOME_InteractiveObject)& ){ return false; }
   virtual void Repaint() {} //!< Null body here.
-  virtual void GetVisible( SALOME_ListIO& theList ) {}
+  virtual void GetVisible( SALOME_ListIO& /*theList*/ ) {}
 };
 
 /*!
@@ -325,6 +349,8 @@ public:
   virtual void BeforeErase( SALOME_View*, const SALOME_Prs2d*  ) {} //! Null body here
   virtual void AfterErase ( SALOME_View*, const SALOME_Prs2d*  ) {} //! Null body here
 
+  // Axiluary method called to update visibility state of presentation
+  virtual void UpdateVisibility( SALOME_View*, const SALOME_Prs*, bool );
 };
 
 #endif