enum Entity{ NODE, /*!< Node corresponds to a geometrical point. */
EDGE, /*!< Edge corresponds to a geometrical line connecting two points. */
FACE, /*!< Face corresponds to a geometrical plane bounded by several lines. */
- CELL /*!< Cell is a volumic element of a mesh */
+ CELL, /*!< Cell is a volumic element of a mesh */
+ NONE /*!< Indicates undefined entity value */
};
/*!
#include <utility>
+//---------------------------------------------------------------
+VISU_Convertor
+::VISU_Convertor():
+ myIsDone(false)
+{}
+
+
+//---------------------------------------------------------------
+const std::string&
+VISU_Convertor
+::GetName()
+{
+ return myName;
+}
+
+
+//---------------------------------------------------------------
+int
+VISU_Convertor
+::IsDone() const
+{
+ return myIsDone;
+}
+
//---------------------------------------------------------------
const VISU::TMeshMap&
VISU_Convertor
class VISU_CONVERTOR_EXPORT VISU_Convertor
{
public:
- virtual
- ~VISU_Convertor()
- {};
-
//! Get brief name of the corresponding source MED file
virtual
const std::string&
- GetName(){ return myName;}
+ GetName();
//! Let known whether the source MED file parsed or not
virtual
int
- IsDone() const { return myIsDone; }
+ IsDone() const;
//! This method perform first parsing of MED file to get known what MED entities are pressent in it
virtual
GenerateName(const std::string& theName, unsigned int theTimeId);
protected:
+ VISU_Convertor();
+
std::string myName;
VISU::TMeshMap myMeshMap;
int myIsDone;
extern "C"
{
-VISU_CONVERTOR_EXPORT
//! Instatiate proper VISU_Convertor subclass
+ VISU_CONVERTOR_EXPORT
VISU_Convertor*
CreateConvertor(const std::string& theFileName);
};
//---------------------------------------------------------------
VISU_Convertor_impl
-::VISU_Convertor_impl()
-{
- myIsDone = false;
-}
+::VISU_Convertor_impl()
+{}
//---------------------------------------------------------------
myIsMinMaxDone(false),
myMed(theMed)
{
- myFileInfo.setFile(QString(theFileName.c_str()));
- myName = myFileInfo.baseName().latin1();
+ myName = theFileName;
}
#include "MED_GaussUtils.hxx"
#include <boost/thread/mutex.hpp>
-#include <qfileinfo.h>
namespace VISU
{
BuildGroups();
protected:
- QFileInfo myFileInfo;
MED::PWrapper myMed; // mpv : bug 13568: one med per converter
virtual
application()->putInfo( anInfo );
QApplication::setOverrideCursor(Qt::waitCursor);
- // MULTIPR: CreateResult
VISU::Result_var aResult = GetVisuGen(this)->CreateResult( aFileInfo.filePath() );
if (CORBA::is_nil(aResult.in())) {
tr("MEN_CACHE_PROPERTIES"), "", 0, aParent, false,
this, SLOT(OnCacheProperties()));
-#ifdef ENABLE_MULTIPR
- // MULTIPR
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_MULTIPR_VIEW_FULL"));
createAction( VISU_MULTIPR_FULL_RES, tr("MEN_MULTIPR_VIEW_FULL_RES"), QIconSet(aPixmap),
tr("MEN_MULTIPR_VIEW_FULL_RES"), "", 0, aParent, false,
createAction( VISU_MULTIPR_HIDE, tr("MEN_MULTIPR_VIEW_HIDE"), QIconSet(aPixmap),
tr("MEN_MULTIPR_VIEW_HIDE"), "", 0, aParent, false,
this, SLOT(OnMultiprViewHide()));
-#endif
}
void
mgr->insert( action( VISU_SELECTION_INFO ), -1, -1, -1 ); // Selection info
-#ifdef ENABLE_MULTIPR
- // MULTIPR
mgr->insert( action( VISU_MULTIPR_FULL_RES ), -1, -1, -1 );
mgr->insert( action( VISU_MULTIPR_MED_RES ), -1, -1, -1 );
mgr->insert( action( VISU_MULTIPR_LOW_RES ), -1, -1, -1 );
mgr->insert( action( VISU_MULTIPR_HIDE ), -1, -1, -1 );
-#endif
-
// Rules
//aRule = "client='ObjectBrowser' and type='MEDFIELD'";
//mgr->setRule( action( VISU_IMPORT_MED ), aRule, true );
-#ifdef ENABLE_MULTIPR
- // MULTIPR
- aRule = "client='ObjectBrowser' and $type in {'VISU::TPART'}";
- mgr->setRule( action( VISU_MULTIPR_FULL_RES ), aRule + " and selcount>=1", true );
- mgr->setRule( action( VISU_MULTIPR_MED_RES ), aRule + " and selcount>=1", true );
- mgr->setRule( action( VISU_MULTIPR_LOW_RES ), aRule + " and selcount>=1", true );
- mgr->setRule( action( VISU_MULTIPR_HIDE), aRule + " and selcount>=1", true );
-#endif
+ aRule = "client='ObjectBrowser' and $type in {'VISU::TPART'} and selcount>=1";
+ mgr->setRule( action( VISU_MULTIPR_FULL_RES ), aRule, true );
+ mgr->setRule( action( VISU_MULTIPR_MED_RES ), aRule, true );
+ mgr->setRule( action( VISU_MULTIPR_LOW_RES ), aRule, true );
+ mgr->setRule( action( VISU_MULTIPR_HIDE), aRule, true );
}
//***************************************************************************
aDlg->exec();
}
-// MULTIPR
+
+//---------------------------------------------------------------
void VisuGUI::OnMultiprViewFullRes()
{
-#ifdef ENABLE_MULTIPR
- OnMultiprChangeRes('F');
-#endif
+ OnMultiprChangeRes('F');
}
-// MULTIPR
+
+//---------------------------------------------------------------
void VisuGUI::OnMultiprViewMediumRes()
{
-#ifdef ENABLE_MULTIPR
- OnMultiprChangeRes('M');
-#endif
+ OnMultiprChangeRes('M');
}
-// MULTIPR
+
+//---------------------------------------------------------------
void VisuGUI::OnMultiprViewLowRes()
{
-#ifdef ENABLE_MULTIPR
- OnMultiprChangeRes('L');
-#endif
+ OnMultiprChangeRes('L');
}
-// MULTIPR
+
+//---------------------------------------------------------------
void VisuGUI::OnMultiprViewHide()
{
-#ifdef ENABLE_MULTIPR
- OnMultiprChangeRes('H');
-#endif
+ OnMultiprChangeRes('H');
}
-// MULTIPR
-void VisuGUI::OnMultiprChangeRes(char resolution)
+
+//---------------------------------------------------------------
+void VisuGUI::OnMultiprChangeRes(char theResolution)
{
-#ifdef ENABLE_MULTIPR
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
if (CheckLock(aCStudy,GetDesktop(this)))
return;
if(aSelectionInfo.empty())
return;
- //cout << "selection: #=" << aSelectionInfo.size() << endl;
+ typedef SALOME::GenericObjPtr<VISU::Result_i> TResultPtr;
+ typedef std::set<TResultPtr> TResultSet;
+ TResultSet aResultSet;
- for (int i=0; i<aSelectionInfo.size(); i++)
- {
+ for (int i=0; i < aSelectionInfo.size(); i++) {
VISU::TSelectionItem aSelectionItem = aSelectionInfo[i];
_PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
continue;
VISU::Result_var aResult = FindResult( VISU::GetSObject( aSObject ).in() );
- VISU::Result_i* result = dynamic_cast<VISU::Result_i*>(VISU::GetServant(aResult).in());
+ if(CORBA::is_nil(aResult.in()))
+ continue;
+
+ VISU::Result_i* aCResult = dynamic_cast<VISU::Result_i*>(VISU::GetServant(aResult).in());
+ if(!aCResult)
+ continue;
- _PTR(GenericAttribute) anAttr;
- if (aSObject->FindAttribute(anAttr, "AttributePixMap"))
- {
- _PTR(AttributePixMap) aPixMap(anAttr);
- if ( aPixMap->HasPixMap() )
- {
- const char* oldIcon = aPixMap->GetPixMap().c_str();
- if ( (strcmp(oldIcon, "ICON_MULTIPR_VIEW_FULL") == 0) ||
- (strcmp(oldIcon, "ICON_MULTIPR_VIEW_MEDIUM") == 0) ||
- (strcmp(oldIcon, "ICON_MULTIPR_VIEW_LOW") == 0) ||
- (strcmp(oldIcon, "ICON_MULTIPR_VIEW_HIDE") == 0) )
- {
- bool hasMediumOrLow = (strstr(aSObject->GetComment().c_str(), "res=FML") != NULL);
-
- if (resolution == 'F')
- {
- if (result != NULL) result->SetResolutionMultipr(aSObject->GetName().c_str(), 'F');
- aPixMap->SetPixMap("ICON_MULTIPR_VIEW_FULL");
- }
- else if ((resolution == 'M') && hasMediumOrLow)
- {
- if (result != NULL) result->SetResolutionMultipr(aSObject->GetName().c_str(), 'M');
- aPixMap->SetPixMap("ICON_MULTIPR_VIEW_MEDIUM");
- }
- else if ((resolution == 'L') && hasMediumOrLow)
- {
- if (result != NULL) result->SetResolutionMultipr(aSObject->GetName().c_str(), 'L');
- aPixMap->SetPixMap("ICON_MULTIPR_VIEW_LOW");
- }
- else if (resolution == 'H')
- {
- if (result != NULL) result->SetResolutionMultipr(aSObject->GetName().c_str(), 'H');
- aPixMap->SetPixMap("ICON_MULTIPR_VIEW_HIDE");
- }
- }
- }
- }
+ aResultSet.insert(TResultPtr(aCResult));
+ aCResult->SetResolution(aSObject->GetName().c_str(), theResolution);
+ }
+
+ // To update all result observers
+ TResultSet::const_iterator anIter = aResultSet.begin();
+ for(; anIter != aResultSet.end(); anIter++){
+ const TResultPtr& aResultPtr = *anIter;
+ aResultPtr->UpdateObservers();
}
UpdateObjBrowser(this, false);
-#endif
}
VISU::GetSelectionMgr( myModule )->installFilter( myFieldFilter );
// type of presentation and groups
- VISU_Convertor* anInput = aResult->GetInput();
+ VISU::Result_i::PInput anInput = aResult->GetInput();
const VISU::TMeshMap& aMeshMap = anInput->GetMeshMap();
std::string aMeshName = thePrs->GetCMeshName();
VISU::TMeshMap::const_iterator aMeshIter = aMeshMap.find(aMeshName);
// Class: VisuGUI_Selection
//////////////////////////////////////////////////
+
+//---------------------------------------------------------------
QtxValue VisuGUI_Selection::param( const int ind, const QString& p ) const
{
QtxValue val( LightApp_Selection::param( ind, p ) );
if ( !val.isValid() ) {
if ( p == "type" ) val = QtxValue( type( ind ) );
else if ( p == "nbComponents" ) val = QtxValue( nbComponents( ind ) );
+ else if ( p == "resolution" ) val = QtxValue( resolution( ind ) );
else if ( p == "medEntity" ) val = QtxValue( medEntity( ind ) );
else if ( p == "medSource" ) val = QtxValue( medSource( ind ) );
else if ( p == "representation" ) val = QtxValue( representation( ind ) );
return val;
}
+
+//---------------------------------------------------------------
// Macro for converting VISU enumeration items into corresponding strings
#define ENUM2STRING( x, y ) \
case y: \
return aResStr;
}
+
+//---------------------------------------------------------------
QString VisuGUI_Selection::nbComponents( const int ind ) const
{
QString aResStr;
return aResStr;
}
+
+//---------------------------------------------------------------
+QString VisuGUI_Selection::resolution( const int ind ) const
+{
+ QString aResStr;
+ SalomeApp_Study* aStudy = GetStudy();
+ if ( !aStudy )
+ return aResStr;
+
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, entry( ind ));
+ VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
+
+ bool isExist;
+ QString aVal = VISU::Storable::FindValue(aMap,"myState",&isExist);
+ if ( isExist )
+ aResStr = aVal;
+
+ return aResStr;
+}
+
+
+//---------------------------------------------------------------
QString VisuGUI_Selection::medEntity( const int ind ) const
{
SalomeApp_Study* aStudy = GetStudy();
}
};
+
+//---------------------------------------------------------------
QString VisuGUI_Selection::isScalarMapAct( const int ind ) const
{
return TPopupDispatcher<TIsScalarMapActFunctor>()(myModule, entry(ind));
private:
QString type( const int ) const;
QString nbComponents( const int ) const;
+ QString resolution( const int ) const;
QString medEntity( const int ) const;
QString medSource( const int ) const;
QString nbTimeStamps( const int ) const;
QString aTime("");
VISU::TEntity anEntity = VISU::TEntity(theEntity);
VISU::Result_i* theResult = myPrsCopy->GetCResult();
- VISU::Result_i::TInput* anInput = theResult->GetInput();
+ VISU::Result_i::PInput anInput = theResult->GetInput();
VISU::PField aField = anInput->GetField(myPrsCopy->GetCMeshName(),
anEntity,
theFieldName);
VISUConfig.hh \
VISU_Gen_i.hh \
VISU_Result_i.hh \
+ VISU_MultiResult_i.hh \
VISU_PrsObject_i.hh \
VISU_Table_i.hh \
VISU_Prs3d_i.hh \
SALOME_GenericObjPointer.hh
libVISUEngineImpl_la_SOURCES = \
- VISU_Result_i.cc \
VISUConfig.cc \
+ VISU_Result_i.cc \
+ VISU_ResultUtils.cc \
+ VISU_MultiResult_i.cc \
+ VISU_CorbaMedConvertor.cxx \
VISU_PrsObject_i.cc \
VISU_Prs3d_i.cc \
VISU_ColoredPrs3d_i.cc \
VISU_View_i.cc \
VISU_Table_i.cc \
VISU_Gen_i.cc \
- VISU_CorbaMedConvertor.cxx \
VISU_DumpPython.cc \
SALOME_GenericObjPointer.cc
};
}
+template<class T, class U>
+inline
+bool
+operator<(SALOME::GenericObjPtr<T> const & a, SALOME::GenericObjPtr<U> const & b)
+{
+ return a.get() < b.get();
+}
+
template<class T, class U>
inline
bool
#include "SALOMEDSClient_AttributeIOR.hxx"
#include "SalomeApp_Application.h"
+#include "SalomeApp_Study.h"
+
+#include "SALOME_Event.hxx"
+
#include <qregexp.h>
using namespace std;
return GetSession()->resourceMgr();
}
- //===========================================================================
+ //---------------------------------------------------------------------------
QMutex* Base_i::myMutex = NULL; //apo - &VISUMutex;
CORBA::ORB_var Base_i::myOrb;
return CORBA::string_dup(myID.c_str());
}
- //===========================================================================
+ //---------------------------------------------------------------------------
static int mySCnt = 0;
static QMutex aMutex(TRUE);
}
- //===========================================================================
+ //---------------------------------------------------------------------------
static Storable::TCallbackMap VisuStoreMap;
std::string
theStr<<output.latin1()<<";";
}
+
+ //---------------------------------------------------------------
void
Storable
::DataToStream(std::ostringstream& theStr,
theStr<<output.latin1()<<";";
}
+
+ //---------------------------------------------------------------
void
Storable
::DataToStream(std::ostringstream& theStr,
theStr<<output.latin1()<<";";
}
+
+ //---------------------------------------------------------------
Storable*
Storable
::Create(SALOMEDS::SObject_ptr theSObject,
return NULL;
}
+
+ //---------------------------------------------------------------
QString
Storable
::FindValue(const TRestoringMap& theMap,
}
+ //---------------------------------------------------------------
QString
Storable
::FindValue(const TRestoringMap& theMap,
}
- //===========================================================================
+ //---------------------------------------------------------------------------
PortableServer::ServantBase_var
GetServant(CORBA::Object_ptr theObject)
{
}
- //===========================================================================
+ //---------------------------------------------------------------------------
CORBA::Object_var
SObjectToObject(SALOMEDS::SObject_ptr theSObject)
{
return anObject;
}
- //===========================================================================
+ //---------------------------------------------------------------------------
CORBA::Object_var
ClientSObjectToObject(_PTR(SObject) theSObject)
{
}
- //===========================================================================
- //===========================================================================
+ //---------------------------------------------------------------------------
std::string
CreateAttributes(SALOMEDS::Study_ptr theStudyDocument,
const std::string& theFatherEntry,
else
aNewSObject = aFather;
SALOMEDS::GenericAttribute_var anAttr;
- if(theIOR != ""){
+ if(theIOR != NO_IOR){
anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSObject, "AttributeIOR");
SALOMEDS::AttributeIOR_var aCustomAttr = SALOMEDS::AttributeIOR::_narrow(anAttr);
aCustomAttr->SetValue(theIOR.c_str());
}
- if(theName != ""){
+ if(theName != NO_NAME){
anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSObject, "AttributeName");
SALOMEDS::AttributeName_var aCustomAttr = SALOMEDS::AttributeName::_narrow(anAttr);
aCustomAttr->SetValue(theName.c_str());
}
- if(thePersistentRef != ""){
+ if(thePersistentRef != NO_PERFSITENT_REF){
anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSObject, "AttributePersistentRef");
SALOMEDS::AttributePersistentRef_var aCustomAttr = SALOMEDS::AttributePersistentRef::_narrow(anAttr);
aCustomAttr->SetValue(thePersistentRef.c_str());
}
- if(theComment != ""){
+ if(theComment != NO_COMMENT){
anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSObject, "AttributeString");
SALOMEDS::AttributeString_var aCustomAttr = SALOMEDS::AttributeString::_narrow(anAttr);
aCustomAttr->SetValue(theComment.c_str());
}
- if(theIconName != ""){
+ if(theIconName != NO_ICON){
anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSObject, "AttributePixMap");
SALOMEDS::AttributePixMap_var aCustomAttr = SALOMEDS::AttributePixMap::_narrow(anAttr);
aCustomAttr->SetPixMap(theIconName.c_str());
aNewSObject = aFather;
_PTR(GenericAttribute) anAttr;
- if (theIOR != "") {
+ if (theIOR != NO_IOR) {
anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSObject, "AttributeIOR");
_PTR(AttributeIOR) aCustomAttr (anAttr);
aCustomAttr->SetValue(theIOR);
}
- if (theName != "") {
+ if (theName != NO_NAME) {
anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSObject, "AttributeName");
_PTR(AttributeName) aCustomAttr (anAttr);
aCustomAttr->SetValue(theName);
}
- if (thePersistentRef != "") {
+ if (thePersistentRef != NO_PERFSITENT_REF) {
anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSObject, "AttributePersistentRef");
_PTR(AttributePersistentRef) aCustomAttr (anAttr);
aCustomAttr->SetValue(thePersistentRef);
}
- if (theComment != "") {
+ if (theComment != NO_COMMENT) {
anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSObject, "AttributeString");
_PTR(AttributeString) aCustomAttr (anAttr);
aCustomAttr->SetValue(theComment);
}
- if (theIconName != "") {
+ if (theIconName != NO_ICON) {
anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSObject, "AttributePixMap");
_PTR(AttributePixMap) aCustomAttr (anAttr);
aCustomAttr->SetPixMap(theIconName);
return aRet;
}
+
+ //---------------------------------------------------------------
QString
GenerateName(const string& theFmt, int theId)
{
}
+ //---------------------------------------------------------------
SALOMEDS::StudyManager_var
GetStudyManager()
{
}
+ //---------------------------------------------------------------
SALOMEDS::Study_var
GetDSStudy(_PTR(Study) theStudy)
{
- //std::string aStudyName = theStudy->Name();
- //return GetStudyManager()->GetStudyByName(aStudyName.c_str());
int aStudyID = theStudy->StudyId();
return GetStudyManager()->GetStudyByID(aStudyID);
}
+
+ //---------------------------------------------------------------
+ struct TGetStudyEvent: public SALOME_Event
+ {
+ int myStudyId;
+
+ typedef _PTR(Study) TResult;
+ TResult myResult;
+
+ TGetStudyEvent(int theStudyId):
+ myStudyId(theStudyId)
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ SUIT_Session* aSession = SUIT_Session::session();
+ QPtrList<SUIT_Application> anApplications = aSession->applications();
+ QPtrListIterator<SUIT_Application> anIter (anApplications);
+ while (SUIT_Application* anApp = anIter.current()) {
+ ++anIter;
+ if (SUIT_Study* aSStudy = anApp->activeStudy()) {
+ if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
+ if (_PTR(Study) aCStudy = aStudy->studyDS()) {
+ if (myStudyId == aCStudy->StudyId()) {
+ myResult = aCStudy;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ };
+
+
+ //---------------------------------------------------------------
+ _PTR(Study)
+ GetStudy(SALOMEDS::Study_var theStudy)
+ {
+ return ProcessEvent(new TGetStudyEvent(theStudy->StudyId()));
+ }
+
+
+ //---------------------------------------------------------------
SALOMEDS::SObject_var
GetSObject( _PTR(SObject) obj )
{
return aSalomeDSStudy->FindObjectID( id.c_str() );
}
+ //---------------------------------------------------------------
_PTR(SObject)
GetClientSObject( SALOMEDS::SObject_var obj,
_PTR(Study) study )
{
- return study->FindObjectID( obj->GetID() );
+ CORBA::String_var anEntry = obj->GetID();
+ return study->FindObjectID( anEntry.in() );
}
+ //---------------------------------------------------------------
void
RemoveFromStudy (SALOMEDS::SObject_ptr theSObject,
bool theIsAttrOnly,
aStudyBuilder->RemoveObjectWithChildren(theSObject);
}
+
+ //---------------------------------------------------------------
void
RemoveFromStudy (_PTR(SObject) theSObject,
bool theIsAttrOnly,
SALOMEDS::SComponent_var
FindOrCreateVisuComponent(SALOMEDS::Study_ptr theStudyDocument);
+ const char* const NO_ICON = "";
+ const char* const NO_IOR = "";
+ const char* const NO_NAME = "";
+ const char* const NO_PERFSITENT_REF = "";
+ const char* const NO_COMMENT = "";
+
VISU_I_EXPORT
std::string
CreateAttributes(SALOMEDS::Study_ptr theStudyDocument,
SALOMEDS::Study_var
GetDSStudy(_PTR(Study));
+ VISU_I_EXPORT
+ _PTR(Study)
+ GetStudy(SALOMEDS::Study_var);
+
VISU_I_EXPORT
void
RemoveFromStudy(SALOMEDS::SObject_ptr theSObject,
ProcessVoidEvent(new TRemoveFromStudy(this));
}
+
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::UpdateFromResult(Result_i* theResult)
+{
+ try{
+ if(theResult == GetCResult()){
+ DoSetInput(false, false);
+ UpdateActors();
+ }
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!");
+ }
+}
+
+
//---------------------------------------------------------------
bool
VISU::ColoredPrs3d_i
myPreviousEntity = myEntity;
myPreviousFieldName = myFieldName;
myPreviousTimeStampNumber = myTimeStampNumber;
+ GetCResult()->ConnectObserver(this, myResultConnection);
}catch(std::exception& exc){
INFOS("Follow exception was occured :\n"<<exc.what());
OnRestoreInput();
#define VISU_ColoredPrs3d_i_HeaderFile
#include "VISU_Prs3d_i.hh"
+#include "VISU_Result_i.hh"
+#include "VISU_BoostSignals.h"
class VISU_ColoredPL;
{
//----------------------------------------------------------------------------
class VISU_I_EXPORT ColoredPrs3d_i : public virtual POA_VISU::ColoredPrs3d,
+ public virtual TResultObserver,
public virtual Prs3d_i
{
ColoredPrs3d_i(const ColoredPrs3d_i&);
void
RemoveFromStudy();
+ //----------------------------------------------------------------------------
+ //! To update the presentation from result in automatic way
+ virtual
+ void
+ UpdateFromResult(Result_i* theResult);
+
//----------------------------------------------------------------------------
virtual
void
CORBA::Long myTimeStampNumber;
CORBA::Long myPreviousTimeStampNumber;
+ boost::signalslib::connection myResultConnection;
+
bool myIsTimeStampFixed;
PField myField;
theTimeStampNumber,
theIsMemoryCheck);
if(aResult){
- VISU::Result_i::TInput* anInput = theResult->GetInput();
+ VISU::Result_i::PInput anInput = theResult->GetInput();
VISU::PField aField = anInput->GetField(theMeshName,
(VISU::TEntity)theEntity,
theFieldName);
#include <vtkTextProperty.h>
#include <vtkProperty.h>
-#ifdef ENABLE_MULTIPR
-#include "MULTIPR_API.hxx"
-#endif
-
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
return aResult;
try{
bool anIsEstimated = true;
- VISU::Result_i::TInput* anInput = theResult->GetInput();
+ VISU::Result_i::PInput anInput = theResult->GetInput(theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
size_t aSize = anInput->GetTimeStampOnGaussPtsSize(theMeshName,
(VISU::TEntity)theEntity,
theFieldName,
VISU::GaussPoints_i
::DoSetInput(bool theIsInitilizePipe, bool theReInit)
{
- static string aStrPrev = "";
- static VISU::Result_i::TInput* anInputPrev = NULL;
-
- // MULTIPR
- VISU::Result_i::TInput* anInput = NULL;
-#ifdef ENABLE_MULTIPR
- if (GetCResult()->IsDistributedMEDMultipr())
- {
- vector<string> aListMEDFiles = GetCResult()->GetCurrentRepresentationMultipr();
-
- string aStrCurrent = "";
- for (unsigned i = 0 ; i < aListMEDFiles.size() ; i++)
- {
- aStrCurrent +=aListMEDFiles[i];
- }
- aStrCurrent += GetCMeshName();
- aStrCurrent += GetCFieldName();
- if (aStrPrev != aStrCurrent)
- {
- if (anInputPrev != NULL) delete anInputPrev;
-
- char aTmpFilename[256];
- sprintf(aTmpFilename, "__tmp.med");
-
- int res = multipr::merge(aListMEDFiles, GetCMeshName().c_str(), GetCFieldName().c_str(), aTmpFilename);
- if (res == 0) throw std::runtime_error("empty mesh");
-
- anInput = CreateConvertor(aTmpFilename);
- anInput->Build();
- anInputPrev = anInput;
-
- aStrPrev = aStrCurrent;
- }
- else
- {
- anInput = anInputPrev;
- }
- }
- else
-#endif
- {
- anInput = GetCResult()->GetInput();
- }
-
+ VISU::Result_i::PInput anInput = GetCResult()->GetInput(GetCMeshName(),
+ GetEntity(),
+ GetCFieldName(),
+ GetTimeStampNumber());
if(!anInput)
throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
- SetField(anInput->GetField(GetCMeshName(),GetTEntity(),GetCFieldName()));
+ SetField(anInput->GetField(GetCMeshName(),
+ GetTEntity(),
+ GetCFieldName()));
if(!GetField())
throw std::runtime_error("There is no Field with the parameters !!!");
VISU::PGaussPtsIDMapper aGaussPtsIDMapper =
- anInput->GetTimeStampOnGaussPts(GetCMeshName(),GetTEntity(),GetCFieldName(),GetTimeStampNumber());
-
+ anInput->GetTimeStampOnGaussPts(GetCMeshName(),
+ GetTEntity(),
+ GetCFieldName(),
+ GetTimeStampNumber());
if(!aGaussPtsIDMapper)
throw std::runtime_error("There is no TimeStamp with the parameters !!!");
if(theIsInitilizePipe){
GetSpecificPL()->Init();
}
- GetCResult()->MinMaxConnect(this);
// To update scalar range according to the new input
if(!IsTimeStampFixed() || theReInit)
{
return mySpacing;
}
-
-//----------------------------------------------------------------------------
-void
-VISU::GaussPoints_i
-::UpdateMinMax()
-{
- MinMaxCunsomer::UpdateMinMax();
- UpdateActors();
-}
#ifndef VISU_GaussPoints_i_HeaderFile
#define VISU_GaussPoints_i_HeaderFile
-#include "VISU_Result_i.hh"
#include "VISU_ColoredPrs3d_i.hh"
#include "VISU_GaussPtsActorFactory.h"
{
//! Class of the Gauss Points presentation.
class VISU_I_EXPORT GaussPoints_i : public virtual POA_VISU::GaussPoints,
- public virtual VISU::TGaussPtsActorFactory,
- public virtual MinMaxCunsomer,
- public virtual ColoredPrs3d_i
+ public virtual TGaussPtsActorFactory,
+ public virtual ColoredPrs3d_i
{
static int myNbPresent;
GaussPoints_i(const GaussPoints_i&);
void
SetSourceRange();
- //! To update the min / max automatically
- virtual
- void
- UpdateMinMax();
-
VISU_GaussPointsPL*
GetSpecificPL() const
{
return Result::_nil();
Mutex mt(myMutex);
aFileInfo.setFile(theFileName);
- Result_i* pResult = new Result_i(myStudyDocument,
- Result_i::eFile,
- Result_i::eImportFile);
+ Result_i* pResult = Result_i::New(myStudyDocument,
+ Result_i::eFile,
+ Result_i::eImportFile);
if(pResult->Create(theFileName) != NULL)
return pResult->_this();
else{
return Result::_nil();
Mutex mt(myMutex);
aFileInfo.setFile(theFileName);
- Result_i* pResult = new Result_i(myStudyDocument,
- Result_i::eFile,
- Result_i::eImportFile,
- false);
+ Result_i* pResult = Result_i::New(myStudyDocument,
+ Result_i::eFile,
+ Result_i::eImportFile,
+ false);
if(pResult->Create(theFileName) != NULL)
return pResult->_this();
else{
Mutex mt(myMutex);
VISU::Result_var aResult;
aFileInfo.setFile(theFileName);
- Result_i* pResult = new Result_i(myStudyDocument,
- Result_i::eRestoredFile,
- Result_i::eCopyAndImportFile);
+ Result_i* pResult = Result_i::New(myStudyDocument,
+ Result_i::eRestoredFile,
+ Result_i::eCopyAndImportFile);
if(pResult->Create(theFileName) != NULL)
aResult = pResult->_this();
return aResult._retn();
if (myStudyDocument->GetProperties()->IsLocked())
return Result::_nil();
Mutex mt(myMutex);
- Result_i* pResult = new Result_i(myStudyDocument,
- Result_i::eComponent,
- Result_i::eImportMed);
+ Result_i* pResult = Result_i::New(myStudyDocument,
+ Result_i::eComponent,
+ Result_i::eImportMed);
if (pResult->Create(theMedSObject) != NULL) {
return pResult->_this();
} else {
if (myStudyDocument->GetProperties()->IsLocked())
return Result::_nil();
Mutex mt(myMutex);
- Result_i* pResult = new Result_i(myStudyDocument,
- Result_i::eComponent,
- Result_i::eImportMedField);
+ Result_i* pResult = Result_i::New(myStudyDocument,
+ Result_i::eComponent,
+ Result_i::eImportMedField);
if (pResult->Create(theField) != NULL) {
return pResult->_this();
} else {
return false;
}
- SALOMEDS::TMPFile* VISU_Gen_i::CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID) {
+ SALOMEDS::TMPFile*
+ VISU_Gen_i
+ ::CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID)
+ {
Mutex mt(myMutex);
theObjectID = 0;
SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile;
SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames;
- PortableServer::POA_ptr aPOA = GetPOA();
-
SALOMEDS::GenericAttribute_var anAttr;
- if (!theObject->FindAttribute(anAttr,"AttributeIOR")) return NULL;
+ if (!theObject->FindAttribute(anAttr,"AttributeIOR"))
+ return NULL;
SALOMEDS::AttributeIOR_var anIORAttr = SALOMEDS::AttributeIOR::_narrow(anAttr);
CORBA::Object_var aCorbaObj;
try {
stmOut2<<aStr<<endl;
stmOut2.close();
- if (Result_i* aResultObj = dynamic_cast<Result_i*>(aPOA->reference_to_servant(aCorbaObj))) {
+ if (Result_i* aResultObj = dynamic_cast<Result_i*>(GetServant(aCorbaObj).in())) {
string aFileName = string(SALOMEDS_Tool::GetNameFromPath(theObject->GetStudy()->URL())) + "_";
if(strlen(aFileName.c_str()) == 1) aFileName="";
const QFileInfo& aFileInfo = aResultObj->GetFileInfo();
aRestoringMap["myMeshName"] = GetCMeshName();
VISU::PUnstructuredGridIDMapper anIDMapper;
- VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
+ VISU::Result_i::PInput anInput = GetCResult()->GetInput();
switch(myType){
case VISU::TENTITY :
anIDMapper = anInput->GetMeshOnEntity(aMeshName,
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File : VISU_MultiResult_i.cc
+// Author : Alexey PETROV
+// Module : VISU
+
+#ifdef ENABLE_MULTIPR
+
+#include "VISU_MultiResult_i.hh"
+#include "VISU_ResultUtils.hh"
+
+#include "VISU_Convertor.hxx"
+
+#include "MULTIPR_API.hxx"
+#include "MULTIPR_Obj.hxx"
+
+#include "SALOMEDS_Tool.hxx"
+
+#include <boost/thread/thread.hpp>
+#include <boost/bind.hpp>
+
+#include <strstream>
+
+
+namespace VISU
+{
+ //---------------------------------------------------------------
+ inline
+ std::string
+ ExtractMainPart(const std::string& thePartName)
+ {
+ size_t aPos = thePartName.rfind('_');
+ if(aPos == std::string::npos)
+ return thePartName;
+
+ std::string aSuffix = thePartName.substr(aPos);
+ if(aSuffix == "_MED" || aSuffix == "_LOW")
+ return thePartName.substr(0, aPos);
+
+ return thePartName;
+ }
+
+
+ //---------------------------------------------------------------
+ inline
+ bool
+ IsSubString(const std::string& theSource,
+ const std::string& theSubString)
+ {
+ return theSource.rfind(theSubString) != std::string::npos;
+ }
+
+
+ //---------------------------------------------------------------
+ inline
+ bool
+ IsMediumResolution(const std::string& thePartName)
+ {
+ return IsSubString(thePartName, "_MED");
+ }
+
+
+ //---------------------------------------------------------------
+ inline
+ bool
+ IsLowResolution(const std::string& thePartName)
+ {
+ return IsSubString(thePartName, "_LOW");
+ }
+
+
+ //---------------------------------------------------------------
+ inline
+ bool
+ IsFullResolution(const std::string& thePartName)
+ {
+ return !IsMediumResolution(thePartName) && !IsLowResolution(thePartName);
+ }
+
+
+ //---------------------------------------------------------------
+ typedef std::set<MultiResult_i::TPartName> TSubParts;
+ typedef std::map<MultiResult_i::TPartName, TSubParts> TMain2SubParts;
+
+ inline
+ std::string
+ GetResolutions(const TMain2SubParts& theMain2SubParts,
+ const std::string& thePartName)
+ {
+ std::string aResolution = "F";
+
+ MultiResult_i::TPartName aMainPart = ExtractMainPart(thePartName);
+ TMain2SubParts::const_iterator anIter = theMain2SubParts.find(aMainPart);
+ if(anIter != theMain2SubParts.end()){
+ const TSubParts& aSubParts = anIter->second;
+
+ if(aSubParts.find(aMainPart + "_LOW") != aSubParts.end())
+ aResolution += "L";
+
+ if(aSubParts.find(aMainPart + "_MED") != aSubParts.end())
+ aResolution += "M";
+ }
+ return aResolution;
+ }
+
+
+ //---------------------------------------------------------------
+ inline
+ MultiResult_i::TResolutionID
+ GetResolutionID(const TMain2SubParts& theMain2SubParts,
+ const std::string& thePartName)
+ {
+ std::string aResolutions = GetResolutions(theMain2SubParts,
+ thePartName);
+ if(aResolutions.find('L') != std::string::npos)
+ return 'L';
+
+ if(aResolutions.find('M') != std::string::npos)
+ return 'M';
+
+ return 'F';
+ }
+
+
+ //---------------------------------------------------------------
+ inline
+ std::string
+ GetIconName(const TMain2SubParts& theMain2SubParts,
+ const std::string& thePartName)
+ {
+ MultiResult_i::TResolutionID aResolutionID = GetResolutionID(theMain2SubParts,
+ thePartName);
+ if(aResolutionID == 'L')
+ return "ICON_MULTIPR_VIEW_LOW";
+
+ if(aResolutionID == 'M')
+ return "ICON_MULTIPR_VIEW_MEDIUM";
+
+ return "ICON_MULTIPR_VIEW_FULL";
+ }
+
+
+ //---------------------------------------------------------------
+ void
+ BuildParts(Result_i* theResult,
+ Result_i::PInput theInput,
+ const QFileInfo& theMPFileInfo,
+ MultiResult_i::TPartName2FileName* thePartName2FileName,
+ MultiResult_i::TPartName2ResolutionID* thePartName2ResolutionID,
+ CORBA::Boolean* theIsDone,
+ CORBA::Boolean theIsBuild,
+ CORBA::Boolean theIsAtOnce,
+ _PTR(Study) theStudy)
+ {
+ if(!theIsBuild || *theIsDone)
+ return;
+
+ // if MED file is not a distributed MED file (created with MULTIPR),
+ // then it is not necessary to build parts
+ if (theMPFileInfo.filePath().isEmpty())
+ return;
+
+ try {
+ multipr::Obj aMultiprObj;
+ aMultiprObj.create(theMPFileInfo.filePath().latin1());
+ if (aMultiprObj.isValidDistributedMEDFile()) {
+ const VISU::TMeshMap& aMeshMap = theInput->GetMeshMap();
+ VISU::TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
+ const VISU::PMesh& aMesh = aMeshMapIter->second;
+
+ typedef std::vector<MultiResult_i::TPartName> TParts;
+ TParts aParts = aMultiprObj.getParts();
+
+ QString aComment = "Sub-parts: #";
+ aComment += QString::number(aParts.size());
+
+ CreateAttributes(theStudy,
+ aMesh->myPartsEntry,
+ NO_ICON,
+ NO_IOR,
+ "Parts",
+ NO_PERFSITENT_REF,
+ aComment.latin1(),
+ false);
+
+ MultiResult_i::TPartName2FileName& aPartName2FileName = *thePartName2FileName;
+ MultiResult_i::TPartName2ResolutionID& aPartName2ResolutionID = *thePartName2ResolutionID;
+
+ TMain2SubParts aMain2SubParts;
+
+ for (size_t aPartID = 0 ; aPartID < aParts.size() ; aPartID++) {
+ const MultiResult_i::TPartName& aPartName = aParts[aPartID];
+ MultiResult_i::TPartName aMainPart = ExtractMainPart(aPartName);
+ aMain2SubParts[aMainPart].insert(aPartName);
+ }
+
+ std::string aLastEntry;
+ for (size_t aPartID = 0 ; aPartID < aParts.size() ; aPartID++) {
+ const MultiResult_i::TPartName& aPartName = aParts[aPartID];
+ std::string aPartInfo = aMultiprObj.getPartInfo(aPartName.c_str());
+
+ std::istrstream anOutputStream(aPartInfo.c_str());
+ std::string aMeshName;
+ anOutputStream>>aMeshName;
+
+ int anID;
+ anOutputStream>>anID;
+
+ std::string aName;
+ anOutputStream>>aName;
+
+ std::string aPath;
+ anOutputStream>>aPath;
+
+ std::string aFileName;
+ anOutputStream>>aFileName;
+
+ aPartName2FileName[aName] = aFileName;
+
+ QString aComment = "";
+ std::string aResoltutions = GetResolutions(aMain2SubParts, aName);
+ if ( IsFullResolution(aName) ) {
+ std::string anIconName = GetIconName(aMain2SubParts, aName);
+ MultiResult_i::TResolutionID aResolutionID = GetResolutionID(aMain2SubParts, aName);
+ aComment.sprintf("myComment=PART;myFile=%s;myResolutions=%s;myState=%c",
+ aFileName.c_str(), aResoltutions.c_str(), aResolutionID);
+ aLastEntry = CreateAttributes(theStudy,
+ aMesh->myPartsEntry,
+ anIconName,
+ NO_IOR,
+ aName,
+ NO_PERFSITENT_REF,
+ aComment.latin1(),
+ true);
+ aPartName2ResolutionID[aName] = aResolutionID;
+ } else {
+ aComment.sprintf("myComment=PART;myFile=%s;myResolutions=%s",
+ aFileName.c_str(), aResoltutions.c_str());
+ CreateAttributes(theStudy,
+ aLastEntry,
+ NO_ICON,
+ NO_IOR,
+ aName,
+ NO_PERFSITENT_REF,
+ aComment.latin1(),
+ true);
+ }
+ }
+ } else {
+ INFOS("invalid distributed MED file");
+ }
+ *theIsDone = true;
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!");
+ }
+
+ ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(), theIsDone));
+ }
+
+
+ //---------------------------------------------------------------
+}
+
+
+//---------------------------------------------------------------
+VISU::MultiResult_i
+::MultiResult_i (SALOMEDS::Study_ptr theStudy,
+ const ESourceId& theSourceId,
+ const ECreationId& theCreationId,
+ CORBA::Boolean theIsBuildImmediately,
+ CORBA::Boolean theIsBuildFields,
+ CORBA::Boolean theIsBuildMinMax,
+ CORBA::Boolean theIsBuildGroups):
+ Result_i(theStudy,
+ theSourceId,
+ theCreationId,
+ theIsBuildImmediately,
+ theIsBuildFields,
+ theIsBuildMinMax,
+ theIsBuildGroups)
+{}
+
+
+//---------------------------------------------------------------
+size_t
+VISU::MultiResult_i
+::IsPossible()
+{
+ return TSuperClass::IsPossible();
+}
+
+
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::MultiResult_i
+::Build(SALOMEDS::SObject_ptr theSObject,
+ CORBA::Boolean theIsAtOnce)
+{
+ if(!TSuperClass::Build(theSObject, theIsAtOnce))
+ return NULL;
+
+ if(IsDone())
+ return this;
+
+ if(theIsAtOnce){
+ BuildParts(this,
+ GetInput(),
+ myMPFileInfo,
+ &myPartName2FileName,
+ &myPartName2ResolutionID,
+ &myIsPartsDone,
+ myIsBuildParts,
+ theIsAtOnce,
+ myStudy);
+ }
+
+ return this;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::MultiResult_i
+::BuildDataTree(const std::string& theResultEntry)
+{
+ BuildEntities(this,
+ GetInput(),
+ &myIsEntitiesDone,
+ theResultEntry,
+ false,
+ myIsBuildGroups,
+ myIsBuildFields,
+ myIsBuildParts,
+ myStudy);
+ {
+ boost::thread aThread(boost::bind(&BuildParts,
+ this,
+ GetInput(),
+ myMPFileInfo,
+ &myPartName2FileName,
+ &myPartName2ResolutionID,
+ &myIsPartsDone,
+ myIsBuildParts,
+ false,
+ myStudy));
+ }
+ {
+ boost::thread aThread(boost::bind(&BuildGroups,
+ this,
+ GetInput(),
+ &myIsGroupsDone,
+ myIsBuildGroups,
+ false,
+ myStudy));
+ }
+ {
+ boost::thread aThread(boost::bind(&BuildFieldDataTree,
+ this,
+ GetInput(),
+ &myIsFieldsDone,
+ myIsBuildFields,
+ &myIsMinMaxDone,
+ myIsBuildMinMax,
+ myStudy));
+ }
+}
+
+
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::MultiResult_i
+::Create(const char* theFileName)
+{
+ QFileInfo aFileInfo(theFileName);
+ QString aTargetFileName = aFileInfo.filePath();
+ if(aTargetFileName.endsWith("_grains_maitre.med")){
+ // retrieve source MED file (sequential MED file)
+ FILE* aFile = fopen(theFileName, "rt");
+ QString aSourceFileName("");
+ char aBuf[1024];
+ while (!feof(aFile)) {
+ fgets(aBuf, 1024, aFile);
+ char* strTag = NULL;
+ if ((aBuf[0] == '#') && ((strTag = strstr(aBuf, "[SOURCE]=")) != NULL)) {
+ char aFileName[256];
+ int ret = sscanf(strTag, "[SOURCE]=%s", aFileName);
+ if (ret == 1) {
+ aSourceFileName = aFileName;
+ break;
+ }
+ }
+ }
+ fclose(aFile);
+ if (aSourceFileName.isEmpty())
+ throw std::runtime_error("distributed MED file; bad format");
+
+ myMPFileInfo.setFile(theFileName);
+ aTargetFileName = aSourceFileName;
+ myIsBuildParts = true;
+ }
+
+ return TSuperClass::Create(aTargetFileName);
+}
+
+
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::MultiResult_i
+::Restore(SALOMEDS::SObject_ptr theSObject,
+ const Storable::TRestoringMap& theMap,
+ const string& thePrefix)
+{
+ return TSuperClass::Restore(theSObject,
+ theMap,
+ thePrefix);
+}
+
+
+//---------------------------------------------------------------
+CORBA::Boolean
+VISU::MultiResult_i
+::IsDone()
+{
+ return TSuperClass::IsDone() &&
+ (myIsBuildParts? myIsPartsDone: true);
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::MultiResult_i
+::ToStream(std::ostringstream& theStr)
+{
+ TSuperClass::ToStream(theStr);
+}
+
+
+//---------------------------------------------------------------
+VISU::MultiResult_i
+::~MultiResult_i()
+{}
+
+
+//---------------------------------------------------------------
+void
+VISU::MultiResult_i
+::SetResolution(const std::string& theName,
+ TResolutionID theNewResolution)
+{
+ TPartName2FileName::iterator anIter = myPartName2FileName.find(theName);
+ if(anIter == myPartName2FileName.end())
+ return;
+
+ TResolutionID& aNewResolution = myPartName2ResolutionID[theName];
+ if(aNewResolution == theNewResolution)
+ return;
+
+ aNewResolution = theNewResolution;
+
+ VISU::Storable::TRestoringMap aRestoringMap;
+ const TFileName& aFileName = anIter->second;
+ aRestoringMap["myComment"] = "PART";
+ aRestoringMap["myFile"] = aFileName;
+ std::string aFatherEntry = GetEntry(aRestoringMap);
+
+ std::string anIconName = "ICON_MULTIPR_VIEW_HIDE";
+ if(theNewResolution == 'F')
+ anIconName = "ICON_MULTIPR_VIEW_FULL";
+ else if(theNewResolution == 'M')
+ anIconName = "ICON_MULTIPR_VIEW_MEDIUM";
+ else if(theNewResolution == 'L')
+ anIconName = "ICON_MULTIPR_VIEW_LOW";
+
+ _PTR(Study) aStudy = GetStudy();
+ _PTR(SObject) aSObject = aStudy->FindObjectID(aFatherEntry);
+ aRestoringMap = Storable::GetStorableMap(aSObject);
+
+ std::ostrstream anOutputStream;
+ anOutputStream<<"myComment=PART;";
+ anOutputStream<<"myFile="<<aFileName<<";";
+ anOutputStream<<"myResolutions="<<aRestoringMap["myResolutions"]<<";";
+ anOutputStream<<"myState="<<theNewResolution;
+
+ CreateAttributes(aStudy,
+ aFatherEntry,
+ anIconName,
+ NO_IOR,
+ NO_NAME,
+ NO_PERFSITENT_REF,
+ anOutputStream.str(),
+ false);
+}
+
+
+namespace VISU
+{
+ //---------------------------------------------------------------
+ inline
+ void
+ UpdateRepresentationKey(const MultiResult_i::TPartName2FileName& thePartName2FileName,
+ MultiResult_i::TRepresentationKey& theRepresentationKey,
+ const std::string& thePartName)
+ {
+ MultiResult_i::TPartName2FileName::const_iterator anIterator = thePartName2FileName.find(thePartName);
+ if (anIterator != thePartName2FileName.end()){
+ const MultiResult_i::TFileName& aFileName = anIterator->second;
+ theRepresentationKey.insert(aFileName);
+ }
+ }
+
+
+ //---------------------------------------------------------------
+ MultiResult_i::TRepresentationKey
+ GetRepresentation(const MultiResult_i::TPartName2FileName& thePartName2FileName,
+ const MultiResult_i::TPartName2ResolutionID& thePartName2ResolutionID)
+ {
+ // name of selected parts
+ MultiResult_i::TRepresentationKey aRepresentationKey;
+
+ // for each part of the mesh
+ MultiResult_i::TPartName2ResolutionID::const_iterator anIter = thePartName2ResolutionID.begin();
+ for ( ; anIter != thePartName2ResolutionID.end() ; anIter++) {
+ const MultiResult_i::TPartName& aPartName = anIter->first;
+ const MultiResult_i::TResolutionID& aResolutionID = anIter->second;
+ if(aResolutionID == 'F')
+ UpdateRepresentationKey(thePartName2FileName, aRepresentationKey, aPartName);
+ if(aResolutionID == 'M')
+ UpdateRepresentationKey(thePartName2FileName, aRepresentationKey, aPartName + "_MED");
+ else if(aResolutionID == 'L')
+ UpdateRepresentationKey(thePartName2FileName, aRepresentationKey, aPartName + "_LOW");
+ }
+ return aRepresentationKey;
+ }
+
+
+ //---------------------------------------------------------------
+ bool
+ UseInitialInput(const MultiResult_i::TPartName2FileName& thePartName2FileName,
+ const MultiResult_i::TPartName2ResolutionID& thePartName2ResolutionID)
+ {
+ bool aResult = true;
+ MultiResult_i::TPartName2FileName::const_iterator anIter = thePartName2FileName.begin();
+ for ( ; anIter != thePartName2FileName.end() ; anIter++) {
+ const MultiResult_i::TPartName& aPartName = anIter->first;
+ if(IsFullResolution(aPartName)){
+ MultiResult_i::TPartName2ResolutionID::const_iterator anIter2 = thePartName2ResolutionID.find(aPartName);
+ if(anIter2 != thePartName2ResolutionID.end()){
+ const MultiResult_i::TResolutionID& aResolutionID = anIter2->second;
+ if(aResolutionID == 'F')
+ continue;
+ }
+ aResult = false;
+ break;
+ }
+ }
+ return aResult;
+ }
+}
+
+
+//---------------------------------------------------------------
+VISU::Result_i::PInput
+VISU::MultiResult_i
+::GetInput(const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber)
+{
+ if(theEntity == NONE) // If client wants use initial behaviour
+ return TSuperClass::GetInput();
+
+ if(!myIsPartsDone) // If corresponding data is not ready yet
+ return TSuperClass::GetInput();
+
+ if(UseInitialInput(myPartName2FileName, myPartName2ResolutionID))
+ return TSuperClass::GetInput();
+
+ MultiResult_i::TRepresentationKey aRepresentationKey =
+ GetRepresentation(myPartName2FileName, myPartName2ResolutionID);
+
+ typedef std::vector<TFileName> TFileNames;
+ TFileNames aFileNames(aRepresentationKey.begin(), aRepresentationKey.end());
+
+ aRepresentationKey.insert( theMeshName );
+ aRepresentationKey.insert( theFieldName );
+
+ TRepresentation2Input::iterator anIter = myRepresentation2Input.find(aRepresentationKey);
+ if(anIter == myRepresentation2Input.end()){
+ std::string aFileName = SALOMEDS_Tool::GetTmpDir() + "tmp.med";
+ //cout<<"MultiResult_i::GetInput - '"<<aFileName<<"'"<<endl;
+ int aRes = multipr::merge(aFileNames, theMeshName.c_str(), theFieldName.c_str(), aFileName.c_str());
+ if (aRes == 0) {
+ QFile(aFileName.c_str()).remove();
+ throw std::runtime_error("empty mesh");
+ }
+ PInput anInput(CreateConvertor(aFileName));
+ anInput->Build();
+ myRepresentation2Input[aRepresentationKey] = anInput;
+ return anInput;
+ }
+
+ return anIter->second;
+}
+
+
+#endif // ENABLE_MULTIPR
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File : VISU_MultiResult_i.hh
+// Author : Alexey PETROV
+// Module : VISU
+
+#ifndef __VISU_MULTI_RESULT_I_H__
+#define __VISU_MULTI_RESULT_I_H__
+
+#ifndef ENABLE_MULTIPR
+# define RESULT_CLASS_NAME Result_i
+#else
+# define RESULT_CLASS_NAME MultiResult_i
+
+#include "VISU_Result_i.hh"
+
+#include <set>
+
+namespace VISU
+{
+ //----------------------------------------------------------------------------
+ class MultiResult_i : public virtual Result_i
+ {
+ MultiResult_i(const MultiResult_i&);
+
+ public:
+ typedef Result_i TSuperClass;
+
+ MultiResult_i(SALOMEDS::Study_ptr theStudy,
+ const ESourceId& theSourceId,
+ const ECreationId& theCreationId,
+ CORBA::Boolean theIsBuildImmediately = true,
+ CORBA::Boolean theIsBuildFields = true,
+ CORBA::Boolean theIsBuildMinMax = true,
+ CORBA::Boolean theIsBuildGroups = true);
+
+ virtual
+ ~MultiResult_i();
+
+ virtual
+ CORBA::Boolean
+ IsDone();
+
+ typedef std::string TPartName;
+ typedef std::string TFileName;
+ typedef std::map<TPartName, TFileName> TPartName2FileName;
+ typedef std::map<TPartName, TResolutionID> TPartName2ResolutionID;
+
+ typedef std::set<std::string> TRepresentationKey;
+ typedef std::map<TRepresentationKey, PInput> TRepresentation2Input;
+
+ private:
+ QFileInfo myMPFileInfo;
+ TPartName2FileName myPartName2FileName;
+ TPartName2ResolutionID myPartName2ResolutionID;
+
+ TRepresentation2Input myRepresentation2Input;
+
+ protected:
+ virtual
+ Storable*
+ Build(SALOMEDS::SObject_ptr theSObject,
+ CORBA::Boolean theIsAtOnce = true) ;
+
+ virtual
+ void
+ BuildDataTree(const std::string& theResultEntry);
+
+ public:
+ virtual
+ size_t
+ IsPossible();
+
+ virtual
+ Storable*
+ Create(const char* theFileName);
+
+ virtual
+ Storable*
+ Restore(SALOMEDS::SObject_ptr theSObject,
+ const Storable::TRestoringMap& theMap,
+ const std::string& thePrefix);
+
+ virtual
+ void
+ ToStream(std::ostringstream& theStr);
+
+ virtual
+ PInput
+ GetInput(const std::string& theMeshName = "",
+ VISU::Entity theEntity = VISU::NONE,
+ const std::string& theFieldName = "",
+ CORBA::Long theTimeStampNumber = -1);
+
+ virtual
+ void
+ SetResolution(const std::string& theName,
+ TResolutionID theNewResolution); // 'F'=FULL 'M'=MEDIUM 'L'=LOW 'H'=HIDE
+ };
+
+}
+
+#endif // ENABLE_MULTIPR
+
+#endif // __VISU_MULTI_RESULT_I_H__
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File : VISU_ResultUtils.cc
+// Author : Alexey PETROV
+// Module : VISU
+
+#include "VISU_ResultUtils.hh"
+
+#include "SUIT_Session.h"
+#include "SALOME_Event.hxx"
+#include "SalomeApp_Study.h"
+#include "SalomeApp_Application.h"
+
+#include "VISU_Convertor.hxx"
+#include "VISU_ConvertorUtils.hxx"
+
+#include <boost/thread/recursive_mutex.hpp>
+#include <boost/thread/thread.hpp>
+#include <boost/bind.hpp>
+
+#ifdef _DEBUG_
+static int MYTIMEDEBUG = 0;
+#else
+static int MYTIMEDEBUG = 0;
+#endif
+
+namespace VISU
+{
+ //----------------------------------------------------------------------------
+ typedef boost::recursive_mutex TMutex;
+ typedef TMutex::scoped_lock TLock;
+
+ static TMutex myMutex;
+
+
+ //----------------------------------------------------------------------------
+ TUpdateObjBrowser
+ ::TUpdateObjBrowser(const int theStudyId, CORBA::Boolean* theIsDone):
+ myStudyId(theStudyId),
+ myIsDone(theIsDone)
+ {}
+
+
+ //----------------------------------------------------------------------------
+ void
+ TUpdateObjBrowser
+ ::Execute()
+ {
+ TLock aLock(myMutex);
+ SUIT_Session* aSession = SUIT_Session::session();
+ QPtrList<SUIT_Application> anApplications = aSession->applications();
+ QPtrListIterator<SUIT_Application> anIter (anApplications);
+ while (SUIT_Application* aSApp = anIter.current()) {
+ if(SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(aSApp)){
+ if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(anApp->activeStudy())) {
+ if (_PTR(Study) aCStudy = aStudy->studyDS()) {
+ if (myStudyId == aCStudy->StudyId()) {
+ TTimerLog aTimerLog(MYTIMEDEBUG,"Result_i::updateObjectBrowser");
+ anApp->updateObjectBrowser();
+ *myIsDone = true;
+ break;
+ }
+ }
+ }
+ }
+ ++anIter;
+ }
+ }
+
+
+ //----------------------------------------------------------------------------
+ struct TResultManager
+ {
+ Result_i* myResult;
+
+ TResultManager(Result_i* theResult):
+ myResult(theResult)
+ {
+ myResult->Register();
+ }
+
+ ~TResultManager()
+ {
+ myResult->Destroy();
+ }
+ };
+
+
+ //----------------------------------------------------------------------------
+ struct TTransactionManager
+ {
+ _PTR(StudyBuilder) myStudyBuilder;
+
+ TTransactionManager(_PTR(Study) theStudyDocument):
+ myStudyBuilder(theStudyDocument->NewBuilder())
+ {
+ TLock aLock(myMutex);
+ myStudyBuilder->NewCommand();
+ }
+
+ ~TTransactionManager()
+ {
+ TLock aLock(myMutex);
+ myStudyBuilder->CommitCommand();
+ }
+ };
+
+
+ //----------------------------------------------------------------------------
+ QString
+ GenerateName(const std::string& theName)
+ {
+ TLock aLock(myMutex);
+
+ typedef std::map<std::string, int> TNameMap;
+ static TNameMap aMap;
+
+ TNameMap::const_iterator anIter = aMap.find(theName);
+ QString aResult;
+ if (anIter == aMap.end()) {
+ aMap[theName] = 0;
+ aResult = theName;
+ } else {
+ aResult = GenerateName(theName,++aMap[theName]);
+ }
+ return aResult;
+ }
+
+
+ //----------------------------------------------------------------------------
+ QString
+ GenerateFieldName (const string& theName, const string& theUnits)
+ {
+ QString aName;
+ const string tmp (theUnits.size(),' ');
+ if (theUnits == "" || theUnits == tmp)
+ aName.sprintf("%s, -",theName.c_str());
+ else
+ aName.sprintf("%s, %s",theName.c_str(),theUnits.c_str());
+ aName = aName.simplifyWhiteSpace();
+ return aName.latin1();
+ }
+
+
+ //----------------------------------------------------------------------------
+ void
+ CreateReference(_PTR(Study) theStudyDocument,
+ const string& theFatherEntry,
+ const string& theRefEntry)
+ {
+ _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
+ _PTR(SObject) aFather = theStudyDocument->FindObjectID(theFatherEntry);
+ _PTR(SObject) aNewObj = aStudyBuilder->NewObject(aFather);
+ _PTR(SObject) aRefSObj = theStudyDocument->FindObjectID(theRefEntry);
+ aStudyBuilder->Addreference(aNewObj,aRefSObj);
+ }
+
+
+ //----------------------------------------------------------------------------
+ void
+ RemoveSObject(_PTR(Study) theStudyDocument,
+ const string& theEntry)
+ {
+ _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
+ _PTR(SObject) aSObject = theStudyDocument->FindObjectID(theEntry);
+ aStudyBuilder->RemoveObject(aSObject);
+ }
+
+
+ //----------------------------------------------------------------------------
+ void
+ BuildEntities(Result_i* theResult,
+ Result_i::PInput theInput,
+ CORBA::Boolean* theIsDone,
+ const std::string& theResultEntry,
+ CORBA::Boolean theIsAtOnce,
+ CORBA::Boolean theIsBuildGroups,
+ CORBA::Boolean theIsBuildFields,
+ CORBA::Boolean theIsBuildParts,
+ _PTR(Study) theStudy)
+ {
+ if(*theIsDone)
+ return;
+
+ TTimerLog aTimerLog(MYTIMEDEBUG,"Result_i::BuildEntities");
+ TResultManager aResultManager(theResult);
+ TTransactionManager aTransactionManager(theStudy);
+
+ {
+ TTimerLog aTimerLog(MYTIMEDEBUG,"theInput->BuildEntities");
+ theInput->BuildEntities();
+ }
+
+ QString aComment,aTmp;
+ const TMeshMap& aMeshMap = theInput->GetMeshMap();
+ TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
+ for(; aMeshMapIter != aMeshMap.end(); aMeshMapIter++){
+ const string& aMeshName = aMeshMapIter->first;
+ const PMesh& aMesh = aMeshMapIter->second;
+ const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
+ if(aMeshOnEntityMap.empty())
+ continue;
+ aComment.sprintf("myComment=MESH;myName=%s;myDim=%d",
+ aMeshName.c_str(),
+ aMesh->myDim);
+ aMesh->myEntry =
+ CreateAttributes(theStudy,
+ theResultEntry,
+ NO_ICON,
+ NO_IOR,
+ aMeshName,
+ NO_PERFSITENT_REF,
+ aComment.latin1(),
+ true);
+
+ aComment.sprintf("myComment=FAMILIES;myMeshName=%s",
+ aMeshName.c_str());
+ std::string aSubMeshesEntry =
+ CreateAttributes(theStudy,
+ aMesh->myEntry,
+ NO_ICON,
+ NO_IOR,
+ "Families",
+ NO_PERFSITENT_REF,
+ aComment.latin1(),
+ true);
+
+ if(theIsBuildGroups){
+ aMesh->myGroupsEntry =
+ CreateAttributes(theStudy,
+ aMesh->myEntry,
+ NO_ICON,
+ NO_IOR,
+ NO_NAME,
+ NO_PERFSITENT_REF,
+ NO_COMMENT,
+ true);
+ }
+
+ if(theIsBuildFields){
+ aMesh->myFieldsEntry =
+ CreateAttributes(theStudy,
+ aMesh->myEntry,
+ NO_ICON,
+ NO_IOR,
+ NO_NAME,
+ NO_PERFSITENT_REF,
+ NO_COMMENT,
+ true);
+ }
+
+ if(theIsBuildParts){
+ aMesh->myPartsEntry =
+ CreateAttributes(theStudy,
+ aMesh->myEntry,
+ NO_ICON,
+ NO_IOR,
+ NO_NAME,
+ NO_PERFSITENT_REF,
+ NO_COMMENT,
+ true);
+ }
+
+ //Import entities
+ TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
+ for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
+ const TEntity& anEntity = aMeshOnEntityMapIter->first;
+ const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
+
+ string anEntityName;
+ switch(anEntity){
+ case NODE_ENTITY:
+ anEntityName = "onNodes";
+ break;
+ case EDGE_ENTITY:
+ anEntityName = "onEdges";
+ break;
+ case FACE_ENTITY:
+ anEntityName = "onFaces";
+ break;
+ case CELL_ENTITY:
+ anEntityName = "onCells";
+ break;
+ default:
+ continue;
+ }
+
+ aComment.sprintf("myComment=ENTITY;myMeshName=%s;myId=%d",
+ aMeshName.c_str(),
+ anEntity);
+
+ aMeshOnEntity->myEntry =
+ CreateAttributes(theStudy,
+ aSubMeshesEntry,
+ NO_ICON,
+ NO_IOR,
+ anEntityName.c_str(),
+ NO_PERFSITENT_REF,
+ aComment.latin1(),
+ true);
+ }
+ }
+
+ ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
+ }
+
+
+ //----------------------------------------------------------------------------
+ void
+ BuildGroups(Result_i* theResult,
+ Result_i::PInput theInput,
+ CORBA::Boolean* theIsDone,
+ CORBA::Boolean theIsBuild,
+ CORBA::Boolean theIsAtOnce,
+ _PTR(Study) theStudy)
+ {
+ if(!theIsBuild || *theIsDone)
+ return;
+
+ TTimerLog aTimerLog(MYTIMEDEBUG,"Result_i::BuildGroups");
+ TResultManager aResultManager(theResult);
+ TTransactionManager aTransactionManager(theStudy);
+
+ {
+ TTimerLog aTimerLog(MYTIMEDEBUG,"theInput->BuildGroups");
+ theInput->BuildGroups();
+ }
+
+ QString aComment,aTmp;
+ const TMeshMap& aMeshMap = theInput->GetMeshMap();
+ TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
+ for(; aMeshMapIter != aMeshMap.end(); aMeshMapIter++){
+ const string& aMeshName = aMeshMapIter->first;
+ const PMesh& aMesh = aMeshMapIter->second;
+
+ const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
+ if(aMeshOnEntityMap.empty())
+ continue;
+
+ TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
+ for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
+ const TEntity& anEntity = aMeshOnEntityMapIter->first;
+ const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
+
+ const TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+ TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
+ for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
+ const string& aFamilyName = aFamilyMapIter->first;
+ const PFamily& aFamily = aFamilyMapIter->second;
+ aComment.sprintf("myComment=FAMILY;myMeshName=%s;myEntityId=%d;myName=%s",
+ aMeshName.c_str(),
+ anEntity,
+ aFamilyName.c_str());
+
+ aFamily->myEntry =
+ CreateAttributes(theStudy,
+ aMeshOnEntity->myEntry,
+ NO_ICON,
+ NO_IOR,
+ aFamilyName,
+ NO_PERFSITENT_REF,
+ aComment.latin1(),
+ true);
+ }
+ }
+ //Importing groups
+ const TGroupMap& aGroupMap = aMesh->myGroupMap;
+ if(!aGroupMap.empty()){
+ aComment.sprintf("myComment=GROUPS;myMeshName=%s",
+ aMeshName.c_str());
+
+ CreateAttributes(theStudy,
+ aMesh->myGroupsEntry,
+ NO_ICON,
+ NO_IOR,
+ "Groups",
+ NO_PERFSITENT_REF,
+ aComment.latin1(),
+ false);
+
+ TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
+ for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
+ const string& aGroupName = aGroupMapIter->first;
+ const PGroup& aGroup = aGroupMapIter->second;
+ aComment.sprintf("myComment=GROUP;myMeshName=%s;myName=%s",
+ aMeshName.c_str(),
+ aGroupName.c_str());
+ aGroup->myEntry =
+ CreateAttributes(theStudy,
+ aMesh->myGroupsEntry,
+ NO_ICON,
+ NO_IOR,
+ aGroupName,
+ NO_PERFSITENT_REF,
+ aComment.latin1(),
+ true);
+ const TFamilySet& aFamilySet = aGroup->myFamilySet;
+ TFamilySet::const_iterator aFamilyIter = aFamilySet.begin();
+ for(; aFamilyIter != aFamilySet.end(); aFamilyIter++){
+ const PFamily& aFamily = *aFamilyIter;
+ CreateReference(theStudy,
+ aGroup->myEntry,
+ aFamily->myEntry);
+ }
+ }
+ }else if(!theIsAtOnce)
+ RemoveSObject(theStudy,
+ aMesh->myGroupsEntry);
+ }
+
+ ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
+ }
+
+
+ //----------------------------------------------------------------------------
+ void
+ BuildFields(Result_i* theResult,
+ Result_i::PInput theInput,
+ CORBA::Boolean* theIsDone,
+ CORBA::Boolean theIsBuild,
+ CORBA::Boolean theIsAtOnce,
+ _PTR(Study) theStudy)
+ {
+ if(!theIsBuild || *theIsDone)
+ return;
+
+ TTimerLog aTimerLog(MYTIMEDEBUG,"Result_i::BuildFields");
+ TResultManager aResultManager(theResult);
+ TTransactionManager aTransactionManager(theStudy);
+
+ {
+ TTimerLog aTimerLog(MYTIMEDEBUG,"theInput->BuildFields");
+ theInput->BuildFields();
+ }
+
+ QString aComment,aTmp;
+ const TMeshMap& aMeshMap = theInput->GetMeshMap();
+ TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
+
+ for(; aMeshMapIter != aMeshMap.end(); aMeshMapIter++)
+ {
+ const string& aMeshName = aMeshMapIter->first;
+ const PMesh& aMesh = aMeshMapIter->second;
+
+ const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
+ if(aMeshOnEntityMap.empty())
+ continue;
+
+ //Import fields
+ bool anIsFieldsEntryUpdated = false;
+ TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
+
+ for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++)
+ {
+ const TEntity& anEntity = aMeshOnEntityMapIter->first;
+ const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
+ const TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+ TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
+
+ for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++)
+ {
+ if(!anIsFieldsEntryUpdated)
+ {
+ aComment = "";
+ aComment.append("myComment=FIELDS;");
+ aComment.append("myMeshName=");aComment.append(aMeshName);
+
+ CreateAttributes(theStudy,
+ aMesh->myFieldsEntry,
+ NO_ICON,
+ NO_IOR,
+ "Fields",
+ NO_PERFSITENT_REF,
+ aComment.latin1(),
+ false);
+
+ anIsFieldsEntryUpdated = true;
+ }
+
+ const string& aFieldName = aFieldMapIter->first;
+ const PField& aField = aFieldMapIter->second;
+ const TValField& aValField = aField->myValField;
+ QString aFieldNameWithUnit = GenerateFieldName(aFieldName,aField->myUnitNames[0]);
+ aComment.sprintf("myComment=FIELD;myMeshName=%s;myEntityId=%d;myName=%s;myNbTimeStamps=%d;myNumComponent=%d",
+ aMeshName.c_str(),
+ anEntity,
+ aFieldName.c_str(),
+ aValField.size(),
+ aField->myNbComp);
+
+ aField->myEntry = CreateAttributes(theStudy,
+ aMesh->myFieldsEntry,
+ NO_ICON,
+ NO_IOR,
+ aFieldNameWithUnit.latin1(),
+ NO_PERFSITENT_REF,
+ aComment.latin1(),
+ true);
+
+ CreateReference(theStudy,
+ aField->myEntry,
+ aMeshOnEntity->myEntry);
+
+ TValField::const_iterator aValFieldIter = aValField.begin();
+
+ for(; aValFieldIter != aValField.end(); aValFieldIter++)
+ {
+ int aTimeStamp = aValFieldIter->first;
+ const PValForTime& aValForTime = aValFieldIter->second;
+ aComment.sprintf("myComment=TIMESTAMP;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
+ aMeshName.c_str(),
+ anEntity,
+ aFieldName.c_str(),
+ aTimeStamp,
+ aField->myNbComp);
+
+ string aTimeStampId = VISU_Convertor::GenerateName(aValForTime->myTime);
+
+ aValForTime->myEntry = CreateAttributes(theStudy,
+ aField->myEntry,
+ NO_ICON,
+ NO_IOR,
+ aTimeStampId,
+ NO_PERFSITENT_REF,
+ aComment.latin1(),
+ true);
+ }
+ }
+ }
+
+ if(!anIsFieldsEntryUpdated && !theIsAtOnce)
+ RemoveSObject(theStudy, aMesh->myFieldsEntry);
+ }
+
+ ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
+ }
+
+
+ //----------------------------------------------------------------------------
+ void
+ BuildMinMax(Result_i* theResult,
+ Result_i::PInput theInput,
+ CORBA::Boolean* theIsDone,
+ CORBA::Boolean theIsBuild)
+ {
+ if(!theIsBuild || *theIsDone)
+ return;
+
+ TTimerLog aTimerLog(MYTIMEDEBUG,"Result_i::BuildMinMax");
+ TResultManager aResultManager(theResult);
+
+ theInput->BuildMinMax();
+
+ *theIsDone = true;
+
+ theResult->UpdateObservers();
+ }
+
+
+ //----------------------------------------------------------------------------
+ void
+ BuildFieldDataTree(Result_i* theResult,
+ Result_i::PInput theInput,
+ CORBA::Boolean* theIsFieldsDone,
+ CORBA::Boolean theIsBuildFields,
+ CORBA::Boolean* theIsMinMaxDone,
+ CORBA::Boolean theIsBuildMinMax,
+ _PTR(Study) theStudy)
+ {
+ BuildFields(theResult,
+ theInput,
+ theIsFieldsDone,
+ theIsBuildFields,
+ false,
+ theStudy);
+
+ BuildMinMax(theResult,
+ theInput,
+ theIsMinMaxDone,
+ theIsBuildMinMax);
+ }
+
+
+ //----------------------------------------------------------------------------
+}
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File : VISU_ResultUtils.hh
+// Author : Alexey PETROV
+// Module : VISU
+
+#ifndef __VISU_RESULT_UTILS_H__
+#define __VISU_RESULT_UTILS_H__
+
+#include "VISU_Result_i.hh"
+#include "SALOME_Event.hxx"
+
+#include <set>
+
+namespace VISU
+{
+ //----------------------------------------------------------------------------
+ struct TUpdateObjBrowser: public SALOME_Event
+ {
+ int myStudyId;
+ CORBA::Boolean* myIsDone;
+ TUpdateObjBrowser(const int theStudyId, CORBA::Boolean* theIsDone);
+
+ virtual
+ void
+ Execute();
+ };
+
+
+ //----------------------------------------------------------------------------
+ QString
+ GenerateName(const std::string& theName);
+
+
+ //----------------------------------------------------------------------------
+ void
+ BuildEntities(Result_i* theResult,
+ Result_i::PInput theInput,
+ CORBA::Boolean* theIsDone,
+ const std::string& theResultEntry,
+ CORBA::Boolean theIsAtOnce,
+ CORBA::Boolean theIsBuildGroups,
+ CORBA::Boolean theIsBuildFields,
+ CORBA::Boolean theIsBuildParts,
+ _PTR(Study) theStudy);
+
+
+ //----------------------------------------------------------------------------
+ void
+ BuildGroups(Result_i* theResult,
+ Result_i::PInput theInput,
+ CORBA::Boolean* theIsDone,
+ CORBA::Boolean theIsBuild,
+ CORBA::Boolean theIsAtOnce,
+ _PTR(Study) theStudy);
+
+
+ //----------------------------------------------------------------------------
+ void
+ BuildFields(Result_i* theResult,
+ Result_i::PInput theInput,
+ CORBA::Boolean* theIsDone,
+ CORBA::Boolean theIsBuild,
+ CORBA::Boolean theIsAtOnce,
+ _PTR(Study) theStudy);
+
+
+ //----------------------------------------------------------------------------
+ void
+ BuildMinMax(Result_i* theResult,
+ Result_i::PInput theInput,
+ CORBA::Boolean* theIsDone,
+ CORBA::Boolean theIsBuild);
+
+
+ //----------------------------------------------------------------------------
+ void
+ BuildFieldDataTree(Result_i* theResult,
+ Result_i::PInput theInput,
+ CORBA::Boolean* theIsFieldsDone,
+ CORBA::Boolean theIsBuildFields,
+ CORBA::Boolean* theIsMinMaxDone,
+ CORBA::Boolean theIsBuildMinMax,
+ _PTR(Study) theStudy);
+
+ //----------------------------------------------------------------------------
+}
+
+
+#endif // __VISU_RESULT_UTILS_H__
// Author : Alexey PETROV
// Module : VISU
-#include "VISU_Result_i.hh"
+#include "VISU_MultiResult_i.hh"
+#include "VISU_ResultUtils.hh"
#include "VISU_Convertor_impl.hxx"
#include "VISU_CorbaMedConvertor.hxx"
#include "SalomeApp_Study.h"
#include "SalomeApp_Application.h"
-#include <boost/thread/recursive_mutex.hpp>
#include <boost/thread/thread.hpp>
-
-#include <boost/thread/mutex.hpp>
#include <boost/bind.hpp>
// QT Includes
// OCCT Includes
#include <Bnd_Box.hxx>
-#ifdef ENABLE_MULTIPR
-// MULTIPR
-#include "MULTIPR_Obj.hxx"
-#endif
-
-using namespace VISU;
-using namespace std;
#ifdef _DEBUG_
static int MYDEBUG = 1;
-static int MYTIMEDEBUG = 0;
#else
static int MYDEBUG = 0;
-static int MYTIMEDEBUG = 0;
#endif
{
//---------------------------------------------------------------
Result_var
- FindResult (SALOMEDS::SObject_ptr theSObject)
+ FindResult(SALOMEDS::SObject_ptr theSObject)
{
SALOMEDS::SComponent_var aSComponent = theSObject->GetFatherComponent();
SALOMEDS::SObject_var aFather = theSObject->GetFather();
//---------------------------------------------------------------
- typedef boost::recursive_mutex TMutex;
- typedef TMutex::scoped_lock TLock;
-
- static TMutex myMutex;
-
- //---------------------------------------------------------------
- struct TGetStudy: public SALOME_Event
- {
- typedef _PTR(Study) TResult;
- TResult myResult;
- int myStudyId;
-
- TGetStudy(const int theStudyId):
- myStudyId(theStudyId)
- {}
-
- virtual
- void
- Execute()
- {
- SUIT_Session* aSession = SUIT_Session::session();
- QPtrList<SUIT_Application> anApplications = aSession->applications();
- QPtrListIterator<SUIT_Application> anIter (anApplications);
- while (SUIT_Application* aSApp = anIter.current()) {
- if(SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(aSApp)){
- if(SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(anApp->activeStudy())) {
- if(_PTR(Study) aStudyDS = aStudy->studyDS()){
- if(aStudyDS->StudyId() == myStudyId){
- myResult = aStudy->studyDS();
- break;
- }
- }
- }
- }
- ++anIter;
- }
- }
- };
-
-
- //---------------------------------------------------------------
- QString
- GenerateName (const std::string& theName)
- {
- TLock aLock(myMutex);
-
- typedef map<string,int> TNameMap;
- static TNameMap aMap;
-
- TNameMap::const_iterator i = aMap.find(theName);
- QString tmp;
- if (i == aMap.end()) {
- aMap[theName] = 0;
- tmp = theName;
- } else {
- tmp = GenerateName(theName,++aMap[theName]);
- }
- if(MYDEBUG) MESSAGE("GenerateName - "<<tmp<<" from - "<<theName<<"; " <<aMap[theName]);
- return tmp;
- }
-
-
- //---------------------------------------------------------------
- QString
- GenerateFieldName (const string& theName, const string& theUnits)
- {
- QString aName;
- const string tmp (theUnits.size(),' ');
- if (theUnits == "" || theUnits == tmp)
- aName.sprintf("%s, -",theName.c_str());
- else
- aName.sprintf("%s, %s",theName.c_str(),theUnits.c_str());
- aName = aName.simplifyWhiteSpace();
- return aName.latin1();
- }
-
-
- //---------------------------------------------------------------
- string
+ std::string
GetComponentDataType (SALOMEDS::SObject_ptr theSObject)
{
SALOMEDS::SComponent_var aCompRefSObj = theSObject->GetFatherComponent();
}
- //---------------------------------------------------------------
- void
- CreateReference (_PTR(Study) theStudyDocument,
- const string& theFatherEntry,
- const string& theRefEntry)
- {
- TLock aLock(myMutex);
-
- _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
- _PTR(SObject) aFather = theStudyDocument->FindObjectID(theFatherEntry);
- _PTR(SObject) aNewObj = aStudyBuilder->NewObject(aFather);
- _PTR(SObject) aRefSObj = theStudyDocument->FindObjectID(theRefEntry);
- aStudyBuilder->Addreference(aNewObj,aRefSObj);
- }
-
-
- //---------------------------------------------------------------
- inline
- std::string
- CreateAttributes(_PTR(Study) theStudyDocument,
- const string& theFatherEntry,
- const string& theIOR,
- const string& theName,
- const string& theComment,
- CORBA::Boolean theCreateNew,
- const string& theIcon = "")
- {
- TLock aLock(myMutex);
-
- _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
- _PTR(SObject) aFather = theStudyDocument->FindObjectID(theFatherEntry);
-
- _PTR(SObject) aNewObj;
- if(theCreateNew)
- aNewObj = aStudyBuilder->NewObject(aFather);
- else
- aNewObj = aFather;
-
- _PTR(GenericAttribute) anAttr;
- if (theIOR != "") {
- anAttr = aStudyBuilder->FindOrCreateAttribute(aNewObj, "AttributeIOR");
- _PTR(AttributeIOR) anIOR (anAttr);
- anIOR->SetValue(theIOR);
- }
- if (theName != "") {
- anAttr = aStudyBuilder->FindOrCreateAttribute(aNewObj, "AttributeName");
- _PTR(AttributeName) aName (anAttr);
- aName->SetValue(theName);
- }
- if (theComment != "") {
- anAttr = aStudyBuilder->FindOrCreateAttribute(aNewObj, "AttributeString");
- _PTR(AttributeString) aCmnt (anAttr);
- aCmnt->SetValue(theComment);
- }
- // MULTIPR
- if (theIcon != "") {
- anAttr = aStudyBuilder->FindOrCreateAttribute(aNewObj, "AttributePixMap");
- _PTR(AttributePixMap) aPixmap (anAttr);
- aPixmap->SetPixMap(theIcon.c_str());
- }
- return aNewObj->GetID();
- }
-
-
- //---------------------------------------------------------------
- inline
- void
- UpdateAttributes(_PTR(Study) theStudyDocument,
- const string& theEntry,
- const string& theIOR,
- const string& theName,
- const string& theComment)
- {
- TLock aLock(myMutex);
-
- _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
- _PTR(SObject) aSObject = theStudyDocument->FindObjectID(theEntry);
-
- _PTR(GenericAttribute) anAttr;
- if (theIOR != "") {
- anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeIOR");
- _PTR(AttributeIOR) anIOR (anAttr);
- anIOR->SetValue(theIOR);
- }
- if (theName != "") {
- anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeName");
- _PTR(AttributeName) aName (anAttr);
- aName->SetValue(theName);
- }
- if (theComment != "") {
- anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeString");
- _PTR(AttributeString) aCmnt (anAttr);
- aCmnt->SetValue(theComment);
- }
- }
-
-
- //---------------------------------------------------------------
- inline
- void
- RemoveSObject(_PTR(Study) theStudyDocument,
- const string& theEntry)
- {
- TLock aLock(myMutex);
-
- _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
- _PTR(SObject) aSObject = theStudyDocument->FindObjectID(theEntry);
- aStudyBuilder->RemoveObject(aSObject);
- }
-
-
- //---------------------------------------------------------------
- struct TResultManager
- {
- Result_i* myResult;
-
- TResultManager(Result_i* theResult):
- myResult(theResult)
- {
- myResult->Register();
- }
-
- ~TResultManager()
- {
- myResult->Destroy();
- }
- };
-
-
- //---------------------------------------------------------------
- struct TTransactionManager
- {
- _PTR(StudyBuilder) myStudyBuilder;
-
- TTransactionManager(_PTR(Study) theStudyDocument):
- myStudyBuilder(theStudyDocument->NewBuilder())
- {
- TLock aLock(myMutex);
- myStudyBuilder->NewCommand();
- }
-
- ~TTransactionManager()
- {
- TLock aLock(myMutex);
- myStudyBuilder->CommitCommand();
- }
- };
-
-
- //---------------------------------------------------------------
- struct TUpdateObjBrowser: public SALOME_Event
- {
- int myStudyId;
- CORBA::Boolean* myIsDone;
- TUpdateObjBrowser(const int theStudyId,
- CORBA::Boolean* theIsDone):
- myStudyId(theStudyId),
- myIsDone(theIsDone)
- {}
-
- virtual
- void
- Execute()
- {
- TLock aLock(myMutex);
- SUIT_Session* aSession = SUIT_Session::session();
- QPtrList<SUIT_Application> anApplications = aSession->applications();
- QPtrListIterator<SUIT_Application> anIter (anApplications);
- while (SUIT_Application* aSApp = anIter.current()) {
- if(SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(aSApp)){
- if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(anApp->activeStudy())) {
- if (_PTR(Study) aCStudy = aStudy->studyDS()) {
- if (myStudyId == aCStudy->StudyId()) {
- TTimerLog aTimerLog(MYTIMEDEBUG,"Result_i::updateObjectBrowser");
- anApp->updateObjectBrowser();
- *myIsDone = true;
- break;
- }
- }
- }
- }
- ++anIter;
- }
- }
- };
-
-
- //---------------------------------------------------------------
- void
- BuildEntities(Result_i* theResult,
- VISU_Convertor* theInput,
- CORBA::Boolean* theIsDone,
- std::string theResultEntry,
- CORBA::Boolean theIsAtOnce,
- CORBA::Boolean theIsBuildGroups,
- CORBA::Boolean theIsBuildFields,
- _PTR(Study) theStudy)
- {
- if(*theIsDone)
- return;
-
- TTimerLog aTimerLog(MYTIMEDEBUG,"Result_i::BuildEntities");
- TResultManager aResultManager(theResult);
- TTransactionManager aTransactionManager(theStudy);
-
- {
- TTimerLog aTimerLog(MYTIMEDEBUG,"theInput->BuildEntities");
- theInput->BuildEntities();
- }
-
- QString aComment,aTmp;
- const TMeshMap& aMeshMap = theInput->GetMeshMap();
- TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
- for(; aMeshMapIter != aMeshMap.end(); aMeshMapIter++){
- const string& aMeshName = aMeshMapIter->first;
- const PMesh& aMesh = aMeshMapIter->second;
- const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
- if(aMeshOnEntityMap.empty())
- continue;
- aComment.sprintf("myComment=MESH;myName=%s;myDim=%d",
- aMeshName.c_str(),
- aMesh->myDim);
- aMesh->myEntry =
- CreateAttributes(theStudy,
- theResultEntry,
- "",
- aMeshName,
- aComment.latin1(),
- true);
-
- aComment.sprintf("myComment=FAMILIES;myMeshName=%s",
- aMeshName.c_str());
- string aSubMeshesEntry =
- CreateAttributes(theStudy,
- aMesh->myEntry,
- "",
- "Families",
- aComment.latin1(),
- true);
-
- if(theIsBuildGroups){
- aMesh->myGroupsEntry =
- CreateAttributes(theStudy,
- aMesh->myEntry,
- "",
- "",
- "",
- true);
- }
-
- if(theIsBuildFields){
- aMesh->myFieldsEntry =
- CreateAttributes(theStudy,
- aMesh->myEntry,
- "",
- "",
- "",
- true);
- }
-
-#ifdef ENABLE_MULTIPR
- // MULTIPR
- aMesh->myPartsEntry =
- CreateAttributes(theStudy,
- aMesh->myEntry,
- "",
- "",
- "",
- true);
-#endif
-
- //Import entities
- TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
- for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
- const TEntity& anEntity = aMeshOnEntityMapIter->first;
- const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
-
- string anEntityName;
- switch(anEntity){
- case NODE_ENTITY:
- anEntityName = "onNodes";
- break;
- case EDGE_ENTITY:
- anEntityName = "onEdges";
- break;
- case FACE_ENTITY:
- anEntityName = "onFaces";
- break;
- case CELL_ENTITY:
- anEntityName = "onCells";
- break;
- default:
- continue;
- }
-
- aComment.sprintf("myComment=ENTITY;myMeshName=%s;myId=%d",
- aMeshName.c_str(),
- anEntity);
-
- aMeshOnEntity->myEntry =
- CreateAttributes(theStudy,
- aSubMeshesEntry,
- "",
- anEntityName.c_str(),
- aComment.latin1(),
- true);
- }
- }
-
- ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
- }
-
- //---------------------------------------------------------------
- void
- BuildGroups(Result_i* theResult,
- VISU_Convertor* theInput,
- CORBA::Boolean* theIsDone,
- CORBA::Boolean theIsBuild,
- CORBA::Boolean theIsAtOnce,
- _PTR(Study) theStudy)
- {
- if(!theIsBuild || *theIsDone)
- return;
-
- TTimerLog aTimerLog(MYTIMEDEBUG,"Result_i::BuildGroups");
- TResultManager aResultManager(theResult);
- TTransactionManager aTransactionManager(theStudy);
-
- {
- TTimerLog aTimerLog(MYTIMEDEBUG,"theInput->BuildGroups");
- theInput->BuildGroups();
- }
-
- QString aComment,aTmp;
- const TMeshMap& aMeshMap = theInput->GetMeshMap();
- TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
- for(; aMeshMapIter != aMeshMap.end(); aMeshMapIter++){
- const string& aMeshName = aMeshMapIter->first;
- const PMesh& aMesh = aMeshMapIter->second;
-
- const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
- if(aMeshOnEntityMap.empty())
- continue;
-
- TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
- for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
- const TEntity& anEntity = aMeshOnEntityMapIter->first;
- const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
-
- const TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
- TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
- for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
- const string& aFamilyName = aFamilyMapIter->first;
- const PFamily& aFamily = aFamilyMapIter->second;
- aComment.sprintf("myComment=FAMILY;myMeshName=%s;myEntityId=%d;myName=%s",
- aMeshName.c_str(),
- anEntity,
- aFamilyName.c_str());
-
- aFamily->myEntry =
- CreateAttributes(theStudy,
- aMeshOnEntity->myEntry,
- "",
- aFamilyName,
- aComment.latin1(),
- true);
- }
- }
- //Importing groups
- const TGroupMap& aGroupMap = aMesh->myGroupMap;
- if(!aGroupMap.empty()){
- aComment.sprintf("myComment=GROUPS;myMeshName=%s",
- aMeshName.c_str());
-
- UpdateAttributes(theStudy,
- aMesh->myGroupsEntry,
- "",
- "Groups",
- aComment.latin1());
-
- TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
- for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
- const string& aGroupName = aGroupMapIter->first;
- const PGroup& aGroup = aGroupMapIter->second;
- aComment.sprintf("myComment=GROUP;myMeshName=%s;myName=%s",
- aMeshName.c_str(),
- aGroupName.c_str());
- aGroup->myEntry =
- CreateAttributes(theStudy,
- aMesh->myGroupsEntry,
- "",
- aGroupName,
- aComment.latin1(),
- true);
- const TFamilySet& aFamilySet = aGroup->myFamilySet;
- TFamilySet::const_iterator aFamilyIter = aFamilySet.begin();
- for(; aFamilyIter != aFamilySet.end(); aFamilyIter++){
- const PFamily& aFamily = *aFamilyIter;
- CreateReference(theStudy,
- aGroup->myEntry,
- aFamily->myEntry);
- }
- }
- }else if(!theIsAtOnce)
- RemoveSObject(theStudy,
- aMesh->myGroupsEntry);
- }
-
- ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
- }
-
-
- //---------------------------------------------------------------
- void BuildFields(
- Result_i* theResult,
- VISU_Convertor* theInput,
- CORBA::Boolean* theIsDone,
- CORBA::Boolean theIsBuild,
- CORBA::Boolean theIsAtOnce,
- _PTR(Study) theStudy)
- {
- if(!theIsBuild || *theIsDone)
- return;
-
- TTimerLog aTimerLog(MYTIMEDEBUG,"Result_i::BuildFields");
- TResultManager aResultManager(theResult);
- TTransactionManager aTransactionManager(theStudy);
-
- {
- TTimerLog aTimerLog(MYTIMEDEBUG,"theInput->BuildFields");
- theInput->BuildFields();
- }
-
- QString aComment,aTmp;
- const TMeshMap& aMeshMap = theInput->GetMeshMap();
- TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
-
- for(; aMeshMapIter != aMeshMap.end(); aMeshMapIter++)
- {
- const string& aMeshName = aMeshMapIter->first;
- const PMesh& aMesh = aMeshMapIter->second;
-
- const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
- if(aMeshOnEntityMap.empty())
- continue;
-
- //Import fields
- bool anIsFieldsEntryUpdated = false;
- TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
-
- for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++)
- {
- const TEntity& anEntity = aMeshOnEntityMapIter->first;
- const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
- const TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
- TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
-
- for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++)
- {
- if(!anIsFieldsEntryUpdated)
- {
- aComment = "";
- aComment.append("myComment=FIELDS;");
- aComment.append("myMeshName=");aComment.append(aMeshName);
-
- UpdateAttributes(
- theStudy,
- aMesh->myFieldsEntry,
- "",
- "Fields",
- aComment.latin1());
-
- anIsFieldsEntryUpdated = true;
- }
-
- const string& aFieldName = aFieldMapIter->first;
- const PField& aField = aFieldMapIter->second;
- const TValField& aValField = aField->myValField;
- QString aFieldNameWithUnit = GenerateFieldName(aFieldName,aField->myUnitNames[0]);
- aComment.sprintf("myComment=FIELD;myMeshName=%s;myEntityId=%d;myName=%s;myNbTimeStamps=%d;myNumComponent=%d",
- aMeshName.c_str(),
- anEntity,
- aFieldName.c_str(),
- aValField.size(),
- aField->myNbComp);
-
- aField->myEntry = CreateAttributes(
- theStudy,
- aMesh->myFieldsEntry,
- "",
- aFieldNameWithUnit.latin1(),
- aComment.latin1(),
- true);
-
- CreateReference(
- theStudy,
- aField->myEntry,
- aMeshOnEntity->myEntry);
-
- TValField::const_iterator aValFieldIter = aValField.begin();
-
- for(; aValFieldIter != aValField.end(); aValFieldIter++)
- {
- int aTimeStamp = aValFieldIter->first;
- const PValForTime& aValForTime = aValFieldIter->second;
- aComment.sprintf("myComment=TIMESTAMP;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
- aMeshName.c_str(),
- anEntity,
- aFieldName.c_str(),
- aTimeStamp,
- aField->myNbComp);
-
- string aTimeStampId = VISU_Convertor::GenerateName(aValForTime->myTime);
-
- aValForTime->myEntry = CreateAttributes(
- theStudy,
- aField->myEntry,
- "",
- aTimeStampId,
- aComment.latin1(),
- true);
- }
- }
- }
-
- if(!anIsFieldsEntryUpdated && !theIsAtOnce)
- RemoveSObject(theStudy, aMesh->myFieldsEntry);
- }
-
- ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
- }
-
-
-#ifdef ENABLE_MULTIPR
- // MULTIPR
- void BuildParts (Result_i* theResult,
- VISU_Convertor* theInput,
- CORBA::Boolean* theIsDone,
- CORBA::Boolean theIsBuild,
- CORBA::Boolean theIsAtOnce,
- _PTR(Study) theStudy)
- {
- if(!theIsBuild || *theIsDone)
- return;
-
- // if MED file is not a distributed MED file (created with MULTIPR),
- // then it is not necessary to build parts
- if (theResult->GetFileInfoMultipr().filePath().isEmpty())
- return;
-
- try
- {
- multipr::Obj multiprObj;
- multiprObj.create(theResult->GetFileInfoMultipr().filePath().latin1());
- if (multiprObj.isValidDistributedMEDFile())
- {
- theResult->SetIsDistributedMEDMultipr(true);
-
- const TMeshMap& aMeshMap = theInput->GetMeshMap();
- TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
- const PMesh& aMesh = aMeshMapIter->second;
-
- vector<string> listParts = multiprObj.getParts();
-
- QString aComment = "Sub-parts: #";
- aComment += QString::number(listParts.size());
-
- UpdateAttributes(
- theStudy,
- aMesh->myPartsEntry,
- "",
- "Parts",
- aComment.latin1());
-
- string lastEntry;
-
- for (unsigned i = 0 ; i < listParts.size() ; i++)
- {
- const char* strItem = listParts[i].c_str();
- const char* strPartInfo = multiprObj.getPartInfo(strItem).c_str();
-
- char lMeshName[256];
- int lId;
- char lPartName[256];
- char lPath[256];
- char lMEDFileName[256];
-
- // parse infos
- sscanf(strPartInfo, "%s %d %s %s %s",
- lMeshName,
- &lId,
- lPartName,
- lPath,
- lMEDFileName);
-
- if ((strstr(lPartName,"_MED") != NULL) || (strstr(lPartName,"_LOW") != NULL))
- {
- QString aComment = "";
- aComment.append("myComment=PART;");
- aComment.append("res=ML;");
- aComment.append("file=");
- aComment.append(lMEDFileName);
-
- CreateAttributes(
- theStudy,
- lastEntry, // father
- "",
- lPartName,
- aComment.latin1(),
- true);
- }
- else
- {
- QString aComment = "";
- QString icon = "";
-
- if (i != listParts.size()-1)
- {
- const char* strItemNext = listParts[i+1].c_str();
- const char* strPartInfoNext = multiprObj.getPartInfo(strItemNext).c_str();
- if ((strstr(strPartInfoNext,"_MED") != NULL) || (strstr(strPartInfoNext,"_LOW") != NULL))
- {
- // next part is MED or LOW resolution
- icon = "ICON_MULTIPR_VIEW_LOW";
- theResult->SetResolutionMultipr(lPartName, 'L');
-
- aComment.append("myComment=PART;");
- aComment.append("res=FML;");
- aComment.append("file=");
- aComment.append(lMEDFileName);
- }
- else
- {
- // no resolution associated with this part
- icon = "ICON_MULTIPR_VIEW_FULL";
- theResult->SetResolutionMultipr(lPartName, 'F');
-
- aComment.append("myComment=PART;");
- aComment.append("res=F;");
- aComment.append("file=");
- aComment.append(lMEDFileName);
- }
- }
- else
- {
- // last part
- icon = "ICON_MULTIPR_VIEW_FULL";
- theResult->SetResolutionMultipr(lPartName, 'F');
-
- aComment.append("myComment=PART;");
- aComment.append("res=FML;");
- aComment.append("file=");
- aComment.append(lMEDFileName);
- }
-
- lastEntry = CreateAttributes(
- theStudy,
- aMesh->myPartsEntry, // father
- "",
- lPartName,
- aComment.latin1(),
- true,
- icon.latin1());
- }
-
- theResult->AddPartMultipr(lPartName, lMEDFileName);
- }
- }
- else
- {
- // invalid distributed MED file
- return;
- }
- }
- catch (...)
- {
- throw std::runtime_error("error while reading distributed MED file");
- }
-
- ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
- }
-#endif
-
-
- //---------------------------------------------------------------
- void
- BuildMinMax(Result_i* theResult,
- VISU_Convertor* theInput,
- CORBA::Boolean* theIsDone,
- CORBA::Boolean theIsBuild,
- Result_i::TUpdateMinMaxSignal* theUpdateMinMaxSignal)
- {
- if(!theIsBuild || *theIsDone)
- return;
-
- TTimerLog aTimerLog(MYTIMEDEBUG,"Result_i::BuildMinMax");
- TResultManager aResultManager(theResult);
-
- theInput->BuildMinMax();
-
- *theIsDone = true;
-
- (*theUpdateMinMaxSignal)();
- }
-
-
- //---------------------------------------------------------------
- void
- BuildFieldDataTree(Result_i* theResult,
- VISU_Convertor* theInput,
- CORBA::Boolean* theIsFieldsDone,
- CORBA::Boolean theIsBuildFields,
- CORBA::Boolean* theIsMinMaxDone,
- CORBA::Boolean theIsBuildMinMax,
- Result_i::TUpdateMinMaxSignal* theUpdateMinMaxSignal,
- _PTR(Study) theStudy)
- {
- BuildFields(theResult,
- theInput,
- theIsFieldsDone,
- theIsBuildFields,
- false,
- theStudy);
-
- BuildMinMax(theResult,
- theInput,
- theIsMinMaxDone,
- theIsBuildMinMax,
- theUpdateMinMaxSignal);
- }
-
-
- //---------------------------------------------------------------
- struct TBuildArgs
- {
- Result_i* myResult;
- VISU_Convertor* myInput;
- CORBA::Boolean* myIsEntitiesDone;
- std::string myResultEntry;
- CORBA::Boolean* myIsFieldsDone;
- CORBA::Boolean myIsBuildFields;
- CORBA::Boolean* myIsMinMaxDone;
- CORBA::Boolean myIsBuildMinMax;
- Result_i::TUpdateMinMaxSignal* myUpdateMinMaxSignal;
- CORBA::Boolean* myIsGroupsDone;
- CORBA::Boolean myIsBuildGroups;
-#ifdef ENABLE_MULTIPR
- CORBA::Boolean* myIsPartsDone;
- CORBA::Boolean myIsBuildParts;
-#endif
- _PTR(Study) myStudy;
-
- TBuildArgs(Result_i* theResult,
- VISU_Convertor* theInput,
- CORBA::Boolean* theIsEntitiesDone,
- std::string theResultEntry,
- CORBA::Boolean* theIsFieldsDone,
- CORBA::Boolean theIsBuildFields,
- CORBA::Boolean* theIsMinMaxDone,
- CORBA::Boolean theIsBuildMinMax,
- Result_i::TUpdateMinMaxSignal* theUpdateMinMaxSignal,
- CORBA::Boolean* theIsGroupsDone,
- CORBA::Boolean theIsBuildGroups,
-#ifdef ENABLE_MULTIPR
- CORBA::Boolean* theIsPartsDone,
- CORBA::Boolean theIsBuildParts,
-#endif
- _PTR(Study) theStudy):
- myResult(theResult),
- myInput(theInput),
- myIsEntitiesDone(theIsEntitiesDone),
- myResultEntry(theResultEntry),
- myIsFieldsDone(theIsFieldsDone),
- myIsBuildFields(theIsBuildFields),
- myIsMinMaxDone(theIsMinMaxDone),
- myIsBuildMinMax(theIsBuildMinMax),
- myUpdateMinMaxSignal(theUpdateMinMaxSignal),
- myIsGroupsDone(theIsGroupsDone),
- myIsBuildGroups(theIsBuildGroups),
-#ifdef ENABLE_MULTIPR
- myIsPartsDone(theIsPartsDone),
- myIsBuildParts(theIsBuildParts),
-#endif
- myStudy(theStudy)
- {}
- };
-
- //---------------------------------------------------------------
- void
- BuildDataTree(TBuildArgs theBuildArgs)
- {
- BuildEntities(theBuildArgs.myResult,
- theBuildArgs.myInput,
- theBuildArgs.myIsEntitiesDone,
- theBuildArgs.myResultEntry,
- false,
- theBuildArgs.myIsBuildGroups,
- theBuildArgs.myIsBuildFields,
- theBuildArgs.myStudy);
-
- {
- boost::thread aThread(boost::bind(&BuildGroups,
- theBuildArgs.myResult,
- theBuildArgs.myInput,
- theBuildArgs.myIsGroupsDone,
- theBuildArgs.myIsBuildGroups,
- false,
- theBuildArgs.myStudy));
- }
- {
- boost::thread aThread(boost::bind(&BuildFieldDataTree,
- theBuildArgs.myResult,
- theBuildArgs.myInput,
- theBuildArgs.myIsFieldsDone,
- theBuildArgs.myIsBuildFields,
- theBuildArgs.myIsMinMaxDone,
- theBuildArgs.myIsBuildMinMax,
- theBuildArgs.myUpdateMinMaxSignal,
- theBuildArgs.myStudy));
- }
-
- /*
- // MULTIPR
- BuildParts(theBuildArgs.myResult,
- theBuildArgs.myInput,
- theBuildArgs.myIsPartsDone,
- theBuildArgs.myIsBuildParts,
- false,
- theBuildArgs.myStudy);
- */
- }
-}
-
-
//---------------------------------------------------------------
-VISU::MinMaxCunsomer
-::MinMaxCunsomer():
- myMinMaxIsInitilized(false)
-{}
-
-bool
-VISU::MinMaxCunsomer
-::IsMinMaxInitilized()
-{
- return myMinMaxIsInitilized;
-}
-
-void
-VISU::MinMaxCunsomer
-::UpdateMinMax()
-{
- myMinMaxIsInitilized = true;
}
myIsBuildFields(theIsBuildFields),
myIsBuildMinMax(theIsBuildMinMax),
myIsBuildGroups(theIsBuildGroups),
-#ifdef ENABLE_MULTIPR
- myIsBuildParts(true),
-#endif
myIsEntitiesDone(false),
myIsFieldsDone(false),
myIsGroupsDone(false),
myIsMinMaxDone(false),
-#ifdef ENABLE_MULTIPR
- myIsPartsDone(false),
-#endif
myIsAllDone(false),
- myInput(NULL)
+ myIsBuildParts(false),
+ myIsPartsDone(false)
{
- myStudy = ProcessEvent(new TGetStudy(myStudyDocument->StudyId()));
-#ifdef ENABLE_MULTIPR
- myIsDistributedMEDMultipr = false;
-#endif
+ myStudy = VISU::GetStudy(myStudyDocument);
}
//---------------------------------------------------------------
void
VISU::Result_i
-::MinMaxConnect(VISU::MinMaxCunsomer* theMinMaxCunsomer)
+::ConnectObserver(TResultObserver* theObserver,
+ boost::signalslib::connection& theConnection)
{
- myUpdateMinMaxSignal.connect(boost::bind(&MinMaxCunsomer::UpdateMinMax,theMinMaxCunsomer));
+ if(theConnection.connected())
+ theConnection.disconnect();
+
+ theConnection =
+ myUpdateObserverSignal.connect(boost::bind(boost::bind(&TResultObserver::UpdateFromResult,
+ theObserver,
+ _1),
+ this));
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::Result_i
+::UpdateObservers()
+{
+ myUpdateObserverSignal();
}
if(theIsBuildAll)
theIsAtOnce = true;
- if(Build(SALOMEDS::SObject::_nil(),theIsAtOnce)){
+ if(Build(SALOMEDS::SObject::_nil(), theIsAtOnce)){
// Set icon
SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder();
GetComment(),
myFileInfo.filePath().latin1(),
myInitFileName.c_str()); // Restoring of Python dump
- string aResultEntry =
+ std::string aResultEntry =
CreateAttributes(myStudy,
aSComponentEntry.in(),
+ NO_ICON,
anIOR.in(),
myName,
+ NO_PERFSITENT_REF,
aComment.latin1(),
true);
mySObject = myStudyDocument->FindObjectID(aResultEntry.c_str());
if(!CORBA::is_nil(theSObject)){
CORBA::String_var aString = theSObject->GetID();
- CreateReference(myStudyDocument,aResultEntry,aString.in());
+ CreateReference(myStudyDocument, aResultEntry, aString.in());
}
if(theIsAtOnce){
theIsAtOnce,
myIsBuildGroups,
myIsBuildFields,
+ myIsBuildParts,
myStudy);
BuildGroups(this,
BuildMinMax(this,
myInput,
&myIsMinMaxDone,
- myIsBuildMinMax,
- &myUpdateMinMaxSignal);
-
-#ifdef ENABLE_MULTIPR
- // MULTIPR
- BuildParts(this,
- myInput,
- &myIsPartsDone,
- myIsBuildParts,
- theIsAtOnce,
- myStudy);
-#endif
+ myIsBuildMinMax);
}
else {
-#ifdef ENABLE_MULTIPR
- if (strlen(GetFileInfoMultipr().filePath().latin1()) == 0)
-#endif
- {
- // sequential MED file
- TBuildArgs aBuildArgs(this,
- myInput,
- &myIsEntitiesDone,
- aResultEntry,
- &myIsFieldsDone,
- myIsBuildFields,
- &myIsMinMaxDone,
- myIsBuildMinMax,
- &myUpdateMinMaxSignal,
- &myIsGroupsDone,
- myIsBuildGroups,
-#ifdef ENABLE_MULTIPR
- &myIsPartsDone,
- myIsBuildParts,
-#endif
- myStudy);
- boost::thread aThread(boost::bind(&BuildDataTree, aBuildArgs));
- }
-#ifdef ENABLE_MULTIPR
- else
- {
- // distributed MED file
- BuildEntities(this,
- myInput,
- &myIsEntitiesDone,
- aResultEntry,
- theIsAtOnce,
- myIsBuildGroups,
- myIsBuildFields,
- myStudy);
-
- BuildGroups(this,
- myInput,
- &myIsGroupsDone,
- myIsBuildGroups,
- theIsAtOnce,
- myStudy);
-
- BuildFields(this,
- myInput,
- &myIsFieldsDone,
- myIsBuildFields,
- theIsAtOnce,
- myStudy);
-
- BuildMinMax(this,
- myInput,
- &myIsMinMaxDone,
- myIsBuildMinMax,
- &myUpdateMinMaxSignal);
-
- // MULTIPR
- BuildParts(this,
- myInput,
- &myIsPartsDone,
- myIsBuildParts,
- theIsAtOnce,
- myStudy);
- }
-#endif
+ boost::thread aThread(boost::bind(boost::bind(&Result_i::BuildDataTree, this, _1),
+ aResultEntry));
}
return this;
}
+//---------------------------------------------------------------
+void
+VISU::Result_i
+::BuildDataTree(const std::string& theResultEntry)
+{
+ BuildEntities(this,
+ myInput,
+ &myIsEntitiesDone,
+ theResultEntry,
+ false,
+ myIsBuildGroups,
+ myIsBuildFields,
+ myIsBuildParts,
+ myStudy);
+
+ {
+ boost::thread aThread(boost::bind(&BuildGroups,
+ this,
+ myInput,
+ &myIsGroupsDone,
+ myIsBuildGroups,
+ false,
+ myStudy));
+ }
+ {
+ boost::thread aThread(boost::bind(&BuildFieldDataTree,
+ this,
+ myInput,
+ &myIsFieldsDone,
+ myIsBuildFields,
+ &myIsMinMaxDone,
+ myIsBuildMinMax,
+ myStudy));
+ }
+}
+
//---------------------------------------------------------------
VISU::Storable*
VISU::Result_i
{
try {
myFileInfo.setFile(theFileName);
-
-#ifdef ENABLE_MULTIPR
- // MULTIPR
- if (myFileInfo.filePath().endsWith("_grains_maitre.med"))
- {
- // retrieve source MED file (sequential MED file)
- QString originalMEDFileName = "";
- FILE* aFile = fopen(theFileName, "rt");
- char aBuf[1024];
- while (!feof(aFile))
- {
- fgets(aBuf, 1024, aFile);
- char* strTag = NULL;
- if ((aBuf[0] == '#') && ((strTag = strstr(aBuf, "[SOURCE]=")) != NULL))
- {
- char strSequentialMEDFilename[256];
- int ret = sscanf(strTag, "[SOURCE]=%s", strSequentialMEDFilename);
- if (ret == 1)
- {
- originalMEDFileName = strSequentialMEDFilename;
- break;
- }
- }
- }
- fclose(aFile);
- if (originalMEDFileName == "")
- throw std::runtime_error("distributed MED file; bad format");
-
- //cout << "MULTIPR: original med file=" << originalMEDFileName << endl;
- myFileInfoMultipr.setFile(myFileInfo.filePath());
- myFileInfo.setFile(originalMEDFileName);
- }
- else
- {
- myFileInfoMultipr.setFile("");
- }
-#endif
-
myInitFileName = myFileInfo.filePath().latin1();
- myName = ::GenerateName(myFileInfo.fileName()).latin1();
+ myName = VISU::GenerateName(myFileInfo.fileName()).latin1();
if(mySourceId == eRestoredFile){
std::string aTmpDir(SALOMEDS_Tool::GetTmpDir());
static QString aCommand;
myFileInfo.setFile(QString(aTmpDir.c_str()) + myFileInfo.fileName());
}
- myInput = CreateConvertor(myFileInfo.absFilePath().latin1());
+ myInput.reset(CreateConvertor(myFileInfo.absFilePath().latin1()));
if(myInput){
if(myIsBuildImmediately)
{
if(MYDEBUG) MESSAGE("Result_i::Create MedObject from SALOMEDS::SObject_ptr");
try{
- myInput = CreateMEDConvertor(theMedSObject);
- if(myInput == NULL)
+ myInput.reset(CreateMEDConvertor(theMedSObject));
+ if(!myInput)
return NULL;
myInput->Build();
myFileInfo.setFile(aCompDataType.c_str());
myInitFileName = aCompDataType;
- myName = ::GenerateName("aResult").latin1();
+ myName = VISU::GenerateName("aResult").latin1();
return Build(theMedSObject);
}catch(std::exception& exc){
{
if(MYDEBUG) MESSAGE("Result_i::Create MedObject from SALOME_MED::FIELD_ptr");
try{
- myInput = CreateMEDFieldConvertor(theField);
- if(myInput == NULL)
+ myInput.reset(CreateMEDFieldConvertor(theField));
+ if(!myInput)
return NULL;
myInput->Build();
myFileInfo.setFile(aCompDataType.c_str());
myInitFileName = aCompDataType;
- myName = ::GenerateName("aResult").latin1();
+ myName = VISU::GenerateName("aResult").latin1();
CORBA::String_var anIOR = myStudyDocument->ConvertObjectToIOR(theField);
SALOMEDS::SObject_var aFieldSObject = myStudyDocument->FindObjectIOR(anIOR);
SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder();
SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(aEngComp);
aStudyBuilder->LoadWith(aCompRefSObj, aDriver);
- /*
- if (strcmp(aDataType, "MED") == 0){
- // create field or MED converter
- CORBA::Object_var aMedObject = VISU::SObjectToObject(aTargetRefSObj);
- SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(aMedObject);
- if(!CORBA::is_nil(aField))
- myInput = CreateMEDFieldConvertor(aField);
- else
- myInput = CreateMEDConvertor(aTargetRefSObj);
- myInput->Build();
- }else
- throw std::runtime_error("GetInput - There is no convertor for the aDataType !!!");
- //*/
-
// create field or MED converter
CORBA::Object_var aMedObject = VISU::SObjectToObject(aTargetRefSObj);
SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(aMedObject);
if (!CORBA::is_nil(aField)) {
// create field converter
- myInput = CreateMEDFieldConvertor(aField);
+ myInput.reset(CreateMEDFieldConvertor(aField));
myInput->Build();
}
else if (strcmp(aDataType, "MED") == 0) {
// create MED converter
- myInput = CreateMEDConvertor(aTargetRefSObj);
+ myInput.reset(CreateMEDConvertor(aTargetRefSObj));
myInput->Build();
}
else {
mySourceId = eFile;
}
if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - mySourceId = " << mySourceId);
- myInput = CreateConvertor(myFileInfo.filePath().latin1());
+ myInput.reset(CreateConvertor(myFileInfo.filePath().latin1()));
myInput->BuildEntities();
if(myIsBuildFields){
return NULL;
}
+
//---------------------------------------------------------------
-VISU::Result_i::TInput*
+void
VISU::Result_i
-::GetInput()
+::SetResolution(const std::string& theName,
+ TResolutionID theNewResolution)
+{}
+
+
+//---------------------------------------------------------------
+VISU::Result_i::PInput
+VISU::Result_i
+::GetInput(const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber)
{
return myInput;
}
+
//---------------------------------------------------------------
CORBA::Boolean
VISU::Result_i
}
//---------------------------------------------------------------
-void
+VISU::Result_i*
VISU::Result_i
-::ToStream(std::ostringstream& theStr)
+::New(SALOMEDS::Study_ptr theStudy,
+ const ESourceId& theSourceId,
+ const ECreationId& theCreationId,
+ CORBA::Boolean theIsBuildImmediately,
+ CORBA::Boolean theIsBuildFields,
+ CORBA::Boolean theIsBuildMinMax,
+ CORBA::Boolean theIsBuildGroups)
{
- if(MYDEBUG) MESSAGE(GetComment());
- Storable::DataToStream(theStr,"myName",myName.c_str());
- Storable::DataToStream(theStr,"myInitFileName",myInitFileName.c_str());
- Storable::DataToStream(theStr,"myCreationId",myCreationId);
- Storable::DataToStream(theStr,"myIsBuildFields",myIsFieldsDone);
- Storable::DataToStream(theStr,"myIsBuildMinMax",myIsMinMaxDone);
- Storable::DataToStream(theStr,"myIsBuildGroups",myIsGroupsDone);
+ return new RESULT_CLASS_NAME(theStudy,
+ theSourceId,
+ theCreationId,
+ theIsBuildImmediately,
+ theIsBuildFields,
+ theIsBuildMinMax,
+ theIsBuildGroups);
}
CORBA::Boolean anIsBuildMinMax = Storable::FindValue(theMap,"myIsBuildMinMax","1").toInt();
CORBA::Boolean anIsBuildGroups = Storable::FindValue(theMap,"myIsBuildGroups","1").toInt();
- VISU::Result_i* aResult = new VISU::Result_i(aStudy,
- aSourceId,
- aCreationId,
- anIsBuildFields,
- anIsBuildMinMax,
- anIsBuildGroups);
+ VISU::Result_i* aResult = new RESULT_CLASS_NAME(aStudy,
+ aSourceId,
+ aCreationId,
+ anIsBuildFields,
+ anIsBuildMinMax,
+ anIsBuildGroups);
if (aResult == NULL)
return NULL;
- return aResult->Restore(theSObject,theMap,thePrefix);
+ return aResult->Restore(theSObject, theMap, thePrefix);
}
//---------------------------------------------------------------
-string
+void
+VISU::Result_i
+::ToStream(std::ostringstream& theStr)
+{
+ if(MYDEBUG) MESSAGE(GetComment());
+ Storable::DataToStream(theStr,"myName",myName.c_str());
+ Storable::DataToStream(theStr,"myInitFileName",myInitFileName.c_str());
+ Storable::DataToStream(theStr,"myCreationId",myCreationId);
+ Storable::DataToStream(theStr,"myIsBuildFields",myIsFieldsDone);
+ Storable::DataToStream(theStr,"myIsBuildMinMax",myIsMinMaxDone);
+ Storable::DataToStream(theStr,"myIsBuildGroups",myIsGroupsDone);
+}
+
+
+//---------------------------------------------------------------
+const std::string&
+VISU::Result_i
+::GetName() const
+{
+ return myName;
+}
+
+
+const QFileInfo&
+VISU::Result_i
+::GetFileInfo() const
+{
+ return myFileInfo;
+}
+
+
+const std::string&
+VISU::Result_i
+::GetFileName() const
+{
+ return myInitFileName;
+}
+
+
+const VISU::Result_i::ECreationId&
VISU::Result_i
-::GetRefFatherEntry()
+::GetCreationId() const
{
- return "";
+ return myCreationId;
}
+
+//---------------------------------------------------------------
std::string
VISU::Result_i
::GetEntry()
return myStudyDocument;
}
+_PTR(Study)
+VISU::Result_i
+::GetStudy() const
+{
+ return myStudy;
+}
+
const SALOMEDS::SComponent_var&
VISU::Result_i
::GetSComponent() const
res = system(aCommand);
MESSAGE("Result_i::~Result_i - system("<<aCommand<<") = "<<res);
}
- if(myInput) delete myInput;
}
//=======================================================================
//function : GetAxisInfo
//purpose :
//=======================================================================
-const Result_i::TAxisInfo*
-Result_i
+const VISU::Result_i::TAxisInfo*
+VISU::Result_i
::GetAxisInfo(const string& theMeshName,
TAxis theAxis,
gp_Dir& thePlaneNormal)
return components;
}
-
-
-#ifdef ENABLE_MULTIPR
-//=======================================================================
-// MULTIPR
-//=======================================================================
-
-// MULTIPR
-void VISU::Result_i::AddPartMultipr(const char* thePartName, const char* theMEDFilename)
-{
- myMapPartNameToMEDFilename.insert(make_pair(thePartName, theMEDFilename));
-}
-
-// MULTIPR
-void VISU::Result_i::SetResolutionMultipr(const char* theName, char theNewResolution)
-{
- map<string, char>::iterator anIterator = mySelectedResolutionMultipr.find(theName);
-
- if (anIterator == mySelectedResolutionMultipr.end())
- {
- // current name does not exist: create
- mySelectedResolutionMultipr.insert(make_pair(theName, theNewResolution));
- }
- else
- {
- // modify
- (*anIterator).second = theNewResolution;
- }
-}
-
-// MULTIPR
-string VISU::Result_i::FindPartMultipr(const char* theName)
-{
- map<string, string>::iterator anIterator = myMapPartNameToMEDFilename.find(theName);
-
- if (anIterator == myMapPartNameToMEDFilename.end())
- {
- return NULL;
- }
- return (*anIterator).second;
-}
-
-// MULTIPR
-void VISU::Result_i::SetIsDistributedMEDMultipr(bool theIsDistributedMED)
-{
- myIsDistributedMEDMultipr = theIsDistributedMED;
-}
-
-// MULTIPR
-bool VISU::Result_i::IsDistributedMEDMultipr() const
-{
- return myIsDistributedMEDMultipr;
-}
-
-// MULTIPR
-vector<string> VISU::Result_i::GetCurrentRepresentationMultipr()
-{
- // name of selected parts
- vector<string> res;
-
- // for each part of the mesh
- for (map<string, char>::iterator it = mySelectedResolutionMultipr.begin() ;
- it != mySelectedResolutionMultipr.end() ;
- it++)
- {
- const char* partName = ((*it).first).c_str();
- char resolution = (*it).second;
-
- //cout << "name=" << partName << " res=" << resolution << endl;
-
- if (resolution == 'F')
- {
- res.push_back( FindPartMultipr(partName) );
- }
- else if (resolution == 'M')
- {
- char subPartName[256];
- sprintf(subPartName, "%s_MED", partName);
- res.push_back( FindPartMultipr(subPartName) );
- }
- else if (resolution == 'L')
- {
- char subPartName[256];
- sprintf(subPartName, "%s_LOW", partName);
- res.push_back( FindPartMultipr(subPartName) );
- }
- }
-
- return res;
-}
-#endif // ENABLE_MULTIPR
#include "VISU_BoostSignals.h"
#include "SALOME_GenericObj_i.hh"
+#include "SALOME_Event.hxx"
#include "VTKViewer.h"
+#include <boost/shared_ptr.hpp>
#include <gp_Dir.hxx>
#include <vector>
#include <map>
namespace VISU
{
//----------------------------------------------------------------------------
- class VISU_I_EXPORT MinMaxCunsomer: public virtual boost::signalslib::trackable
- {
- protected:
- bool myMinMaxIsInitilized;
- MinMaxCunsomer();
+ class Result_i;
- public:
- virtual
- bool
- IsMinMaxInitilized();
+ //----------------------------------------------------------------------------
+ struct TResultObserver: public virtual boost::signalslib::trackable
+ {
virtual
void
- UpdateMinMax();
+ UpdateFromResult(Result_i* theResult) = 0;
};
//----------------------------------------------------------------------------
class VISU_I_EXPORT Result_i : public virtual POA_VISU::Result,
- public virtual RemovableObject_i,
- public virtual SALOME::GenericObj_i
+ public virtual RemovableObject_i,
+ public virtual SALOME::GenericObj_i
{
Result_i(const Result_i &);
enum ESourceId {eRestoredComponent = -2, eRestoredFile = -1, eFile = 1, eComponent = 2};
enum ECreationId {eImportFile, eCopyAndImportFile, eImportMed, eImportMedField};
- Result_i(SALOMEDS::Study_ptr theStudy,
- const ESourceId& theSourceId,
- const ECreationId& theCreationId,
- CORBA::Boolean theIsBuildImmediately = true,
- CORBA::Boolean theIsBuildFields = true,
- CORBA::Boolean theIsBuildMinMax = true,
- CORBA::Boolean theIsBuildGroups = true);
+ static
+ Result_i*
+ New(SALOMEDS::Study_ptr theStudy,
+ const ESourceId& theSourceId,
+ const ECreationId& theCreationId,
+ CORBA::Boolean theIsBuildImmediately = true,
+ CORBA::Boolean theIsBuildFields = true,
+ CORBA::Boolean theIsBuildMinMax = true,
+ CORBA::Boolean theIsBuildGroups = true);
+
+ virtual
+ void
+ RemoveFromStudy();
- virtual ~Result_i();
- virtual void RemoveFromStudy();
+ virtual
+ VISU::VISUType
+ GetType()
+ {
+ return VISU::TRESULT;
+ }
- virtual VISU::VISUType GetType() { return VISU::TRESULT;}
- virtual CORBA::Boolean BuildAll();
+ virtual
+ CORBA::Boolean
+ BuildAll();
- virtual CORBA::Boolean Build(CORBA::Boolean theIsBuildAll,
- CORBA::Boolean theIsAtOnce);
- virtual CORBA::Boolean IsDone();
+ virtual
+ CORBA::Boolean
+ Build(CORBA::Boolean theIsBuildAll,
+ CORBA::Boolean theIsAtOnce);
- virtual CORBA::Boolean IsEntitiesDone();
+ virtual
+ CORBA::Boolean
+ IsDone();
- virtual void SetBuildFields(CORBA::Boolean theIsBuildFields,
- CORBA::Boolean theIsCalculateMinMax);
- virtual CORBA::Boolean IsFieldsDone();
+ virtual
+ CORBA::Boolean
+ IsEntitiesDone();
- virtual void SetBuildGroups(CORBA::Boolean theIsBuildGroups);
- virtual CORBA::Boolean IsGroupsDone();
+ virtual
+ void
+ SetBuildFields(CORBA::Boolean theIsBuildFields,
+ CORBA::Boolean theIsCalculateMinMax);
- virtual CORBA::Boolean IsMinMaxDone();
+ virtual
+ CORBA::Boolean
+ IsFieldsDone();
+
+ virtual
+ void
+ SetBuildGroups(CORBA::Boolean theIsBuildGroups);
+
+ virtual
+ CORBA::Boolean
+ IsGroupsDone();
+
+ virtual
+ CORBA::Boolean
+ IsMinMaxDone();
virtual
void
- MinMaxConnect(MinMaxCunsomer* theMinMaxCunsomer);
+ UpdateObservers();
- typedef boost::signal0<void> TUpdateMinMaxSignal;
+ virtual
+ void
+ ConnectObserver(TResultObserver* theObserver,
+ boost::signalslib::connection& theConnection);
+
+ typedef boost::signal0<void> TUpdateObserverSignal;
typedef VISU_Convertor TInput;
+ typedef boost::shared_ptr<TInput> PInput;
private:
ESourceId mySourceId;
ECreationId myCreationId;
- TInput *myInput;
- std::string myName, myInitFileName;
+ PInput myInput;
+ std::string myName;
QFileInfo myFileInfo;
-
-#ifdef ENABLE_MULTIPR
- // MULTIPR
- QFileInfo myFileInfoMultipr;
- std::map<std::string, std::string> myMapPartNameToMEDFilename;
- std::map<std::string, char> mySelectedResolutionMultipr;
- bool myIsDistributedMEDMultipr;
-#endif
+ std::string myInitFileName;
protected:
- virtual Storable* Build(SALOMEDS::SObject_ptr theSObject,
- CORBA::Boolean theIsAtOnce = true) ;
- virtual Storable* BuildAll(SALOMEDS::SObject_ptr theSObject) ;
+ Result_i(SALOMEDS::Study_ptr theStudy,
+ const ESourceId& theSourceId,
+ const ECreationId& theCreationId,
+ CORBA::Boolean theIsBuildImmediately = true,
+ CORBA::Boolean theIsBuildFields = true,
+ CORBA::Boolean theIsBuildMinMax = true,
+ CORBA::Boolean theIsBuildGroups = true);
+
+ virtual
+ ~Result_i();
+
+ virtual
+ Storable*
+ Build(SALOMEDS::SObject_ptr theSObject,
+ CORBA::Boolean theIsAtOnce = true) ;
+
+ virtual
+ void
+ BuildDataTree(const std::string& theResultEntry);
+
+ virtual
+ Storable*
+ BuildAll(SALOMEDS::SObject_ptr theSObject) ;
_PTR(Study) myStudy;
CORBA::Boolean myIsBuildImmediately;
CORBA::Boolean myIsEntitiesDone;
- CORBA::Boolean myIsFieldsDone;
- CORBA::Boolean myIsGroupsDone;
- CORBA::Boolean myIsMinMaxDone;
-#ifdef ENABLE_MULTIPR
- CORBA::Boolean myIsPartsDone; // MULTIPR
-#endif
+ CORBA::Boolean myIsFieldsDone;
CORBA::Boolean myIsBuildFields;
+
+ CORBA::Boolean myIsGroupsDone;
CORBA::Boolean myIsBuildGroups;
+ CORBA::Boolean myIsPartsDone;
+ CORBA::Boolean myIsBuildParts;
+
+ CORBA::Boolean myIsMinMaxDone;
CORBA::Boolean myIsBuildMinMax;
-#ifdef ENABLE_MULTIPR
- CORBA::Boolean myIsBuildParts; // MULTIPR
-#endif
- TUpdateMinMaxSignal myUpdateMinMaxSignal;
+ TUpdateObserverSignal myUpdateObserverSignal;
CORBA::Boolean myIsAllDone;
public:
- virtual size_t IsPossible();
+ virtual
+ size_t
+ IsPossible();
+
+ virtual
+ Storable*
+ Create(const char* theFileName);
+
+ virtual
+ Storable*
+ Create(SALOMEDS::SObject_ptr theMedSObject);
+
+ virtual
+ Storable*
+ Create(SALOME_MED::FIELD_ptr theField);
- virtual Storable* Create(const char* theFileName);
- virtual Storable* Create(SALOMEDS::SObject_ptr theMedSObject);
- virtual Storable* Create(SALOME_MED::FIELD_ptr theField);
+ virtual
+ Storable*
+ Restore(SALOMEDS::SObject_ptr theSObject,
+ const Storable::TRestoringMap& theMap,
+ const std::string& thePrefix);
+
+ static
+ Storable*
+ Restore(SALOMEDS::SObject_ptr theSObject,
+ const std::string& thePrefix,
+ const Storable::TRestoringMap& theMap);
- virtual Storable* Restore(SALOMEDS::SObject_ptr theSObject,
- const Storable::TRestoringMap& theMap,
- const std::string& thePrefix);
+ virtual
+ void
+ ToStream(std::ostringstream& theStr);
- static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
- const std::string& thePrefix,
- const Storable::TRestoringMap& theMap);
+ virtual
+ const char*
+ GetComment() const;
- virtual void ToStream(std::ostringstream& theStr);
- virtual const char* GetComment() const;
static const std::string myComment;
- TInput* GetInput();
- const std::string& GetName() const { return myName;}
- const QFileInfo& GetFileInfo() const { return myFileInfo;}
-#ifdef ENABLE_MULTIPR
- const QFileInfo& GetFileInfoMultipr() const { return myFileInfoMultipr;}
-#endif
- const std::string& GetFileName() const { return myInitFileName;}
- const ECreationId& GetCreationId() const { return myCreationId;}
-
-#ifdef ENABLE_MULTIPR
- // MULTIPR
- void AddPartMultipr(const char* thePartName, const char* theMEDFilename);
- void SetResolutionMultipr(const char* theName, char theNewResolution); // 'F'=FULL 'M'=MEDIUM 'L'=LOW 'H'=HIDE
- std::string FindPartMultipr(const char* theName);
- std::vector<std::string> GetCurrentRepresentationMultipr();
- void SetIsDistributedMEDMultipr(bool theIsDistributedMED);
- bool IsDistributedMEDMultipr() const;
-#endif
+ typedef char TResolutionID;
+
+ virtual
+ void
+ SetResolution(const std::string& theName,
+ TResolutionID theNewResolution);
+ virtual
+ PInput
+ GetInput(const std::string& theMeshName = "",
+ VISU::Entity theEntity = VISU::NONE,
+ const std::string& theFieldName = "",
+ CORBA::Long theTimeStampNumber = -1);
+
+ const std::string&
+ GetName() const;
+
+ const QFileInfo&
+ GetFileInfo() const;
+
+ const std::string&
+ GetFileName() const;
+
+ const ECreationId&
+ GetCreationId() const;
+
private:
SALOMEDS::SObject_var mySObject;
SALOMEDS::Study_var myStudyDocument;
SALOMEDS::SComponent_var mySComponent;
public:
- std::string GetRefFatherEntry();
- std::string GetEntry();
- const SALOMEDS::SObject_var& GetSObject() const;
- const SALOMEDS::Study_var& GetStudyDocument() const;
- const SALOMEDS::SComponent_var& GetSComponent() const;
- std::string GetEntry(const Storable::TRestoringMap& theRestoringMap);
+ std::string
+ GetEntry();
+
+ const SALOMEDS::SObject_var&
+ GetSObject() const;
+
+ const SALOMEDS::Study_var&
+ GetStudyDocument() const;
+
+ _PTR(Study)
+ GetStudy() const;
+
+ const SALOMEDS::SComponent_var&
+ GetSComponent() const;
+
+ std::string
+ GetEntry(const Storable::TRestoringMap& theRestoringMap);
// Info on structured mesh contained in TInput
public:
theTimeStampNumber,
false);
if(theIsMemoryCheck && aResult){
- VISU::Result_i::TInput* anInput = theResult->GetInput();
+ VISU::Result_i::PInput anInput = theResult->GetInput();
const VISU::PField aField = anInput->GetField(theMeshName,
(VISU::TEntity)theEntity,
theFieldName);
return;
VISU::TEntity aEntity = VISU::TEntity(theEntity);
- VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
+ VISU::Result_i::PInput anInput = GetCResult()->GetInput();
myScalarField = anInput->GetField(GetCMeshName(), aEntity, theFieldName);
VISU::PUnstructuredGridIDMapper anIDMapper =
try{
if(theResult){
bool anIsEstimated = true;
- VISU::Result_i::TInput* anInput = theResult->GetInput();
+ VISU::Result_i::PInput anInput = theResult->GetInput();
size_t aSize = anInput->GetTimeStampOnMeshSize(theMeshName,
(VISU::TEntity)theEntity,
theFieldName,
VISU::ScalarMap_i
::AddMeshOnGroup(const char* theGroupName)
{
- VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
+ VISU::Result_i::PInput anInput = GetCResult()->GetInput();
VISU::PUnstructuredGridIDMapper anIDMapper = anInput->GetMeshOnGroup(GetCMeshName(), theGroupName);
if(anIDMapper){
int aNbGroups = myGroupNames.size();
VISU::ScalarMap_i
::DoSetInput(bool theIsInitilizePipe, bool theReInit)
{
- VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
+ VISU::Result_i::PInput anInput = GetCResult()->GetInput();
if(!anInput)
throw std::runtime_error("Mesh_i::Build - GetCResult()->GetInput() == NULL !!!");
if(!TSuperClass::IsPossible(theResult, theMeshName, theEntity, theFieldName, theTimeStampNumber, false))
return 0;
- VISU::Result_i::TInput* anInput = theResult->GetInput();
+ VISU::Result_i::PInput anInput = theResult->GetInput();
VISU::PUnstructuredGridIDMapper anIDMapper =
anInput->GetTimeStampOnMesh(theMeshName,
VISU::TEntity(theEntity),
false);
if(theIsMemoryCheck && aResult){
bool anIsEstimated = true;
- VISU::Result_i::TInput* anInput = theResult->GetInput();
+ VISU::Result_i::PInput anInput = theResult->GetInput();
size_t aSize = anInput->GetTimeStampOnMeshSize(theMeshName,
(VISU::TEntity)theEntity,
theFieldName,