src/PIPELINE/VISU_GaussPointsPL.hxx

Go to the documentation of this file.
00001 //  VISU OBJECT : interactive object for VISU entities implementation
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:    VISU_GaussPointsPL.hxx
00025 // Author:  
00026 // Module : VISU
00027 
00028 #ifndef VISU_GaussPointsPL_HeaderFile
00029 #define VISU_GaussPointsPL_HeaderFile
00030 
00031 #include "VISU_ScalarMapPL.hxx"
00032 #include "VISU_Convertor.hxx"
00033 
00034 #include <vector>
00035 
00036 class VTKViewer_PassThroughFilter;
00037 class VISU_OpenGLPointSpriteMapper;
00038 
00039 class vtkGeometryFilter;
00040 class vtkGlyph3D;
00041 class vtkSphereSource;
00042 class vtkDataArray;
00043 class vtkImageData;
00044 class vtkPointSet;
00045 
00046 class vtkCellDataToPointData;
00047 class vtkWarpVector;
00048 class SALOME_Transform;
00049 
00051 
00055 class VISU_GaussPointsPL : public VISU_ScalarMapPL
00056 {
00057 protected:
00058   VISU_GaussPointsPL();
00059 
00060   virtual
00061   ~VISU_GaussPointsPL();
00062 
00063 public:
00064   vtkTypeMacro(VISU_GaussPointsPL,VISU_ScalarMapPL);
00065 
00066   static 
00067   VISU_GaussPointsPL* New();
00068   
00069   virtual
00070   void
00071   ShallowCopy(VISU_PipeLine *thePipeLine);
00072 
00074   virtual
00075   TMapper* 
00076   GetMapper();
00077 
00079   VISU_OpenGLPointSpriteMapper*
00080   GetPSMapper();
00081 
00083   vtkDataSet*
00084   GetPickableDataSet();
00085 
00087   virtual
00088   void
00089   Init();
00090 
00092   virtual
00093   void
00094   Build();
00095 
00097   virtual
00098   void
00099   Update();
00100 
00102   void
00103   UpdateGlyph();
00104 
00105   virtual 
00106   VISU::TGaussPointID 
00107   GetObjID(vtkIdType theID) const;
00108 
00109   virtual
00110   vtkFloatingPointType* 
00111   GetNodeCoord(vtkIdType theObjID);
00112 
00113   void 
00114   SetGaussPtsIDMapper(const VISU::PGaussPtsIDMapper& theGaussPtsIDMapper);
00115 
00116   const VISU::PGaussPtsIDMapper&  
00117   GetGaussPtsIDMapper() const;
00118 
00119   VISU::TVTKOutput*  
00120   GetParentMesh() const;
00121 
00123 
00128   void
00129   SetBicolor(bool theBicolor);
00130 
00132   bool
00133   GetBicolor();
00134 
00136 
00141   void
00142   SetIsColored(bool theIsColored);
00143 
00145   void
00146   SetPrimitiveType(int thePrimitiveType);
00147 
00149   int
00150   GetPrimitiveType();
00151 
00153   vtkFloatingPointType 
00154   GetMaximumSupportedSize();
00155 
00157   void
00158   SetClamp(vtkFloatingPointType theClamp);
00159 
00161   vtkFloatingPointType
00162   GetClamp();
00163 
00165   void
00166   SetSize(vtkFloatingPointType theSize);
00167 
00169   vtkFloatingPointType 
00170   GetSize();
00171 
00173   void
00174   SetMinSize(vtkFloatingPointType theMinSize);
00175 
00177   vtkFloatingPointType 
00178   GetMinSize();
00179 
00181   void
00182   SetMaxSize(vtkFloatingPointType theMaxSize);
00183 
00185   vtkFloatingPointType 
00186   GetMaxSize();
00187 
00189   void
00190   SetMagnification(vtkFloatingPointType theMagnification);
00191 
00193   vtkFloatingPointType
00194   GetMagnification();
00195 
00197   void
00198   SetMagnificationIncrement(vtkFloatingPointType theIncrement);
00199 
00201   vtkFloatingPointType
00202   GetMagnificationIncrement() { return myMagnificationIncrement; }
00203 
00205   void
00206   SetAlphaThreshold(vtkFloatingPointType theAlphaThreshold);
00207 
00209   vtkFloatingPointType
00210   GetAlphaThreshold();
00211 
00213   void
00214   SetResolution(int theResolution);
00215 
00217   int
00218   GetResolution() { return myResolution; }
00219 
00221   void
00222   ChangeMagnification( bool up );
00223 
00225   vtkFloatingPointType
00226   GetMaxPointSize();
00227 
00229   vtkFloatingPointType
00230   GetPointSize(vtkIdType theID);
00231 
00233   vtkFloatingPointType
00234   GetPointSize(vtkIdType theID, vtkDataArray* theScalarArray);
00235 
00237   void
00238   SetAverageCellSize(vtkFloatingPointType AverageCellSize);
00239 
00241   vtkFloatingPointType
00242   GetAverageCellSize();
00243 
00245   void
00246   SetImageData(vtkImageData* theImageData);
00247 
00249 
00253   static
00254   vtkSmartPointer<vtkImageData>
00255   MakeTexture( const char* theMainTexture,
00256             const char* theAlphaTexture );
00257 
00258 public:
00259   virtual void  SetIsDeformed( bool theIsDeformed );
00260   virtual bool  GetIsDeformed() const;
00261 
00262   virtual void  SetScale( vtkFloatingPointType theScale );
00263   virtual vtkFloatingPointType GetScale();
00264   virtual void  SetMapScale( vtkFloatingPointType theMapScale = 1.0 );
00265 
00266 protected:
00267   bool myIsDeformed;
00268   vtkFloatingPointType myScaleFactor;
00269   vtkWarpVector *myWarpVector;
00270   vtkCellDataToPointData* myCellDataToPointData;
00271   std::vector<VTKViewer_PassThroughFilter*> myPassFilter;
00272   
00273   vtkGlyph3D* myGlyph;
00274   vtkSphereSource* mySphereSource;
00275   int myResolution;
00276 
00277 protected:
00278   VISU_OpenGLPointSpriteMapper* myPSMapper;
00279   VISU::PGaussPtsIDMapper myGaussPtsIDMapper;
00280 
00281   vtkGeometryFilter* myGeomFilter;
00282 
00283   vtkDataArray *myScalarArray;
00284   vtkFloatingPointType mySourceScalarRange[2];
00285   vtkFloatingPointType myDeltaScalarRange;
00286 
00287   int   myPrimitiveType;
00288   vtkFloatingPointType myMagnificationIncrement;
00289 };
00290   
00291 #endif