Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/visu.git] / src / OBJECT / VISU_GaussPtsAct.h
index 4e7094b964761935310d1b5f1e4af21641700c64..891f391b9c7097a604a113f30dffe7fa23bbbd1e 100644 (file)
@@ -1,34 +1,34 @@
-//  VISU OBJECT : interactive object for VISU entities implementation
+//  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, 
-//  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 
+//  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  VISU OBJECT : interactive object for VISU entities implementation
 //  File   : VISU_ScalarMapAct.h
 //  Author : Laurent CORNABE with help of Nicolas REJNERI
 //  Module : VISU
 //  $Header$
-
+//
 #ifndef VISU_GaussPtsAct_HeaderFile
 #define VISU_GaussPtsAct_HeaderFile
 
+#include "VISU_OBJECT.h"
 #include "VISU_Actor.h"
 #include "VISU_GaussPtsActorFactory.h"
 
@@ -53,17 +53,21 @@ class VISU_CursorPyramid;
 class VISU_FramedTextActor;
 
 class vtkUnstructuredGrid;
-class vtkDataSetMapper;
+class vtkPolyDataMapper;
 class vtkDataArray;
 
+class vtkCellDataToPointData;
+class vtkWarpVector;
+
 class vtkInteractorObserver;
 class vtkCallbackCommand;
 
 class VISU_ScalarBarCtrl;
-class VISU_PickingSettings;
 class VISU_InsideCursorSettings;
 class VISU_OutsideCursorSettings;
 
+class SALOME_ExtractPolyDataGeometry;
+class vtkImplicitBoolean;
 
 //============================================================================
 //! Base class for Gauss Points Actors.
@@ -76,7 +80,7 @@ class VISU_OutsideCursorSettings;
   - defining a way to handle VISU_ImplicitFunctionWidget;
   - global / local scalar bar mamangement.
 */
-class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor
+class VISU_OBJECT_EXPORT VISU_GaussPtsAct : public VISU_Actor
 {
  public:
   vtkTypeMacro(VISU_GaussPtsAct,VISU_Actor);
@@ -94,6 +98,11 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor
   VISU_GaussPointsPL*
   GetGaussPointsPL();
 
+  //! Copies all properties from the given actor
+  virtual
+  void
+  DeepCopy(VISU_Actor *theActor);
+
   virtual
   void
   ShallowCopyPL(VISU_PipeLine* thePipeLine);
@@ -106,7 +115,7 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor
 
   //! Redefined method of getting an actor bounds.
   virtual
-  float
+  vtkFloatingPointType
   GetBounds();
 
   //! Redefined method of getting an actor input.
@@ -114,6 +123,11 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor
   vtkDataSet* 
   GetInput(); 
 
+  //! Gets memory size used by the instance (bytes).
+  virtual
+  unsigned long int
+  GetMemorySize();
   //----------------------------------------------------------------------------
   virtual
   void
@@ -122,6 +136,10 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor
   VISU::TGaussPtsActorFactory*
   GetGaussPtsFactory();    
 
+  virtual
+  void 
+  SetPosition(double _arg[3]);
+
   //----------------------------------------------------------------------------
   //! Add actor to the renderer.
   virtual
@@ -176,7 +194,9 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor
   bool
   GetBarVisibility();
 
-  virtual void SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl);
+  virtual 
+  void
+  SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl);
 
   //! Return the information about pipeline magnification changing.
   /*! True indicates that magnification is increased, false - decreased. */
@@ -220,9 +240,6 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor
   UpdateInsideCursorSettings( PDeviceActor );
 
   //----------------------------------------------------------------------------
-  void
-  SetPickingSettings(VISU_PickingSettings* thePickingSettings);
-
   //! Apply the picking settings on the actor.
   void
   UpdatePickingSettings();
@@ -231,6 +248,26 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor
   bool
   IsInfinitive();
 
+  virtual
+  int
+  GetPickable();
+
+  //----------------------------------------------------------------------------
+  virtual
+  unsigned long int 
+  GetMTime();
+
+  //----------------------------------------------------------------------------
+  virtual void RemoveAllClippingPlanes();
+
+  virtual vtkIdType GetNumberOfClippingPlanes();
+
+  virtual bool AddClippingPlane(vtkPlane* thePlane);
+
+  virtual vtkPlane* GetClippingPlane(vtkIdType theID);
+
+  virtual vtkImplicitFunctionCollection* GetClippingPlanes();
+
  protected:
   //----------------------------------------------------------------------------
   VISU_GaussPtsAct();
@@ -249,19 +286,19 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor
 
   //! To get current value of the radius of the Point Sprite
   virtual
-  float
+  vtkFloatingPointType
   GetRadius(vtkIdType theObjID,
            vtkIdType theVTKID,
            vtkDataArray *theScalarArray);
 
   //! To get current value of the magnification
   virtual
-  float
+  vtkFloatingPointType
   GetMagnification(vtkIdType theObjID);
 
   //! To get current value of the clamp
   virtual
-  float
+  vtkFloatingPointType
   GetClamp(vtkIdType theObjID);
 
   //----------------------------------------------------------------------------
@@ -280,7 +317,7 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor
   void
   OnInteractorEvent(unsigned long theEvent);
 
