Version: 6.3.1

src/VISU_I/VISU_Evolution.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 //  File   : VISU_Evolution.h
00021 //  Author : Oleg UVAROV
00022 //  Module : VISU
00023 //
00024 #ifndef VISU_EVOLUTION_H
00025 #define VISU_EVOLUTION_H
00026 
00027 #include "VISUConfig.hh"
00028 
00029 #include <VISU_ConvertorDef_impl.hxx>
00030 #include <SALOMEDSClient_Study.hxx>
00031 
00032 #include <QList>
00033 #include <QMap>
00034 #include <QPair>
00035 
00036 #include <vtkType.h>
00037 
00038 #include <string>
00039 
00040 class Plot2d_ViewFrame;
00041 
00042 namespace VISU
00043 {
00044   class Result_i;
00045 };
00046 
00047 namespace VISU
00048 {
00049   typedef QMap< vtkIdType, vtkFloatingPointType >         Comp2Value;
00050   typedef QMapIterator< vtkIdType, vtkFloatingPointType > Comp2ValueIterator;
00051 
00052   typedef QMap< vtkIdType, Comp2Value >                   Elem2Comp2Value;
00053   typedef QMapIterator< vtkIdType, Comp2Value >           Elem2Comp2ValueIterator;
00054 
00055   typedef QPair< double, std::string >                    TimeStampData;
00056   typedef QList< TimeStampData >                          TimeStampDataList;
00057   typedef QListIterator< TimeStampData >                  TimeStampDataListIterator;
00058 
00059   typedef QPair< QString, QString >                       ComponentData;
00060   typedef QList< ComponentData >                          ComponentDataList;
00061   typedef QListIterator< ComponentData >                  ComponentDataListIterator;
00062 
00063   typedef QList< vtkFloatingPointType >                   TimeStampValueList;
00064   typedef QListIterator< vtkFloatingPointType >           TimeStampValueListIterator;
00065 };
00066 
00067 class VISU_I_EXPORT VISU_Evolution
00068 {
00069 protected:
00070   bool _showEvolution();
00071 
00072 public:
00073   VISU_Evolution( _PTR(Study) theStudy,
00074                   VISU::XYPlot_ptr theXYPlot = VISU::XYPlot::_nil() );
00075   ~VISU_Evolution();
00076 
00077   virtual VISU::VISUType    GetType() { return VISU::TNONE; }
00078 
00079   _PTR(Study)               getStudy() const { return myStudy; }
00080 
00081   bool                      setField( _PTR(SObject) theField );
00082   bool                      setField( SALOMEDS::SObject_ptr theField );
00083 
00084   int                       getNbPoints() const;
00085 
00086   void                      setPointId( int thePointId );
00087   int                       getPointId() const { return myPointId; }
00088 
00089   void                      setComponentId( int theComponentId );
00090   int                       getComponentId() const { return myComponentId; }
00091 
00092   bool                      showEvolution();
00093 
00094   void                      setViewer( Plot2d_ViewFrame* theView ) { myView = theView; }
00095   Plot2d_ViewFrame*         getViewer() const { return myView; }
00096 
00097   VISU::Result_i*           getResult() const { return myResult; }
00098   const VISU::PFieldImpl&   getField() const { return myFieldImpl; }
00099 
00100   std::string               getFieldEntry() const { return myFieldEntry; }
00101   std::string               getEvolutionEntry() const { return myEvolutionEntry; }
00102   std::string               getMeshName() const { return myMeshName; }
00103   VISU::TEntity             getEntity() const { return myEntity; }
00104   std::string               getFieldName() const { return myFieldName; }
00105 
00106   const VISU::TimeStampDataList& getTimeStampDataList() const { return myTimeStampDataList; }
00107   const VISU::ComponentDataList& getComponentDataList() const { return myComponentDataList; }
00108 
00109   void                      restoreFromStudy( SALOMEDS::SObject_ptr theObj );
00110   void                      restoreFromStudy( _PTR(SObject) theObj );
00111 
00112 private:
00113   bool                      extractData( int thePointId,
00114                                          int theComponentId,
00115                                          VISU::TimeStampValueList& theTimeStampValueList );
00116 
00117 private:
00118   _PTR(Study)               myStudy;
00119   _PTR(SObject)             myField;
00120 
00121   int                       myPointId;
00122   int                       myComponentId;
00123 
00124   Plot2d_ViewFrame*         myView;
00125 
00126   VISU::Result_i*           myResult;
00127   VISU::PFieldImpl          myFieldImpl;
00128 
00129   std::string               myFieldEntry;
00130   std::string               myEvolutionEntry;
00131   std::string               myMeshName;
00132   VISU::TEntity             myEntity;
00133   std::string               myFieldName;
00134 
00135   VISU::TimeStampDataList   myTimeStampDataList;
00136   VISU::ComponentDataList   myComponentDataList;
00137 };
00138 
00139 
00140 class VISU_I_EXPORT VISU_Evolution_i: public virtual POA_VISU::Evolution,
00141                                       public virtual VISU::Base_i
00142 {
00143   VISU_Evolution* myEngine;
00144 public:
00145   VISU_Evolution_i( SALOMEDS::Study_ptr theStudy,
00146                     VISU::XYPlot_ptr theXYPlot = VISU::XYPlot::_nil() );
00147   ~VISU_Evolution_i();
00148 
00149   virtual VISU::VISUType    GetType() { return VISU::TEVOLUTION; }
00150 
00151   virtual bool              setField(SALOMEDS::SObject_ptr theField);
00152 
00153   virtual void              setPointId(CORBA::Long thePointId);
00154 
00155   virtual void              setComponentId(CORBA::Long theComponentId);
00156 
00157   virtual CORBA::Boolean    showEvolution();
00158 
00159   virtual void              restoreFromStudy(SALOMEDS::SObject_ptr theField);
00160 };
00161 
00162 #endif //VISU_EVOLUTION_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