-// File : VISU_GEN_i.h file
-// Created :
-// Author : Alexey Petrov
-// Project : SALOME
-// Copyright : OPEN CASCADE
-// $Header:
-
+// Copyright (C) 2003 CEA/DEN, EDF R&D
+//
+//
+//
+// File : VISU_GEN_i.h file
+// Author : Alexey Petrov
+// Module : VISU
+// $Header:
#ifndef __VISU_GEN_I_H__
#define __VISU_GEN_I_H__
#include "SALOME_NamingService.hxx"
namespace VISU{
+ class Result_i;
class VISU_Gen_i : public virtual POA_VISU::VISU_Gen,
public virtual ::Engines_Component_i,
public virtual Base_i
{
- VISU_Gen_var myVisuGen;
SALOMEDS::Study_var myStudyDocument;
VISU_Gen_i();
VISU_Gen_i(const VISU::VISU_Gen_i &);
public:
- VISU_Gen_i(CORBA::ORB_ptr theORB, PortableServer::POA_ptr thePOA, QMutex* theMutex);
- VISU_Gen_i(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName);
+ VISU_Gen_i(CORBA::ORB_ptr theORB,
+ PortableServer::POA_ptr thePOA,
+ SALOME_NamingService* theNamingService,
+ QMutex* theMutex);
virtual ~VISU_Gen_i();
+
+ virtual char* GetID();
virtual VISU::VISUType GetType() { return VISU::TVISUGEN;};
virtual void SetCurrentStudy(SALOMEDS::Study_ptr theStudy);
virtual SALOMEDS::Study_ptr GetCurrentStudy();
+
virtual ViewManager_ptr GetViewManager();
virtual SALOMEDS::SObject_ptr ImportTables(const char* theFileName);
+ virtual CORBA::Boolean ExportTableToFile(SALOMEDS::SObject_ptr theTable, const char* theFileName );
//Create Result
virtual Result_ptr ImportFile(const char* theFileName);
- virtual Result_ptr ImportMed(SALOME_MED::FIELD_ptr theField);
- virtual Result_ptr ImportMedMesh(SALOME_MED::MESH_ptr theMesh);
- virtual Result_ptr ImportMedSupport(SALOME_MED::SUPPORT_ptr theSupport);
+ virtual Result_ptr CopyAndImportFile(const char* theFileName);
+ virtual Result_ptr ImportMed(SALOMEDS::SObject_ptr theMedSObject);
+ virtual Result_ptr ImportMedField(SALOME_MED::FIELD_ptr theField);
//Create Presentation Of Submeshes
virtual Mesh_ptr MeshOnEntity(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity);
- virtual Mesh_ptr FamilyMeshOnEntity(Result_ptr theResult, const char* theMeshName,
+ virtual Mesh_ptr FamilyMeshOnEntity(Result_ptr theResult, const char* theMeshName,
VISU::Entity theEntity, const char* theFamilyName);
virtual Mesh_ptr GroupMesh(Result_ptr theResult, const char* theMeshName, const char* theGroupName);
//Create 3D collored Presentation Of Different Types
- virtual ScalarMap_ptr ScalarMapOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
+ template<typename TPrs3d_i> TPrs3d_i*
+ CreatePrs3d(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
+ const char* theFieldName, CORBA::Double theIteration, bool theAddToStudy = true)
+ {
+ TPrs3d_i* aPresent = NULL;
+ if(myStudyDocument->GetProperties()->IsLocked())
+ return aPresent;
+
+ typedef typename TPrs3d_i::TInterface TPrs3d;
+ typename TPrs3d::_var_type aPrs3d;
+ Mutex mt(myMutex);
+ if(Result_i* pResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
+ if(TPrs3d_i::IsPossible(pResult,theMeshName,theEntity,theFieldName,int(theIteration))){
+ aPresent = new TPrs3d_i(pResult,theAddToStudy);
+ if(aPresent->Create(theMeshName,theEntity,theFieldName,int(theIteration)) == NULL){
+ aPresent->_remove_ref();
+ aPresent = NULL;
+ }
+ }
+ }
+ return aPresent;
+ }
+
+ template<typename TPrs3d_i> typename TPrs3d_i::TInterface::_var_type
+ Prs3dOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
+ const char* theFieldName, CORBA::Double theIteration, bool theAddToStudy = true)
+ {
+ typedef typename TPrs3d_i::TInterface TPrs3d;
+ typename TPrs3d::_var_type aPrs3d;
+ if(TPrs3d_i* aPrs3d = CreatePrs3d<TPrs3d_i>(theResult,theMeshName,theEntity,theFieldName,theIteration,theAddToStudy))
+ return aPrs3d->_this();
+ return TPrs3d::_nil();
+ }
+
+ virtual ScalarMap_ptr ScalarMapOnField(Result_ptr theResult,
+ const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, CORBA::Double theIteration);
- virtual DeformedShape_ptr DeformedShapeOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
+ virtual DeformedShape_ptr DeformedShapeOnField(Result_ptr theResult,
+ const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, CORBA::Double theIteration);
- virtual Vectors_ptr VectorsOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
+ virtual Vectors_ptr VectorsOnField(Result_ptr theResult,
+ const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, CORBA::Double theIteration);
- virtual IsoSurfaces_ptr IsoSurfacesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
+ virtual IsoSurfaces_ptr IsoSurfacesOnField(Result_ptr theResult,
+ const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, CORBA::Double theIteration);
- virtual CutPlanes_ptr CutPlanesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
+ virtual CutPlanes_ptr CutPlanesOnField(Result_ptr theResult,
+ const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, CORBA::Double theIteration);
- virtual StreamLines_ptr StreamLinesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
+ virtual CutLines_ptr CutLinesOnField(Result_ptr theResult,
+ const char* theMeshName, VISU::Entity theEntity,
+ const char* theFieldName, CORBA::Double theIteration);
+ virtual StreamLines_ptr StreamLinesOnField(Result_ptr theResult,
+ const char* theMeshName, VISU::Entity theEntity,
const char* theFieldName, CORBA::Double theIteration);
+ virtual Plot3D_ptr Plot3DOnField(Result_ptr theResult,
+ const char* theMeshName, VISU::Entity theEntity,
+ const char* theFieldName, CORBA::Double theIteration);
//Create Digital Presentation
virtual Table_ptr CreateTable(const char* theTableEntry);
virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow);
virtual Container_ptr CreateContainer();
-
+ virtual Animation_ptr CreateAnimation(View3D_ptr theView3d);
+
+ virtual void DeleteResult(Result_ptr theResult);
+ virtual void DeletePrs3d(Prs3d_ptr thePrs3d);
+
+ // inherited methods from Engines::Component
+ virtual
+ Engines::TMPFile*
+ DumpPython(CORBA::Object_ptr theStudy,
+ CORBA::Boolean theIsPublished,
+ CORBA::Boolean& theIsValidScript);
// inherited methods from SALOMEDS::Driver
virtual SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
const char* theURL,
bool isMultiFile);
+ virtual SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
+ const char* theURL,
+ bool isMultiFile);
virtual bool Load(SALOMEDS::SComponent_ptr,
const SALOMEDS::TMPFile &,
const char* theURL,
bool isMultiFile);
+ virtual bool LoadASCII(SALOMEDS::SComponent_ptr,
+ const SALOMEDS::TMPFile &,
+ const char* theURL,
+ bool isMultiFile);
- virtual void Close(SALOMEDS::SComponent_ptr IORSComponent);
+ virtual void Close(SALOMEDS::SComponent_ptr IORSComponent);
virtual char* ComponentDataType();
virtual char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
const char* IORString,
- CORBA::Boolean isMultiFile);
+ CORBA::Boolean isMultiFile,
+ CORBA::Boolean isASCII);
virtual char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
const char* aLocalPersistentID,
- CORBA::Boolean isMultiFile);
-
+ CORBA::Boolean isMultiFile,
+ CORBA::Boolean isASCII);
+
virtual bool CanPublishInStudy(CORBA::Object_ptr theIOR);
virtual SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
SALOMEDS::SObject_ptr theSObject,
SALOMEDS::SObject_ptr theObject);
};
}
-#endif
+#endif