if(thePipeLine){
if(vtkMapper *aMapper = myPipeLine->GetMapper()){
if(vtkDataSet *aDataSet = aMapper->GetInput()){
- if(!aDataSet)
- throw std::runtime_error("VISU_Actor::SetPipeLine >> There is no input data !!!");
-
- aDataSet->Update();
-
- static float EPS = VTK_LARGE_FLOAT * 0.1 ;
- if(aDataSet->GetLength() > EPS)
- throw std::runtime_error("VISU_Actor::SetPipeLine >> Diagonal of the actor is too large !!!");
-
- if(!aDataSet->GetNumberOfCells())
- throw std::runtime_error("VISU_Actor::SetPipeLine >> There is no visible elements");
-
SetShrinkable(thePipeLine->IsShrinkable());
SetMapperInput(aDataSet);
try {
GetVisuGen(this)->ExportTableToFile(GetSObject(aSObj), aFile.latin1());
application()->putInfo(aFile + " " + tr("INF_DONE"));
- } catch(std::exception& ex) {
- INFOS(ex.what());
+ } catch(std::exception& exc) {
+ INFOS(exc.what());
SUIT_MessageBox::warn1(GetDesktop(this),
tr("WRN_VISU"),
- tr("ERR_ERROR_DURING_EXPORT") + " " + tr(ex.what()),
+ tr("ERR_ERROR_DURING_EXPORT") + " " + tr(exc.what()),
tr("BUT_OK"));
} catch(...) {
INFOS(tr("ERR_ERROR_DURING_EXPORT"));
QApplication::restoreOverrideCursor();
}
+void
+VisuGUI::
+OnEraseAll()
+{
+ startOperation( myEraseAll );
+ if (SVTK_ViewWindow* vw = GetViewWindow(this)) {
+ vw->unHighlightAll();
+ if (vtkRenderer *aRen = vw->getRenderer()) {
+ vtkActor *anActor;
+ vtkActorCollection *anActColl = aRen->GetActors();
+ for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
+ if (anActor->GetVisibility() > 0)
+ if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
+ RemoveScalarBarPosition(this,anVISUActor->GetPrs3d());
+ anVISUActor->VisibilityOff();
+ }
+ }
+ vw->Repaint();
+ }
+ } else if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(this, false)) {
+ aPlot2d->EraseAll();
+ }
+}
+
void
VisuGUI::
}
-void
-VisuGUI::
-OnEraseAll()
-{
- startOperation( myEraseAll );
- if (SVTK_ViewWindow* vw = GetViewWindow(this)) {
- vw->unHighlightAll();
- if (vtkRenderer *aRen = vw->getRenderer()) {
- vtkActor *anActor;
- vtkActorCollection *anActColl = aRen->GetActors();
- for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
- if (anActor->GetVisibility() > 0)
- if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
- RemoveScalarBarPosition(this,anVISUActor->GetPrs3d());
- anVISUActor->VisibilityOff();
- }
- }
- vw->Repaint();
- }
- } else if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(this, false)) {
- aPlot2d->EraseAll();
- }
-}
-
void
VisuGUI::
OnMakeSurfaceframe()
SVTK_Viewer* vtk_viewer = dynamic_cast<SVTK_Viewer*>( aViewFrame );
if( vtk_viewer )
{
- SVTK_ViewWindow* wnd = dynamic_cast<SVTK_ViewWindow*>( vtk_viewer->getViewManager()->getActiveView() );
+ SVTK_ViewWindow* wnd =
+ dynamic_cast<SVTK_ViewWindow*>( vtk_viewer->getViewManager()->getActiveView() );
if( wnd )
{
VISU::Prs3d_i* thePrs = dynamic_cast<VISU::Prs3d_i*>( VISU::GetServant( anObj ).in() );
SPlot2d_Viewer* plot_viewer = dynamic_cast<SPlot2d_Viewer*>( aViewFrame );
if( plot_viewer )
{
- Plot2d_ViewWindow* wnd = dynamic_cast<Plot2d_ViewWindow*>( plot_viewer->getViewManager()->getActiveView() );
+ Plot2d_ViewWindow* wnd =
+ dynamic_cast<Plot2d_ViewWindow*>( plot_viewer->getViewManager()->getActiveView() );
if( !wnd )
return 0;
delete aDlg;
return;
}
- aPrs3d->UpdateActors();
+ try {
+ aPrs3d->UpdateActors();
+ } catch (std::runtime_error& exc) {
+ INFOS(exc.what());
+ SUIT_MessageBox::warn1
+ (GetDesktop(theModule), QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": pammy1 " + QObject::tr(exc.what()),
+ QObject::tr("BUT_OK"));
+
+ aPrs3d->RemoveActors();
+ }
typedef typename TViewer::TViewWindow TViewWindow;
if(TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule)){
aViewWindow->getRenderer()->ResetCameraClippingRange();
if(aActor = thePrs->CreateActor())
aView->AddActor(aActor);
}catch(std::exception& exc){
- SUIT_MessageBox::warn1(GetDesktop(theModule),
- QObject::tr("WRN_VISU"),
- QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warn1
+ (GetDesktop(theModule), QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_CREATE_ACTOR") + ": pammy2 " + QObject::tr(exc.what()),
+ QObject::tr("BUT_OK"));
}
QApplication::restoreOverrideCursor();
}
aResActor = anVISUActor;
thePrs->UpdateActor(aResActor);
aResActor->VisibilityOn();
- } catch (std::runtime_error& ex) {
+ } catch (std::runtime_error& exc) {
aResActor->VisibilityOff();
- INFOS(ex.what());
- SUIT_MessageBox::warn1(GetDesktop(theModule), QObject::tr("WRN_VISU"),
- QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(ex.what()),
- QObject::tr("BUT_OK"));
+ INFOS(exc.what());
+ SUIT_MessageBox::warn1
+ (GetDesktop(theModule), QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_CREATE_ACTOR") + ": pammy3 " + QObject::tr(exc.what()),
+ QObject::tr("BUT_OK"));
}
} else if (theDispOnly) {
anVISUActor->VisibilityOff();
CORBA::String_var anEntry = aSObject->GetID();
try {
- thePrs->Update();
thePrs->UpdateActors();
- } catch (std::runtime_error& ex) {
- INFOS(ex.what());
+ } catch (std::runtime_error& exc) {
+ INFOS(exc.what());
QApplication::restoreOverrideCursor();
- SUIT_MessageBox::warn1 (GetDesktop(theModule), QObject::tr("WRN_VISU"),
- QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(ex.what()),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warn1
+ (GetDesktop(theModule), QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": pammy4 " + QObject::tr(exc.what()),
+ QObject::tr("BUT_OK"));
thePrs->RemoveActors();
return;
theModule->getApp()->updateActions();
} catch (std::runtime_error& exc) {
INFOS(exc.what());
- SUIT_MessageBox::warn1 (GetDesktop(theModule),
- QObject::tr("WRN_VISU"),
- QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warn1
+ (GetDesktop(theModule), QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_CREATE_ACTOR") + ": pammy5 " + QObject::tr(exc.what()),
+ QObject::tr("BUT_OK"));
}
}
}
typedef typename TViewer::TViewWindow TView;
if(TView* aView = GetViewWindow<TViewer>(theModule,theIsCreateView)){
QApplication::setOverrideCursor( Qt::waitCursor );
- try{
+ try {
if(VISU_Actor* anActor = thePrs->CreateActor()){
aView->AddActor(anActor);
if(theIsHighlight)
QApplication::restoreOverrideCursor();
return anActor;
}
- }catch(std::exception& exc){
- SUIT_MessageBox::warn1(GetDesktop(theModule),
- QObject::tr("WRN_VISU"),
- QObject::tr("ERR_CANT_CREATE_ACTOR"),
- QObject::tr("BUT_OK"));
+ } catch(std::exception& exc) {
+ QApplication::restoreOverrideCursor();
+ INFOS(exc.what());
+ SUIT_MessageBox::warn1
+ (GetDesktop(theModule), QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_CREATE_ACTOR") + ": pammy6 " + QObject::tr(exc.what()),
+ QObject::tr("BUT_OK"));
}
}
return NULL;
if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anAct)){
if(VISU::Prs3d_i* aPrs3d = anActor->GetPrs3d()){
if(thePrs == aPrs3d){
+ try {
+ thePrs->UpdateActors();
+ } catch (std::runtime_error& exc) {
+ INFOS(exc.what());
+ QApplication::restoreOverrideCursor();
+ SUIT_MessageBox::warn1
+ (GetDesktop(theModule), QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": pammy7 " + QObject::tr(exc.what()),
+ QObject::tr("BUT_OK"));
+
+ thePrs->RemoveActors();
+ return NULL;
+ }
aResActor = anActor;
- thePrs->UpdateActors();
aResActor->VisibilityOn();
}else if(theDispOnly){
anActor->VisibilityOff();