Version: 6.3.1

src/OBJECT/VISU_ActorBase.h

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 //  VISU OBJECT : interactive object for VISU entities implementation
00021 //  File   : 
00022 //  Author : 
00023 //  Module : VISU
00024 //  $Header: /home/server/cvs/VISU/VISU_SRC/src/OBJECT/VISU_ActorBase.h,v 1.2.16.3.2.2 2011-06-02 06:00:17 vsr Exp $
00025 //
00026 #ifndef VISU_ACTOR_BASE_H
00027 #define VISU_ACTOR_BASE_H
00028 
00029 #include "VISU_OBJECT.h"
00030 #include "SALOME_Actor.h"
00031 #include "VISU_BoostSignals.h"
00032 #include <boost/bind.hpp>
00033 
00034 class VTKViewer_ShrinkFilter;
00035 
00036 //----------------------------------------------------------------------------
00037 namespace VISU 
00038 { 
00039   struct TActorFactory;
00040 }
00041 
00042 
00044 class VISU_OBJECT_EXPORT VISU_ActorBase: public SALOME_Actor,
00045                                     public boost::signalslib::trackable
00046 {
00047  public:
00048   vtkTypeMacro(VISU_ActorBase, SALOME_Actor);
00049 
00050   //----------------------------------------------------------------------------
00051   VISU::TActorFactory* GetFactory();
00052   virtual void SetFactory(VISU::TActorFactory* theActorFactory);
00053   
00054   //----------------------------------------------------------------------------
00055   virtual void UpdateFromFactory();
00056 
00057   //----------------------------------------------------------------------------
00058   virtual void SetTransform(VTKViewer_Transform* theTransform); 
00059 
00060   virtual void SetLineWidth(vtkFloatingPointType theLineWidth);
00061   virtual vtkFloatingPointType GetLineWidth();
00062 
00063   virtual void SetShrink();
00064   virtual void UnShrink(); 
00065   virtual bool IsShrunkable();
00066   virtual bool IsShrunk();
00067   virtual void SetShrinkable(bool theIsShrinkable);
00068 
00069   virtual void SetShrinkFactor(vtkFloatingPointType theFactor = 0.8); 
00070   virtual vtkFloatingPointType GetShrinkFactor();
00071   
00072   virtual void SetRepresentation(int theMode);
00073 
00074   virtual void RemoveFromRender(vtkRenderer* theRenderer);
00075   virtual void RemoveFromRender();
00076 
00077   virtual void ConnectToFactory(boost::signal0<void>& , boost::signal0<void>&);
00078 
00079   //----------------------------------------------------------------------------
00082   virtual vtkDataSet* GetHighlightedDataSet();
00083   
00084 
00085  protected:
00086   VISU_ActorBase();
00087   virtual  ~VISU_ActorBase();
00088 
00089   VISU::TActorFactory*                 myActorFactory;
00090   vtkTimeStamp                         myUpdateFromFactoryTime;
00091   boost::signal1<void,VISU_ActorBase*> myDestroySignal;
00092 
00093   boost::signalslib::connection        myUpdateActorsConnection;
00094   boost::signalslib::connection        myRemoveFromRendererConnection;
00095 
00096   vtkSmartPointer<VTKViewer_ShrinkFilter> myShrinkFilter;
00097 
00098   bool myIsShrinkable;
00099   bool myIsShrunk;
00100 };
00101 
00102 #endif //VISU_ACTOR_BASE_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