anInput.myFieldName = CORBA::string_dup( aFieldName.latin1() );
anInput.myTimeStampNumber = 1;
+ QApplication::setOverrideCursor(Qt::waitCursor);
+
size_t isOk = VISU::CheckIsPossible( myType, anInput, true );
+
+ QApplication::restoreOverrideCursor();
+
return isOk > 0;
}
}
if( myReInit->isChecked() && myPrs )
{
+ QApplication::setOverrideCursor(Qt::waitCursor);
+
myPrs->SetResultObject( myResult );
myPrs->SetMeshName( aMeshName.latin1() );
myPrs->SetEntity( VISU::Entity( myEntity ) );
myPrs->Apply( true );
myDialog->initFromPrsObject( myPrs, false );
+
+ QApplication::restoreOverrideCursor();
}
}
}
//---------------------------------------------------------------
void VisuGUI_InputPane::changeTimeStamp( int theTimeStamp )
{
+ QApplication::setOverrideCursor(Qt::waitCursor);
+
myPrs->SetTimeStampNumber( myPrs->GetTimeStampNumberByIndex( theTimeStamp ) );
myPrs->Apply( true );
myDialog->initFromPrsObject( myPrs, false );
+
+ QApplication::restoreOverrideCursor();
}
VISU::ColoredPrs3dHolder::BasicInput_var anInput = aHolder->GetBasicInput();
anInput->myTimeStampNumber = aNumber;
+ QApplication::setOverrideCursor(Qt::waitCursor);
+
aHolder->Apply( aPrs3d, anInput, myView3D );
+
+ QApplication::restoreOverrideCursor();
}
updateMemoryState();
VISU::ColoredPrs3d_i
::RemoveFromStudy()
{
- struct TRemoveFromStudy: public SALOME_Event
+ struct TEvent: public SALOME_Event
{
VISU::ColoredPrs3d_i* myRemovable;
- TRemoveFromStudy(VISU::ColoredPrs3d_i* theRemovable):
+
+ TEvent(VISU::ColoredPrs3d_i* theRemovable):
myRemovable(theRemovable)
{}
Execute()
{
SALOMEDS::SObject_var aSObject = myRemovable->GetSObject();
+
if(!CORBA::is_nil(aSObject.in()))
VISU::RemoveFromStudy(aSObject,false);
+
myRemovable->TSuperClass::RemoveFromStudy();
}
};
- ProcessVoidEvent(new TRemoveFromStudy(this));
+ ProcessVoidEvent(new TEvent(this));
}
VISU::ColoredPrs3d_i
::UpdateFromResult(Result_i* theResult)
{
- try{
- if(theResult == GetCResult()){
- DoSetInput(false, false);
- UpdateActors();
+ struct TEvent: public SALOME_Event
+ {
+ VISU::ColoredPrs3d_i* myColoredPrs3d;
+
+ TEvent(VISU::ColoredPrs3d_i* theColoredPrs3d):
+ myColoredPrs3d(theColoredPrs3d)
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ try{
+ myColoredPrs3d->DoSetInput(false, false);
+ myColoredPrs3d->UpdateActors();
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!");
+ }
}
- }catch(std::exception& exc){
- INFOS("Follow exception was occured :\n"<<exc.what());
- }catch(...){
- INFOS("Unknown exception was occured!");
- }
+ };
+
+ if ( theResult == GetCResult() )
+ ProcessVoidEvent(new TEvent(this));
}
if(!IsRangeFixed() && theReInit)
SetSourceRange();
- GetCResult()->ConnectObserver(this, myResultConnection);
+ if(GetPublishInStudyMode() != EDoNotPublish)
+ GetCResult()->ConnectObserver(this, myResultConnection);
myPreviousEntity = myEntity;
myPreviousFieldName = myFieldName;
return GetComponentMax(GetScalarMode());
}
+
+//----------------------------------------------------------------------------
+struct TGetComponentMin: public SALOME_Event
+{
+ VISU::ColoredPrs3d_i* myColoredPrs3d;
+ vtkIdType myCompID;
+
+ typedef CORBA::Double TResult;
+ TResult myResult;
+
+ TGetComponentMin( VISU::ColoredPrs3d_i* theColoredPrs3d,
+ vtkIdType theCompID ):
+ myColoredPrs3d( theColoredPrs3d ),
+ myCompID( theCompID )
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ VISU::PMinMaxController aMinMaxController = myColoredPrs3d->GetMinMaxController();
+ if ( aMinMaxController ) {
+ myResult = aMinMaxController->GetComponentMin( myCompID );
+ } else {
+ VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myCompID );
+ myResult = aTMinMax.first;
+ }
+ }
+};
+
+
//----------------------------------------------------------------------------
vtkFloatingPointType
VISU::ColoredPrs3d_i
::GetComponentMin(vtkIdType theCompID)
{
- if(PMinMaxController aMinMaxController = GetMinMaxController())
- return aMinMaxController->GetComponentMin(theCompID);
-
- TMinMax aTMinMax = GetMinMax(GetCResult(), GetField(), theCompID);
- return aTMinMax.first;
+ return ProcessEvent( new TGetComponentMin( this, theCompID ) );
}
+//----------------------------------------------------------------------------
+struct TGetComponentMax: public SALOME_Event
+{
+ VISU::ColoredPrs3d_i* myColoredPrs3d;
+ vtkIdType myCompID;
+
+ typedef CORBA::Double TResult;
+ TResult myResult;
+
+ TGetComponentMax( VISU::ColoredPrs3d_i* theColoredPrs3d,
+ vtkIdType theCompID ):
+ myColoredPrs3d( theColoredPrs3d ),
+ myCompID( theCompID )
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ VISU::PMinMaxController aMinMaxController = myColoredPrs3d->GetMinMaxController();
+ if ( aMinMaxController ) {
+ myResult = aMinMaxController->GetComponentMax( myCompID );
+ } else {
+ VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myCompID );
+ myResult = aTMinMax.second;
+ }
+ }
+};
+
+
//----------------------------------------------------------------------------
vtkFloatingPointType
VISU::ColoredPrs3d_i
::GetComponentMax(vtkIdType theCompID)
{
- if(PMinMaxController aMinMaxController = GetMinMaxController())
- return aMinMaxController->GetComponentMax(theCompID);
-
- TMinMax aTMinMax = GetMinMax(GetCResult(), GetField(), theCompID);
- return aTMinMax.second;
+ return ProcessEvent( new TGetComponentMax( this, theCompID ) );
}
//----------------------------------------------------------------------------
aScalarBarCtrl->SetRangeLocal(aRange);
}
- TMinMax aTMinMax(-VTK_LARGE_FLOAT,VTK_LARGE_FLOAT);
bool anIsMinMaxDone = IsGlobalRangeDefined();
- if(anIsMinMaxDone)
- aTMinMax = GetField()->GetMinMax(GetScalarMode());
aScalarBarCtrl->SetGlobalRangeIsDefined(anIsMinMaxDone);
+
+ TMinMax aTMinMax( GetComponentMin( GetScalarMode() ),
+ GetComponentMax( GetScalarMode() ));
aScalarBarCtrl->SetRangeGlobal(aTMinMax.first, aTMinMax.second);
VISU_ScalarBarCtrl::EMode aScalarBarMode = VISU_ScalarBarCtrl::eGlobal;
VISU::TSetModified aModified(this);
myIsActiveLocalScalarBar = theIsActiveLocalScalarBar;
+
+ if ( !theIsActiveLocalScalarBar || !IsRangeFixed() )
+ SetSourceRange();
+
myParamsTime.Modified();
}
UseFixedRange(false);
}
+
+//----------------------------------------------------------------------------
+struct TGetSourceMin: public SALOME_Event
+{
+ VISU::GaussPoints_i* myColoredPrs3d;
+
+ typedef CORBA::Double TResult;
+ TResult myResult;
+
+ TGetSourceMin( VISU::GaussPoints_i* theColoredPrs3d ):
+ myColoredPrs3d( theColoredPrs3d )
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ if ( myColoredPrs3d->IsTimeStampFixed() || myColoredPrs3d->GetIsActiveLocalScalarBar() ) {
+ vtkFloatingPointType aRange[2];
+ myColoredPrs3d->GetSpecificPL()->GetSourceRange(aRange);
+ myResult = aRange[0];
+ }else{
+ VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode() );
+ myResult = aTMinMax.first;
+ }
+ }
+};
+
+
+//----------------------------------------------------------------------------
CORBA::Double
VISU::GaussPoints_i
::GetSourceMin()
{
- if(IsTimeStampFixed() || GetIsActiveLocalScalarBar()){
- vtkFloatingPointType aRange[2];
- GetSpecificPL()->GetSourceRange(aRange);
- return aRange[0];
- }else{
- TMinMax aTMinMax = GetField()->GetMinMax(GetScalarMode());
- return aTMinMax.first;
- }
+ return ProcessEvent( new TGetSourceMin( this ) );
}
+
+//----------------------------------------------------------------------------
+struct TGetSourceMax: public SALOME_Event
+{
+ VISU::GaussPoints_i* myColoredPrs3d;
+
+ typedef CORBA::Double TResult;
+ TResult myResult;
+
+ TGetSourceMax( VISU::GaussPoints_i* theColoredPrs3d ):
+ myColoredPrs3d( theColoredPrs3d )
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ if ( myColoredPrs3d->IsTimeStampFixed() || myColoredPrs3d->GetIsActiveLocalScalarBar() ) {
+ vtkFloatingPointType aRange[2];
+ myColoredPrs3d->GetSpecificPL()->GetSourceRange(aRange);
+ myResult = aRange[1];
+ }else{
+ VISU::TMinMax aTMinMax = myColoredPrs3d->GetField()->GetMinMax( myColoredPrs3d->GetScalarMode() );
+ myResult = aTMinMax.second;
+ }
+ }
+};
+
+
+//----------------------------------------------------------------------------
CORBA::Double
VISU::GaussPoints_i
::GetSourceMax()
{
- if(IsTimeStampFixed() || GetIsActiveLocalScalarBar()){
- vtkFloatingPointType aRange[2];
- GetSpecificPL()->GetSourceRange(aRange);
- return aRange[1];
- }else{
- TMinMax aTMinMax = GetField()->GetMinMax(GetScalarMode());
- return aTMinMax.second;
- }
+ return ProcessEvent( new TGetSourceMax( this ) );
}
if(!theIsBuild || *theIsDone)
return;
+ INITMSG(MYDEBUG, "BuildParts\n");
TTimerLog aTimerLog(MYTIMEDEBUG, "BuildParts");
TResultManager aResultManager(theResult);
TTransactionManager aTransactionManager(theStudy);
const VISU::PMesh& aMesh = aMeshMapIter->second;
MultiResult_i::TPartNames aPartNames = aMultiprObj.getParts();
+ BEGMSG(MYDEBUG, "aPartNames.size() = "<<aPartNames.size()<<"\n");
if(thePublishInStudy){
QString aComment = "Sub-parts: #";
const MultiResult_i::TPartName& aPartName = aPartNames[aPartID];
MultiResult_i::TPartName aMainPart = ExtractMainPart(aPartName);
aMainPart2SubPartNames[aMainPart].insert(aPartName);
+ BEGMSG(MYDEBUG, "aMainPart2SubPartNames['"<<aMainPart<<"'].insert('"<<aPartName<<"')\n");
}
for (size_t aPartID = 0 ; aPartID < aPartNames.size() ; aPartID++) {
aPartInfos[aFileInfo.fileName()] = aPartInfo;
aPartName2FileName[aPartInfo.myName] = aPartInfo.myFileName;
+ BEGMSG(MYDEBUG, "aPartName2FileName['"<<aPartInfo.myName<<"'] = '"<<aPartInfo.myFileName<<"'\n");
if(!thePublishInStudy)
continue;
aComment.latin1(),
true);
aPartName2Resolution[aPartInfo.myName] = aResolution;
+ BEGMSG(MYDEBUG, "aPartName2Resolution['"<<aPartInfo.myName<<"'] = '"<<aResoltutionsString<<"'\n");
}
}
QFileInfo aFileInfo(theFileName);
QString aTargetFileName = aFileInfo.filePath();
if(aTargetFileName.endsWith("_maitre.med")){
- myMultiprObj.create(theFileName);
- if (myMultiprObj.isValidDistributedMEDFile()) {
- aTargetFileName = myMultiprObj.getSequentialMEDFilename();
- SetInitFileName(aFileInfo.filePath().latin1());
- SetName(VISU::GenerateName(aFileInfo.fileName()).latin1(), false);
- myIsBuildParts = true;
+ try {
+ myMultiprObj.create(theFileName);
+ if ( myMultiprObj.isValidDistributedMEDFile() ) {
+ aTargetFileName = myMultiprObj.getSequentialMEDFilename();
+ SetInitFileName(aFileInfo.filePath().latin1());
+ SetName(VISU::GenerateName(aFileInfo.fileName()).latin1(), false);
+ myIsBuildParts = true;
+ }
+ }catch(std::exception& exc){
+ MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
+ }catch(multipr::RuntimeException& exc){
+ std::ostringstream aStream;
+ exc.dump(aStream);
+ aStream<<ends;
+ MSG(MYDEBUG,"Follow exception was occured in:\n"<<aStream.str());
+ }catch(...){
+ MSG(MYDEBUG,"Unknown exception !!!");
}
}
continue;
MultiResult_i::TPartInfo aPartInfo = GetPartInfo(myMultiprObj, aPartName);
- if(aPartInfo.myMeshName == theMeshName)
+ if(true || aPartInfo.myMeshName == theMeshName) // To ignore theMeshName input parameter
aMeshParts.push_back(aPartName);
}
continue;
MultiResult_i::TPartInfo aPartInfo = GetPartInfo(myMultiprObj, aPartName);
- if(aPartInfo.myMeshName != theMeshName)
+ if(false || aPartInfo.myMeshName != theMeshName) // To ignore theMeshName input parameter
continue;
MultiResult_i::TResolutions aResolutions = VISU::GetResolutions(myMainPart2SubPartNames, thePartName);
VISU::Storable::TRestoringMap aRestoringMap;
aRestoringMap["myComment"] = "PART";
- aRestoringMap["myMeshName"] = theMeshName;
+ //aRestoringMap["myMeshName"] = theMeshName; // To ignore theMeshName input parameter
aRestoringMap["myName"] = thePartName;
const VISU::TMeshMap& aMeshMap = Result_i::GetInput()->GetMeshMap();
- //VISU::TMeshMap::const_iterator aMeshIter = aMeshMap.find(theMeshName);
+ //VISU::TMeshMap::const_iterator aMeshIter = aMeshMap.find(theMeshName); // To ignore theMeshName input parameter
VISU::TMeshMap::const_iterator aMeshIter = aMeshMap.begin();
if(aMeshIter == aMeshMap.end())
return;
else
aFatherEntry = Result_i::GetEntry(aRestoringMap);
+ if ( aFatherEntry == "" )
+ return;
+
std::string anIconName = "ICON_MULTIPR_VIEW_HIDE";
if(theResolution == VISU::Result::FULL)
anIconName = "ICON_MULTIPR_VIEW_FULL";
VISU::Result_i
::UpdateObservers()
{
- myUpdateObserverSignal();
+ struct TEvent: public SALOME_Event
+ {
+ VISU::Result_i::TUpdateObserverSignal& myUpdateObserverSignal;
+
+ TEvent(VISU::Result_i::TUpdateObserverSignal& theUpdateObserverSignal):
+ myUpdateObserverSignal(theUpdateObserverSignal)
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ myUpdateObserverSignal();
+ }
+ };
+
+ ProcessVoidEvent(new TEvent(myUpdateObserverSignal));
}
return this;
}
}catch(std::exception& exc){
- INFOS("Follow exception was occured :\n"<<exc.what());
+ MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
}catch(...){
- INFOS("Unknown exception was occured!!!");
+ MSG(MYDEBUG,"Unknown exception !!!");
}
return NULL;
}