QFileInfo aFileInfo =
SUIT_FileDlg::getFileName(GetDesktop(this),
- "",
- aFilter,
- tr("MEN_IMPORT_FROM_FILE"),
- true);
+ "",
+ aFilter,
+ tr("MEN_IMPORT_FROM_FILE"),
+ true);
if(aFileInfo.exists()){
application()->putInfo( "Importing From File " + aFileInfo.filePath() + "..." );
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())
- SUIT_MessageBox::warn1(GetDesktop(this),
- tr("WRN_VISU"),
- tr("ERR_CANT_BUILD_PRESENTATION"),
- tr("BUT_OK") );
- else
- aRes->BuildAll();
- }
+ 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") );
+ else
+ aRes->BuildAll();
+ }
}else{
aResourceMgr->setValue("VISU", "full_med_loading", false);
aResult = GetVisuGen(this)->ImportFile(aFileInfo.filePath());
if(CORBA::is_nil(aResult.in())) {
SUIT_MessageBox::warn1(GetDesktop(this),
- tr("WRN_VISU"),
- tr("ERR_ERROR_IN_THE_FILE"),
- tr("BUT_OK") );
+ tr("WRN_VISU"),
+ tr("ERR_ERROR_IN_THE_FILE"),
+ tr("BUT_OK") );
}else{
application()->putInfo(aFileInfo.filePath()+tr("INF_DONE"));
updateObjBrowser();
QFileInfo aFileInfo =
SUIT_FileDlg::getFileName(GetDesktop(this),
- "",
- aFilter,
- tr("MEN_EXPLORE_MED_FILE"),
- true);
+ "",
+ aFilter,
+ tr("MEN_EXPLORE_MED_FILE"),
+ true);
if(aFileInfo.exists()){
application()->putInfo( tr("MEN_EXPLORE_MED_FILE") + " " + aFileInfo.filePath() + "..." );
std::string aStudyName = aStudy->Name();
QFileInfo aFileInfo =
SUIT_FileDlg::getFileName(GetDesktop(this),
- "",
- aFilter,
- tr("MEN_IMPORT_TABLE"),
- true);
+ "",
+ aFilter,
+ tr("MEN_IMPORT_TABLE"),
+ true);
if(aFileInfo.exists()){
application()->putInfo( tr("MEN_IMPORT_TABLE") + " " + aFileInfo.filePath() + " ..." );
if(CORBA::is_nil(anObject.in())) {
SUIT_MessageBox::warn1(GetDesktop(this),
- tr("WRN_VISU"),
- tr("ERR_ERROR_IN_THE_FILE"),
- tr("BUT_OK") );
+ tr("WRN_VISU"),
+ tr("ERR_ERROR_IN_THE_FILE"),
+ tr("BUT_OK") );
}else{
application()->putInfo(aFileInfo.filePath()+tr("INF_DONE"));
updateObjBrowser();
if (!aSObject->_is_nil()) {
CORBA::Object_var anObject = VISU::SObjectToObject(aSObject);
if (!CORBA::is_nil(anObject)) {
- SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(anObject);
- if (!CORBA::is_nil(aMED.in()))
- GetVisuGen(this)->ImportMed(aSObject);
- SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(anObject);
- if (!CORBA::is_nil(aField.in()))
- GetVisuGen(this)->ImportMedField(aField);
+ SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(anObject);
+ if (!CORBA::is_nil(aMED.in()))
+ GetVisuGen(this)->ImportMed(aSObject);
+ SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(anObject);
+ if (!CORBA::is_nil(aField.in()))
+ GetVisuGen(this)->ImportMedField(aField);
} else {
- SALOMEDS::SObject_var aSFather = aSObject->GetFather();
- SALOMEDS::GenericAttribute_var anAttr;
- aSFather->FindAttribute(anAttr, "AttributeName");
- SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
- CORBA::String_var aValue = aName->Value();
- if (strcmp(aValue.in(), "MEDFIELD") == 0)
- GetVisuGen(this)->ImportMed(aSObject);
+ SALOMEDS::SObject_var aSFather = aSObject->GetFather();
+ SALOMEDS::GenericAttribute_var anAttr;
+ aSFather->FindAttribute(anAttr, "AttributeName");
+ SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
+ CORBA::String_var aValue = aName->Value();
+ if (strcmp(aValue.in(), "MEDFIELD") == 0)
+ GetVisuGen(this)->ImportMed(aSObject);
}
}
}
void
CreateCurves( SalomeApp_Module* theModule,
- VISU::CutLines_i* thePrs,
- QDialog* theDlg,
- const bool theCreate = true )
+ VISU::CutLines_i* thePrs,
+ QDialog* theDlg,
+ const bool theCreate = true )
{
if ( !thePrs )
return;
for ( _PTR(ChildIterator) aIter = aStudy->NewChildIterator( aSObject ); aIter->More(); aIter->Next() ) {
_PTR(SObject) aTblObj = aIter->Value();
if ( aTblObj ) {
- _PTR(GenericAttribute) anAttr;
- if (aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
- aBuilder->RemoveObjectWithChildren( aIter->Value() ); // We should have only one child
- break;
- }
+ _PTR(GenericAttribute) anAttr;
+ if (aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
+ aBuilder->RemoveObjectWithChildren( aIter->Value() ); // We should have only one child
+ break;
+ }
}
}
}
GetVisuGen( theModule )->CreateTable( thePrs->GetEntry() );
if ( aCutDlg->isGenerateCurves() ) {
if( aSObject ) {
- _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
- for ( _PTR(ChildIterator) aIter = aStudy->NewChildIterator( aSObject ); aIter->More(); aIter->Next() ) {
- _PTR(SObject) aTblObj = aIter->Value();
- if ( aTblObj ) {
- _PTR(GenericAttribute) anAttr;
- if ( aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
- CreatePlot( theModule, aTblObj );
- }
- }
- }
+ _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
+ for ( _PTR(ChildIterator) aIter = aStudy->NewChildIterator( aSObject ); aIter->More(); aIter->Next() ) {
+ _PTR(SObject) aTblObj = aIter->Value();
+ if ( aTblObj ) {
+ _PTR(GenericAttribute) anAttr;
+ if ( aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
+ CreatePlot( theModule, aTblObj );
+ }
+ }
+ }
}
}
}
template<class TPrs3d_i>
TPrs3d_i*
CreatePrs3d(SalomeApp_Module* theModule,
- _PTR(SObject) theTimeStamp,
- const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName,
- int theTimeId)
+ _PTR(SObject) theTimeStamp,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeId)
{
VISU::Result_var aResult;
if (CheckResult(theModule,theTimeStamp,aResult)){
return dynamic_cast<TPrs3d_i*>(VISU::GetServant(aPrs3d.in()).in());
}
SUIT_MessageBox::warn1(GetDesktop(theModule),
- QObject::tr("WRN_VISU"),
- QObject::tr("ERR_CANT_BUILD_PRESENTATION"),
- QObject::tr("BUT_OK") );
+ QObject::tr("WRN_VISU"),
+ QObject::tr("ERR_CANT_BUILD_PRESENTATION"),
+ QObject::tr("BUT_OK") );
return NULL;
}
template<class TPrs3d_i, class TDlg, int IsDlgModal>
bool
CreatePrs3d(SalomeApp_Module* theModule,
- _PTR(SObject) theTimeStamp,
- const Handle(SALOME_InteractiveObject)& theIO)
+ _PTR(SObject) theTimeStamp,
+ const Handle(SALOME_InteractiveObject)& theIO)
{
using namespace VISU;
Storable::TRestoringMap aMap = getMapOfValue(theTimeStamp);
QApplication::setOverrideCursor(Qt::waitCursor);
TPrs3d_i* aPrs3d =
CreatePrs3d<TPrs3d_i>(theModule,
- theTimeStamp,
- aMeshName.latin1(),
- (Entity)anEntity.toInt(),
- aFieldName.latin1(),
- aTimeStampId.toInt());
+ theTimeStamp,
+ aMeshName.latin1(),
+ (Entity)anEntity.toInt(),
+ aFieldName.latin1(),
+ aTimeStampId.toInt());
QApplication::restoreOverrideCursor();
if(aPrs3d){
SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
int aValue = aResourceMgr->integerValue("Visu:BuildDefaultPrs3d",0);
if(!aValue){
if(TDlg* aDlg = new TDlg(theModule)){ // dialog box in creation mode
- aDlg->initFromPrsObject(aPrs3d);
- if(IsDlgModal)
- 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
- QApplication::restoreOverrideCursor();
- delete aDlg;
- } else {
- DeletePrs3d(theModule,aPrs3d,theIO);
- delete aDlg;
- return false;
- }
- else{
- aDlg->show();
- return true;
- }
+ aDlg->initFromPrsObject(aPrs3d);
+ if(IsDlgModal)
+ 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
+ QApplication::restoreOverrideCursor();
+ delete aDlg;
+ } else {
+ DeletePrs3d(theModule,aPrs3d,theIO);
+ delete aDlg;
+ return false;
+ }
+ else{
+ aDlg->show();
+ return true;
+ }
}
}
PublishInView(theModule,aPrs3d);
// is it Prs3d object ?
VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in());
if(aPrsObject){
- if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Prs3d object");
- UpdateViewer( this, aPrsObject );
- if (SVTK_ViewWindow* vw = GetViewWindow( this )) {
- vw->highlight(anIO, 1);
- }
- continue;
+ if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Prs3d object");
+ UpdateViewer( this, aPrsObject );
+ if (SVTK_ViewWindow* vw = GetViewWindow( this )) {
+ vw->highlight(anIO, 1);
+ }
+ continue;
}
// is it Curve ?
VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(anObject).in());
if(aCurve){
- if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Curve object");
- PlotCurve( this, aCurve, VISU::eDisplay );
- continue;
+ if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Curve object");
+ PlotCurve( this, aCurve, VISU::eDisplay );
+ continue;
}
// is it Container ?
VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(anObject).in());
if(aContainer){
- if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Container object");
- PlotContainer( this, aContainer, VISU::eDisplay );
- continue;
+ if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Container object");
+ PlotContainer( this, aContainer, VISU::eDisplay );
+ continue;
}
// is it Table ?
VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(anObject).in());
if(aTable){
- if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Table object");
- PlotTable( this, aTable, VISU::eDisplay );
- continue;
+ if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Table object");
+ PlotTable( this, aTable, VISU::eDisplay );
+ continue;
}
}
}
aDlg->initFromPrsObject(aPrsObject);
if (aDlg->exec()) {
if (!(aDlg->storeToPrsObject(aPrsObject))) {
- delete aDlg;
+ delete aDlg;
return;
}
RecreateActor(theModule, aPrsObject);
if (SVTK_ViewWindow* vw = GetViewWindow(theModule)) {
- //if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
+ //if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
vw->getRenderer()->ResetCameraClippingRange();
vw->Repaint();
- //}
+ //}
}
}
delete aDlg;
/*{
VISU::CutPlanes_i* aPrsObject = dynamic_cast<VISU::CutPlanes_i*>(aPrs3d);
if (aPrsObject) {
- VisuGUI_CutPlanesDlg* aDlg =
+ VisuGUI_CutPlanesDlg* aDlg =
new VisuGUI_CutPlanesDlg (GetDesktop(this), false, false);
aDlg->initFromPrsObject(aPrsObject);
- aDlg->show();
+ aDlg->show();
}
}*/
break;
/*{
VISU::CutLines_i* aPrsObject = dynamic_cast<VISU::CutLines_i*>(aPrs3d);
if (aPrsObject) {
- VisuGUI_CutLinesDlg* aDlg =
+ VisuGUI_CutLinesDlg* aDlg =
new VisuGUI_CutLinesDlg (GetDesktop(this), false, false);
aDlg->initFromPrsObject(aPrsObject);
- aDlg->show();
+ aDlg->show();
}
}*/
break;
/*{
VISU::Plot3D_i* aPrsObject = dynamic_cast<VISU::Plot3D_i*>(aPrs3d);
if (aPrsObject) {
- VisuGUI_Plot3DDlg* aDlg = new VisuGUI_Plot3DDlg();
+ VisuGUI_Plot3DDlg* aDlg = new VisuGUI_Plot3DDlg();
aDlg->initFromPrsObject(aPrsObject);
- aDlg->show();
- myActiveDialogBox = aDlg;
+ aDlg->show();
+ myActiveDialogBox = aDlg;
}
}*/
break;
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)) {
- anVISUActor = anVISUActor->GetParent();
- anVISUActor->VisibilityOff();
- }
+ if (anActor->GetVisibility() > 0)
+ if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
+ anVISUActor = anVISUActor->GetParent();
+ anVISUActor->VisibilityOff();
+ }
}
vw->Repaint();
}
if (aMesh) {
switch (aRepresent) {
case VISU::POINT :
- anOldColor = aMesh->GetNodeColor();
- break;
+ anOldColor = aMesh->GetNodeColor();
+ break;
case VISU::WIREFRAME :
case VISU::INSIDEFRAME :
- anOldColor = aMesh->GetLinkColor();
- break;
+ anOldColor = aMesh->GetLinkColor();
+ break;
case VISU::SHADED :
case VISU::SURFACEFRAME :
- anOldColor = aMesh->GetCellColor();
- break;
+ anOldColor = aMesh->GetCellColor();
+ break;
}
} else if (aDeformedShape) {
anOldColor = aDeformedShape->GetColor();
aNewColor.B = aColorNew.blue()/255.;
if (aMesh) {
switch (aRepresent) {
- case VISU::POINT :
- aMesh->SetNodeColor(aNewColor);
- break;
- case VISU::WIREFRAME :
- case VISU::INSIDEFRAME :
- aMesh->SetLinkColor(aNewColor);
- break;
- case VISU::SHADED :
- case VISU::SURFACEFRAME :
- aMesh->SetCellColor(aNewColor);
- break;
+ case VISU::POINT :
+ aMesh->SetNodeColor(aNewColor);
+ break;
+ case VISU::WIREFRAME :
+ case VISU::INSIDEFRAME :
+ aMesh->SetLinkColor(aNewColor);
+ break;
+ case VISU::SHADED :
+ case VISU::SURFACEFRAME :
+ aMesh->SetCellColor(aNewColor);
+ break;
}
} else {
aDeformedShape->SetColor(aNewColor);
if ( !CORBA::is_nil( aVisuObj ) && aVisuObj->GetType() == VISU::TTABLE ) {
CORBA::Object_ptr aTable = VISU::Table::_narrow( anObject );
if( !CORBA::is_nil( aTable ) ) {
- VISU::Table_i* table = dynamic_cast<VISU::Table_i*>( VISU::GetServant(aTable).in() );
- if ( table ) {
- SO = GetCStudy( GetAppStudy( this ) )->FindObjectID( table->GetObjectEntry() );
- }
+ VISU::Table_i* table = dynamic_cast<VISU::Table_i*>( VISU::GetServant(aTable).in() );
+ if ( table ) {
+ SO = GetCStudy( GetAppStudy( this ) )->FindObjectID( table->GetObjectEntry() );
+ }
}
}
} else {
return;
VisuGUI_TableDlg* dlg = new VisuGUI_TableDlg( GetDesktop( this ),
- SO,
- false,
- //SAL2670 Orientation of show tables
- VisuGUI_TableDlg::ttAuto,
- Qt::Vertical );
+ SO,
+ false,
+ //SAL2670 Orientation of show tables
+ VisuGUI_TableDlg::ttAuto,
+ Qt::Vertical );
dlg->show();
}
// Table (VISU object) is selected
CORBA::Object_ptr aTbl = VISU::Table::_narrow( anObject );
if( !CORBA::is_nil( aTbl ) ) {
- VISU::Table_i* table = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTbl).in());
- if ( table ) {
- _PTR(SObject) SO = aStudy->FindObjectID( table->GetObjectEntry() );
- if ( IsSObjectTable(SO) ) {
- // get name of SObject
- if ( SO->FindAttribute( anAttr, "AttributeName" ) ) {
- aName = anAttr;
- SOName = QString( aName->Value().c_str() );
- }
- SPlot2d_SetupPlot2dDlg* dlg = new SPlot2d_SetupPlot2dDlg( SO, GetDesktop( this ) );
- if ( dlg->exec() == QDialog::Accepted ) {
- if ( !IsStudyLocked( aStudy ) ) {
- // if study is not locked - create new container, create curves and insert them
- // into container, then plot container if current viewer is of VIEW_PLOT2D type
- int horIndex;
- QValueList<int> verIndices;
- dlg->getCurvesSource( horIndex, verIndices );
- if ( horIndex >= 0 && verIndices.count() > 0 ) {
- CORBA::Object_var aContainer = GetVisuGen(this)->CreateContainer();
- if( !CORBA::is_nil( aContainer ) ) {
- VISU::Container_i* pContainer =
+ VISU::Table_i* table = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTbl).in());
+ if ( table ) {
+ _PTR(SObject) SO = aStudy->FindObjectID( table->GetObjectEntry() );
+ if ( IsSObjectTable(SO) ) {
+ // get name of SObject
+ if ( SO->FindAttribute( anAttr, "AttributeName" ) ) {
+ aName = anAttr;
+ SOName = QString( aName->Value().c_str() );
+ }
+ SPlot2d_SetupPlot2dDlg* dlg = new SPlot2d_SetupPlot2dDlg( SO, GetDesktop( this ) );
+ if ( dlg->exec() == QDialog::Accepted ) {
+ if ( !IsStudyLocked( aStudy ) ) {
+ // if study is not locked - create new container, create curves and insert them
+ // into container, then plot container if current viewer is of VIEW_PLOT2D type
+ int horIndex;
+ QValueList<int> verIndices;
+ dlg->getCurvesSource( horIndex, verIndices );
+ if ( horIndex >= 0 && verIndices.count() > 0 ) {
+ CORBA::Object_var aContainer = GetVisuGen(this)->CreateContainer();
+ if( !CORBA::is_nil( aContainer ) ) {
+ VISU::Container_i* pContainer =
dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
- if ( pContainer ) {
- for ( int i = 0; i < verIndices.count(); i++ ) {
- CORBA::Object_var aNewCurve =
+ if ( pContainer ) {
+ for ( int i = 0; i < verIndices.count(); i++ ) {
+ CORBA::Object_var aNewCurve =
GetVisuGen(this)->CreateCurve( table->_this(), horIndex+1, verIndices[i]+1 );
- if( !CORBA::is_nil( aNewCurve ) ) {
- VISU::Curve_i* pCrv =
+ if( !CORBA::is_nil( aNewCurve ) ) {
+ VISU::Curve_i* pCrv =
dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aNewCurve).in());
- if ( pCrv ) {
- bool isAuto;
- int marker, line, lineWidth;
- QColor color;
- if ( dlg->getCurveAttributes(verIndices[i], isAuto, marker,
+ if ( pCrv ) {
+ bool isAuto;
+ int marker, line, lineWidth;
+ QColor color;
+ if ( dlg->getCurveAttributes(verIndices[i], isAuto, marker,
line, lineWidth, color) && !isAuto ) {
- SALOMEDS::Color c;
+ SALOMEDS::Color c;
c.R = color.red() /255.;
c.G = color.green()/255.;
c.B = color.blue() /255.;
- pCrv->SetColor( c );
- pCrv->SetMarker( ( VISU::Curve::MarkerType )marker );
- pCrv->SetLine( ( VISU::Curve::LineType )line, lineWidth );
- }
- pContainer->AddCurve( pCrv->_this() );
- }
- }
- }
- updateObjBrowser();
- PlotContainer( this, pContainer, VISU::eDisplay );
- }
- }
- }
- }
- else {
- // if study is locked just get curves info and plot them
+ pCrv->SetColor( c );
+ pCrv->SetMarker( ( VISU::Curve::MarkerType )marker );
+ pCrv->SetLine( ( VISU::Curve::LineType )line, lineWidth );
+ }
+ pContainer->AddCurve( pCrv->_this() );
+ }
+ }
+ }
+ updateObjBrowser();
+ PlotContainer( this, pContainer, VISU::eDisplay );
+ }
+ }
+ }
+ }
+ else {
+ // if study is locked just get curves info and plot them
// if current viewer is of VIEW_PLOT2D type
- QPtrList<Plot2d_Curve> container;
- dlg->getCurves( container );
- if ( !container.isEmpty() ) {
- GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
- GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( SOName );
- }
- }
- }
- delete dlg;
- }
- }
+ QPtrList<Plot2d_Curve> container;
+ dlg->getCurves( container );
+ if ( !container.isEmpty() ) {
+ GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
+ GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( SOName );
+ }
+ }
+ }
+ delete dlg;
+ }
+ }
}
}
}
if ( IsSObjectTable(SO) ) {
// get name of SObject
if ( SO->FindAttribute( anAttr, "AttributeName" ) ) {
- aName = anAttr;
- SOName = QString( aName->Value().c_str() );
+ aName = anAttr;
+ SOName = QString( aName->Value().c_str() );
}
SPlot2d_SetupPlot2dDlg* dlg = new SPlot2d_SetupPlot2dDlg( SO, GetDesktop( this ) );
if ( dlg->exec() == QDialog::Accepted ) {
- if ( !IsStudyLocked( aStudy ) ) {
- // if study is not locked - create new table and container objects, create curves
- // and insert them into container, then plot container if current viewer is of VIEW_PLOT2D type
- int horIndex;
- QValueList<int> verIndices;
- dlg->getCurvesSource( horIndex, verIndices );
- if ( horIndex >= 0 && verIndices.count() > 0 ) {
- CORBA::Object_var aTable = GetVisuGen(this)->CreateTable( SO->GetID().c_str() );
- CORBA::Object_var aContainer = GetVisuGen(this)->CreateContainer();
- if ( !CORBA::is_nil( aTable ) && !CORBA::is_nil( aContainer ) ) {
- VISU::Table_i* pTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTable).in());
- VISU::Container_i* pContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
-
- if ( pContainer && pTable ) {
- for ( int i = 0; i < verIndices.count(); i++ ) {
- CORBA::Object_var aNewCurve = GetVisuGen(this)->CreateCurve
+ if ( !IsStudyLocked( aStudy ) ) {
+ // if study is not locked - create new table and container objects, create curves
+ // and insert them into container, then plot container if current viewer is of VIEW_PLOT2D type
+ int horIndex;
+ QValueList<int> verIndices;
+ dlg->getCurvesSource( horIndex, verIndices );
+ if ( horIndex >= 0 && verIndices.count() > 0 ) {
+ CORBA::Object_var aTable = GetVisuGen(this)->CreateTable( SO->GetID().c_str() );
+ CORBA::Object_var aContainer = GetVisuGen(this)->CreateContainer();
+ if ( !CORBA::is_nil( aTable ) && !CORBA::is_nil( aContainer ) ) {
+ VISU::Table_i* pTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTable).in());
+ VISU::Container_i* pContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
+
+ if ( pContainer && pTable ) {
+ for ( int i = 0; i < verIndices.count(); i++ ) {
+ CORBA::Object_var aNewCurve = GetVisuGen(this)->CreateCurve
( pTable->_this(), horIndex+1, verIndices[i]+1 );
- if( !CORBA::is_nil( aNewCurve ) ) {
- VISU::Curve_i* pCrv = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aNewCurve).in());
- if ( pCrv ) {
- bool isAuto;
- int marker, line, lineWidth;
- QColor color;
- if ( dlg->getCurveAttributes(verIndices[i], isAuto, marker,
+ if( !CORBA::is_nil( aNewCurve ) ) {
+ VISU::Curve_i* pCrv = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aNewCurve).in());
+ if ( pCrv ) {
+ bool isAuto;
+ int marker, line, lineWidth;
+ QColor color;
+ if ( dlg->getCurveAttributes(verIndices[i], isAuto, marker,
line, lineWidth, color) && !isAuto ) {
- SALOMEDS::Color c;
- c.R = color.red()/255.;
- c.G = color.green()/255.;
- c.B = color.blue()/255.;
- pCrv->SetColor( c );
- pCrv->SetMarker( ( VISU::Curve::MarkerType )marker );
- pCrv->SetLine( ( VISU::Curve::LineType )line, lineWidth );
- }
- pContainer->AddCurve( pCrv->_this() );
- }
- }
- }
- updateObjBrowser();
- PlotContainer( this, pContainer, VISU::eDisplay );
- }
- }
- }
- } else {
- // if study is locked just get curves info and plot them
- QPtrList<Plot2d_Curve> container;
- dlg->getCurves( container );
- if ( !container.isEmpty() ) {
- GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
- GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( SOName );
- }
- }
+ SALOMEDS::Color c;
+ c.R = color.red()/255.;
+ c.G = color.green()/255.;
+ c.B = color.blue()/255.;
+ pCrv->SetColor( c );
+ pCrv->SetMarker( ( VISU::Curve::MarkerType )marker );
+ pCrv->SetLine( ( VISU::Curve::LineType )line, lineWidth );
+ }
+ pContainer->AddCurve( pCrv->_this() );
+ }
+ }
+ }
+ updateObjBrowser();
+ PlotContainer( this, pContainer, VISU::eDisplay );
+ }
+ }
+ }
+ } else {
+ // if study is locked just get curves info and plot them
+ QPtrList<Plot2d_Curve> container;
+ dlg->getCurves( container );
+ if ( !container.isEmpty() ) {
+ GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
+ GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( SOName );
+ }
+ }
}
delete dlg;
}
if( !CORBA::is_nil( aCurve ) ) {
VISU::Curve_i* aDSCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
if ( aDSCurve && (!IsStudyLocked( GetCStudy(aAppStudy) )) ) {
- Plot2d_SetupCurveDlg aDlg(GetDesktop( this ));
-
- aDlg.setLine( (int)aDSCurve->GetLine(), aDSCurve->GetLineWidth() );
- aDlg.setMarker( (int)aDSCurve->GetMarker() );
- SALOMEDS::Color aColor = aDSCurve->GetColor();
- aDlg.setColor( QColor( (int)(aColor.R*255.), (int)(aColor.G*255.), (int)(aColor.B*255.) ) );
- if( aDlg.exec() == QDialog::Accepted ) {
- aDSCurve->SetLine( (VISU::Curve::LineType)aDlg.getLine(), aDlg.getLineWidth() );
- aDSCurve->SetMarker( (VISU::Curve::MarkerType)aDlg.getMarker());
- SALOMEDS::Color newColor;
- newColor.R = aDlg.getColor().red()/255.;
- newColor.G = aDlg.getColor().green()/255.;
- newColor.B = aDlg.getColor().blue()/255.;
- aDSCurve->SetColor( newColor );
- PlotCurve(this, aDSCurve, VISU::eDisplay);
- }
+ Plot2d_SetupCurveDlg aDlg(GetDesktop( this ));
+
+ aDlg.setLine( (int)aDSCurve->GetLine(), aDSCurve->GetLineWidth() );
+ aDlg.setMarker( (int)aDSCurve->GetMarker() );
+ SALOMEDS::Color aColor = aDSCurve->GetColor();
+ aDlg.setColor( QColor( (int)(aColor.R*255.), (int)(aColor.G*255.), (int)(aColor.B*255.) ) );
+ if( aDlg.exec() == QDialog::Accepted ) {
+ aDSCurve->SetLine( (VISU::Curve::LineType)aDlg.getLine(), aDlg.getLineWidth() );
+ aDSCurve->SetMarker( (VISU::Curve::MarkerType)aDlg.getMarker());
+ SALOMEDS::Color newColor;
+ newColor.R = aDlg.getColor().red()/255.;
+ newColor.G = aDlg.getColor().green()/255.;
+ newColor.B = aDlg.getColor().blue()/255.;
+ aDSCurve->SetColor( newColor );
+ PlotCurve(this, aDSCurve, VISU::eDisplay);
+ }
}
}
}
if (!CORBA::is_nil(aCnt)) {
VISU::Container_i* container = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aCnt).in());
if (container && container->GetNbCurves() > 0) {
- container->Clear();
- updateObjBrowser();
+ container->Clear();
+ updateObjBrowser();
}
}
}
VISU::Curve_i* curve =
dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
if (curve)
- curve->SetName(Name.latin1());
+ curve->SetName(Name.latin1());
}
break;
}
VISU::Table_i* table =
dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTable).in());
if (table)
- table->SetName(Name.latin1());
+ table->SetName(Name.latin1());
}
break;
}
VISU::Container_i* container =
dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
if (container)
- container->SetName(Name.latin1());
+ container->SetName(Name.latin1());
}
break;
}
}
// rename the study object
- //getApp()->activeStudy()->renameIObject(anIO, Name);
aName->SetValue(Name.latin1()); // rename the SObject
anIO->setName(Name.latin1()); // rename the InteractiveObject
updateObjBrowser(false);
try {
for (int j = 0; j < aCycles; j++) {
for (int i = 0; i <= aSteps; i++) {
- float aPercents = float(i)/aSteps;
- aPrsObject->SetMapScale(aPercents);
- aPrsObject->UpdateActor(aActor);
- vw->getRenderWindow()->getRenderWindow()->Render();
- usleep(aTemp);
+ float aPercents = float(i)/aSteps;
+ aPrsObject->SetMapScale(aPercents);
+ aPrsObject->UpdateActor(aActor);
+ vw->getRenderWindow()->getRenderWindow()->Render();
+ usleep(aTemp);
}
}
} catch (std::exception& exc) {
if (getValue(aSObject, "myComment") == QString("FIELD")) {
long aNumber = getValue(aSObject, "myNbTimeStamps").toLong();
if (aNumber > 1) {
- if (!isDefined) {
- aNbTimes = aNumber;
- aAnimationDlg->addField(aSObject);
- isDefined = true;
- } else if (aNbTimes == aNumber) {
- aAnimationDlg->addField(aSObject);
- }
+ if (!isDefined) {
+ aNbTimes = aNumber;
+ aAnimationDlg->addField(aSObject);
+ isDefined = true;
+ } else if (aNbTimes == aNumber) {
+ aAnimationDlg->addField(aSObject);
+ }
}
}
}
std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
if (!aPrsList.empty()) {
for (int i = 0, n = aPrsList.size(); i < n; i++) {
- VISU::Prs3d_i* aPrsObject = aPrsList[i];
- if (aPrsObject) {
- VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
- if (aScalar) {
- if (first) {
- first = false;
- aMin = aScalar->GetMin(); aMax = aScalar->GetMax();
- } else {
- if (aScalar->GetMin() < aMin) aMin = aScalar->GetMin();
- if (aScalar->GetMax() > aMax) aMax = aScalar->GetMax();
- }
- }
- }
+ VISU::Prs3d_i* aPrsObject = aPrsList[i];
+ if (aPrsObject) {
+ VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
+ if (aScalar) {
+ if (first) {
+ first = false;
+ aMin = aScalar->GetMin(); aMax = aScalar->GetMax();
+ } else {
+ if (aScalar->GetMin() < aMin) aMin = aScalar->GetMin();
+ if (aScalar->GetMax() > aMax) aMax = aScalar->GetMax();
+ }
+ }
+ }
}
}
}
std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
if (!aPrsList.empty()) {
for (int i = 0, n = aPrsList.size(); i < n; i++) {
- VISU::Prs3d_i* aPrsObject = aPrsList[i];
- if(aPrsObject){
- VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
- if (aScalar) {
- aScalar->SetRange(aMin, aMax);
- RecreateActor(this, aScalar);
- update = true;
- }
- }
+ VISU::Prs3d_i* aPrsObject = aPrsList[i];
+ if(aPrsObject){
+ VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
+ if (aScalar) {
+ aScalar->SetRange(aMin, aMax);
+ RecreateActor(this, aScalar);
+ update = true;
+ }
+ }
}
}
}
if (update) {
if (SVTK_ViewWindow* vw = GetViewWindow(this)) {
//if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
- vw->getRenderer()->ResetCameraClippingRange();
- vw->Repaint();
+ vw->getRenderer()->ResetCameraClippingRange();
+ vw->Repaint();
//}
}
}
std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
if (!aPrsList.empty()) {
for (int i = 0, n = aPrsList.size(); i < n; i++) {
- VISU::Prs3d_i* aPrsObject = aPrsList[i];
- if (aPrsObject) {
- VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
- if (aScalar) {
- aScalar->SetSourceRange();
- RecreateActor(this, aScalar);
- update = true;
- }
- }
+ VISU::Prs3d_i* aPrsObject = aPrsList[i];
+ if (aPrsObject) {
+ VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
+ if (aScalar) {
+ aScalar->SetSourceRange();
+ RecreateActor(this, aScalar);
+ update = true;
+ }
+ }
}
}
}
if (update) {
if (SVTK_ViewWindow* vw = GetViewWindow(this)) {
//if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
- vw->getRenderer()->ResetCameraClippingRange();
- vw->Repaint();
+ vw->getRenderer()->ResetCameraClippingRange();
+ vw->Repaint();
//}
}
}
if (anIO->hasEntry()) {
_PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
if (aSObject) {
- CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
- if (!CORBA::is_nil(aCORBAObject)) {
- PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
- if (VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in())) {
- aDlg->addPresentation(aPrsObject);
- }
- }
+ CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
+ if (!CORBA::is_nil(aCORBAObject)) {
+ PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
+ if (VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in())) {
+ aDlg->addPresentation(aPrsObject);
+ }
+ }
}
}
}
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
// Create actions
- createAction( VISU_IMPORT_FROM_FILE, "", QIconSet(), tr("MEN_IMPORT_FROM_FILE"), "", (CTRL + Key_I), aParent, false,
- this, SLOT(OnImportFromFile()));
- createAction( VISU_EXPLORE_MED, "", QIconSet(), tr("MEN_EXPLORE_MED_FILE"), "", (CTRL + Key_M), aParent, false,
- this, SLOT(OnExploreMEDFile()));
- createAction( VISU_IMPORT_TABLE, "", QIconSet(), tr("MEN_IMPORT_TABLE"), "", 0, aParent, false,
- this, SLOT(OnImportTableFromFile()));
+ createAction( VISU_IMPORT_FROM_FILE, "", QIconSet(),
+ tr("MEN_IMPORT_FROM_FILE"), "", (CTRL + Key_I), aParent, false,
+ this, SLOT(OnImportFromFile()));
+
+ createAction( VISU_EXPLORE_MED, "", QIconSet(),
+ tr("MEN_EXPLORE_MED_FILE"), "", (CTRL + Key_M), aParent, false,
+ this, SLOT(OnExploreMEDFile()));
+
+ createAction( VISU_IMPORT_TABLE, "", QIconSet(),
+ tr("MEN_IMPORT_TABLE"), "", 0, aParent, false,
+ this, SLOT(OnImportTableFromFile()));
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SCALAR_MAP"));
- createAction( VISU_SCALAR_MAP, tr("MEN_SCALAR_MAP"), QIconSet(aPixmap), tr("MEN_SCALAR_MAP"), "", 0, aParent, false,
- this, SLOT(OnCreateScalarMap()));
+ createAction( VISU_SCALAR_MAP, tr("MEN_SCALAR_MAP"), QIconSet(aPixmap),
+ tr("MEN_SCALAR_MAP"), "", 0, aParent, false,
+ this, SLOT(OnCreateScalarMap()));
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_DEFORMED_SHAPE"));
- createAction( VISU_DEFORMED_SHAPE, tr("MEN_DEFORMED_SHAPE"), QIconSet(aPixmap), tr("MEN_DEFORMED_SHAPE"), "", 0, aParent, false,
- this, SLOT(OnCreateDeformedShape()));
+ createAction( VISU_DEFORMED_SHAPE, tr("MEN_DEFORMED_SHAPE"), QIconSet(aPixmap),
+ tr("MEN_DEFORMED_SHAPE"), "", 0, aParent, false,
+ this, SLOT(OnCreateDeformedShape()));
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_VECTORS"));
- createAction( VISU_VECTORS, tr("MEN_VECTORS"), QIconSet(aPixmap), tr("MEN_VECTORS"), "", 0, aParent, false,
- this, SLOT(OnCreateVectors()));
+ createAction( VISU_VECTORS, tr("MEN_VECTORS"), QIconSet(aPixmap),
+ tr("MEN_VECTORS"), "", 0, aParent, false,
+ this, SLOT(OnCreateVectors()));
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ISO_SURFACES"));
- createAction( VISU_ISO_SURFACES, tr("MEN_ISO_SURFACES"), QIconSet(aPixmap), tr("MEN_ISO_SURFACES"), "", 0, aParent, false,
- this, SLOT(OnCreateIsoSurfaces()));
+ createAction( VISU_ISO_SURFACES, tr("MEN_ISO_SURFACES"), QIconSet(aPixmap),
+ tr("MEN_ISO_SURFACES"), "", 0, aParent, false,
+ this, SLOT(OnCreateIsoSurfaces()));
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_PLANES"));
- createAction( VISU_CUT_PLANES, tr("MEN_CUT_PLANES"), QIconSet(aPixmap), tr("MEN_CUT_PLANES"), "", 0, aParent, false,
- this, SLOT(OnCreateCutPlanes()));
+ createAction( VISU_CUT_PLANES, tr("MEN_CUT_PLANES"), QIconSet(aPixmap),
+ tr("MEN_CUT_PLANES"), "", 0, aParent, false,
+ this, SLOT(OnCreateCutPlanes()));
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_STREAM_LINES"));
- createAction( VISU_STREAM_LINES, tr("MEN_STREAM_LINES"), QIconSet(aPixmap), tr("MEN_STREAM_LINES"), "", 0, aParent, false,
- this, SLOT(OnCreateStreamLines()));
+ createAction( VISU_STREAM_LINES, tr("MEN_STREAM_LINES"), QIconSet(aPixmap),
+ tr("MEN_STREAM_LINES"), "", 0, aParent, false,
+ this, SLOT(OnCreateStreamLines()));
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_LINES"));
- createAction( VISU_CUT_LINES, tr("MEN_CUT_LINES"), QIconSet(aPixmap), tr("MEN_CUT_LINES"), "", 0, aParent, false,
- this, SLOT(OnCreateCutLines()));
+ createAction( VISU_CUT_LINES, tr("MEN_CUT_LINES"), QIconSet(aPixmap),
+ tr("MEN_CUT_LINES"), "", 0, aParent, false,
+ this, SLOT(OnCreateCutLines()));
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT_3D"));
createAction( VISU_PLOT_3D, tr("MEN_PLOT_3D"), QIconSet(aPixmap),
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT2D"));
createAction( VISU_PLOT2D, tr("MEN_CREATE_PLOT2D"), QIconSet(aPixmap),
tr("MEN_CREATE_PLOT2D"), "", 0, aParent, false,
- this, SLOT(OnCreatePlot2dView()));
+ this, SLOT(OnCreatePlot2dView()));
createAction( VISU_DELETE_OBJS, tr("MEN_DELETE_OBJS"), QIconSet(),
tr("MEN_DELETE_OBJS"), "", 0, aParent, false,
this, SLOT(OnDeleteObjects()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- //createAction( 4022, tr("MEN_RENAME_TABLE"), QIconSet(aPixmap), tr("MEN_RENAME_TABLE"), "", 0, aParent, false,
- //this, SLOT(OnRenameTable()));
+ createAction( VISU_SHOW_TABLE, tr("MEN_SHOW_TABLE"), QIconSet(),
+ tr("MEN_SHOW_TABLE"), "", 0, aParent, false,
+ this, SLOT(OnShowTable()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_SHOW_TABLE, tr("MEN_SHOW_TABLE"), QIconSet(), tr("MEN_SHOW_TABLE"), "", 0, aParent, false,
- this, SLOT(OnShowTable()));
+ createAction( VISU_CREATE_CURVES, tr("MEN_CREATE_CURVES"), QIconSet(),
+ tr("MEN_CREATE_CURVES"), "", 0, aParent, false,
+ this, SLOT(OnPlotData()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_CREATE_CURVES, tr("MEN_CREATE_CURVES"), QIconSet(), tr("MEN_CREATE_CURVES"), "", 0, aParent, false,
- this, SLOT(OnPlotData()));
-
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_EXPORT_TABLE, tr("MEN_EXPORT_TABLE"), QIconSet(), tr("MEN_EXPORT_TABLE"), "", 0, aParent, false,
- this, SLOT(OnExportTableToFile()));
+ createAction( VISU_EXPORT_TABLE, tr("MEN_EXPORT_TABLE"), QIconSet(),
+ tr("MEN_EXPORT_TABLE"), "", 0, aParent, false,
+ this, SLOT(OnExportTableToFile()));
createAction( VISU_IMPORT_MED_STRUCTURE, tr("MEN_IMPORT_MED_STRUCTURE"), QIconSet(),
tr("MEN_IMPORT_MED_STRUCTURE"), "", 0, aParent, false,
- this, SLOT(OnImportMedField()));
+ this, SLOT(OnImportMedField()));
createAction( VISU_IMPORT_MED_TIMESTAMP, tr("MEN_IMPORT_MED_TIMESTAMP"), QIconSet(),
tr("MEN_IMPORT_MED_TIMESTAMP"), "", 0, aParent, false,
- this, SLOT(OnImportMedField()));
+ this, SLOT(OnImportMedField()));
createAction( VISU_IMPORT_MED_FIELD, tr("MEN_IMPORT_MED_FIELD"), QIconSet(),
tr("MEN_IMPORT_MED_FIELD"), "", 0, aParent, false,
- this, SLOT(OnImportMedField()));
+ this, SLOT(OnImportMedField()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_CREATE_PRS, tr("MEN_CREATE_PRS"), QIconSet(), tr("MEN_CREATE_PRS"), "", 0, aParent, false,
- this, SLOT(OnCreateMesh()));
+ createAction( VISU_CREATE_PRS, tr("MEN_CREATE_PRS"), QIconSet(),
+ tr("MEN_CREATE_PRS"), "", 0, aParent, false,
+ this, SLOT(OnCreateMesh()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
createAction( VISU_CREATE_MANY_PRS, tr("MEN_CREATE_MANY_PRS"), QIconSet(),
tr("MEN_CREATE_MANY_PRS"), "", 0, aParent, false,
- this, SLOT(OnCreateManyMesh()));
+ this, SLOT(OnCreateManyMesh()));
createAction( VISU_TRANSLATE_PRS, tr("MEN_TRANSLATE_PRS"), QIconSet(),
tr("MEN_TRANSLATE_PRS"), "", 0, aParent, false,
- this, SLOT(OnTranslatePrs()));
+ this, SLOT(OnTranslatePrs()));
createAction( VISU_MERGE_SCALAR_BARS, tr("MEN_MERGE_SCALAR_BARS"), QIconSet(),
tr("MEN_MERGE_SCALAR_BARS"), "", 0, aParent, false,
- this, SLOT(OnMergeScalarBars()));
+ this, SLOT(OnMergeScalarBars()));
createAction( VISU_FREE_SCALAR_BARS, tr("MEN_FREE_SCALAR_BARS"), QIconSet(),
tr("MEN_FREE_SCALAR_BARS"), "", 0, aParent, false,
- this, SLOT(OnFreeScalarBars()));
+ this, SLOT(OnFreeScalarBars()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ERASE"));
- createAction( VISU_ERASE, tr("MEN_ERASE"), QIconSet(), tr("MEN_ERASE"), "", 0, aParent, false,
- this, SLOT(OnErasePrs()));
+ createAction( VISU_ERASE, tr("MEN_ERASE"), QIconSet(),
+ tr("MEN_ERASE"), "", 0, aParent, false,
+ this, SLOT(OnErasePrs()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_DISPLAY, tr("MEN_DISPLAY"), QIconSet(), tr("MEN_DISPLAY"), "", 0, aParent, false,
- this, SLOT(OnDisplayPrs()));
+ createAction( VISU_DISPLAY, tr("MEN_DISPLAY"), QIconSet(),
+ tr("MEN_DISPLAY"), "", 0, aParent, false,
+ this, SLOT(OnDisplayPrs()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_DISPLAY_ONLY, tr("MEN_DISPLAY_ONLY"), QIconSet(), tr("MEN_DISPLAY_ONLY"), "", 0, aParent, false,
- this, SLOT(OnDisplayOnlyPrs()));
+ createAction( VISU_DISPLAY_ONLY, tr("MEN_DISPLAY_ONLY"), QIconSet(),
+ tr("MEN_DISPLAY_ONLY"), "", 0, aParent, false,
+ this, SLOT(OnDisplayOnlyPrs()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_COPY_PRS, tr("MEN_COPY_PRS"), QIconSet(), tr("MEN_COPY_PRS"), "", 0, aParent, false,
- this, SLOT(OnCopyPresentation()));
+ createAction( VISU_COPY_PRS, tr("MEN_COPY_PRS"), QIconSet(),
+ tr("MEN_COPY_PRS"), "", 0, aParent, false,
+ this, SLOT(OnCopyPresentation()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_CURVE_PROPS, tr("MEN_CURVE_PROPS"), QIconSet(), tr("MEN_CURVE_PROPS"), "", 0, aParent, false,
- this, SLOT(OnCurveProperties()));
+ createAction( VISU_CURVE_PROPS, tr("MEN_CURVE_PROPS"), QIconSet(),
+ tr("MEN_CURVE_PROPS"), "", 0, aParent, false,
+ this, SLOT(OnCurveProperties()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
createAction( VISU_RENAME, tr("MEN_RENAME"), QIconSet(), tr("MEN_RENAME"), "", 0, aParent, false,
- this, SLOT(OnRename()));
-
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_EDIT_CONTAINER, tr("MEN_EDIT_CONTAINER"), QIconSet(), tr("MEN_EDIT_CONTAINER"), "", 0, aParent, false,
- this, SLOT(OnEditContainer()));
+ this, SLOT(OnRename()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- //createAction( 4043, tr("MEN_RENAME_CONTAINER"), QIconSet(aPixmap), tr("MEN_RENAME_CONTAINER"), "", 0, aParent, false,
- //this, SLOT(OnRenameContainer()));
+ createAction( VISU_EDIT_CONTAINER, tr("MEN_EDIT_CONTAINER"), QIconSet(),
+ tr("MEN_EDIT_CONTAINER"), "", 0, aParent, false,
+ this, SLOT(OnEditContainer()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_CLEAR_CONTAINER, tr("MEN_CLEAR_CONTAINER"), QIconSet(), tr("MEN_CLEAR_CONTAINER"), "", 0, aParent, false,
- this, SLOT(OnClearContainer()));
+ createAction( VISU_CLEAR_CONTAINER, tr("MEN_CLEAR_CONTAINER"), QIconSet(),
+ tr("MEN_CLEAR_CONTAINER"), "", 0, aParent, false,
+ this, SLOT(OnClearContainer()));
createAction( VISU_SAVE_VIEW_PARAMS, tr("MEN_SAVE_VIEWPARAMS"), QIconSet(),
tr("MEN_SAVE_VIEWPARAMS"), "", 0, aParent, false,
- this, SLOT(OnSaveViewParams()));
+ this, SLOT(OnSaveViewParams()));
createAction( VISU_SAVE_VIEW_PARAMS_1, tr("MEN_SAVE_VIEWPARAMS"), QIconSet(),
tr("MEN_SAVE_VIEWPARAMS"), "", 0, aParent, false,
- this, SLOT(OnSaveViewParams()));
+ this, SLOT(OnSaveViewParams()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
createAction( VISU_RESTORE_VIEW_PARAMS, tr("MEN_RESTORE_VIEWPARAMS"), QIconSet(),
tr("MEN_RESTORE_VIEWPARAMS"), "", 0, aParent, false,
- this, SLOT(OnRestoreViewParams()));
+ this, SLOT(OnRestoreViewParams()));
- createAction( VISU_DELETE_VIEW_PARAMS, tr("MEN_DELETE_VIEWPARAMS"), QIconSet(),
- tr("MEN_DELETE_VIEWPARAMS"), "", 0, aParent, false,
- //this, SLOT(OnDeleteViewParams()));
- this, SLOT(OnDeleteObjects()));
+ //createAction( VISU_DELETE_VIEW_PARAMS, tr("MEN_DELETE_VIEWPARAMS"), QIconSet(),
+ // tr("MEN_DELETE_VIEWPARAMS"), "", 0, aParent, false,
+ // this, SLOT(OnDeleteObjects()));
createAction( VISU_ARRANGE_ACTORS, tr("MEN_ARRANGE_ACTORS"), QIconSet(),
tr("MEN_ARRANGE_ACTORS"), "", 0, aParent, false,
- this, SLOT(OnArrangeActors()));
+ this, SLOT(OnArrangeActors()));
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_POINTS"));
- createAction( VISU_POINTS, tr("MEN_POINTS"), QIconSet(aPixmap), tr("MEN_POINTS"), "", 0, aParent, false,
- this, SLOT(OnMakePoints()));
+ createAction( VISU_POINTS, tr("MEN_POINTS"), QIconSet(aPixmap),
+ tr("MEN_POINTS"), "", 0, aParent, false,
+ this, SLOT(OnMakePoints()));
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_WIREFRAME"));
- createAction( VISU_WIREFRAME, tr("MEN_WIREFRAME"), QIconSet(aPixmap), tr("MEN_WIREFRAME"), "", 0, aParent, false,
- this, SLOT(OnMakeWireframe()));
+ createAction( VISU_WIREFRAME, tr("MEN_WIREFRAME"), QIconSet(aPixmap),
+ tr("MEN_WIREFRAME"), "", 0, aParent, false,
+ this, SLOT(OnMakeWireframe()));
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SURFACE"));
- createAction( VISU_SURFACE, tr("MEN_SURFACE"), QIconSet(aPixmap), tr("MEN_SURFACE"), "", 0, aParent, false,
- this, SLOT(OnMakeSurface()));
+ createAction( VISU_SURFACE, tr("MEN_SURFACE"), QIconSet(aPixmap),
+ tr("MEN_SURFACE"), "", 0, aParent, false,
+ this, SLOT(OnMakeSurface()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_INSIDEFRAME, tr("MEN_INSIDEFRAME"), QIconSet(), tr("MEN_INSIDEFRAME"), "", 0, aParent, false,
- this, SLOT(OnMakeInsideframe()));
+ createAction( VISU_INSIDEFRAME, tr("MEN_INSIDEFRAME"), QIconSet(),
+ tr("MEN_INSIDEFRAME"), "", 0, aParent, false,
+ this, SLOT(OnMakeInsideframe()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_SURFACEFRAME, tr("MEN_SURFACEFRAME"), QIconSet(), tr("MEN_SURFACEFRAME"), "", 0, aParent, false,
- this, SLOT(OnMakeSurfaceframe()));
+ createAction( VISU_SURFACEFRAME, tr("MEN_SURFACEFRAME"), QIconSet(),
+ tr("MEN_SURFACEFRAME"), "", 0, aParent, false,
+ this, SLOT(OnMakeSurfaceframe()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_SHRINK, tr("MEN_SHRINK"), QIconSet(), tr("MEN_SHRINK"), "", 0, aParent, false,
- this, SLOT(OnMakeShrink()));
+ createAction( VISU_SHRINK, tr("MEN_SHRINK"), QIconSet(),
+ tr("MEN_SHRINK"), "", 0, aParent, false,
+ this, SLOT(OnMakeShrink()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_UNSHRINK, tr("MEN_UNSHRINK"), QIconSet(), tr("MEN_UNSHRINK"), "", 0, aParent, false,
- this, SLOT(OnMakeShrink()));
+ createAction( VISU_UNSHRINK, tr("MEN_UNSHRINK"), QIconSet(),
+ tr("MEN_UNSHRINK"), "", 0, aParent, false,
+ this, SLOT(OnMakeShrink()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_CELL_COLOR, tr("MEN_CELL_COLOR"), QIconSet(), tr("MEN_CELL_COLOR"), "", 0, aParent, false,
- this, SLOT(OnChangeColor()));
+ createAction( VISU_CELL_COLOR, tr("MEN_CELL_COLOR"), QIconSet(),
+ tr("MEN_CELL_COLOR"), "", 0, aParent, false,
+ this, SLOT(OnChangeColor()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_COLOR, tr("MEN_COLOR"), QIconSet(), tr("MEN_COLOR"), "", 0, aParent, false,
- this, SLOT(OnChangeColor()));
+ createAction( VISU_COLOR, tr("MEN_COLOR"), QIconSet(),
+ tr("MEN_COLOR"), "", 0, aParent, false,
+ this, SLOT(OnChangeColor()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_EDGE_COLOR, tr("MEN_EDGE_COLOR"), QIconSet(), tr("MEN_EDGE_COLOR"), "", 0, aParent, false,
- this, SLOT(OnChangeWireframeColor()));
+ createAction( VISU_EDGE_COLOR, tr("MEN_EDGE_COLOR"), QIconSet(),
+ tr("MEN_EDGE_COLOR"), "", 0, aParent, false,
+ this, SLOT(OnChangeWireframeColor()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_OPACITY, tr("MEN_OPACITY"), QIconSet(), tr("MEN_OPACITY"), "", 0, aParent, false,
- this, SLOT(OnChangeOpacity()));
+ createAction( VISU_OPACITY, tr("MEN_OPACITY"), QIconSet(),
+ tr("MEN_OPACITY"), "", 0, aParent, false,
+ this, SLOT(OnChangeOpacity()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_LINE_WIDTH, tr("MEN_LINE_WIDTH"), QIconSet(), tr("MEN_LINE_WIDTH"), "", 0, aParent, false,
- this, SLOT(OnChangeLines()));
+ createAction( VISU_LINE_WIDTH, tr("MEN_LINE_WIDTH"), QIconSet(),
+ tr("MEN_LINE_WIDTH"), "", 0, aParent, false,
+ this, SLOT(OnChangeLines()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_EDIT_PRS, tr("MEN_EDIT_PRS"), QIconSet(), tr("MEN_EDIT_PRS"), "", 0, aParent, false,
- this, SLOT(OnEditPrs()));
+ createAction( VISU_EDIT_PRS, tr("MEN_EDIT_PRS"), QIconSet(),
+ tr("MEN_EDIT_PRS"), "", 0, aParent, false,
+ this, SLOT(OnEditPrs()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
- createAction( VISU_CREATE_TABLE, tr("MEN_CREATE_TABLE"), QIconSet(), tr("MEN_CREATE_TABLE"), "", 0, aParent, false,
- this, SLOT(OnCreateTable()));
+ createAction( VISU_CREATE_TABLE, tr("MEN_CREATE_TABLE"), QIconSet(),
+ tr("MEN_CREATE_TABLE"), "", 0, aParent, false,
+ this, SLOT(OnCreateTable()));
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SWEEP"));
- createAction( VISU_SWEEP, tr("MEN_SWEEP"), QIconSet(aPixmap), tr("MEN_SWEEP"), "", 0, aParent, false,
- this, SLOT(OnSweep()));
+ createAction( VISU_SWEEP, tr("MEN_SWEEP"), QIconSet(aPixmap),
+ tr("MEN_SWEEP"), "", 0, aParent, false,
+ this, SLOT(OnSweep()));
createAction( VISU_CLIPPING, tr("MEN_CLIPPING"), QIconSet(),
tr("MEN_CLIPPING"), "", 0, aParent, false,
- this, SLOT(OnClippingPlanes()));
+ this, SLOT(OnClippingPlanes()));
- //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
createAction( VISU_SELECTION_INFO, tr("MEN_SELECTION_INFO"), QIconSet(),
tr("MEN_SELECTION_INFO"), "", 0, aParent, false,
- this, SLOT(OnSelectionInfo()));
+ this, SLOT(OnSelectionInfo()));
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_TIMEANIMATION"));
- createAction( VISU_ANIMATION, tr("MEN_ANIMATION"), QIconSet(aPixmap), tr("MEN_ANIMATION"), "", 0, aParent, false,
- this, SLOT(OnTimeAnimation()));
+ createAction( VISU_ANIMATION, tr("MEN_ANIMATION"), QIconSet(aPixmap),
+ tr("MEN_ANIMATION"), "", 0, aParent, false,
+ this, SLOT(OnTimeAnimation()));
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ERASE_ALL"));
createAction( VISU_ERASE_ALL, tr("MEN_ERASE_ALL"), QIconSet(aPixmap),
tr("MEN_ERASE_ALL"), "", 0, aParent, false,
- this, SLOT(OnEraseAll()));
+ this, SLOT(OnEraseAll()));
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GLOBAL_SELECTION"));
createAction( VISU_GLOBAL_SELECTION, tr("MEN_GLOBAL_SELECTION"), QIconSet(aPixmap),
tr("MEN_GLOBAL_SELECTION"), "", 0, aParent, false,
- //this, SLOT(OnEraseAll()));
- this);
+ //this, SLOT(OnEraseAll()));
+ this);
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PARTIAL_SELECTION"));
createAction( VISU_PARTIAL_SELECTION, tr("MEN_PARTIAL_SELECTION"), QIconSet(aPixmap),
tr("MEN_PARTIAL_SELECTION"), "", 0, aParent, false,
- //this, SLOT(OnEraseAll()));
- this);
+ //this, SLOT(OnEraseAll()));
+ this);
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SCALING"));
createAction( VISU_SCALING, tr("MEN_SCALING"), QIconSet(aPixmap),
tr("MEN_SCALING"), "", 0, aParent, false,
- this, SLOT(OnScaling()));
+ this, SLOT(OnScaling()));
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUBE_AXES"));
createAction( VISU_CUBE_AXES, tr("MEN_CUBE_AXES"), QIconSet(aPixmap),
tr("MEN_CUBE_AXES"), "", 0, aParent, false,
- this, SLOT(OnCubeAxes()));
+ this, SLOT(OnCubeAxes()));
createAction( VISU_SHOW_ANIMATION, tr("MEN_SHOW_ANIMATION"), QIconSet(),
tr("MEN_SHOW_ANIMATION"), "", 0, aParent, false,
- this, SLOT(OnShowAnimation()));
+ this, SLOT(OnShowAnimation()));
}
void
mgr->insert( action( VISU_SAVE_VIEW_PARAMS ), -1, -1, -1 ); // save view params
mgr->insert( action( VISU_SAVE_VIEW_PARAMS_1 ), -1, -1, -1 ); // save view params
mgr->insert( action( VISU_RESTORE_VIEW_PARAMS ), -1, -1, -1 ); // restore view params
- mgr->insert( action( VISU_DELETE_VIEW_PARAMS ), -1, -1, -1 ); // delete view params
+ //mgr->insert( action( VISU_DELETE_VIEW_PARAMS ), -1, -1, -1 ); // delete view params
mgr->insert( action( VISU_ARRANGE_ACTORS ), -1, -1, -1 ); // arrange actors
mgr->setRule( action( VISU_SAVE_VIEW_PARAMS_1 ), aRule, true );
mgr->setRule( action( VISU_SAVE_VIEW_PARAMS ), "client='VTKViewer' and selcount=0", true );
mgr->setRule( action( VISU_RESTORE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true );
- mgr->setRule( action( VISU_DELETE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true );
+ //mgr->setRule( action( VISU_DELETE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true );
mgr->setRule( action( VISU_ARRANGE_ACTORS ), "client='VTKViewer' and selcount=0", true );
mgr->setRule( action( VISU_CELL_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'", true );
mgr->setRule( action( VISU_EDGE_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'", true );
mgr->setRule( action( VISU_COLOR ), aRule + " and ((type='VISU::TMESH'"
- " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}) "
+ " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}) "
"or (type='VISU::TDEFORMEDSHAPE' and hasActor=1))", true );
mgr->setRule( action( VISU_OPACITY ), aRule + aShrinkType + " and hasActor=1", true );
mgr->setRule( action( VISU_LINE_WIDTH ), aRule + aLineType + " and hasActor=1", true );
// rename command
- aRule = "selcount=1 and ($type in {'VISU::TVIEW3D' " + aCurveAll + " " + aPrsAll + "})";
+ aRule = "selcount=1 and ($type in {'VISU::TVIEW3D' 'VISU::TMESH' " + aCurveAll + " " + aPrsAll + "})";
mgr->setRule( action( VISU_RENAME ), aRule, true );
// copy presentation command
} else {
_PTR(SObject) aSFather = SO->GetFather();
if (aSFather) {
- _PTR(GenericAttribute) anAttr;
+ _PTR(GenericAttribute) anAttr;
aSFather->FindAttribute(anAttr, "AttributeName");
if (anAttr) {
_PTR(AttributeName) aName (anAttr);
setPreferenceProperty( tfont, "families", fam );
setPreferenceProperty( tfont, "system", false );
- setPreferenceProperty( tfont, "widget_flags", wflag );
+ setPreferenceProperty( tfont, "widget_flags", wflag );
setPreferenceProperty( lfont, "families", fam );
setPreferenceProperty( lfont, "system", false );
setPreferenceProperty( lfont, "widget_flags", wflag );
-
+
int colorsLabelsGr = addPreference( tr( "VISU_COLORS_AND_LABELS" ), sbarTab );
int numcol = addPreference( tr( "VISU_NB_COLORS" ), colorsLabelsGr, SalomeApp_Preferences::IntSpin, "VISU", "scalar_bar_num_colors" );
setPreferenceProperty( numcol, "min", 2 );
- setPreferenceProperty( numcol, "max", 64 );
-
+ setPreferenceProperty( numcol, "max", 64 );
+
int numlab = addPreference( tr( "VISU_NB_LABELS" ), colorsLabelsGr, SalomeApp_Preferences::IntSpin, "VISU", "scalar_bar_num_labels" );
setPreferenceProperty( numlab, "min", 2 );
setPreferenceProperty( numlab, "max", 65 );
QStringList orients;
orients.append( tr( "VISU_VERTICAL" ) );
orients.append( tr( "VISU_HORIZONTAL" ) );
- QValueList<QVariant> indices;
- indices.append( 0 );
+ QValueList<QVariant> indices;
+ indices.append( 0 );
indices.append( 1 );
setPreferenceProperty( orient, "strings", orients );
setPreferenceProperty( orient, "indexes", indices );
-
+
int posVSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_VERTICAL" ), sbarTab );
int xv = addPreference( tr( "VISU_X" ), posVSizeGr, SalomeApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_x" );
- int yv = addPreference( tr( "VISU_Y" ), posVSizeGr, SalomeApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_y" );
+ int yv = addPreference( tr( "VISU_Y" ), posVSizeGr, SalomeApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_y" );
int wv = addPreference( tr( "VISU_WIDTH" ), posVSizeGr, SalomeApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_width" );
int hv = addPreference( tr( "VISU_HEIGHT" ), posVSizeGr, SalomeApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_height" );
setPreferenceProperty( xv, "step", 0.1 );
setPreferenceProperty( hh, "max", 1.0 );
int srangeTab = addPreference( tr( "Scalar range, Sweep, MED import" ) );
-
+
int rangeGr = addPreference( tr( "VISU_SCALAR_RANGE" ), srangeTab );
setPreferenceProperty( rangeGr, "columns", 1 );
modes.append( tr( "VISU_COMPONENT" ) + tr("1") );
modes.append( tr( "VISU_COMPONENT" ) + tr("2") );
modes.append( tr( "VISU_COMPONENT" ) + tr("3") );
- indices.clear();
- indices.append( 0 );
+ indices.clear();
+ indices.append( 0 );
indices.append( 1 );
indices.append( 2 );
indices.append( 3 );
setPreferenceProperty( mode, "strings", modes );
setPreferenceProperty( mode, "indexes", indices );
-
+
addPreference( tr( "VISU_LOGARITHMIC_SCALING" ), rangeGr, SalomeApp_Preferences::Bool, "VISU", "scalar_bar_logarithmic" );
int rangetype = addPreference( tr( "VISU_RANGE_TO_USE" ), rangeGr, SalomeApp_Preferences::Selector, "VISU", "scalar_range_type" );
QStringList types;
types.append( tr( "VISU_FIELD_RANGE" ) );
types.append( tr( "VISU_IMPOSED_RANGE" ) );
- indices.clear();
- indices.append( 0 );
+ indices.clear();
+ indices.append( 0 );
indices.append( 1 );
setPreferenceProperty( rangetype, "strings", types );
setPreferenceProperty( rangetype, "indexes", indices );
-
+
int imposedGr = addPreference( tr( "VISU_MINMAX_IMPOSED_RANGE" ), srangeTab );
-
+
int min = addPreference( tr( "VISU_MIN" ), imposedGr, SalomeApp_Preferences::DblSpin, "VISU", "scalar_range_min" );
int max = addPreference( tr( "VISU_MAX" ), imposedGr, SalomeApp_Preferences::DblSpin, "VISU", "scalar_range_max" );
setPreferenceProperty( min, "step", 0.1 );
int sweepGr = addPreference( tr( "VISU_SWEEPING_PREF" ), srangeTab );
setPreferenceProperty( sweepGr, "columns", 1 );
-
+
int timestep = addPreference( tr( "VISU_TIME_STEP" ), sweepGr, SalomeApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
int nbcycles = addPreference( tr( "VISU_NB_CYCLES" ), sweepGr, SalomeApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );
int nbsteps = addPreference( tr( "VISU_NB_STEPS" ), sweepGr, SalomeApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
if (!aStudy) return false;
// In some cases single selection can have its own popup-menu item for deletion
- if (aListIO.Extent() == 1) {
+ /*if (aListIO.Extent() == 1) {
Handle(SALOME_InteractiveObject) anIO = aListIO.First();
_PTR(SObject) aSObject = aStudy->FindObjectID(anIO->getEntry());
if (aSObject) {
return false; // special case
}
}
- }
+ }*/
SALOME_ListIteratorOfListIO anIter (aListIO);
for (; anIter.More(); anIter.Next()) {
_PTR(SObject) aSObject = aStudy->FindObjectID(anIO->getEntry());
VISU::Storable::TRestoringMap pMap;
if (aSObject) {
- CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
- if (!CORBA::is_nil(aCORBAObject)) {
- VISU::RemovableObject_var aRemovableObj = VISU::RemovableObject::_narrow(aCORBAObject);
- if (CORBA::is_nil(aRemovableObj)) {
+ CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
+ if (!CORBA::is_nil(aCORBAObject)) {
+ VISU::RemovableObject_var aRemovableObj = VISU::RemovableObject::_narrow(aCORBAObject);
+ if (CORBA::is_nil(aRemovableObj)) {
// Not removable CORBA object
return false;
}
- } else {
+ } else {
// Can be removed, if lays directly under VISU
// (first sub-level) or is a child of such an object
string aNAME, aVisuNAME = GetVisuGen(theModule)->ComponentDataType();
return false;
}
}
- }
+ }
}
}
}
case VISU::TCURVE:
{
if (VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aBase).in()))
- PlotCurve(theModule, aCurve, VISU::eErase );
+ PlotCurve(theModule, aCurve, VISU::eErase );
break;
}
case VISU::TCONTAINER:
{
if (VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aBase).in()))
- PlotContainer(theModule, aContainer, VISU::eErase );
+ PlotContainer(theModule, aContainer, VISU::eErase );
break;
}
case VISU::TTABLE:
default:
{
if (VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aBase).in())) {
- ErasePrs3d(theModule, aPrsObject);
- if (theUpdate) {
- if (SVTK_ViewWindow* vw = GetViewWindow(theModule))
- vw->Repaint();
- }
+ ErasePrs3d(theModule, aPrsObject);
+ if (theUpdate) {
+ if (SVTK_ViewWindow* vw = GetViewWindow(theModule))
+ vw->Repaint();
+ }
}
}
} // switch (aType)
void
DeletePrs3d(SalomeApp_Module* theModule,
- VISU::Prs3d_i* thePrs,
- const Handle(SALOME_InteractiveObject)& theIO)
+ VISU::Prs3d_i* thePrs,
+ const Handle(SALOME_InteractiveObject)& theIO)
{
if (!thePrs)
return;
for(int i = 0, iEnd = aViewWindows.size(); i < iEnd; i++){
SVTK_ViewWindow* aView = aViewWindows[i];
if(VISU_Actor* anActor = FindActor(aView,anEntry.in())){
- aView->RemoveActor(anActor);
- anActor->Delete();
+ aView->RemoveActor(anActor);
+ anActor->Delete();
}
}
thePrs->RemoveFromStudy();
void
ErasePrs3d(const SalomeApp_Module* theModule,
- VISU::Prs3d_i* thePrs)
+ VISU::Prs3d_i* thePrs)
{
if ( SVTK_ViewWindow* vw = GetViewWindow( theModule ) ){
VISU_Actor* anVISUActor = FindActor( vw, thePrs );
if (anVISUActor) {
- anVISUActor->VisibilityOff();
+ anVISUActor->VisibilityOff();
}
}
}
anActor->UnShrink();
else
anActor->SetShrink();
- break;
+ break;
default:
- if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
- aMesh->SetPresentationType(theType);
- RecreateActor(theModule, aMesh);
- } else {
- anActor->SetRepresentation(theType);
+ if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
+ aMesh->SetPresentationType(theType);
+ RecreateActor(theModule, aMesh);
+ } else {
+ anActor->SetRepresentation(theType);
}
}
vw->Repaint();
bool
CheckTimeStamp(const SalomeApp_Module* theModule,
- _PTR(SObject)& theSObject,
- Handle(SALOME_InteractiveObject)* theIO)
+ _PTR(SObject)& theSObject,
+ Handle(SALOME_InteractiveObject)* theIO)
{
Handle(SALOME_InteractiveObject) anIO;
CORBA::Object_var anObject = GetSelectedObj(theModule, &anIO);
theSObject = aStudy->FindObjectID(anIO->getEntry());
QString aValue = getValue(theSObject,"myType");
if (aValue.toInt() == int(VISU::TTIMESTAMP))
- return true;
+ return true;
}
SUIT_MessageBox::warn1(GetDesktop(theModule),
- QObject::tr("WRN_VISU"),
- QObject::tr("WRN_NO_AVAILABLE_DATA"),
- QObject::tr("BUT_OK") );
+ QObject::tr("WRN_VISU"),
+ QObject::tr("WRN_NO_AVAILABLE_DATA"),
+ QObject::tr("BUT_OK") );
return false;
}
VISU::Result_i*
CheckResult(const SalomeApp_Module* theModule,
- _PTR(SObject) theSource,
- VISU::Result_var& theResult)
+ _PTR(SObject) theSource,
+ VISU::Result_var& theResult)
{
_PTR(SObject) aSObj = theSource->GetFather();
if (!aSObj)
VISU::Result_i* pResult = dynamic_cast<VISU::Result_i*>(VISU::GetServant(anObject).in());
if (pResult == NULL)
SUIT_MessageBox::warn1(GetDesktop(theModule),
- QObject::tr("WRN_VISU"),
- QObject::tr("WRN_NO_AVAILABLE_DATA"),
- QObject::tr("BUT_OK"));
+ QObject::tr("WRN_VISU"),
+ QObject::tr("WRN_NO_AVAILABLE_DATA"),
+ QObject::tr("BUT_OK"));
return pResult;
}
{
if(SalomeApp_Application* anApp = theModule->getApp()){
if(SUIT_ViewManager* aViewManager = anApp->activeViewManager()){
- if (!theType.isNull()) {
- if (aViewManager->getType() != theType)
- return 0;
- }
- return aViewManager->getActiveView();
+ if (!theType.isNull()) {
+ if (aViewManager->getType() != theType)
+ return 0;
+ }
+ return aViewManager->getActiveView();
}
}
return 0;
anApp->viewManagers(SVTK_Viewer::Type(),aViewManagerList);
QPtrListIterator<SUIT_ViewManager> anIter(aViewManagerList);
while(SUIT_ViewManager* aViewManager = anIter.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(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewWindow))
- aViewWindows.push_back(aView);
- }
- ++anIter;
+ QPtrVector<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* aView = dynamic_cast<SVTK_ViewWindow*>(aViewWindow))
+ aViewWindows.push_back(aView);
+ }
+ ++anIter;
}
}
return aViewWindows;
{
if(SalomeApp_Application* anApp = theModule->getApp()){
if(SUIT_ViewManager* aViewManager = anApp->getViewManager( SVTK_Viewer::Type(), theCreate )){
- if(SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()){
- return dynamic_cast<SVTK_ViewWindow*>(aViewWindow);
- }
+ if(SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()){
+ return dynamic_cast<SVTK_ViewWindow*>(aViewWindow);
+ }
}
}
return NULL;
(SUIT_Session::session()->activeApplication());
if (anApp) {
if (SUIT_ViewManager* aViewManager = anApp->activeViewManager()) {
- if (aViewManager->getType() == SVTK_Viewer::Type()) {
- if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()) {
- return dynamic_cast<SVTK_ViewWindow*>(aViewWindow);
- }
- }
+ if (aViewManager->getType() == SVTK_Viewer::Type()) {
+ if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()) {
+ return dynamic_cast<SVTK_ViewWindow*>(aViewWindow);
+ }
+ }
}
}
return NULL;
VISU_Actor*
PublishInView(const SalomeApp_Module* theModule,
- VISU::Prs3d_i* thePrs)
+ VISU::Prs3d_i* thePrs)
{
VISU_Actor* aActor = NULL;
if(!thePrs)
if(SVTK_ViewWindow* aView = GetViewWindow(theModule)){
QApplication::setOverrideCursor( Qt::waitCursor );
if(aActor = thePrs->CreateActor()){
- aView->AddActor(aActor);
+ aView->AddActor(aActor);
}
QApplication::restoreOverrideCursor();
}
VISU_Actor*
UpdateViewer(const SalomeApp_Module* theModule,
- VISU::Prs3d_i* thePrs,
- bool theDispOnly)
+ VISU::Prs3d_i* thePrs,
+ bool theDispOnly)
{
SVTK_ViewWindow* vw = GetViewWindow( theModule );
if (!vw) return NULL;
VISU_Actor* aResActor = NULL;
for(anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ){
if(!SALOME_Actor::SafeDownCast(anActor))
- continue;
+ continue;
if(anActor->IsA("VISU_Actor")){
- anVISUActor = VISU_Actor::SafeDownCast(anActor);
- VISU::Prs3d_i* aPrs = anVISUActor->GetPrs3d();
- if(aPrs == NULL) continue;
- if (thePrs == aPrs) {
- aResActor = anVISUActor->GetParent();
- thePrs->UpdateActor(aResActor);
- aResActor->VisibilityOn();
-
- } else if (theDispOnly) {
- anVISUActor->GetParent()->VisibilityOff();
- } else {
- }
+ anVISUActor = VISU_Actor::SafeDownCast(anActor);
+ VISU::Prs3d_i* aPrs = anVISUActor->GetPrs3d();
+ if(aPrs == NULL) continue;
+ if (thePrs == aPrs) {
+ aResActor = anVISUActor->GetParent();
+ thePrs->UpdateActor(aResActor);
+ aResActor->VisibilityOn();
+
+ } else if (theDispOnly) {
+ anVISUActor->GetParent()->VisibilityOff();
+ } else {
+ }
} else if (theDispOnly && anActor->GetVisibility()) {
- anActor->VisibilityOff();
+ anActor->VisibilityOff();
} else {
}
}
anApp->viewManagers(SVTK_Viewer::Type(),aViewManagerList);
QPtrListIterator<SUIT_ViewManager> anIter (aViewManagerList);
while (SUIT_ViewManager* aViewManager = anIter.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 (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)) {
+ QPtrVector<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 (vw->isVisible(theIObject)) {
vw->getRenderer()->ResetCameraClippingRange();
vw->Repaint();
vw->highlight(theIObject, true, true);
}
- }
- }
- }
- ++anIter;
+ }
+ }
+ }
+ ++anIter;
}
}
}
VISU_Actor*
FindActor(SVTK_ViewWindow* theViewWindow,
- const char* theEntry)
+ const char* theEntry)
{
using namespace VTK;
if(vtkRenderer* aRenderer = theViewWindow->getRenderer()){
if(vtkActorCollection* aCollection = aRenderer->GetActors()){
- if(VISU_Actor* anActor = Find<VISU_Actor>(aCollection,TIsSameEntry<VISU_Actor>(theEntry))){
- return anActor->GetParent();
- }
+ if(VISU_Actor* anActor = Find<VISU_Actor>(aCollection,TIsSameEntry<VISU_Actor>(theEntry))){
+ return anActor->GetParent();
+ }
}
}
return NULL;
VISU_Actor*
FindActor(SVTK_ViewWindow* theViewWindow,
- VISU::Prs3d_i* thePrs)
+ VISU::Prs3d_i* thePrs)
{
SALOMEDS::SObject_var aSObject = thePrs->GetSObject();
CORBA::String_var anEntry = aSObject->GetID();
for (int i = 0, iEnd = aViewWindows.size(); i < iEnd; i++) {
SVTK_ViewWindow* aView = aViewWindows[i];
if (VISU_Actor* anActor = FindActor(aView, anEntry.in())) {
- thePrs->UpdateActor(anActor);
+ thePrs->UpdateActor(anActor);
}
}
} catch (std::runtime_error& ex) {
for (int i = 0, iEnd = aViewWindows.size(); i < iEnd; i++) {
SVTK_ViewWindow* aView = aViewWindows[i];
if (VISU_Actor* anActor = FindActor(aView, anEntry.in())) {
- aView->RemoveActor(anActor);
- anActor->Delete();
+ aView->RemoveActor(anActor);
+ anActor->Delete();
}
}
return;
{
if(SalomeApp_Application* anApp = theModule->getApp()){
if(SUIT_ViewManager* aViewManager = anApp->getViewManager( Plot2d_Viewer::Type(), theCreate )){
- return dynamic_cast<SPlot2d_Viewer*>(aViewManager->getViewModel());
+ return dynamic_cast<SPlot2d_Viewer*>(aViewManager->getViewModel());
}
}
return NULL;
// Internal function used by several public functions below
void
UpdateCurve(VISU::Curve_i* theCurve,
- Plot2d_ViewFrame* aPlot,
- SPlot2d_Curve* plotCurve,
- int theDisplaying)
+ Plot2d_ViewFrame* aPlot,
+ SPlot2d_Curve* plotCurve,
+ int theDisplaying)
{
if ( theDisplaying == VISU::eErase ) {
if ( plotCurve )
- aPlot->eraseCurve( plotCurve, false );
+ aPlot->eraseCurve( plotCurve, false );
}
else if ( theDisplaying == VISU::eDisplay || theDisplaying == VISU::eDisplayOnly ) {
if ( plotCurve ) {
- plotCurve->setHorTitle( theCurve->GetHorTitle().c_str() );
- //plotCurve->setVerTitle( ( theCurve->GetVerTitle().c_str() ) );
- plotCurve->setVerTitle( theCurve->GetName() );
- plotCurve->setHorUnits( theCurve->GetHorUnits().c_str() );
- plotCurve->setVerUnits( theCurve->GetVerUnits().c_str() );
- double* xList = 0;
- double* yList = 0;
- int nbPoints = theCurve->GetData( xList, yList );
- if ( nbPoints > 0 && xList && yList ) {
- plotCurve->setData( xList, yList, nbPoints );
- }
- if ( !theCurve->IsAuto() ) {
- plotCurve->setLine( (Plot2d_Curve::LineType)theCurve->GetLine(), theCurve->GetLineWidth() );
- plotCurve->setMarker( (Plot2d_Curve::MarkerType)theCurve->GetMarker() );
- SALOMEDS::Color color = theCurve->GetColor();
- plotCurve->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) );
- }
- plotCurve->setAutoAssign( theCurve->IsAuto() );
- aPlot->displayCurve( plotCurve, false );
+ plotCurve->setHorTitle( theCurve->GetHorTitle().c_str() );
+ //plotCurve->setVerTitle( ( theCurve->GetVerTitle().c_str() ) );
+ plotCurve->setVerTitle( theCurve->GetName() );
+ plotCurve->setHorUnits( theCurve->GetHorUnits().c_str() );
+ plotCurve->setVerUnits( theCurve->GetVerUnits().c_str() );
+ double* xList = 0;
+ double* yList = 0;
+ int nbPoints = theCurve->GetData( xList, yList );
+ if ( nbPoints > 0 && xList && yList ) {
+ plotCurve->setData( xList, yList, nbPoints );
+ }
+ if ( !theCurve->IsAuto() ) {
+ plotCurve->setLine( (Plot2d_Curve::LineType)theCurve->GetLine(), theCurve->GetLineWidth() );
+ plotCurve->setMarker( (Plot2d_Curve::MarkerType)theCurve->GetMarker() );
+ SALOMEDS::Color color = theCurve->GetColor();
+ plotCurve->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) );
+ }
+ plotCurve->setAutoAssign( theCurve->IsAuto() );
+ aPlot->displayCurve( plotCurve, false );
}
else {
- Plot2d_Curve* crv = theCurve->CreatePresentation();
- if ( crv ) {
- aPlot->displayCurve( crv, false );
- 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() );
- }
+ Plot2d_Curve* crv = theCurve->CreatePresentation();
+ if ( crv ) {
+ aPlot->displayCurve( crv, false );
+ 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() );
+ }
}
}
}
void
PlotTable(const SalomeApp_Module* theModule,
- VISU::Table_i* table,
- int theDisplaying)
+ VISU::Table_i* table,
+ int theDisplaying)
{
SPlot2d_Viewer* aView = GetPlot2dViewer( theModule, true ); // create if necessary
if ( !aView )
if ( TableSO ) {
_PTR(ChildIterator) Iter = aStudy->NewChildIterator( TableSO );
for ( ; Iter->More(); Iter->Next() ) {
- CORBA::Object_var childObject = VISU::ClientSObjectToObject( Iter->Value() );
- if( !CORBA::is_nil( childObject ) ) {
- CORBA::Object_ptr aCurve = VISU::Curve::_narrow( childObject );
- if( !CORBA::is_nil( aCurve ) ) {
- VISU::Curve_i* theCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
- SPlot2d_Curve* plotCurve = 0;
- SPlot2d_Curve* tmpCurve;
- for ( int i = 0; i < clist.count(); i++ ) {
- tmpCurve = dynamic_cast<SPlot2d_Curve*>( clist.at( i ) );
- if (tmpCurve && tmpCurve->hasIO() &&
+ CORBA::Object_var childObject = VISU::ClientSObjectToObject( Iter->Value() );
+ if( !CORBA::is_nil( childObject ) ) {
+ CORBA::Object_ptr aCurve = VISU::Curve::_narrow( childObject );
+ if( !CORBA::is_nil( aCurve ) ) {
+ VISU::Curve_i* theCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
+ SPlot2d_Curve* plotCurve = 0;
+ SPlot2d_Curve* tmpCurve;
+ for ( int i = 0; i < clist.count(); i++ ) {
+ tmpCurve = dynamic_cast<SPlot2d_Curve*>( clist.at( i ) );
+ if (tmpCurve && tmpCurve->hasIO() &&
!strcmp(tmpCurve->getIO()->getEntry(), theCurve->GetEntry())) {
- plotCurve = tmpCurve;
- break;
- }
- }
-
- UpdateCurve( theCurve, aPlot, plotCurve, theDisplaying );
-
- if ( theDisplaying == VISU::eErase && plotCurve ) {
- clist.remove( plotCurve );
- }
- }
- }
+ plotCurve = tmpCurve;
+ break;
+ }
+ }
+
+ UpdateCurve( theCurve, aPlot, plotCurve, theDisplaying );
+
+ if ( theDisplaying == VISU::eErase && plotCurve ) {
+ clist.remove( plotCurve );
+ }
+ }
+ }
}
aPlot->Repaint();
}
void
PlotCurve(const SalomeApp_Module* theModule,
- VISU::Curve_i* theCurve,
- int theDisplaying)
+ VISU::Curve_i* theCurve,
+ int theDisplaying)
{
SPlot2d_Viewer* aView = GetPlot2dViewer( theModule, true );
if ( !aView )
tmpCurve = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
if (tmpCurve && tmpCurve->hasIO() &&
!strcmp(tmpCurve->getIO()->getEntry(), theCurve->GetEntry())) {
- plotCurve = tmpCurve;
+ plotCurve = tmpCurve;
} else if (theDisplaying == VISU::eDisplayOnly) {
- aPlot->eraseCurve(clist.at(i));
+ aPlot->eraseCurve(clist.at(i));
}
}
void
PlotContainer(const SalomeApp_Module* theModule,
- VISU::Container_i* container,
- int theDisplaying)
+ VISU::Container_i* container,
+ int theDisplaying)
{
SPlot2d_Viewer* aView = GetPlot2dViewer( theModule, true );
if ( !aView )
if ( container->GetNbCurves() > 0 ) {
int nbCurves = container->GetNbCurves();
for ( int k = 1; k <= nbCurves; k++ ) {
- VISU::Curve_i* theCurve = container->GetCurve( k );
- if ( theCurve && theCurve->IsValid() ) {
- SPlot2d_Curve* plotCurve = dynamic_cast<SPlot2d_Curve*>
+ VISU::Curve_i* theCurve = container->GetCurve( k );
+ if ( theCurve && theCurve->IsValid() ) {
+ SPlot2d_Curve* plotCurve = dynamic_cast<SPlot2d_Curve*>
(aView->getCurveByIO(new SALOME_InteractiveObject (theCurve->GetEntry(), "", "")));
- UpdateCurve( theCurve, aPlot, plotCurve, theDisplaying );
+ UpdateCurve( theCurve, aPlot, plotCurve, theDisplaying );
- if ( plotCurve && theDisplaying == VISU::eErase ) {
- clist.remove( plotCurve );
- }
- }
+ if ( plotCurve && theDisplaying == VISU::eErase ) {
+ clist.remove( plotCurve );
+ }
+ }
}
}
aPlot->Repaint();
void
CreatePlot(SalomeApp_Module* theModule,
- _PTR(SObject) theTableSO)
+ _PTR(SObject) theTableSO)
{
if ( IsSObjectTable(theTableSO) ) {
CORBA::Object_var aTable = VISU::ClientSObjectToObject(theTableSO);
CORBA::Object_var aContainer = GetVisuGen( theModule )->CreateContainer();
if ( !CORBA::is_nil( aTable ) && !CORBA::is_nil( aContainer ) ) {
- VISU::Table_i* pTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTable).in());
- VISU::Container_i* pContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
-
- if ( pContainer && pTable ) {
- for ( int i = 2; i <= pTable->GetNbRows(); i++ ) {
- CORBA::Object_var aNewCurve = GetVisuGen( theModule )->CreateCurve( pTable->_this(), 1, i );
- if( !CORBA::is_nil( aNewCurve ) ) {
- VISU::Curve_i* pCrv = dynamic_cast<VISU::Curve_i*>( VISU::GetServant(aNewCurve).in() );
- if ( pCrv ) {
- pContainer->AddCurve( pCrv->_this() );
- }
- }
- }
- theModule->updateObjBrowser();
- PlotContainer( theModule, pContainer, VISU::eDisplay );
- }
+ VISU::Table_i* pTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTable).in());
+ VISU::Container_i* pContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
+
+ if ( pContainer && pTable ) {
+ for ( int i = 2; i <= pTable->GetNbRows(); i++ ) {
+ CORBA::Object_var aNewCurve = GetVisuGen( theModule )->CreateCurve( pTable->_this(), 1, i );
+ if( !CORBA::is_nil( aNewCurve ) ) {
+ VISU::Curve_i* pCrv = dynamic_cast<VISU::Curve_i*>( VISU::GetServant(aNewCurve).in() );
+ if ( pCrv ) {
+ pContainer->AddCurve( pCrv->_this() );
+ }
+ }
+ }
+ theModule->updateObjBrowser();
+ PlotContainer( theModule, pContainer, VISU::eDisplay );
+ }
}
}
}