Salome HOME
updated copyright message
[modules/geom.git] / src / EntityGUI / EntityGUI_PolylineDlg.h
index 364c144ce36928c4d8e94d3929bf58a399b98826..3d959cd82878d536b1a3ea4e57ffb41ca88f5977 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  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
 #ifndef ENTITYGUI_POLYLINEDLG_H
 #define ENTITYGUI_POLYLINEDLG_H
 
-
 #include <GEOMBase_Skeleton.h>
 
 class CurveCreator_Curve;
 class CurveCreator_Widget;
+class OCCViewer_ViewManager;
 class QGroupBox;
 class QComboBox;
 
-
 //=================================================================================
 // class    : EntityGUI_PolylineDlg
 // purpose  :
@@ -50,13 +49,31 @@ public:
   void  deleteSelected();
   bool  deleteEnabled();
 
+  void  setPreviewZLayer( int theLayer );
+  int   getPreviewZLayer() const;
+
 protected:
 
   // redefined from GEOMBase_Helper
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
-       
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
+
+  /**
+   * This method sets/gets the view manager to control the temporary
+   * displayed objects on Z layer. 
+   * \param theManager the view manager.
+   */
+  void                   setPreviewManager( OCCViewer_ViewManager* theManager );
+  OCCViewer_ViewManager* getPreviewManager();
+
+  /**
+   * This method defines a state of selection button.
+   * \return true if selection button is checked, otherwise false.
+   */
+  bool isCheckToSelect();
+
 private:
 
   void Init();
@@ -102,7 +119,7 @@ private:
    * This method add a local coordinate system of the selected object.
    *
    * \param theSelectedObject the selected object. It can be a planar face
-   *        or an inported polyline.
+   *        or an imported polyline.
    * \param IsPlane true for planar face; false for imported polyline.
    * \param theLCS the local coordinate system.
    */
@@ -119,17 +136,27 @@ private:
    */
   gp_Ax3 WPlaneToLCS(GEOM::GeomObjPtr theGeomObj);
 
+  /**
+   * This method displays the AIS_InteractiveObject(s) to preview
+   * on the Z layer and sets VIOLET color.
+   */
+  void displayPreview();
+
+  /**
+   * This method erases AIS_InteractiveObject(s) from
+   * AIS_InteractiveContext and release memory.
+   */
+  void erasePreview();
+
 protected slots:
 
   void ClickOnOk();
   bool ClickOnApply();
-  void ClickOnCancel();
   void processStartedSubOperation( QWidget*, bool );
   void processFinishedSubOperation( QWidget* );
-  void SetEditCurrentArgument();
-  void SelectionIntoArgument();
+  void SetEditCurrentArgument( bool );
+  void SelectionIntoArgument( bool isForced = false );
   void ActivateThisDialog();
-  void onUpdatePreview();
   void ActivateLocalCS();
 
 private:
@@ -146,6 +173,8 @@ private:
   QLineEdit                    *myEditCurrentArgument;   /* Current LineEdit */
   QList<gp_Ax3>                 myLCSList;
   QList<GEOM::GeomObjPtr>       myWPlaneList;
+  OCCViewer_ViewManager*        myPreviewManager;
+  int                           myPreviewZLayer;
 
 };