-  float myPriority;
+  vtkFloatingPointType myPriority;
   bool myChangeMagnification;
   VISU::TGaussPtsActorFactory* myGaussPtsActorFactory;
   boost::signal1<void,VISU_GaussPtsAct*> myUpdatePrs3dSignal;
@@ -293,9 +330,11 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor
   VISU_GaussPointsPL* myCurrentPL;
   vtkSmartPointer<VISU_GaussPointsPL> myGaussPointsPL;
 
-  vtkIdType myLastObjPointID;
+  vtkSmartPointer<vtkPolyDataMapper> myMapper;
+  vtkSmartPointer<SALOME_ExtractPolyDataGeometry> myPolyDataExtractor;
+  vtkSmartPointer<vtkImplicitBoolean> myFunction;
 
-  vtkSmartPointer<VISU_FramedTextActor> myTextActor;
+  vtkIdType myLastPreHighlightObjID;
 
   vtkSmartPointer<VISU_CursorPyramid> myCursorPyramid;
   vtkSmartPointer<VISU_CursorPyramid> myCursorPyramidSelected;
@@ -303,11 +342,13 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor
   vtkSmartPointer<vtkUnstructuredGrid> myCellSource;
   vtkSmartPointer<SVTK_Actor> myCellActor;
 
+  vtkSmartPointer<vtkWarpVector> myWarpVector;
+  vtkSmartPointer<vtkCellDataToPointData> myCellDataToPointData;
+
   bool myBarVisibility;
   vtkSmartPointer<VISU_ScalarBarCtrl> myScalarBarCtrl;
 
   VISU_InsideCursorSettings* myInsideCursorSettings;
-  VISU_PickingSettings* myPickingSettings;
 };
 
 
@@ -320,7 +361,7 @@ class VISU_GaussPtsAct2;
  * which has two representation modes - outside and
  * inside segmentation cursor.
  */
-class VTKOCC_EXPORT VISU_GaussPtsAct1 : public VISU_GaussPtsAct
+class VISU_OBJECT_EXPORT VISU_GaussPtsAct1 : public VISU_GaussPtsAct
 {
  public:
   vtkTypeMacro(VISU_GaussPtsAct1,VISU_GaussPtsAct);
@@ -372,8 +413,29 @@ class VTKOCC_EXPORT VISU_GaussPtsAct1 : public VISU_GaussPtsAct
   void
   SetTransform(VTKViewer_Transform* theTransform);
 
-  virtual void SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl);
+  virtual 
+  void
+  SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl);
+
+  //! Redefined method of rendering the Opaque Geometry.
+  virtual
+  int
+  RenderOpaqueGeometry(vtkViewport *viewport);
+
+  //! Redefined method of rendering the Translucent Geometry.
+  virtual
+  int
+  RenderTranslucentGeometry(vtkViewport *viewport);
+                     
+  virtual
+  void 
+  SetPosition(double _arg[3]);
 
+  //! Gets memory size used by the instance (bytes).
+  virtual
+  unsigned long int
+  GetMemorySize();
  protected:
   //----------------------------------------------------------------------------
   VISU_GaussPtsAct1();
@@ -388,19 +450,19 @@ class VTKOCC_EXPORT VISU_GaussPtsAct1 : public VISU_GaussPtsAct
 
   //! To get current value of the radius of the Point Sprite
   virtual
-  float
+  vtkFloatingPointType
   GetRadius(vtkIdType theObjID,
            vtkIdType theVTKID,
            vtkDataArray *theScalarArray);
 
   //! To get current value of the magnification
   virtual
-  float
+  vtkFloatingPointType
   GetMagnification(vtkIdType theObjID);
 
   //! To get current value of the clamp
   virtual
-  float
+  vtkFloatingPointType
   GetClamp(vtkIdType theObjID);
 
   //----------------------------------------------------------------------------
@@ -418,6 +480,7 @@ class VTKOCC_EXPORT VISU_GaussPtsAct1 : public VISU_GaussPtsAct
   OnInteractorEvent(unsigned long theEvent);
 
   boost::signal1<void,int> mySetVisibilitySignal;
+  boost::signal1<void,double*> myUpdatePositionSignal;
   VISU_OutsideCursorSettings* myOutsideCursorSettings;
 
   //----------------------------------------------------------------------------
@@ -427,7 +490,7 @@ class VTKOCC_EXPORT VISU_GaussPtsAct1 : public VISU_GaussPtsAct
 
 
 //! Gauss Points Actor, displayed in the Segmented View.
-class VTKOCC_EXPORT VISU_GaussPtsAct2 : public VISU_GaussPtsAct
+class VISU_OBJECT_EXPORT VISU_GaussPtsAct2 : public VISU_GaussPtsAct
 {
  public:
   vtkTypeMacro(VISU_GaussPtsAct2,VISU_GaussPtsAct);
@@ -451,8 +514,19 @@ class VTKOCC_EXPORT VISU_GaussPtsAct2 : public VISU_GaussPtsAct
   void
   SetVisibility(int theMode);
 
-  virtual void SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl);
+  virtual 
+  void
+  SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl);
 
+  //! Gets memory size used by the instance (bytes).
+  virtual
+  unsigned long int
+  GetMemorySize();
+                     
+  virtual
+  void 
+  SetPosition(double _arg[3]);
+  
  protected:
   //----------------------------------------------------------------------------
   VISU_GaussPtsAct2();