aFilter,
tr("MEN_IMPORT_FROM_FILE"),
true);
- if(aFileInfo.exists()){
+ if(aFileInfo.exists()) {
application()->putInfo( "Importing From File " + aFileInfo.filePath() + "..." );
VISU::Result_var aResult;
bool anIsBuild = aResourceMgr->booleanValue("VISU", "full_med_loading", false);
- if(VisuGUI_FileDlg::IsBuild){
+ if (VisuGUI_FileDlg::IsBuild) {
aResult = GetVisuGen(this)->ImportFile(aFileInfo.filePath());
- if(!CORBA::is_nil(aResult.in()))
- if(Result_i* aRes = dynamic_cast<Result_i*>(GetServant(aResult).in())){
- if(!aRes->IsPossible())
+ if (!CORBA::is_nil(aResult.in()))
+ if (Result_i* aRes = dynamic_cast<Result_i*>(GetServant(aResult).in())) {
+ if (!aRes->IsPossible())
SUIT_MessageBox::warn1(GetDesktop(this),
tr("WRN_VISU"),
tr("ERR_CANT_BUILD_PRESENTATION"),
- tr("BUT_OK") );
+ tr("BUT_OK"));
else
aRes->BuildAll();
}
- }else{
+ } else {
aResourceMgr->setValue("VISU", "full_med_loading", false);
aResult = GetVisuGen(this)->ImportFile(aFileInfo.filePath());
aResourceMgr->setValue("VISU", "full_med_loading", anIsBuild);
}
- if(CORBA::is_nil(aResult.in())) {
+ if (CORBA::is_nil(aResult.in())) {
SUIT_MessageBox::warn1(GetDesktop(this),
tr("WRN_VISU"),
tr("ERR_ERROR_IN_THE_FILE"),
- tr("BUT_OK") );
+ tr("BUT_OK"));
}else{
- application()->putInfo(aFileInfo.filePath()+tr("INF_DONE"));
- updateObjBrowser();
+ application()->putInfo(aFileInfo.filePath() + tr("INF_DONE"));
+ UpdateObjBrowser(this);
}
}
}
std::string aStudyName = aStudy->Name();
aGen->readStructFileWithFieldType(aFileInfo.filePath(),aStudyName.c_str());
application()->putInfo(aFileInfo.filePath()+tr("INF_DONE"));
- //updateObjBrowser();
getApp()->updateObjectBrowser(true); // as need to update MED tree
+ getApp()->updateActions();
}
}
aFilter,
tr("MEN_IMPORT_TABLE"),
true);
- if(aFileInfo.exists()){
+ if (aFileInfo.exists()) {
application()->putInfo( tr("MEN_IMPORT_TABLE") + " " + aFileInfo.filePath() + " ..." );
CORBA::Object_var anObject = GetVisuGen(this)->ImportTables(aFileInfo.filePath());
- if(CORBA::is_nil(anObject.in())) {
+ if (CORBA::is_nil(anObject.in())) {
SUIT_MessageBox::warn1(GetDesktop(this),
tr("WRN_VISU"),
tr("ERR_ERROR_IN_THE_FILE"),
- tr("BUT_OK") );
- }else{
+ tr("BUT_OK"));
+ } else {
application()->putInfo(aFileInfo.filePath()+tr("INF_DONE"));
- updateObjBrowser();
+ UpdateObjBrowser(this);
}
}
}
}
}
}
- updateObjBrowser(true);
+ UpdateObjBrowser(this, true);
QApplication::restoreOverrideCursor();
}
if ( !aCutDlg )
return;
- _PTR(Study) aStudy = GetCStudy( GetAppStudy( theModule ) );
+ _PTR(Study) aStudy = GetCStudy( GetAppStudy( theModule ) );
_PTR(SObject) aSObject = aStudy->FindObjectID( thePrs->GetEntry().latin1() );
- if ( !theCreate && aSObject ){
+ if ( !theCreate && aSObject ) {
// Remove old Table
_PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
- for ( _PTR(ChildIterator) aIter = aStudy->NewChildIterator( aSObject ); aIter->More(); aIter->Next() ) {
+ _PTR(ChildIterator) aIter = aStudy->NewChildIterator(aSObject);
+ for (; aIter->More(); aIter->Next()) {
_PTR(SObject) aTblObj = aIter->Value();
if ( aTblObj ) {
_PTR(GenericAttribute) anAttr;
if ( aCutDlg->isGenerateTable() ) {
GetVisuGen( theModule )->CreateTable( thePrs->GetEntry() );
if ( aCutDlg->isGenerateCurves() ) {
- if( aSObject ) {
+ if ( aSObject ) {
_PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
- for ( _PTR(ChildIterator) aIter = aStudy->NewChildIterator( aSObject ); aIter->More(); aIter->Next() ) {
+ _PTR(ChildIterator) aIter = aStudy->NewChildIterator(aSObject);
+ for (; aIter->More(); aIter->Next()) {
_PTR(SObject) aTblObj = aIter->Value();
if ( aTblObj ) {
_PTR(GenericAttribute) anAttr;
}
}
}
+
+ if (!theCreate && aSObject) {
+ UpdateObjBrowser(theModule);
+ }
}
template<class TPrs3d_i>
if(aDlg->exec() && (aDlg->storeToPrsObject(aPrs3d))) {
// Optionally, create table and curves for cut lines
QApplication::setOverrideCursor(Qt::waitCursor);
- CreateCurves( theModule, dynamic_cast<VISU::CutLines_i*>( aPrs3d ), aDlg, true ); // in creation mode
+ CreateCurves( theModule,
+ dynamic_cast<VISU::CutLines_i*>( aPrs3d ),
+ aDlg,
+ true ); // in creation mode
QApplication::restoreOverrideCursor();
delete aDlg;
} else {
theModule->application()->putInfo(QObject::tr("INF_DONE"));
theModule->updateObjBrowser();
+ UpdateObjBrowser(theModule);
if (SVTK_ViewWindow* aView = GetViewWindow(theModule))
aView->onFitAll();
{
CheckLock(GetCStudy(GetAppStudy(this)));
GetVisuGen( this )->CreateContainer();
- updateObjBrowser();
+ UpdateObjBrowser(this);
}
void
{
TPrs3d_i* aPrsObject = dynamic_cast<TPrs3d_i*>(thePrs3d);
if (aPrsObject) {
- //TDlg* aDlg = new TDlg (GetDesktop(theModule), false, true);
TDlg* aDlg = new TDlg (theModule);
aDlg->initFromPrsObject(aPrsObject);
if (aDlg->exec()) {
}
RecreateActor(theModule, aPrsObject);
if (SVTK_ViewWindow* vw = GetViewWindow(theModule)) {
- //if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
- vw->getRenderer()->ResetCameraClippingRange();
- vw->Repaint();
- //}
+ vw->getRenderer()->ResetCameraClippingRange();
+ vw->Repaint();
}
+ // Optionally, create table and curves for cut lines
+ QApplication::setOverrideCursor(Qt::waitCursor);
+ CreateCurves( theModule,
+ dynamic_cast<VISU::CutLines_i*>( aPrsObject ),
+ aDlg,
+ false ); // in edition mode
+ QApplication::restoreOverrideCursor();
}
delete aDlg;
}
break;
case VISU::TCUTPLANES:
EditPrs3d<VISU::CutPlanes_i, VisuGUI_CutPlanesDlg>(this, aPrs3d);
- /*{
- VISU::CutPlanes_i* aPrsObject = dynamic_cast<VISU::CutPlanes_i*>(aPrs3d);
- if (aPrsObject) {
- VisuGUI_CutPlanesDlg* aDlg =
- new VisuGUI_CutPlanesDlg (GetDesktop(this), false, false);
- aDlg->initFromPrsObject(aPrsObject);
- aDlg->show();
- }
- }*/
break;
case VISU::TCUTLINES:
EditPrs3d<VISU::CutLines_i, VisuGUI_CutLinesDlg>(this, aPrs3d);
- /*{
- VISU::CutLines_i* aPrsObject = dynamic_cast<VISU::CutLines_i*>(aPrs3d);
- if (aPrsObject) {
- VisuGUI_CutLinesDlg* aDlg =
- new VisuGUI_CutLinesDlg (GetDesktop(this), false, false);
- aDlg->initFromPrsObject(aPrsObject);
- aDlg->show();
- }
- }*/
break;
case VISU::TISOSURFACE:
EditPrs3d<VISU::IsoSurfaces_i, VisuGUI_IsoSurfacesDlg>(this, aPrs3d);
break;
case VISU::TPLOT3D:
EditPrs3d<VISU::Plot3D_i, VisuGUI_Plot3DDlg>(this, aPrs3d);
- /*{
- VISU::Plot3D_i* aPrsObject = dynamic_cast<VISU::Plot3D_i*>(aPrs3d);
- if (aPrsObject) {
- VisuGUI_Plot3DDlg* aDlg = new VisuGUI_Plot3DDlg();
- aDlg->initFromPrsObject(aPrsObject);
- aDlg->show();
- myActiveDialogBox = aDlg;
- }
- }*/
break;
default:
return;
VISU::CutLines_var aCutLines = VISU::CutLines::_narrow( anObject );
if(!aCutLines->_is_nil() || IsSObjectTable(aSObject)) {
GetVisuGen( this )->CreateTable( aSObject->GetID().c_str() );
- updateObjBrowser();
+ UpdateObjBrowser(this);
}
}
aStudyBuilder->CommitCommand();
//GetActiveStudy()->unHighlightAll();
- updateObjBrowser(true);
+ UpdateObjBrowser(this, true);
}
void
}
}
}
- updateObjBrowser();
+ UpdateObjBrowser(this);
PlotContainer( this, pContainer, VISU::eDisplay );
}
}
}
}
}
- updateObjBrowser();
+ UpdateObjBrowser(this);
PlotContainer( this, pContainer, VISU::eDisplay );
}
}
VISU::Container_i* container = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aCnt).in());
if (container && container->GetNbCurves() > 0) {
container->Clear();
- updateObjBrowser();
+ UpdateObjBrowser(this);
}
}
}
VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aServant.in());
if (!aContainer) return;
- //VisuGUI_EditContainerDlg* aDlg = new VisuGUI_EditContainerDlg (GetDesktop(this));
VisuGUI_EditContainerDlg* aDlg = new VisuGUI_EditContainerDlg (this);
aDlg->initFromPrsObject(aContainer);
if (aDlg->exec()) {
aDlg->storeToPrsObject(aContainer);
- updateObjBrowser(true);
+ UpdateObjBrowser(this, true);
}
delete aDlg;
}
const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
VISU::View3D_i::SaveViewParams(aViewMgr, anIO->getName());
}
- updateObjBrowser();
+ UpdateObjBrowser(this);
}
void
// rename the study object
aName->SetValue(Name.latin1()); // rename the SObject
anIO->setName(Name.latin1()); // rename the InteractiveObject
- updateObjBrowser(false);
+ UpdateObjBrowser(this, false);
QApplication::restoreOverrideCursor();
}
}
break;
}
- updateObjBrowser();
+ UpdateObjBrowser(this);
}
void