Back to index

salome-smesh  6.5.0
SMESH_PreviewActorsCollection.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  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 //  SMESH OBJECT : interactive object for SMESH visualization
00021 //  File   : SMESH_PreviewActorsCollection.h
00022 //  Author : OCN
00023 //  Module : SMESH
00024 //  $Header: /home/server/cvs/SMESH/SMESH_SRC/src/OBJECT/SMESH_PreviewActorsCollection.h,v 1
00025 //
00026 #ifndef SMESH_PREVIEW_ACTOR_COLLECTION_H
00027 #define SMESH_PREVIEW_ACTOR_COLLECTION_H
00028 
00029 #include "SMESH_Object.h"
00030 
00031 #include <TopoDS_Shape.hxx>
00032 #include <TopAbs_ShapeEnum.hxx>
00033 #include <TopTools_IndexedMapOfShape.hxx>
00034 #include <QList>
00035 #include <QMap>
00036 #include <QString>
00037 
00038 class vtkRenderer;
00039 class GEOM_Actor;
00040 class SVTK_Selector;
00041 
00042 class SMESHOBJECT_EXPORT SMESH_PreviewActorsCollection
00043 {
00044 public:
00045   SMESH_PreviewActorsCollection();
00046   ~SMESH_PreviewActorsCollection();
00047 
00048   virtual void    AddToRender(vtkRenderer* theRenderer);
00049   virtual void    RemoveFromRender(vtkRenderer* theRenderer);
00050 
00051   bool            Init( const TopoDS_Shape& theShape, TopAbs_ShapeEnum subShapeType = TopAbs_EDGE, const QString& = QString("") );
00052 
00053   void            SetSelector( SVTK_Selector* );
00054 
00055   void            HighlightAll( bool );
00056   void            HighlightID( int );
00057 
00058   GEOM_Actor*     GetActorByIndex( int );
00059 
00060   int             GetIndexByShape( const TopoDS_Shape& );
00061 
00062   void            SetShown( bool );
00063 
00064   int             count() const;
00065   int             chunkSize() const;
00066   int             currentChunk() const;
00067   bool            hasPrevious() const;
00068   bool            hasNext() const;
00069   void            previous();
00070   void            next();
00071   
00072 protected:
00073   GEOM_Actor*    createActor( const TopoDS_Shape& );
00074   void           showCurrentChunk();
00075   void           clearActors();
00076    
00077 protected:
00078   TopAbs_ShapeEnum             myType;
00079   QString                      myEntry;
00080   TopoDS_Shape                 myMainShape;
00081   SVTK_Selector*               mySelector;
00082   vtkRenderer*                 myRenderer;
00083   TopTools_IndexedMapOfShape   myMapOfShapes;
00084   QMap<int, GEOM_Actor*>       myMapOfActors;
00085   QList<int>                   myIndices;
00086   int                          myCurrentChunk;
00087   int                          myChunkSize;
00088   bool                         myIsShown;
00089 };
00090 
00091 
00092 #endif //SMESH_DEVICE_ACTOR_COLLECTION_H