Version: 6.3.1

src/VISU_I/VISU_Gen_i.hh

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 //  File   : VISU_Gen_i.hh
00024 //  Author : Alexey Petrov
00025 //  Module : VISU
00026 //
00027 #ifndef __VISU_GEN_I_H__
00028 #define __VISU_GEN_I_H__
00029 
00030 #include "VISUConfig.hh"
00031 
00032 #include "VISU_I.hxx"
00033 #include "SALOME_Component_i.hxx"
00034 #include "SALOME_NamingService.hxx"
00035 #include "VISU_ColoredPrs3d_i.hh"
00036 #include "VISU_ClippingPlaneMgr.hxx"
00037 
00038 #include <VTKViewer_MarkerDef.h>
00039 
00040 #include <map>
00041 #include <string>
00042 
00043 namespace VISU
00044 {
00045   //----------------------------------------------------------------------------
00046   typedef std::map<int, VTK::MarkerMap> StudyId2MarkerMap;
00047 
00048   //----------------------------------------------------------------------------
00049   class VISU_Gen_i : public virtual POA_VISU::VISU_Gen,
00050                public virtual ::Engines_Component_i,
00051                public virtual Base_i
00052   {
00053     SALOMEDS::Study_var myStudyDocument;
00054     VISU_ClippingPlaneMgr myClippingPlaneMgr;
00055 
00056     StudyId2MarkerMap myMarkerMap;
00057 
00058     VISU_Gen_i(const VISU::VISU_Gen_i &);
00059   public:
00060     VISU_Gen_i(CORBA::ORB_ptr theORB,
00061             PortableServer::POA_ptr thePOA,
00062             SALOME_NamingService* theNamingService,
00063             QMutex* theMutex);
00064 
00065     virtual 
00066     ~VISU_Gen_i();
00067 
00068     virtual 
00069     char* 
00070     GetID();
00071 
00072     virtual
00073     VISU::VISUType 
00074     GetType() { return VISU::TVISUGEN;};
00075 
00076     virtual
00077     void
00078     SetCurrentStudy(SALOMEDS::Study_ptr theStudy);
00079 
00080     virtual
00081     SALOMEDS::Study_ptr
00082     GetCurrentStudy();
00083 
00084     virtual
00085     ViewManager_ptr
00086     GetViewManager();
00087 
00088     virtual
00089     SALOMEDS::SObject_ptr
00090     ImportTables(const char* theFileName, bool theFirstStrAsTitle = false);
00091 
00092     virtual
00093     CORBA::Boolean
00094     ExportTableToFile(SALOMEDS::SObject_ptr theTable, 
00095                 const char* theFileName );
00096 
00097     //Create Result
00098     virtual
00099     Result_ptr
00100     ImportFile(const char* theFileName);
00101 
00102     virtual
00103     Result_ptr
00104     CreateResult(const char* theFileName);
00105 
00106     virtual
00107     Result_ptr
00108     CopyAndImportFile(const char* theFileName);
00109 
00110     virtual
00111     Result_ptr
00112     ImportMed(SALOMEDS::SObject_ptr theMedSObject);
00113 
00114     virtual
00115     Result_ptr
00116     ImportMedField(SALOME_MED::FIELD_ptr theField);
00117 
00118 
00119     //Rename Presentation Of Submeshes
00120     void
00121     RenameMeshInStudy(Result_ptr theResult,
00122                 const std::string& theMeshName,
00123                 int theEntity, // -1 for group indication
00124                 const std::string& theSubMeshName, // Family or Group name
00125                 const std::string& theNewName);
00126     virtual
00127     void
00128     RenameEntityInStudy(Result_ptr   theResult,
00129                const char*  theMeshName,
00130                VISU::Entity theEntity,
00131                const char*  theNewName);
00132     virtual
00133     void
00134     RenameFamilyInStudy(Result_ptr   theResult,
00135                const char*  theMeshName,
00136                VISU::Entity theEntity,
00137                const char*  theFamilyName,
00138                const char*  theNewName);
00139     virtual
00140     void
00141     RenameGroupInStudy(Result_ptr  theResult,
00142                  const char*  theMeshName,
00143                  const char* theGroupName,
00144                  const char* theNewName);
00145 
00146     //Create Presentation Of Submeshes
00147     virtual
00148     Mesh_ptr
00149     MeshOnEntity(Result_ptr theResult, 
00150            const char* theMeshName, 
00151            VISU::Entity theEntity);
00152 
00153     virtual
00154     Mesh_ptr
00155     FamilyMeshOnEntity(Result_ptr theResult, 
00156                  const char* theMeshName,
00157                  VISU::Entity theEntity, 
00158                  const char* theFamilyName);
00159 
00160     virtual
00161     Mesh_ptr
00162     GroupMesh(Result_ptr theResult, 
00163            const char* theMeshName, 
00164            const char* theGroupName);
00165 
00166     Prs3d_ptr
00167     CreatePrs3d(VISUType theType,
00168           SALOMEDS::Study_ptr theStudy);
00169 
00170     virtual
00171     ScalarMap_ptr
00172     ScalarMapOnField(Result_ptr theResult,
00173                const char* theMeshName, 
00174                VISU::Entity theEntity,
00175                const char* theFieldName, 
00176                CORBA::Long theIteration);
00177 
00178     virtual
00179     GaussPoints_ptr
00180     GaussPointsOnField(Result_ptr theResult,
00181                  const char* theMeshName, 
00182                  VISU::Entity theEntity,
00183                  const char* theFieldName, 
00184                  CORBA::Long theIteration);
00185 
00186     virtual
00187     DeformedShape_ptr
00188     DeformedShapeOnField(Result_ptr theResult,
00189                 const char* theMeshName, 
00190                 VISU::Entity theEntity,
00191                 const char* theFieldName, 
00192                 CORBA::Long theIteration);
00193 
00194     //This function is obsolete. Use DeformedShapeAndScalarMapOnField instead.
00195     virtual
00196     DeformedShapeAndScalarMap_ptr
00197     ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
00198                         const char* theMeshName, 
00199                         VISU::Entity theEntity,
00200                         const char* theFieldName, 
00201                         CORBA::Long theIteration);
00202 
00203     virtual
00204     DeformedShapeAndScalarMap_ptr
00205     DeformedShapeAndScalarMapOnField(Result_ptr theResult,
00206                          const char* theMeshName, 
00207                          VISU::Entity theEntity,
00208                          const char* theFieldName, 
00209                          CORBA::Long theIteration);
00210 
00211     virtual
00212     Vectors_ptr
00213     VectorsOnField(Result_ptr theResult,
00214              const char* theMeshName, 
00215              VISU::Entity theEntity,
00216              const char* theFieldName, 
00217              CORBA::Long theIteration);
00218 
00219     virtual
00220     IsoSurfaces_ptr
00221     IsoSurfacesOnField(Result_ptr theResult,
00222                  const char* theMeshName, 
00223                  VISU::Entity theEntity,
00224                  const char* theFieldName, 
00225                  CORBA::Long theIteration);
00226 
00227     virtual
00228     CutPlanes_ptr
00229     CutPlanesOnField(Result_ptr theResult,
00230                const char* theMeshName, 
00231                VISU::Entity theEntity,
00232                const char* theFieldName, 
00233                CORBA::Long theIteration);
00234 
00235     virtual
00236     CutLines_ptr
00237     CutLinesOnField(Result_ptr theResult,
00238               const char* theMeshName, 
00239               VISU::Entity theEntity,
00240               const char* theFieldName, 
00241               CORBA::Long theIteration);
00242 
00243     virtual
00244     CutSegment_ptr
00245     CutSegmentOnField(Result_ptr theResult,
00246                 const char* theMeshName, 
00247                 VISU::Entity theEntity,
00248                 const char* theFieldName, 
00249                 CORBA::Long theIteration);
00250 
00251     virtual
00252     StreamLines_ptr
00253     StreamLinesOnField(Result_ptr theResult,
00254                  const char* theMeshName, 
00255                  VISU::Entity theEntity,
00256                  const char* theFieldName, 
00257                  CORBA::Long theIteration);
00258 
00259     virtual
00260     Plot3D_ptr
00261     Plot3DOnField(Result_ptr theResult,
00262             const char* theMeshName, 
00263             VISU::Entity theEntity,
00264             const char* theFieldName, 
00265             CORBA::Long theIteration);
00266 
00267     //Create Digital Presentation
00268     virtual 
00269     Table_ptr
00270     CreateTable(const char* theTableEntry);
00271 
00272     virtual
00273     Curve_ptr
00274     CreateCurve(Table_ptr theTable, 
00275           CORBA::Long theHRow, 
00276           CORBA::Long theVRow);
00277 
00278     virtual
00279     Curve_ptr
00280     CreateCurveWithZ(Table_ptr theTable, 
00281                      CORBA::Long theHRow, 
00282                      CORBA::Long theVRow,
00283                      CORBA::Long theZRow);
00284 
00285     virtual
00286     Curve_ptr
00287     CreateCurveWithZExt(Table_ptr theTable, 
00288                         CORBA::Long theHRow, 
00289                         CORBA::Long theVRow,
00290                         CORBA::Long theZRow,
00291                         CORBA::Boolean theIsV2);
00292 
00293     virtual
00294     Container_ptr 
00295     CreateContainer();
00296 
00297     virtual
00298     Animation_ptr
00299     CreateAnimation(View3D_ptr theView3d);
00300 
00301     virtual
00302     Evolution_ptr
00303     CreateEvolution(XYPlot_ptr theXYPLot);
00304 
00305     virtual
00306     void 
00307     DeleteResult(Result_ptr theResult);
00308 
00309     virtual
00310     void 
00311     DeletePrs3d(Prs3d_ptr thePrs3d);
00312 
00313     // inherited methods from Engines::Component
00314     virtual
00315     Engines::TMPFile*
00316     DumpPython(CORBA::Object_ptr theStudy,
00317             CORBA::Boolean theIsPublished,
00318             CORBA::Boolean theIsMultiFile,
00319             CORBA::Boolean& theIsValidScript);
00320 
00321     // inherited methods from SALOMEDS::Driver
00322     virtual
00323     SALOMEDS::TMPFile* 
00324     Save(SALOMEDS::SComponent_ptr theComponent,
00325       const char* theURL,
00326       bool isMultiFile);
00327 
00328     virtual
00329     SALOMEDS::TMPFile* 
00330     SaveASCII(SALOMEDS::SComponent_ptr theComponent,
00331            const char* theURL,
00332            bool isMultiFile);
00333 
00334     virtual
00335     bool
00336     Load(SALOMEDS::SComponent_ptr,
00337       const SALOMEDS::TMPFile &,
00338       const char* theURL,
00339       bool isMultiFile);
00340 
00341     virtual
00342     bool
00343     LoadASCII(SALOMEDS::SComponent_ptr,
00344            const SALOMEDS::TMPFile &,
00345            const char* theURL,
00346            bool isMultiFile);
00347     
00348     virtual
00349     void
00350     Close(SALOMEDS::SComponent_ptr IORSComponent);
00351 
00352     virtual
00353     char* 
00354     ComponentDataType();
00355 
00356     virtual
00357     char* 
00358     IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
00359                   const char* IORString,
00360                   CORBA::Boolean isMultiFile,
00361                   CORBA::Boolean isASCII);
00362 
00363     virtual
00364     char* 
00365     LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
00366                   const char* aLocalPersistentID,
00367                   CORBA::Boolean isMultiFile,
00368                   CORBA::Boolean isASCII);
00369 
00370     virtual 
00371     bool
00372     CanPublishInStudy(CORBA::Object_ptr theIOR);
00373 
00374     virtual
00375     SALOMEDS::SObject_ptr
00376     PublishInStudy(SALOMEDS::Study_ptr theStudy,
00377              SALOMEDS::SObject_ptr theSObject,
00378              CORBA::Object_ptr theObject,
00379              const char* theName) throw (SALOME::SALOME_Exception);
00380 
00381     CORBA::Boolean 
00382     CanCopy(SALOMEDS::SObject_ptr theObject);
00383 
00384     SALOMEDS::TMPFile* 
00385     CopyFrom(SALOMEDS::SObject_ptr theObject, 
00386           CORBA::Long& theObjectID);
00387 
00388     CORBA::Boolean 
00389     CanPaste(const char* theComponentName, 
00390           CORBA::Long theObjectID);
00391 
00392     SALOMEDS::SObject_ptr
00393     PasteInto(const SALOMEDS::TMPFile& theStream,
00394            CORBA::Long theObjectID,
00395            SALOMEDS::SObject_ptr theObject);
00396 
00397     virtual
00398     VISU::ColoredPrs3dCache_ptr
00399     GetColoredPrs3dCache(SALOMEDS::Study_ptr theStudy);
00400 
00401     
00402     virtual CORBA::Long CreateClippingPlane(CORBA::Double X,CORBA::Double  Y, CORBA::Double Z, 
00403                              CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ, 
00404                              CORBA::Boolean isAuto, const char* name);
00405 
00406     virtual void EditClippingPlane(CORBA::Long id, CORBA::Double X,CORBA::Double  Y, CORBA::Double Z, 
00407                          CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ, 
00408                          CORBA::Boolean isAuto, const char* name);
00409 
00410     /* Returns clipping plane by its Id */
00411     virtual VISU::ClippingPlane* GetClippingPlane(CORBA::Long id);
00412     
00413     /* Deletes clipping plane by its Id */
00414     virtual CORBA::Boolean DeleteClippingPlane(CORBA::Long id);
00415     
00416     /* Applyes a clipping plane with Id to presentation thePrs */
00417     virtual CORBA::Boolean ApplyClippingPlane(Prs3d_ptr thePrs, CORBA::Long id);
00418     
00419     /* Detaches a clipping plane with Id from presentation thePrs */
00420     virtual CORBA::Boolean DetachClippingPlane(Prs3d_ptr thePrs, CORBA::Long id);
00421     
00422     /* Get number of clipping planes */
00423     virtual CORBA::Long GetClippingPlanesNb();
00424 
00425     VISU_ClippingPlaneMgr& GetClippingPlaneMgr() { return myClippingPlaneMgr; }
00426 
00427     /* Convert a set of VTK files to the MED file */
00428     virtual
00429     CORBA::Boolean
00430     VTK2MED(const VISU::string_array& theVTKFiles,
00431          const char* theMEDFile,
00432          const char* theMeshName,
00433          const VISU::double_array& theTStamps);
00434 
00435     /* Load texture from file */
00436     virtual CORBA::Long LoadTexture(const char* theTextureFile);
00437 
00438     StudyId2MarkerMap& GetMarkerMap() { return myMarkerMap; }
00439   };
00440 }
00441 
00442 #endif
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