Version: 6.3.1

src/OBJECT/VISU_GaussPtsDeviceActor.h

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  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 //  SMESH OBJECT : interactive object for SMESH visualization
00024 //  File   : 
00025 //  Author : 
00026 //  Module : 
00027 //  $Header: /home/server/cvs/VISU/VISU_SRC/src/OBJECT/VISU_GaussPtsDeviceActor.h,v 1.6.2.2.6.1.8.1 2011-06-02 06:00:17 vsr Exp $
00028 //
00029 #ifndef VISU_GAUSS_PTS_DEVICE_ACTOR_H
00030 #define VISU_GAUSS_PTS_DEVICE_ACTOR_H
00031 
00032 #include "VISU_OBJECT.h"
00033 #include "VISU_Actor.h"
00034 #include "VTKViewer_GeometryFilter.h"
00035 
00036 #include <vtkLODActor.h>
00037 #include <vtkSmartPointer.h>
00038 
00039 class VTKViewer_Transform;
00040 class VTKViewer_TransformFilter;
00041 
00042 class VISU_OpenGLPointSpriteMapper;
00043 class VISU_GaussPointsPL;
00044 
00045 class vtkPassThroughFilter;
00046 class vtkImageData;
00047 class SALOME_ExtractPolyDataGeometry;
00048 
00049 
00050 //============================================================================
00051 namespace VISU
00052 {
00053   typedef vtkSmartPointer<vtkImageData> TTextureValue;
00054 
00055   VISU_OBJECT_EXPORT
00056   TTextureValue
00057   GetTexture(const std::string& theMainTexture, 
00058              const std::string& theAlphaTexture);
00059 }
00060 
00061 
00062 //============================================================================
00063 class VISU_OBJECT_EXPORT VISU_GaussDeviceActorBase: public vtkLODActor
00064 {
00065  public:
00066   vtkTypeMacro(VISU_GaussDeviceActorBase, vtkLODActor);
00067   
00068   static 
00069   VISU_GaussDeviceActorBase* 
00070   New();
00071 
00072   virtual
00073   void
00074   Render(vtkRenderer *, vtkMapper *);
00075 
00076   //----------------------------------------------------------------------------
00077   void
00078   SetTransform(VTKViewer_Transform* theTransform); 
00079 
00080   //----------------------------------------------------------------------------
00081   void
00082   SetPointSpriteMapper(VISU_OpenGLPointSpriteMapper* theMapper) ;
00083 
00084   virtual
00085   void
00086   DoMapperShallowCopy( vtkMapper* theMapper,
00087                        bool theIsCopyInput );
00088 
00089   VISU_OpenGLPointSpriteMapper*
00090   GetPointSpriteMapper();
00091 
00092   //----------------------------------------------------------------------------
00094   virtual
00095   unsigned long int
00096   GetMemorySize();
00097 
00098   //----------------------------------------------------------------------------
00099   void SetExtractor(SALOME_ExtractPolyDataGeometry* theExtractor) 
00100     { myPolyDataExtractor = theExtractor; }
00101 
00102   SALOME_ExtractPolyDataGeometry* GetExtractor() const
00103     { return myPolyDataExtractor; }
00104  
00105  protected:
00106   //----------------------------------------------------------------------------
00107   vtkSmartPointer<VISU_OpenGLPointSpriteMapper> myMapper;
00108   vtkSmartPointer<VTKViewer_TransformFilter> myTransformFilter;
00109 
00110   typedef vtkSmartPointer<vtkPassThroughFilter> PPassThroughFilter;
00111   std::vector<PPassThroughFilter> myPassFilter;
00112 
00113   SALOME_ExtractPolyDataGeometry* myPolyDataExtractor;
00114 
00115   VISU_GaussDeviceActorBase();
00116   ~VISU_GaussDeviceActorBase();
00117 
00118  private:
00119   VISU_GaussDeviceActorBase(const VISU_GaussDeviceActorBase&); // Not implemented
00120   void operator=(const VISU_GaussDeviceActorBase&); // Not implemented
00121 };
00122 
00123 
00124 //============================================================================
00125 class VISU_GaussPtsDeviceActor: public VISU_GaussDeviceActorBase
00126 {
00127  public:
00128   vtkTypeMacro(VISU_GaussPtsDeviceActor, VISU_GaussDeviceActorBase);
00129 
00130   static 
00131   VISU_GaussPtsDeviceActor* 
00132   New();
00133 
00134   //----------------------------------------------------------------------------
00135   void
00136   AddToRender(vtkRenderer* theRenderer); 
00137 
00138   void
00139   RemoveFromRender(vtkRenderer* theRenderer);
00140 
00141   //----------------------------------------------------------------------------
00142   VISU_GaussPointsPL* 
00143   GetPipeLine();
00144 
00145   void
00146   SetPipeLine(VISU_GaussPointsPL* thePipeLine) ;
00147 
00148   void
00149   ShallowCopyPL(VISU_GaussPointsPL* thePipeLine);
00150 
00151   virtual
00152   int
00153   GetPickable();
00154 
00155   //----------------------------------------------------------------------------
00157   virtual
00158   unsigned long int
00159   GetMemorySize();
00160  
00161  protected:
00162   //----------------------------------------------------------------------------
00163   vtkSmartPointer<VISU_GaussPointsPL> myPipeLine;
00164 
00165   VISU_GaussPtsDeviceActor();
00166   ~VISU_GaussPtsDeviceActor();
00167 
00168  private:
00169   VISU_GaussPtsDeviceActor(const VISU_GaussPtsDeviceActor&); // Not implemented
00170   void operator=(const VISU_GaussPtsDeviceActor&); // Not implemented
00171 };
00172 
00173 
00174 //============================================================================
00175 class vtkActor;
00176 class vtkConeSource;
00177 class vtkAppendPolyData;
00178 class vtkPolyDataMapper;
00179 
00180 #include <vtkLODActor.h>
00181 
00182 class VISU_CursorPyramid : public vtkLODActor 
00183 {
00184 public:
00185   vtkTypeMacro(VISU_CursorPyramid, vtkObject);
00186 
00187   static
00188   VISU_CursorPyramid* 
00189   New();
00190 
00191   virtual
00192   void
00193   Render(vtkRenderer *, vtkMapper *);
00194 
00195   void
00196   AddToRender(vtkRenderer* theRenderer);
00197 
00198   void
00199   RemoveFromRender(vtkRenderer* theRenderer);
00200 
00201   void
00202   Init(vtkFloatingPointType theHeight,
00203        vtkFloatingPointType theCursorSize,
00204        vtkFloatingPointType theRadius,
00205        vtkFloatingPointType theMagnification,
00206        vtkFloatingPointType theClamp,
00207        vtkFloatingPointType thePos[3],
00208        vtkFloatingPointType theColor[3]);
00209 
00210   void SetPreferences(vtkFloatingPointType theHeight,
00211                       vtkFloatingPointType theCursorSize);
00212 
00213 protected:
00214   VISU_CursorPyramid();
00215 
00216   void
00217   Init(vtkFloatingPointType theHeight,
00218        vtkFloatingPointType theRadius);
00219 
00220   int myNbCones;
00221   vtkSmartPointer<vtkConeSource> mySources[6];
00222   vtkSmartPointer<vtkAppendPolyData> myAppendFilter;
00223   vtkSmartPointer<vtkPolyDataMapper> myMapper;
00224   //
00225   vtkFloatingPointType myHeight;
00226   vtkFloatingPointType myCursorSize;
00227   vtkFloatingPointType myRadius;
00228   vtkFloatingPointType myMagnification;
00229   vtkFloatingPointType myClamp;
00230 
00231  private:
00232   VISU_CursorPyramid(const VISU_CursorPyramid&); // Not implemented
00233   void operator=(const VISU_CursorPyramid&); // Not implemented
00234 };
00235 
00236 
00237 #endif //VISU_GAUSS_PTS_DEVICE_ACTOR_H
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS