Back to index

salome-gui  6.5.0
SVTK_DeviceActor.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  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 //  SVTK OBJECT : interactive object for SVTK visualization
00024 //  File   : SVTK_DeviceActor.h
00025 //  Author : 
00026 
00027 #ifndef SVTK_DEVICE_ACTOR_H
00028 #define SVTK_DEVICE_ACTOR_H
00029 
00030 #include "SVTK.h"
00031 #include "VTKViewer.h"
00032 #include "VTKViewer_Actor.h"
00033 #include "VTKViewer_MarkerDef.h"
00034 
00035 #include <vector>
00036 
00037 #include <vtkLODActor.h>
00038 #include <vtkProperty.h>
00039 
00040 class VTKViewer_Transform;
00041 class VTKViewer_TransformFilter;
00042 class VTKViewer_GeometryFilter;
00043 
00044 class vtkCell;
00045 class vtkDataSet;
00046 class vtkShrinkFilter;
00047 class vtkFeatureEdges;
00048 class VTKViewer_DataSetMapper;
00049 class vtkPassThroughFilter;
00050 
00051 #ifdef WIN32
00052 #pragma warning ( disable:4251 )
00053 #endif
00054 
00055 class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor
00056 {
00057  public:
00058   vtkTypeMacro(SVTK_DeviceActor,vtkLODActor);
00059 
00060   static
00061   SVTK_DeviceActor* 
00062   New();
00063 
00065   virtual
00066   void
00067   SetTransform(VTKViewer_Transform* theTransform); 
00068 
00070   virtual
00071   void
00072   SetMapper(vtkMapper* theMapper); 
00073 
00075   virtual
00076   vtkDataSet* 
00077   GetInput(); 
00078 
00080   virtual
00081   void
00082   SetInput(vtkDataSet* theDataSet); 
00083 
00086   virtual
00087   int
00088   GetNodeObjId(int theVtkID);
00089 
00090   virtual
00091   vtkFloatingPointType* 
00092   GetNodeCoord(int theObjID);
00093 
00094   virtual
00095   int
00096   GetElemObjId(int theVtkID);
00097 
00098   virtual
00099   vtkCell* 
00100   GetElemCell(int theObjID);
00101 
00103   virtual 
00104   void
00105   SetStoreMapping(bool theStoreMapping);
00107 
00108   virtual 
00109   unsigned long int 
00110   GetMTime();
00111 
00114   vtkFloatingPointType
00115   GetShrinkFactor();
00116 
00117   virtual 
00118   void  
00119   SetShrinkFactor(vtkFloatingPointType value);
00120 
00121   virtual
00122   void
00123   SetShrinkable(bool theIsShrinkable);
00124 
00125   bool
00126   IsShrunkable();
00127 
00128   bool
00129   IsShrunk();
00130 
00131   virtual
00132   void
00133   SetShrink(); 
00134 
00135   virtual
00136   void
00137   UnShrink(); 
00139 
00142   virtual
00143   bool
00144   IsFeatureEdgesAllowed();
00145 
00146   virtual
00147   void
00148   SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
00149 
00150   virtual
00151   bool
00152   IsFeatureEdgesEnabled();
00153 
00154   virtual
00155   void
00156   SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled);
00157 
00158   virtual
00159   vtkFloatingPointType
00160   GetFeatureEdgesAngle();
00161 
00162   virtual
00163   void
00164   SetFeatureEdgesAngle(vtkFloatingPointType theAngle); 
00165 
00166   virtual
00167   void
00168   GetFeatureEdgesFlags(bool& theIsFeatureEdges,
00169                        bool& theIsBoundaryEdges,
00170                        bool& theIsManifoldEdges,
00171                        bool& theIsNonManifoldEdges);
00172   virtual
00173   void
00174   SetFeatureEdgesFlags(bool theIsFeatureEdges,
00175                        bool theIsBoundaryEdges,
00176                        bool theIsManifoldEdges,
00177                        bool theIsNonManifoldEdges);
00178 
00179   virtual
00180   bool
00181   GetFeatureEdgesColoring();
00182 
00183   virtual
00184   void
00185   SetFeatureEdgesColoring(bool theIsColoring);
00187 
00189   virtual
00190   void 
00191     SetRepresentation(VTKViewer::Representation::Type theMode);
00192 
00193   VTKViewer::Representation::Type 
00194   GetRepresentation();
00195 
00196   virtual
00197   vtkFloatingPointType
00198   GetDefaultPointSize();
00199 
00200   virtual
00201   vtkFloatingPointType
00202   GetDefaultLineWidth();
00203 
00204   bool
00205   IsShaded();
00206 
00207   void
00208   SetShaded(bool theShaded);
00210 
00212   void
00213   SetMarkerEnabled( bool );
00214 
00215   void
00216   SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
00217 
00218   void
00219   SetMarkerTexture( int, VTK::MarkerTexture );
00220 
00221   VTK::MarkerType
00222   GetMarkerType();
00223 
00224   VTK::MarkerScale
00225   GetMarkerScale();
00226 
00227   int
00228   GetMarkerTexture();
00230 
00231   virtual
00232   void
00233   Render(vtkRenderer *, vtkMapper *);
00234 
00235   VTKViewer_DataSetMapper* GetDataSetMapper();
00236 
00237   //----------------------------------------------------------------------------
00239   virtual void SetQuadraticArcMode(bool theFlag);
00240   virtual bool GetQuadraticArcMode();
00241 
00242   virtual void SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle);
00243   virtual vtkFloatingPointType GetQuadraticArcAngle();
00244 
00245   virtual
00246   void
00247   SetCoincident3DAllowed(bool theIsFeatureEdgesAllowed);
00248 
00249   virtual
00250   bool 
00251   IsCoincident3DAllowed() const;
00252 
00253 
00254  protected:
00255   VTKViewer::Representation::Type myRepresentation;
00256   vtkProperty *myProperty;
00257   bool myIsShaded;
00258 
00260   void
00261   InitPipeLine(vtkMapper* theMapper); 
00262 
00263   VTKViewer_GeometryFilter *myGeomFilter;
00264   VTKViewer_TransformFilter *myTransformFilter;
00265   std::vector<vtkPassThroughFilter*> myPassFilter;
00266   vtkShrinkFilter* myShrinkFilter;
00267   vtkFeatureEdges* myFeatureEdges;
00268   VTKViewer_DataSetMapper* myMapper;
00269 
00270   bool myIsShrinkable;
00271   bool myIsShrunk;
00272   
00273   bool myIsFeatureEdgesAllowed;
00274   bool myIsFeatureEdgesEnabled;
00275 
00276   bool myIsResolveCoincidentTopology;
00277   vtkFloatingPointType myPolygonOffsetFactor;
00278   vtkFloatingPointType myPolygonOffsetUnits;
00279 
00280   void SetPolygonOffsetParameters(vtkFloatingPointType factor, 
00281                                   vtkFloatingPointType units);
00282   void GetPolygonOffsetParameters(vtkFloatingPointType& factor, 
00283                                   vtkFloatingPointType& units);
00284 
00285   SVTK_DeviceActor();
00286   ~SVTK_DeviceActor();
00287 
00288  private:
00289   SVTK_DeviceActor(const SVTK_DeviceActor&); // Not implemented
00290   void operator=(const SVTK_DeviceActor&); // Not implemented
00291 
00292 };
00293 
00294 #ifdef WIN32
00295 #pragma warning ( default:4251 )
00296 #endif
00297 
00298 #endif //SVTK_DEVICE_ACTOR_H