Version: 6.3.1

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