#include <QPushButton>
#include <QLineEdit>
#include <QCheckBox>
+#include <QComboBox>
#include "utilities.h"
checkLayout->addWidget( myEditCheck );
checkLayout->addWidget( myUpdateCheck );
mainLayout->addLayout( checkLayout );
+
+ if ( LightApp_Application* app = ( LightApp_Application* )SUIT_Session::session()->activeApplication() ) {
+ int anEnableEditing = app->resourceMgr()->booleanValue( "VISU", "tables_enable_editing", false );
+ myEditCheck->setChecked( anEnableEditing );
+ }
}
mainLayout->addWidget( top );
mainLayout->addLayout( btnLayout );
Constructor
*/
VISU_TableDlg::TableWidget::TableWidget( QWidget* parent,
- Qt::Orientation orientation )
+ Qt::Orientation orientation )
: QWidget( parent ), myOrientation( orientation )
{
myTitleEdit = new QLineEdit( this );
myAddColBtn = new QPushButton( VISU_TableDlg::tr( "ADD_COLUMN_BTN" ), this );
myDelColBtn = new QPushButton( VISU_TableDlg::tr( "REMOVE_COLUMN_BTN" ), this );
mySelectAllBtn = new QPushButton( VISU_TableDlg::tr( "SELECT_ALL_BTN" ), this );
- myClearBtn = new QPushButton( VISU_TableDlg::tr( "CLEAR_BTN"), this );
+ myClearBtn = new QPushButton( VISU_TableDlg::tr( "CLEAR_BTN" ), this );
+
+ mySortPolicyLabel = new QLabel( VISU_TableDlg::tr( "VISU_TABLES_SORT_POLICY" ), this );
+ mySortPolicyCombo = new QComboBox( this );
+ mySortPolicyCombo->insertItems( 0, QStringList() <<
+ VISU_TableDlg::tr( "VISU_TABLES_EMPTY_LOWEST" ) <<
+ VISU_TableDlg::tr( "VISU_TABLES_EMPTY_HIGHEST" ) <<
+ VISU_TableDlg::tr( "VISU_TABLES_EMPTY_FIRST" ) <<
+ VISU_TableDlg::tr( "VISU_TABLES_EMPTY_LAST" ) <<
+ VISU_TableDlg::tr( "VISU_TABLES_EMPTY_IGNORE" ) );
+
+ if ( LightApp_Application* app = ( LightApp_Application* )SUIT_Session::session()->activeApplication() ) {
+ int aSortPolicy = app->resourceMgr()->integerValue( "VISU", "tables_sort_policy", 3 );
+ mySortPolicyCombo->setCurrentIndex( aSortPolicy );
+ }
// the features has been temporarily disabled
myAddRowBtn->hide();
btnLayout->addWidget( mySelectAllBtn );
btnLayout->addWidget( myClearBtn );
+ QHBoxLayout* sortLayout = new QHBoxLayout;
+ sortLayout->setMargin( 0 );
+ sortLayout->setSpacing( SPACING_SIZE );
+ sortLayout->addWidget( mySortPolicyLabel );
+ sortLayout->addWidget( mySortPolicyCombo );
+ sortLayout->addStretch( 1 );
+
QGridLayout* mainLayout = new QGridLayout( this );
mainLayout->setMargin( 0 );
mainLayout->setSpacing( SPACING_SIZE );
mainLayout->addWidget( myTitleEdit, 0, 0, 1, 2 );
- mainLayout->addWidget( myTable, 1, 0 );
- mainLayout->addLayout( btnLayout, 1, 1 );
+ mainLayout->addWidget( myTable, 1, 0 );
+ mainLayout->addLayout( btnLayout, 1, 1 );
+ mainLayout->addLayout( sortLayout, 2, 0, 1, 2 );
connect( myTable, SIGNAL( itemSelectionChanged() ),
this, SLOT( updateButtonsState() ) );
connect( myAdjustBtn, SIGNAL( clicked() ), this, SLOT( adjustTable() ) );
connect( mySelectAllBtn, SIGNAL( clicked() ), this, SLOT( selectAll() ) );
connect( myClearBtn, SIGNAL( clicked() ), this, SLOT( clearTable() ) );
+ connect( myTable->horizontalHeader(), SIGNAL( sectionClicked( int ) ),
+ this, SLOT( columnClicked( int ) ) );
+ connect( myTable->verticalHeader(), SIGNAL( sectionClicked( int ) ),
+ this, SLOT( rowClicked( int ) ) );
myTable->horizontalHeader()->installEventFilter( this );
myTable->verticalHeader()->installEventFilter( this );
myTable->installEventFilter( this );
setEditEnabled( false );
showColumnTitles( false );
+ updateTableFromServant();
+ updateButtonsState();
+}
+
+void VISU_TableDlg::TableWidget::updateTableFromServant()
+{
_PTR(SObject) aSObject = myStudy->FindObjectID( myTableObj->GetObjectEntry() );
if ( aSObject ) {
int i, j;
break;
}
}
- updateButtonsState();
}
/*!
*/
void VISU_TableDlg::TableWidget::setEditEnabled( bool enable )
{
- // the feature has been temporarily disabled
+ if( !enable ) {
+ myTable->horizontalHeader()->setSortIndicatorShown( false );
+ myTable->verticalHeader()->setSortIndicatorShown( false );
+ adjustTable();
+ }
+
+ mySortPolicyLabel->setEnabled( enable );
+ mySortPolicyCombo->setEnabled( enable );
+
+ // the rest features have been temporarily disabled
enable = false;
myTitleEdit->setReadOnly( !enable );
myTable->clearContents();
updateButtonsState();
}
+/*!
+ Column clicked slot
+*/
+void VISU_TableDlg::TableWidget::columnClicked( int column )
+{
+ if ( myTableObj && mySortPolicyCombo->isEnabled() ) {
+ myTableObj->SortByRow( column + 1,
+ ( VISU::SortOrder )myTable->horizontalHeader()->sortIndicatorOrder(),
+ ( VISU::SortPolicy )mySortPolicyCombo->currentIndex() );
+ myTable->horizontalHeader()->setSortIndicatorShown( true );
+ myTable->verticalHeader()->setSortIndicatorShown( false );
+ updateTableFromServant();
+ }
+}
+/*!
+ Row clicked slot
+*/
+void VISU_TableDlg::TableWidget::rowClicked( int row )
+{
+ /* the feature has been temporarily disabled
+ if ( myTableObj && mySortPolicyCombo->isEnabled() && row > 0 ) { // first row contains units
+ myTableObj->SortByColumn( row,
+ ( VISU::SortOrder )myTable->verticalHeader()->sortIndicatorOrder(),
+ ( VISU::SortPolicy )mySortPolicyCombo->currentIndex() );
+ myTable->horizontalHeader()->setSortIndicatorShown( false );
+ myTable->verticalHeader()->setSortIndicatorShown( true );
+ updateTableFromServant();
+ }
+ */
+}
/*!
Event filter - handles titles editing
*/
QList<SUIT_Application*> anApplications = aSession->applications();
QList<SUIT_Application*>::Iterator anIter = anApplications.begin();
while ( anIter != anApplications.end() ) {
- SUIT_Application* anApp = *anIter;
- if (SUIT_Study* aSStudy = anApp->activeStudy()) {
- if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
+ SUIT_Application* anApp = *anIter;
+ if (SUIT_Study* aSStudy = anApp->activeStudy()) {
+ if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
if (_PTR(Study) aCStudy = aStudy->studyDS()) {
//if (myStudyName == aCStudy->Name()) {
if (myStudyId == aCStudy->StudyId()) {
- myResult = dynamic_cast<SalomeApp_Application*>(anApp);
- break;
- }
- }
- }
- }
- anIter++;
+ myResult = dynamic_cast<SalomeApp_Application*>(anApp);
+ break;
+ }
+ }
+ }
+ }
+ anIter++;
}
if (!myResult) {
//MESSAGE("Error: application is not found for study : " << myStudyName);
{
VISU::View3D_i* aView = new View3D_i (myApplication);
if (aView->Create(0))
- myResult = aView->_this();
+ myResult = aView->_this();
}
};
{
//if (CheckStudy(myStudyDocument)) {
if (myApplication) {
- TViewFrame* pView = new TViewFrame (myApplication);
- if (pView->Create(1)) {
- myResult = pView->_this();
- qApp->processEvents(); // Fix for bug 9929
- }
+ TViewFrame* pView = new TViewFrame (myApplication);
+ if (pView->Create(1)) {
+ myResult = pView->_this();
+ qApp->processEvents(); // Fix for bug 9929
+ }
}
}
};
Table_ptr myTable;
public:
TCreateTableViewFrameEvent (SalomeApp_Application* theApplication,
- Table_ptr theTable):
+ Table_ptr theTable):
TCreateViewEvent(theApplication),
myTable(theTable),
myResult(VISU::TableView::_nil())
virtual void Execute()
{
//if (CheckStudy(myStudyDocument)) {
- VISU::TableView_i* pView = new TableView_i (myApplication);
- if (pView->Create(myTable) != NULL)
- myResult = pView->_this();
+ VISU::TableView_i* pView = new TableView_i (myApplication);
+ if (pView->Create(myTable) != NULL)
+ myResult = pView->_this();
//}
}
typedef VISU::TableView_ptr TResult;
View_ptr myView;
public:
TEvent(View_ptr theView):
- myView(theView)
+ myView(theView)
{}
virtual void Execute(){
- if (!CORBA::is_nil(myView)) {
- if (VISU::View_i* pView = dynamic_cast<VISU::View_i*>(VISU::GetServant(myView).in())) {
- pView->Close();
- pView->_remove_ref();
- }
- }
+ if (!CORBA::is_nil(myView)) {
+ if (VISU::View_i* pView = dynamic_cast<VISU::View_i*>(VISU::GetServant(myView).in())) {
+ pView->Close();
+ pView->_remove_ref();
+ }
+ }
}
};
VISU_Actor *anVISUActor = NULL, *aResActor = NULL;
for(anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL;){
if(anActor->IsA("VISU_Actor")){
- anVISUActor = VISU_Actor::SafeDownCast(anActor);
- if (thePrs == anVISUActor->GetPrs3d()) {
- aResActor = anVISUActor;
- if(theDisplaing < eErase)
- aResActor->VisibilityOn();
- else
- aResActor->VisibilityOff();
- } else {
- if(theDisplaing == eEraseAll || theDisplaing == eDisplayOnly)
- anVISUActor->VisibilityOff();
- else if ( theDisplaing == eDisplayAll )
- anVISUActor->VisibilityOn();
- }
+ anVISUActor = VISU_Actor::SafeDownCast(anActor);
+ if (thePrs == anVISUActor->GetPrs3d()) {
+ aResActor = anVISUActor;
+ if(theDisplaing < eErase)
+ aResActor->VisibilityOn();
+ else
+ aResActor->VisibilityOff();
+ } else {
+ if(theDisplaing == eEraseAll || theDisplaing == eDisplayOnly)
+ anVISUActor->VisibilityOff();
+ else if ( theDisplaing == eDisplayAll )
+ anVISUActor->VisibilityOn();
+ }
}
}
if (aResActor) {
}
if(thePrs != NULL && theDisplaing < eErase){
try{
- anVISUActor = thePrs->CreateActor();
- vf->AddActor(anVISUActor);
+ anVISUActor = thePrs->CreateActor();
+ vf->AddActor(anVISUActor);
}catch(std::exception& exc){
- if(MYDEBUG) INFOS(exc.what());
- return NULL;
+ if(MYDEBUG) INFOS(exc.what());
+ return NULL;
}catch(...){
- if(MYDEBUG) INFOS("Unknown exception was occured!!!");
- return NULL;
+ if(MYDEBUG) INFOS("Unknown exception was occured!!!");
+ return NULL;
}
}
RepaintView(theViewWindow);
struct TUpdatePlot2dEvent: public SALOME_Event
{
- int myDisplaying;
Curve_i* myCurve;
+ int myDisplaying;
- TUpdatePlot2dEvent (const int theDisplaying, Curve_i* theCurve):
- myDisplaying(theDisplaying),
- myCurve(theCurve)
+ TUpdatePlot2dEvent (Curve_i* theCurve, const int theDisplaying):
+ myCurve(theCurve),
+ myDisplaying(theDisplaying)
{}
virtual void Execute()
if (Plot2d_ViewManager* aManager = dynamic_cast<Plot2d_ViewManager*>(aViewManager)) {
if (SPlot2d_Viewer* aViewer = dynamic_cast<SPlot2d_Viewer*>(aManager->getViewModel())) {
if (Plot2d_ViewFrame* aViewFrame = aViewer->getActiveViewFrame()) {
- UpdatePlot2d(aViewFrame, myDisplaying, myCurve);
+ UpdatePlot2d(myCurve, myDisplaying, aViewFrame);
}
}
}
}
};
- void UpdatePlot2d (Plot2d_ViewFrame *theView,int theDisplaying, Curve_i* theCurve)
+ void UpdatePlot2d (Curve_i* theCurve, int theDisplaying, Plot2d_ViewFrame* theView)
{
if(MYDEBUG) MESSAGE("UpdatePlot2d - theDisplaying = " << theDisplaying);
if (!theView) {
// update all views
- ProcessVoidEvent(new TUpdatePlot2dEvent(theDisplaying, theCurve));
+ ProcessVoidEvent(new TUpdatePlot2dEvent(theCurve, theDisplaying));
return;
}
QList<Plot2d_Curve*> clist;
theView->getCurves(clist);
if (theDisplaying == eEraseAll) {
for (int i = 0; i < clist.count(); i++) {
- if(MYDEBUG) MESSAGE("UpdatePlot2d - erasing all : curve - " << clist.at(i));
- theView->eraseCurve(clist.at(i));
+ if(MYDEBUG) MESSAGE("UpdatePlot2d - erasing all : curve - " << clist.at(i));
+ theView->eraseCurve(clist.at(i));
}
} else if (theDisplaying == eErase) {
if (theCurve) {
- for (int i = 0; i < clist.count(); i++) {
- SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
- if (aSPlot2dC->hasIO() &&
- !strcmp(theCurve->GetEntry().c_str(), aSPlot2dC->getIO()->getEntry())) {
- if(MYDEBUG) MESSAGE("UpdatePlot2d - erasing : curve - " << aSPlot2dC);
- theView->eraseCurve(aSPlot2dC);
- }
- }
- }
- } else if (theDisplaying == eDisplay) {
- if (theCurve) {
- bool bFound = false;
- for (int i = 0; i < clist.count(); i++) {
- SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
- if (aSPlot2dC->hasIO() &&
- !strcmp(theCurve->GetEntry().c_str(), aSPlot2dC->getIO()->getEntry())) {
- if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying : curve - " << aSPlot2dC);
- aSPlot2dC->setHorTitle( theCurve->GetHorTitle().c_str() );
- aSPlot2dC->setVerTitle( theCurve->GetVerTitle().c_str() );
- aSPlot2dC->setHorUnits( theCurve->GetHorUnits().c_str() );
- aSPlot2dC->setVerUnits( theCurve->GetVerUnits().c_str() );
- double* xList = 0;
- double* yList = 0;
- QStringList zList;
- int nbPoints = theCurve->GetData( xList, yList, zList );
- if (nbPoints > 0 && xList && yList) {
- aSPlot2dC->setData( xList, yList, nbPoints, zList );
- }
- if (!theCurve->IsAuto()) {
- aSPlot2dC->setLine((Plot2d::LineType)theCurve->GetLine(),
- theCurve->GetLineWidth());
- aSPlot2dC->setMarker((Plot2d::MarkerType)theCurve->GetMarker());
- SALOMEDS::Color color = theCurve->GetColor();
- aSPlot2dC->setColor(QColor((int)(color.R*255.),
- (int)(color.G*255.),
- (int)(color.B*255.)));
- }
- aSPlot2dC->setAutoAssign(theCurve->IsAuto());
- theView->displayCurve(aSPlot2dC);
- bFound = true;
- }
- }
- if (!bFound) {
- Plot2d_Curve* crv = theCurve->CreatePresentation();
- if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying : curve (new) - "<<crv );
- if (crv) {
- theView->displayCurve( crv );
- theCurve->SetLine( (VISU::Curve::LineType)crv->getLine(), crv->getLineWidth() );
- theCurve->SetMarker( (VISU::Curve::MarkerType)crv->getMarker());
- SALOMEDS::Color newColor;
- newColor.R = crv->getColor().red()/255.;
- newColor.G = crv->getColor().green()/255.;
- newColor.B = crv->getColor().blue()/255.;
- theCurve->SetColor( newColor );
- crv->setAutoAssign( theCurve->IsAuto() );
- }
- }
+ for (int i = 0; i < clist.count(); i++) {
+ SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
+ if (aSPlot2dC->hasIO() &&
+ !strcmp(theCurve->GetEntry().c_str(), aSPlot2dC->getIO()->getEntry())) {
+ if(MYDEBUG) MESSAGE("UpdatePlot2d - erasing : curve - " << aSPlot2dC);
+ theView->eraseCurve(aSPlot2dC);
+ }
+ }
}
- } else if (theDisplaying == eDisplayOnly) {
+ } else if (theDisplaying == eDisplay ||
+ theDisplaying == eDisplayOnly ||
+ theDisplaying == eUpdateData) {
if (theCurve) {
- bool bFound = false;
- for (int i = 0; i < clist.count(); i++) {
- SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
- if (aSPlot2dC->hasIO() &&
- !strcmp(theCurve->GetEntry().c_str(), aSPlot2dC->getIO()->getEntry())) {
- if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying only : curve - " << aSPlot2dC);
- aSPlot2dC->setHorTitle( theCurve->GetHorTitle().c_str() );
- aSPlot2dC->setVerTitle( theCurve->GetVerTitle().c_str() );
- aSPlot2dC->setHorUnits( theCurve->GetHorUnits().c_str() );
- aSPlot2dC->setVerUnits( theCurve->GetVerUnits().c_str() );
- double* xList = 0;
- double* yList = 0;
- QStringList zList;
- int nbPoints = theCurve->GetData( xList, yList, zList );
- if ( nbPoints > 0 && xList && yList ) {
- aSPlot2dC->setData( xList, yList, nbPoints, zList );
- }
- if ( !theCurve->IsAuto() ) {
- aSPlot2dC->setLine((Plot2d::LineType)theCurve->GetLine(), theCurve->GetLineWidth());
- aSPlot2dC->setMarker((Plot2d::MarkerType)theCurve->GetMarker());
- SALOMEDS::Color color = theCurve->GetColor();
- aSPlot2dC->setColor(QColor((int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.)));
- }
- aSPlot2dC->setAutoAssign(theCurve->IsAuto());
- theView->displayCurve(aSPlot2dC);
- bFound = true;
- } else {
- theView->eraseCurve(aSPlot2dC);
- }
- }
- if (!bFound) {
- Plot2d_Curve* crv = theCurve->CreatePresentation();
- if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying only : curve (new) - " << crv);
- if (crv) {
- theView->displayCurve(crv);
- theCurve->SetLine((VISU::Curve::LineType)crv->getLine(), crv->getLineWidth());
- theCurve->SetMarker((VISU::Curve::MarkerType)crv->getMarker());
- SALOMEDS::Color newColor;
- newColor.R = crv->getColor().red()/255.;
- newColor.G = crv->getColor().green()/255.;
- newColor.B = crv->getColor().blue()/255.;
- theCurve->SetColor(newColor);
- crv->setAutoAssign(theCurve->IsAuto());
- }
- }
+ bool bFound = false;
+ for (int i = 0; i < clist.count(); i++) {
+ SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
+ if (aSPlot2dC->hasIO() &&
+ !strcmp(theCurve->GetEntry().c_str(), aSPlot2dC->getIO()->getEntry())) {
+ if (theDisplaying == eUpdateData) {
+ if(MYDEBUG) MESSAGE("UpdatePlot2d - updating data : curve - " << aSPlot2dC);
+ }
+ else {
+ if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying : curve - " << aSPlot2dC);
+ }
+ double* xList = 0;
+ double* yList = 0;
+ QStringList zList;
+ int nbPoints = theCurve->GetData( xList, yList, zList );
+ if (nbPoints > 0 && xList && yList) {
+ aSPlot2dC->setData( xList, yList, nbPoints, zList );
+ }
+ if (theDisplaying == eUpdateData) {
+ theView->updateCurve(aSPlot2dC, true);
+ } else {
+ aSPlot2dC->setHorTitle( theCurve->GetHorTitle().c_str() );
+ aSPlot2dC->setVerTitle( theCurve->GetVerTitle().c_str() );
+ aSPlot2dC->setHorUnits( theCurve->GetHorUnits().c_str() );
+ aSPlot2dC->setVerUnits( theCurve->GetVerUnits().c_str() );
+ if (!theCurve->IsAuto()) {
+ aSPlot2dC->setLine((Plot2d::LineType)theCurve->GetLine(),
+ theCurve->GetLineWidth());
+ aSPlot2dC->setMarker((Plot2d::MarkerType)theCurve->GetMarker());
+ SALOMEDS::Color color = theCurve->GetColor();
+ aSPlot2dC->setColor(QColor((int)(color.R*255.),
+ (int)(color.G*255.),
+ (int)(color.B*255.)));
+ }
+ aSPlot2dC->setAutoAssign(theCurve->IsAuto());
+ theView->displayCurve(aSPlot2dC);
+ bFound = true;
+ }
+ } else if (theDisplaying == eDisplayOnly) {
+ theView->eraseCurve(aSPlot2dC);
+ }
+ }
+ if (!bFound && theDisplaying != eUpdateData) {
+ Plot2d_Curve* crv = theCurve->CreatePresentation();
+ if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying : curve (new) - "<<crv );
+ if (crv) {
+ theView->displayCurve( crv );
+ theCurve->SetLine( (VISU::Curve::LineType)crv->getLine(), crv->getLineWidth() );
+ theCurve->SetMarker( (VISU::Curve::MarkerType)crv->getMarker());
+ SALOMEDS::Color newColor;
+ newColor.R = crv->getColor().red()/255.;
+ newColor.G = crv->getColor().green()/255.;
+ newColor.B = crv->getColor().blue()/255.;
+ theCurve->SetColor( newColor );
+ crv->setAutoAssign( theCurve->IsAuto() );
+ }
+ }
}
}
}
QList<SUIT_Application*> anApplications = aSession->applications();
QList<SUIT_Application*>::Iterator anIter = anApplications.begin();
while ( anIter != anApplications.end() ) {
- SUIT_Application* aSUITApp = *anIter;
- if (SUIT_Study* aSStudy = aSUITApp->activeStudy()) {
+ SUIT_Application* aSUITApp = *anIter;
+ if (SUIT_Study* aSStudy = aSUITApp->activeStudy()) {
if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
if (_PTR(Study) aCStudy = aStudy->studyDS()) {
if (aStudyName == aCStudy->Name()) {
anApp = dynamic_cast<SalomeApp_Application*>(aSUITApp);
- break;
- }
- }
- }
+ break;
+ }
+ }
+ }
}
- anIter++;
+ anIter++;
}
if (!anApp)
return;
QList<SUIT_ViewManager*>::Iterator anVMIter = aViewManagerList.begin();
for (; anVMIter != aViewManagerList.end(); anVMIter++ ) {
SUIT_ViewManager* aViewManager = *anVMIter;
- QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
- for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
- if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
- if (Plot2d_ViewWindow* vw = dynamic_cast<Plot2d_ViewWindow*>(aViewWindow)) {
+ QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+ for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
+ if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
+ if (Plot2d_ViewWindow* vw = dynamic_cast<Plot2d_ViewWindow*>(aViewWindow)) {
Plot2d_ViewFrame* vf = vw->getViewFrame();
- QList<Plot2d_Curve*> clist;
- vf->getCurves(clist);
- for (int i = 0; i < clist.count(); i++) {
+ QList<Plot2d_Curve*> clist;
+ vf->getCurves(clist);
+ for (int i = 0; i < clist.count(); i++) {
if (SPlot2d_Curve* cu = dynamic_cast<SPlot2d_Curve*>(clist.at(i))) {
- if (cu->hasIO() &&
- strcmp(myPrs->GetEntry().c_str(), cu->getIO()->getEntry())) {
- vf->eraseCurve(cu);
- }
- }
- }
- vf->Repaint();
- //jfa tmp:aViewFrame->unHighlightAll();
+ if (cu->hasIO() &&
+ strcmp(myPrs->GetEntry().c_str(), cu->getIO()->getEntry())) {
+ vf->eraseCurve(cu);
+ }
+ }
+ }
+ vf->Repaint();
+ //jfa tmp:aViewFrame->unHighlightAll();
}
}
}
if (_PTR(Study) aCStudy = aStudy->studyDS()) {
if (aStudyName == aCStudy->Name()) {
anApp = dynamic_cast<SalomeApp_Application*>(aSUITApp);
- break;
- }
- }
- }
+ break;
+ }
+ }
+ }
}
}
if (!anApp)
SUIT_ViewManager* aViewManager = anVMIter.current();
QPtrVector<SUIT_ViewWindow> aViews = aViewManager->getViews();
for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
- if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
- if (Plot2d_ViewWindow* vw = dynamic_cast<Plot2d_ViewWindow*>(aViewWindow)) {
+ if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
+ if (Plot2d_ViewWindow* vw = dynamic_cast<Plot2d_ViewWindow*>(aViewWindow)) {
Plot2d_ViewFrame* vf = vw->getViewFrame();
QList<Plot2d_Curve> clist;
vf->getCurves(clist);
- for (int i = 0; i < clist.count(); i++) {
+ for (int i = 0; i < clist.count(); i++) {
if (SPlot2d_Curve* cu = dynamic_cast<SPlot2d_Curve*>(clist.at(i))) {
- if (cu->hasIO() &&
- strcmp(cu->getIO()->getEntry(), thePrs->GetEntry()) == 0) {
- vf->eraseCurve(cu);
- }
- }
- }
- vf->Repaint();
- //jfa tmp:aViewFrame->unHighlightAll();
+ if (cu->hasIO() &&
+ strcmp(cu->getIO()->getEntry(), thePrs->GetEntry()) == 0) {
+ vf->eraseCurve(cu);
+ }
+ }
+ }
+ vf->Repaint();
+ //jfa tmp:aViewFrame->unHighlightAll();
}
}
}
if (_PTR(Study) aCStudy = aStudy->studyDS()) {
if (aStudyName == aCStudy->Name()) {
anApp = dynamic_cast<SalomeApp_Application*>(aSUITApp);
- break;
- }
- }
- }
+ break;
+ }
+ }
+ }
}
anIter++;
}
SUIT_ViewManager* aViewManager = *anVMIter;
QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
- if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
- if (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)) {
+ if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
+ if (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)) {
VISU_Actor* anActor = NULL;
- VTK::ActorCollectionCopy aCopy(vw->getRenderer()->GetActors());
+ VTK::ActorCollectionCopy aCopy(vw->getRenderer()->GetActors());
vtkActorCollection *anActColl = aCopy.GetActors();
- anActColl->InitTraversal();
+ anActColl->InitTraversal();
vtkActor *aVTKActor = anActColl->GetNextActor();
- for (; !anActor && aVTKActor; aVTKActor = anActColl->GetNextActor()) {
+ for (; !anActor && aVTKActor; aVTKActor = anActColl->GetNextActor()) {
if (VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(aVTKActor)) {
- if (thePrs == anVISUActor->GetPrs3d()) {
- anActor = anVISUActor;
+ if (thePrs == anVISUActor->GetPrs3d()) {
+ anActor = anVISUActor;
}
}
}
if (anActor) {
- vw->RemoveActor(anActor);
+ vw->RemoveActor(anActor);
}
}
}