Version: 6.3.1

src/VISU_I/VISU_MultiResult_i.hh

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   : VISU_MultiResult_i.hh
00022 //  Author : Alexey PETROV
00023 //  Module : VISU
00024 //
00025 #ifndef __VISU_MULTI_RESULT_I_H__
00026 #define __VISU_MULTI_RESULT_I_H__
00027 
00028 #ifndef ENABLE_MULTIPR
00029 #  define RESULT_CLASS_NAME Result_i
00030 #else
00031 #  define RESULT_CLASS_NAME MultiResult_i
00032 
00033 #include "VISU_Result_i.hh"
00034 #include "MULTIPR_Obj.hxx"
00035 
00036 #include <set>
00037 
00038 namespace VISU
00039 {
00040   //----------------------------------------------------------------------------
00041   class MultiResult_i : public virtual Result_i
00042   {
00043     MultiResult_i(const MultiResult_i&);
00044 
00045   public:
00046     typedef Result_i TSuperClass;
00047 
00048     MultiResult_i(SALOMEDS::Study_ptr theStudy,
00049             const ESourceId& theSourceId,
00050             const ECreationId& theCreationId,
00051             CORBA::Boolean theIsBuildImmediately,
00052             CORBA::Boolean theIsBuildFields,
00053             CORBA::Boolean theIsBuildMinMax,
00054             CORBA::Boolean theIsBuildGroups);
00055 
00056     MultiResult_i();
00057 
00058     virtual
00059     ~MultiResult_i();
00060 
00061     virtual
00062     CORBA::Boolean
00063     IsDone();
00064 
00065     virtual
00066     VISU::Result::EntityNames* 
00067     GetPartNames(const char* theMeshName);
00068 
00069     virtual
00070     VISU::Result::Resolutions* 
00071     GetResolutions(const char* theMeshName, 
00072              const char* thePartName);
00073 
00074     virtual
00075     VISU::Result::Resolution
00076     GetResolution(const char* theMeshName, 
00077             const char* thePartName);
00078 
00079     virtual
00080     void 
00081     SetResolution(const char* theMeshName, 
00082             const char* thePartName, 
00083             VISU::Result::Resolution theResolution);
00084 
00085 
00086     typedef std::string TPartName;
00087     typedef std::vector<TPartName> TPartNames;
00088 
00089     typedef size_t TPartID;
00090     typedef std::string TPath;
00091     typedef std::string TMeshName;
00092 
00093     struct TPartInfo
00094     {
00095       TMeshName myMeshName;
00096       TPartName myName;
00097       TPartID myPartID;
00098       TPath myPath;
00099       TFileName myFileName;
00100     };
00101 
00102     typedef std::map<TFileName, TPartInfo> TPartInfos;
00103     TPartInfos myPartInfos;
00104 
00105     typedef std::map<TPartName, TFileName> TPartName2FileName;
00106     typedef std::map<TPartName, VISU::Result::Resolution> TPartName2Resolution;
00107     typedef std::set<VISU::Result::Resolution> TResolutions;
00108 
00109     typedef std::set<std::string> TRepresentationKey;
00110     typedef std::map<TRepresentationKey, PInput> TRepresentation2Input;
00111 
00112     typedef std::set<TPartName> TSubPartNames;
00113     typedef std::map<TPartName, TSubPartNames> TMainPart2SubPartNames;
00114 
00115   private:
00116     multipr::Obj myMultiprObj;
00117     TPartName2FileName myPartName2FileName;
00118     TPartName2Resolution myPartName2Resolution;
00119     TMainPart2SubPartNames myMainPart2SubPartNames;
00120 
00121     TRepresentation2Input myRepresentation2Input;
00122 
00123   protected:
00124     virtual
00125     Storable* 
00126     Build(SALOMEDS::SObject_ptr theSObject,
00127        CORBA::Boolean theIsAtOnce = true) ;
00128 
00129     virtual
00130     void
00131     BuildDataTree(const std::string& theResultEntry);
00132 
00133   public:
00134     virtual 
00135     size_t
00136     IsPossible();
00137 
00138     virtual
00139     Storable* 
00140     Create(const char* theFileName);
00141 
00142     virtual 
00143     Storable*
00144     Restore(SALOMEDS::SObject_ptr theSObject,
00145          const Storable::TRestoringMap& theMap,
00146          const std::string& thePrefix,
00147          CORBA::Boolean theIsMultiFile);
00148 
00149     //---------------------------------------------------------------
00150     virtual 
00151     bool
00152     Save(SALOMEDS::SComponent_ptr theComponent,
00153       const std::string& theURL,
00154       bool theIsMultiFile,
00155       bool theIsASCII,
00156       TFileNames& theFileNames,
00157       TFileNames& theFiles);
00158 
00159     virtual 
00160     CORBA::Boolean 
00161     CanCopy(SALOMEDS::SObject_ptr theObject);
00162 
00163     virtual
00164     void
00165     ToStream(std::ostringstream& theStr);
00166 
00167     virtual
00168     PInput
00169     GetInput(const std::string& theMeshName = "",
00170           VISU::Entity theEntity = VISU::NONE,
00171           const std::string& theFieldName = "", 
00172           CORBA::Long theTimeStampNumber = -1);
00173   };
00174 
00175 }
00176 
00177 #endif // ENABLE_MULTIPR
00178 
00179 #endif // __VISU_MULTI_RESULT_I_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