src/OBJECT/VISU_GaussPtsDeviceActor.h

Go to the documentation of this file.
00001 //  SMESH OBJECT : interactive object for SMESH visualization
00002 //
00003 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
00005 // 
00006 //  This library is free software; you can redistribute it and/or 
00007 //  modify it under the terms of the GNU Lesser General Public 
00008 //  License as published by the Free Software Foundation; either 
00009 //  version 2.1 of the License. 
00010 // 
00011 //  This library is distributed in the hope that it will be useful, 
00012 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
00013 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00014 //  Lesser General Public License for more details. 
00015 // 
00016 //  You should have received a copy of the GNU Lesser General Public 
00017 //  License along with this library; if not, write to the Free Software 
00018 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
00019 // 
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 //
00023 //
00024 //  File   : 
00025 //  Author : 
00026 //  Module : 
00027 //  $Header: /home/server/cvs/VISU/VISU_SRC/src/OBJECT/VISU_GaussPtsDeviceActor.h,v 1.4 2006/06/01 11:36:04 jfa Exp $
00028 
00029 #ifndef VISU_GAUSS_PTS_DEVICE_ACTOR_H
00030 #define VISU_GAUSS_PTS_DEVICE_ACTOR_H
00031 
00032 #include "VTKViewer_GeometryFilter.h"
00033 
00034 #include <vtkLODActor.h>
00035 #include <vtkSmartPointer.h>
00036 
00037 class VTKViewer_Transform;
00038 class VTKViewer_TransformFilter;
00039 class VTKViewer_PassThroughFilter;
00040 
00041 class VISU_OpenGLPointSpriteMapper;
00042 class VISU_GaussPointsPL;
00043 
00044 
00045 //============================================================================
00046 class VISU_GaussPtsDeviceActor: public vtkLODActor
00047 {
00048  public:
00049   vtkTypeMacro(VISU_GaussPtsDeviceActor,vtkLODActor);
00050 
00051   static 
00052   VISU_GaussPtsDeviceActor* 
00053   New();
00054 
00055   virtual
00056   void
00057   Render(vtkRenderer *, vtkMapper *);
00058 
00059   //----------------------------------------------------------------------------
00060   void
00061   AddToRender(vtkRenderer* theRenderer); 
00062 
00063   void
00064   RemoveFromRender(vtkRenderer* theRenderer);
00065 
00066   void
00067   SetTransform(VTKViewer_Transform* theTransform); 
00068 
00069   //----------------------------------------------------------------------------
00070   VISU_GaussPointsPL* 
00071   GetPipeLine();
00072 
00073   void
00074   SetPipeLine(VISU_GaussPointsPL* thePipeLine) ;
00075 
00076   void
00077   ShallowCopyPL(VISU_GaussPointsPL* thePipeLine);
00078 
00079   VISU_OpenGLPointSpriteMapper*
00080   GetPSMapper();
00081 
00082   virtual
00083   int
00084   GetPickable();
00085 
00086  protected:
00087   //----------------------------------------------------------------------------
00088   vtkSmartPointer<VISU_GaussPointsPL> myPipeLine;
00089   vtkSmartPointer<VISU_OpenGLPointSpriteMapper> myMapper;
00090   vtkSmartPointer<VTKViewer_GeometryFilter> myGeomFilter;
00091   vtkSmartPointer<VTKViewer_TransformFilter> myTransformFilter;
00092 
00093   typedef vtkSmartPointer<VTKViewer_PassThroughFilter> PPassThroughFilter;
00094   std::vector<PPassThroughFilter> myPassFilter;
00095 
00096   VISU_GaussPtsDeviceActor();
00097   ~VISU_GaussPtsDeviceActor();
00098 
00099  private:
00100   VISU_GaussPtsDeviceActor(const VISU_GaussPtsDeviceActor&); // Not implemented
00101   void operator=(const VISU_GaussPtsDeviceActor&); // Not implemented
00102 };
00103 
00104 
00105 //============================================================================
00106 class vtkActor;
00107 class vtkConeSource;
00108 class vtkAppendPolyData;
00109 class vtkPolyDataMapper;
00110 
00111 #include <vtkLODActor.h>
00112 
00113 class VISU_CursorPyramid : public vtkLODActor 
00114 {
00115 public:
00116   vtkTypeMacro(VISU_CursorPyramid, vtkObject);
00117 
00118   static
00119   VISU_CursorPyramid* 
00120   New();
00121 
00122   virtual
00123   void
00124   Render(vtkRenderer *, vtkMapper *);
00125 
00126   void
00127   AddToRender(vtkRenderer* theRenderer);
00128 
00129   void
00130   RemoveFromRender(vtkRenderer* theRenderer);
00131 
00132   void
00133   Init(vtkFloatingPointType theHeight,
00134        vtkFloatingPointType theCursorSize,
00135        vtkFloatingPointType theRadius,
00136        vtkFloatingPointType theMagnification,
00137        vtkFloatingPointType theClamp,
00138        vtkFloatingPointType thePos[3],
00139        vtkFloatingPointType theColor[3]);
00140 
00141   void SetPreferences(vtkFloatingPointType theHeight,
00142                 vtkFloatingPointType theCursorSize);
00143 
00144 protected:
00145   VISU_CursorPyramid();
00146 
00147   void
00148   Init(vtkFloatingPointType theHeight,
00149        vtkFloatingPointType theRadius);
00150 
00151   int myNbCones;
00152   vtkSmartPointer<vtkConeSource> mySources[6];
00153   vtkSmartPointer<vtkAppendPolyData> myAppendFilter;
00154   vtkSmartPointer<vtkPolyDataMapper> myMapper;
00155   //
00156   vtkFloatingPointType myHeight;
00157   vtkFloatingPointType myCursorSize;
00158   vtkFloatingPointType myRadius;
00159   vtkFloatingPointType myMagnification;
00160   vtkFloatingPointType myClamp;
00161 
00162  private:
00163   VISU_CursorPyramid(const VISU_CursorPyramid&); // Not implemented
00164   void operator=(const VISU_CursorPyramid&); // Not implemented
00165 };
00166 
00167 
00168 //==================================================================
00169 // class VISU_FramedTextActor
00170 //
00171 #include <vtkActor2D.h>
00172 //
00173 class vtkViewport;
00174 class vtkProp;
00175 class vtkWindow;
00176 class vtkPolyData;
00177 class vtkPolyDataMapper2D;
00178 class vtkActor2D;
00179 class vtkTimeStamp;
00180 class vtkTextProperty;
00181 class vtkTextMapper;
00182 
00183 class VISU_FramedTextActor : public vtkActor2D
00184 {
00185 public:
00186   // vtks
00187   vtkTypeRevisionMacro(VISU_FramedTextActor,vtkActor2D);
00188   static VISU_FramedTextActor *New();
00189   //
00190   virtual int  RenderOpaqueGeometry(vtkViewport* viewport);
00191   virtual int  RenderTranslucentGeometry(vtkViewport*) { return 0; };
00192   virtual int  RenderOverlay(vtkViewport* viewport);
00193   virtual void ReleaseGraphicsResources(vtkWindow *);
00194   virtual void SetVisibility (int );
00195   virtual int  GetVisibility() ;
00196   virtual void SetPickable (int ) ;
00197   virtual int GetPickable();
00198   //
00199   // selectors
00200   void SetText(const char* theText);
00201   char* GetText();
00202   //
00203   void SetModePosition(const int theMode);
00204   int  GetModePosition()const;
00205   //
00206   void SetWorldPoint(const vtkFloatingPointType theWorldPoint[4]);
00207   const vtkFloatingPointType* GetWorldPoint()const;
00208   //
00209   void  SetDistance(const vtkFloatingPointType theDistance);
00210   vtkFloatingPointType GetDistance()const;
00211   //
00212   void  SetTransparency(const vtkFloatingPointType theTransparency);
00213   vtkFloatingPointType GetTransparency()const;
00214   //
00215 protected:
00216   VISU_FramedTextActor();
00217   ~VISU_FramedTextActor();
00218 
00219 protected:
00220   vtkPolyData         *myBar;
00221   vtkPolyDataMapper2D *myBarMapper;
00222   vtkActor2D          *myBarActor;
00223   //
00224   vtkTextProperty *myTextProperty;
00225   vtkTextMapper   *myTextMapper;
00226   vtkActor2D      *myTextActor;
00227   //
00228   vtkTimeStamp  myBuildTime;
00229   //
00230   int   myModePosition;
00231   vtkFloatingPointType myWorldPoint[4];
00232   vtkFloatingPointType myDistance;
00233   vtkFloatingPointType myTransparency;
00234   
00235 private:
00236  VISU_FramedTextActor(const VISU_FramedTextActor&);  // Not implemented.
00237   void operator=(const VISU_FramedTextActor&);  // Not implemented.
00238 };
00239 
00240 #endif //VISU_GAUSS_PTS_DEVICE_ACTOR_H