-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI.cxx
// Author :
// Module : VISU
+#include <Standard_math.hxx> // E.A. must be included before Python.h to fix compilation on windows
+#include "Python.h"
+
#include "VisuGUI.h"
// STL Includes
//#include "SVTK_MainWindow.h"
#include "VTKViewer_Algorithm.h"
+#include "VTKViewer_MarkerDlg.h"
#include "SPlot2d_ViewModel.h"
#include "VisuGUI_SetupPlot2dDlg.h"
#include "VisuGUI_CursorDlg.h"
#include "VisuGUI_Selection.h"
#include "VisuGUI_TimeAnimation.h"
+#include "VisuGUI_EvolutionDlg.h"
#include "VisuGUI_EditContainerDlg.h"
#include "VisuGUI_ClippingDlg.h"
#include "VisuGUI_Plot3DDlg.h"
#include "VisuGUI_BuildProgressDlg.h"
#include "VisuGUI_TransparencyDlg.h"
#include "VisuGUI_ShrinkFactorDlg.h"
-#include "VisuGUI_CacheDlg.h"
+//#include "VisuGUI_CacheDlg.h"
#include "VisuGUI_Table3dDlg.h"
#include "VisuGUI_ClippingPanel.h"
#include "VisuGUI_FilterScalarsDlg.h"
#include "VISU_Vectors_i.hh"
#include "VisuGUI_VectorsDlg.h"
-#include "VisuGUI_TableDlg.h"
+#include "VISU_TableDlg.h"
#include "VisuGUI_FileInfoDlg.h"
#include "SALOMEconfig.h"
VisuGUI
::~VisuGUI()
{
+ if( myDisplayer ) {
+ delete myDisplayer;
+ myDisplayer = 0;
+ }
+
+ if( mySlider ) {
+ delete mySlider;
+ mySlider = 0;
+ }
+
+ if( mySweep ) {
+ delete mySweep;
+ mySweep = 0;
+ }
}
void
if ( !aFileInfo.exists() ) {
// file not exist
errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
- arg( tr( "ERR_FILE_NOT_EXISTS" ) ) );
+ arg( tr( "ERR_FILE_NOT_EXISTS" ) ) );
}
else {
try {
- if ( !toUseBuildProgress ) {
- // build progress is not used, use build flags from settings
- bool toBuildFields = aResourceMgr->booleanValue( "VISU", "build_fields", true );
- bool toBuildMinMax = aResourceMgr->booleanValue( "VISU", "build_min_max", true );
- bool toBuildGroups = aResourceMgr->booleanValue( "VISU", "build_groups", true );
- bool toBuildAll = aResourceMgr->booleanValue( "VISU", "full_med_loading", false );
- bool toBuildAtOnce = aResourceMgr->booleanValue( "VISU", "build_at_once", false );
-
- QString anInfo( tr( "IMPORT_FROM_FILE" ) + " " + aFileInfo.filePath() + " ... " );
- application()->putInfo( anInfo );
-
- VISU::Result_var aResult = GetVisuGen( this )->CreateResult( aFileInfo.filePath().toLatin1().constData() );
-
- if ( CORBA::is_nil( aResult.in() ) ) {
- errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
- arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
- }
- else {
- aResult->SetBuildFields( toBuildFields, toBuildMinMax );
- aResult->SetBuildGroups( toBuildGroups );
- aResult->Build( toBuildAll, toBuildAtOnce );
- application()->putInfo( anInfo + tr("INF_DONE") );
- }
- } // if ( !toUseBuildProgress )
- else {
- // use build progress
- wc.suspend();
- VisuGUI_BuildProgressDlg* aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this) );
- aBuildProgressDlg->setFileName( aFileInfo.filePath() );
- aBuildProgressDlg->setGenerator( GetVisuGen(this) );
- aBuildProgressDlg->exec();
- wc.resume();
- }
+ if ( !toUseBuildProgress ) {
+ // build progress is not used, use build flags from settings
+ bool toBuildFields = aResourceMgr->booleanValue( "VISU", "build_fields", true );
+ bool toBuildMinMax = aResourceMgr->booleanValue( "VISU", "build_min_max", true );
+ bool toBuildGroups = aResourceMgr->booleanValue( "VISU", "build_groups", true );
+ bool toBuildAll = aResourceMgr->booleanValue( "VISU", "full_med_loading", false );
+ bool toBuildAtOnce = aResourceMgr->booleanValue( "VISU", "build_at_once", false );
+
+ QString anInfo( tr( "IMPORT_FROM_FILE" ) + " " + aFileInfo.filePath() + " ... " );
+ application()->putInfo( anInfo );
+
+ VISU::Result_var aResult = GetVisuGen( this )->CreateResult( aFileInfo.filePath().toLatin1().constData() );
+
+ if ( CORBA::is_nil( aResult.in() ) ) {
+ errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
+ arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
+ }
+ else {
+ aResult->SetBuildFields( toBuildFields, toBuildMinMax );
+ aResult->SetBuildGroups( toBuildGroups );
+ aResult->Build( toBuildAll, toBuildAtOnce );
+ application()->putInfo( anInfo + tr("INF_DONE") );
+ }
+ } // if ( !toUseBuildProgress )
+ else {
+ // use build progress
+ wc.suspend();
+ VisuGUI_BuildProgressDlg* aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this) );
+ aBuildProgressDlg->setFileName( aFileInfo.filePath() );
+ aBuildProgressDlg->setGenerator( GetVisuGen(this) );
+ aBuildProgressDlg->exec();
+ wc.resume();
+ }
} // try
catch(...) {
- errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).arg( tr( "UNKNOWN_IMPORT_ERROR" ) ) );
+ errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).arg( tr( "UNKNOWN_IMPORT_ERROR" ) ) );
}
} // else // if ( !aFileInfo.exists() )
} // for (...)
if ( errors.count() > 0 ) {
SUIT_MessageBox::critical( GetDesktop(this),
- tr("ERR_ERROR"),
- tr("IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
+ tr("ERR_ERROR"),
+ tr("IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
}
else {
UpdateObjBrowser(this);
aFilter.append( tr("FLT_TABLE_FILES") );
aFilter.append( tr("FLT_ALL_FILES") );
- QString anInitialPath = "";
- if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
- anInitialPath = QDir::currentPath();
+ //QString anInitialPath = "";
+ //if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
+ // anInitialPath = QDir::currentPath();
+
+ //QStringList aFiles = SUIT_FileDlg::getOpenFileNames(GetDesktop(this),
+ // anInitialPath,
+ // aFilter,
+ // tr("TLT_IMPORT_TABLE"));
+
+ SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
+ bool aFirstStrAsTitle = aResourceMgr->booleanValue("VISU", "first_str_as_title", false);
+
+ SalomeApp_CheckFileDlg fd( GetDesktop(this), true, tr("FIRST_STR_AS_TITLE") );
+ fd.setWindowTitle( tr( "IMPORT_FROM_FILE" ) );
+ fd.setFileMode( SalomeApp_CheckFileDlg::ExistingFiles );
+ fd.setFilters( aFilter );
+ fd.SetChecked( aFirstStrAsTitle );
+ if ( SalomeApp_CheckFileDlg::getLastVisitedPath().isEmpty() )
+ fd.setDirectory( QDir::currentPath() );
+
+ QStringList aFiles;
+ if ( !fd.exec() )
+ return; // cancelled, return
+ aFiles = fd.selectedFiles();
+ aFirstStrAsTitle = fd.IsChecked();
- QStringList aFiles = SUIT_FileDlg::getOpenFileNames(GetDesktop(this),
- anInitialPath,
- aFilter,
- tr("TLT_IMPORT_TABLE"));
if ( aFiles.count() == 0 )
return; // nothing selected
if ( !aFileInfo.exists() ) {
errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
- arg( tr( "ERR_FILE_NOT_EXISTS" ) ) );
+ arg( tr( "ERR_FILE_NOT_EXISTS" ) ) );
}
else {
try {
- QString anInfo( tr("TLT_IMPORT_TABLE") + " " + aFileInfo.filePath() + " ..." );
- application()->putInfo( anInfo );
-
- CORBA::Object_var anObject = GetVisuGen(this)->ImportTables(aFileInfo.filePath().toLatin1().constData());
-
- if (CORBA::is_nil(anObject.in())) {
- errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
- arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
- }
- else {
- application()->putInfo( anInfo + tr("INF_DONE") );
- }
+ QString anInfo( tr("TLT_IMPORT_TABLE") + " " + aFileInfo.filePath() + " ..." );
+ application()->putInfo( anInfo );
+
+ CORBA::Object_var anObject =
+ GetVisuGen(this)->ImportTables(aFileInfo.filePath().toLatin1().constData(),
+ aFirstStrAsTitle);
+
+ if (CORBA::is_nil(anObject.in())) {
+ errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
+ arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
+ }
+ else {
+ application()->putInfo( anInfo + tr("INF_DONE") );
+ }
}
catch(...) {
- errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).arg( tr( "UNKNOWN_IMPORT_ERROR" ) ) );
+ errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).arg( tr( "UNKNOWN_IMPORT_ERROR" ) ) );
}
}
}
if ( errors.count() > 0 ) {
SUIT_MessageBox::critical( GetDesktop(this),
- tr("ERR_ERROR"),
- tr("IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
+ tr("ERR_ERROR"),
+ tr("IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
}
else {
UpdateObjBrowser(this);
if (!aTabAttr) return;
aTitle = aTabAttr->GetTitle().c_str();
} else {
- _PTR(AttributeTableOfInteger) aTabAttr (anAttr);
- if (!aTabAttr) return;
+ _PTR(AttributeTableOfInteger) aTabAttr (anAttr);
+ if (!aTabAttr) return;
aTitle = aTabAttr->GetTitle().c_str();
}
aTitle.simplified();
// get name for the file
QStringList aFilter;
- aFilter.append("Table Files (*.xls)");
+ aFilter.append("Table Files (*.txt *.tab)");
+ aFilter.append("CSV Table Files (*.csv)");
QFileInfo aFileInfo =
SUIT_FileDlg::getFileName(GetDesktop(this),
QString aFile = aFileInfo.filePath();
if (!aFile.isEmpty()) {
application()->putInfo(tr("MEN_EXPORT_TABLE") + " " + aFile + " ...");
- aDir = Qtx::dir(aFile, true);
+ aDir = Qtx::dir(aFile, true);
aResourceMgr->setValue("VISU", "OutputDir", aDir);
- try {
- GetVisuGen(this)->ExportTableToFile(GetSObject(aSObj), (const char*)aFile.toLatin1());
+ try {
+ GetVisuGen(this)->ExportTableToFile(GetSObject(aSObj), (const char*)aFile.toLatin1());
application()->putInfo(aFile + " " + tr("INF_DONE"));
- } catch(std::exception& exc) {
- INFOS(exc.what());
- SUIT_MessageBox::warning(GetDesktop(this),
+ } catch(std::exception& exc) {
+ INFOS(exc.what());
+ SUIT_MessageBox::warning(GetDesktop(this),
tr("WRN_VISU"),
- tr("ERR_ERROR_DURING_EXPORT") + " " + tr(exc.what()) );
+ tr("ERR_ERROR_DURING_EXPORT") + " " + tr(exc.what()) );
- } catch(...) {
- INFOS((const char*)tr("ERR_ERROR_DURING_EXPORT").toLatin1());
- SUIT_MessageBox::warning( GetDesktop(this),
+ } catch(...) {
+ INFOS((const char*)tr("ERR_ERROR_DURING_EXPORT").toLatin1());
+ SUIT_MessageBox::warning( GetDesktop(this),
tr("WRN_VISU"),
- tr("ERR_ERROR_DURING_EXPORT") );
+ tr("ERR_ERROR_DURING_EXPORT") );
- }
+ }
}
}
}
if( aTblObj ) {
_PTR(GenericAttribute) anAttr;
if (aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
- _PTR(ChildIterator) aChildIter = aStudy->NewChildIterator( aTblObj );
- SalomeApp_Study* salome_study = GetAppStudy( theModule );
- for( aChildIter->InitEx( false ); aChildIter->More(); aChildIter->Next() ){
- salome_study->deleteReferencesTo( aChildIter->Value() );
- _PTR(SObject) aSO = aChildIter->Value();
- if(aSO){
- Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aSO);
- if (aRestoringMap["myComment"] == "CURVE") {
- CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSO);
- if(!CORBA::is_nil(aCORBAObject)){
- PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
- if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aServant.in())){
- PlotRemoveCurve(theModule, aCurve);
- }
- }
- }
- }
-
- }
+ _PTR(ChildIterator) aChildIter = aStudy->NewChildIterator( aTblObj );
+ SalomeApp_Study* salome_study = GetAppStudy( theModule );
+ for( aChildIter->InitEx( false ); aChildIter->More(); aChildIter->Next() ){
+ salome_study->deleteReferencesTo( aChildIter->Value() );
+ _PTR(SObject) aSO = aChildIter->Value();
+ if(aSO){
+ Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aSO);
+ if (aRestoringMap["myComment"] == "CURVE") {
+ CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSO);
+ if(!CORBA::is_nil(aCORBAObject)){
+ PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
+ if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aServant.in())){
+ PlotRemoveCurve(theModule, aCurve);
+ }
+ }
+ }
+ }
+
+ }
aBuilder->RemoveObjectWithChildren( aTblObj ); // We should have only one child
- //UpdateObjBrowser(theModule,true,aTblObj);
+ //UpdateObjBrowser(theModule,true,aTblObj);
break;
}
}
switch (aType) {
case VISU::TPOINTMAP3D:
if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this)){
- displayer()->Display(anIO->getEntry());
- aViewWindow->highlight(anIO, 1);
- aViewWindow->getRenderer()->ResetCameraClippingRange();
- aViewWindow->Repaint();
- break;
+ displayer()->Display(anIO->getEntry());
+ aViewWindow->highlight(anIO, 1);
+ aViewWindow->getRenderer()->ResetCameraClippingRange();
+ aViewWindow->Repaint();
+ break;
}
else {
- if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(this, false))
- aPlot2d->Repaint();
- displayer()->Display(anIO->getEntry());
+ if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(this, false))
+ aPlot2d->Repaint();
+ displayer()->Display(anIO->getEntry());
}
case VISU::TCURVE:
case VISU::TCONTAINER:
case VISU::TTABLE:
+ getViewManager(SPlot2d_Viewer::Type(), true);
displayer()->Display(anIO->getEntry());
break;
default: {
VISU::Prs3d_i* aPrs3d = VISU::GetPrs3dFromBase(aBase);
if(aPrs3d){
- if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this)){
- displayer()->Display(anIO->getEntry());
- aViewWindow->highlight(anIO, 1);
- aViewWindow->getRenderer()->ResetCameraClippingRange();
- aViewWindow->Repaint();
- }
+ if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this)){
+ displayer()->Display(anIO->getEntry());
+ aViewWindow->highlight(anIO, 1);
+ aViewWindow->getRenderer()->ResetCameraClippingRange();
+ aViewWindow->Repaint();
+ }
}
}
}
LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
if (!aSelectionMgr)
return;
-
+
SALOME_ListIO aSel, aList;
aSelectionMgr->selectedObjects(aSel);
extractContainers(aSel, aList);
aChild = anIter->Value();
CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aChild);
if(!CORBA::is_nil(aCORBAObject)){
- PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
- if( dynamic_cast<VISU::Curve_i*>(aServant.in()))
- hasCurvesChildren = true;
+ PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
+ if( dynamic_cast<VISU::Curve_i*>(aServant.in()))
+ hasCurvesChildren = true;
}
}
if (hasCurvesChildren && ( aViewerType == SPlot2d_Viewer::Type() || aViewerType == SVTK_Viewer::Type() ) ) {
return;
} else {
- // activate SVTK Viewer
+ // activate SVTK Viewer
getApp()->getViewManager( SVTK_Viewer::Type(), true );
return;
}
for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
if (anActor->GetVisibility() > 0)
if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
- RemoveScalarBarPosition(this, vw, anVISUActor->GetPrs3d());
+ RemoveScalarBarPosition(this, vw, anVISUActor->GetPrs3d());
anVISUActor->VisibilityOff();
}
}
//----------------------------------------------------------------------------
VISU::Prs3d_i*
GetPrsToModify(const SalomeApp_Module* theModule,
- Handle(SALOME_InteractiveObject)& theIO)
+ Handle(SALOME_InteractiveObject)& theIO)
{
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule);
if(aSelectionInfo.empty())
QColor aColor (int(255*anOldColor.R),
- int(255*anOldColor.G),
- int(255*anOldColor.B));
+ int(255*anOldColor.G),
+ int(255*anOldColor.B));
QColor aColorNew = QColorDialog::getColor(aColor, GetDesktop(this));
if (aColorNew.isValid()) {
aNewColor.R = aColorNew.red()/255.;
delete CursorDlg;
}
+//----------------------------------------------------------------------------
+void
+VisuGUI
+::OnChangePointMarker()
+{
+ SALOME_ListIO aListIO;
+ GetSelectionMgr( this )->selectedObjects( aListIO );
+ if( aListIO.Extent() < 1 )
+ return;
+
+ VISU::StudyId2MarkerMap& aMarkerMap = GetVisuGen( this )->GetMarkerMap();
+ _PTR(Study) aCStudy = GetCStudy( GetAppStudy( this ) );
+ int aStudyId = aCStudy->StudyId();
+
+ bool update = false;
+ for( SALOME_ListIteratorOfListIO It( aListIO ); It.More(); It.Next() )
+ {
+ Handle(SALOME_InteractiveObject)& anIO = It.Value();
+ std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList( this, anIO );
+ for( int i = 0, n = aPrsList.size(); i < n; i++ )
+ {
+ if( VISU::Prs3d_i* aPrs = aPrsList[i] )
+ {
+ VTKViewer_MarkerDlg* aDlg = new VTKViewer_MarkerDlg( GetDesktop( this ) );
+ aDlg->setHelpData( "VISU", "point_marker_page.html" );
+
+ aDlg->setCustomMarkerMap( aMarkerMap[ aStudyId ] );
+
+ VISU::MarkerType aMarkerTypeCurrent = aPrs->GetMarkerType();
+ VISU::MarkerScale aMarkerScaleCurrent = aPrs->GetMarkerScale();
+ int aMarkerTextureCurrent = aPrs->GetMarkerTexture();
+ if( aMarkerTypeCurrent != VISU::MT_USER )
+ aDlg->setStandardMarker( (VTK::MarkerType)aMarkerTypeCurrent, (VTK::MarkerScale)aMarkerScaleCurrent );
+ else
+ aDlg->setCustomMarker( aMarkerTextureCurrent );
+
+ if( aDlg->exec() )
+ {
+ aMarkerMap[ aStudyId ] = aDlg->getCustomMarkerMap();
+
+ VISU::MarkerType aMarkerTypeNew = (VISU::MarkerType)aDlg->getMarkerType();
+ VISU::MarkerScale aMarkerScaleNew = (VISU::MarkerScale)aDlg->getStandardMarkerScale();
+ int aMarkerTextureNew = aDlg->getCustomMarkerID();
+ if( aMarkerTypeNew != VISU::MT_USER )
+ aPrs->SetMarkerStd( aMarkerTypeNew, aMarkerScaleNew );
+ else
+ aPrs->SetMarkerTexture( aMarkerTextureNew );
+
+ aPrs->UpdateActors();
+ update = true;
+ }
+
+ delete aDlg;
+ }
+ }
+ }
+
+ if( update )
+ if( SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>( this ) )
+ vw->Repaint();
+}
+
//----------------------------------------------------------------------------
void
VisuGUI
Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
_PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
- if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase))
+ if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase)) {
aSObject = GetCStudy( GetAppStudy( this ) )->FindObjectID( aTable->GetObjectEntry() );
-
- if( !IsSObjectTable( aSObject ) )
- return;
-
- VisuGUI_TableDlg* dlg = new VisuGUI_TableDlg( GetDesktop( this ),
- aSObject,
- false,
- //SAL2670 Orientation of show tables
- VisuGUI_TableDlg::ttAuto,
- Qt::Vertical );
- dlg->show();
+ if( IsSObjectTable( aSObject ) ) {
+ VISU_TableDlg* dlg = new VISU_TableDlg( GetDesktop( this ),
+ GetCStudy( GetAppStudy( this ) ),
+ aTable,
+ false,
+ //SAL2670 Orientation of show tables
+ VISU_TableDlg::ttAuto,
+ Qt::Vertical );
+ dlg->show();
+ }
+ }
}
//----------------------------------------------------------------------------
aGauss->SetBarVisible( theVisibility );
RecreateActor(this, aGauss);
update = true;
- }
- }
+ }
+ }
}
}
}
anIO = it.Value();
if (anIO->hasEntry()) {
if (IsRemovable(anIO->getEntry(), this)) {
- aNameList.append("\n - ");
- // Get Name Of the Main Object if it's a referenced object
- VISU::TObjectInfo anObjectInfo = GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
- if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
- _PTR(SObject) aRefSObject;
- if (aSObject->ReferencedObject(aRefSObject)) {
- QString aRefName = QString::fromStdString ( aRefSObject->GetName() );
- aNameList.append( aRefName );
- }
- else
- aNameList.append(anIO->getName());
- }
- anEntries[i++] = anIO->getEntry();
+ aNameList.append("\n - ");
+ // Get Name Of the Main Object if it's a referenced object
+ VISU::TObjectInfo anObjectInfo = GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
+ if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
+ _PTR(SObject) aRefSObject;
+ if (aSObject->ReferencedObject(aRefSObject)) {
+ QString aRefName = QString::fromStdString ( aRefSObject->GetName() );
+ aNameList.append( aRefName );
+ }
+ else
+ aNameList.append(anIO->getName());
+ }
+ anEntries[i++] = anIO->getEntry();
}
}
}
nbSelected = i;
if (nbSelected < 1) {
SUIT_MessageBox::warning(GetDesktop(this),
- QObject::tr("WRN_VISU"),
- QObject::tr("WRN_NO_APPROPRIATE_SELECTION"));
+ QObject::tr("WRN_VISU"),
+ QObject::tr("WRN_NO_APPROPRIATE_SELECTION"));
return;
}
if ( SUIT_MessageBox::question( GetDesktop(this),
- QObject::tr( "WRN_VISU" ),
- QObject::tr( "VISU_REALLY_DELETE" ).arg( nbSelected ).arg( aNameList ),
- SUIT_MessageBox::Yes | SUIT_MessageBox::No ) != SUIT_MessageBox::Yes )
+ QObject::tr( "WRN_VISU" ),
+ QObject::tr( "VISU_REALLY_DELETE" ).arg( nbSelected ).arg( aNameList ),
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No ) != SUIT_MessageBox::Yes )
return;
// There is a transaction
emit beforeObjectDelete(QString(aSObject->GetID().c_str()));
_PTR(SObject) aRefSObject;
if (aSObject->ReferencedObject(aRefSObject)) {
- // It can be a reference on curve, published under a container.
- // In this case the curve should be removed from the container.
- // See bug 10441.
- VISU::TObjectInfo aRefObjectInfo = GetObjectByEntry(GetAppStudy(this), aRefSObject->GetID());
- VISU::Base_i* aRefBase = aRefObjectInfo.myBase;
- if(aRefBase && aRefBase->GetType() == VISU::TMESH){
- DeleteSObject(this, aCStudy, aRefSObject);
- UpdateObjBrowser(this, true, aRefSObject);
- }else if(aRefBase && aRefBase->GetType() == VISU::TCURVE){
- CORBA::Object_var anObject = ClientSObjectToObject(aRefSObject);
- VISU::Curve_var aCurve = VISU::Curve::_narrow(anObject);
- _PTR(SObject) aParentSO = aSObject->GetFather();
- VISU::TObjectInfo aParentObjectInfo = GetObjectByEntry(GetAppStudy(this), aParentSO->GetID());
- if(VISU::Base_i* aParentBase = aParentObjectInfo.myBase){
- if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aParentBase)){
- if(aContainer->GetNbCurves() > 0){
- aContainer->RemoveCurve(aCurve);
- UpdateObjBrowser(this, true, aParentSO);
- }
- }
- }
- }
+ // It can be a reference on curve, published under a container.
+ // In this case the curve should be removed from the container.
+ // See bug 10441.
+ VISU::TObjectInfo aRefObjectInfo = GetObjectByEntry(GetAppStudy(this), aRefSObject->GetID());
+ VISU::Base_i* aRefBase = aRefObjectInfo.myBase;
+ if(aRefBase && aRefBase->GetType() == VISU::TMESH){
+ DeleteSObject(this, aCStudy, aRefSObject);
+ UpdateObjBrowser(this, true, aRefSObject);
+ }else if(aRefBase && aRefBase->GetType() == VISU::TCURVE){
+ CORBA::Object_var anObject = ClientSObjectToObject(aRefSObject);
+ VISU::Curve_var aCurve = VISU::Curve::_narrow(anObject);
+ _PTR(SObject) aParentSO = aSObject->GetFather();
+ VISU::TObjectInfo aParentObjectInfo = GetObjectByEntry(GetAppStudy(this), aParentSO->GetID());
+ if(VISU::Base_i* aParentBase = aParentObjectInfo.myBase){
+ if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aParentBase)){
+ if(aContainer->GetNbCurves() > 0){
+ aContainer->RemoveCurve(aCurve);
+ UpdateObjBrowser(this, true, aParentSO);
+ }
+ }
+ }
+ }
}
else{
- DeleteSObject(this, aCStudy, aSObject);
- UpdateObjBrowser(this, true, aSObject);
+ DeleteSObject(this, aCStudy, aSObject);
+ UpdateObjBrowser(this, true, aSObject);
}
}
}
if(VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase){
if(aBase->GetType() == VISU::TTABLE || aBase->GetType() == VISU::TPOINTMAP3D) {
if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase)){
- _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
- _PTR(SObject) aSObject = aStudy->FindObjectID( aTable->GetObjectEntry() );
- if(IsSObjectTable(aSObject)){
- VisuGUI_SetupPlot2dDlg* aDlg = new VisuGUI_SetupPlot2dDlg(aSObject, GetDesktop(this));
- if(aDlg->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;
- QList<int> verIndices, zIndices;
- aDlg->getCurvesSource( horIndex, verIndices, zIndices );
- if( horIndex >= 0 && verIndices.count() > 0 ){
- CORBA::Object_var aContainerObj = GetVisuGen(this)->CreateContainer();
- if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainerObj).in())){
- for( int i = 0; i < verIndices.count(); i++ ){
- VISU::Curve_var aCurveObject =
- GetVisuGen(this)->CreateCurveWithZ(aTable->_this(), horIndex+1, verIndices[i]+1, zIndices[i]+1 );
- if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurveObject).in())){
- bool isAuto;
- int marker, line, lineWidth;
- QColor color;
- if ( aDlg->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.;
- aCurve->SetColor( c );
- aCurve->SetMarker( ( VISU::Curve::MarkerType )marker );
- aCurve->SetLine( ( VISU::Curve::LineType )line, lineWidth );
- }
- aContainer->AddCurve(aCurveObject);
- }
- }
- UpdateObjBrowser(this);
- PlotContainer( this, aContainer, VISU::eDisplay );
- }
- }
- } else {
- // get name of SObject
- QString aSObjectName;
- _PTR(GenericAttribute) anAttr;
- if(aSObject->FindAttribute( anAttr, "AttributeName" )){
- _PTR(AttributeName) aName = anAttr;
- aSObjectName = QString( aName->Value().c_str() );
- }
- // if study is locked just get curves info and plot them
- // if current viewer is of VIEW_PLOT2D type
- QList<Plot2d_Curve*> container;
- aDlg->getCurves( container );
- if ( !container.isEmpty() ) {
- GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
- GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( aSObjectName );
- }
- }
- }
- delete aDlg;
- }
+ _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
+ _PTR(SObject) aSObject = aStudy->FindObjectID( aTable->GetObjectEntry() );
+ if(IsSObjectTable(aSObject)){
+ VisuGUI_SetupPlot2dDlg* aDlg = new VisuGUI_SetupPlot2dDlg(aSObject, GetDesktop(this));
+ if(aDlg->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;
+ QList<int> verIndices, ver1Indices, ver2Indices, zIndices;
+ aDlg->getCurvesSource( horIndex, ver1Indices, ver2Indices, zIndices );
+ verIndices = ver1Indices + ver2Indices;
+ if( horIndex >= 0 && verIndices.count() > 0 ){
+ CORBA::Object_var aContainerObj = GetVisuGen(this)->CreateContainer();
+ if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainerObj).in())){
+ for( int i = 0; i < verIndices.count(); i++ ){
+ bool isV2 = ver2Indices.contains(verIndices[i]);
+ VISU::Curve_var aCurveObject =
+ GetVisuGen(this)->CreateCurveWithZExt(aTable->_this(), horIndex+1, verIndices[i]+1, zIndices[i]+1, isV2 );
+ if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurveObject).in())){
+ bool isAuto;
+ int marker, line, lineWidth;
+ QColor color;
+ if ( aDlg->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.;
+ aCurve->SetColor( c );
+ aCurve->SetMarker( ( VISU::Curve::MarkerType )marker );
+ aCurve->SetLine( ( VISU::Curve::LineType )line, lineWidth );
+ }
+ aContainer->AddCurve(aCurveObject);
+ }
+ }
+ UpdateObjBrowser(this);
+ PlotContainer( this, aContainer, VISU::eDisplay );
+ }
+ }
+ } else {
+ // get name of SObject
+ QString aSObjectName;
+ _PTR(GenericAttribute) anAttr;
+ if(aSObject->FindAttribute( anAttr, "AttributeName" )){
+ _PTR(AttributeName) aName = anAttr;
+ aSObjectName = QString( aName->Value().c_str() );
+ }
+ // if study is locked just get curves info and plot them
+ // if current viewer is of VIEW_PLOT2D type
+ QList<Plot2d_Curve*> container;
+ aDlg->getCurves( container );
+ if ( !container.isEmpty() ) {
+ GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
+ GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( aSObjectName );
+ }
+ }
+ }
+ delete aDlg;
+ }
}
}
}else if(!aSelectionItem.myIO.IsNull()){
if(IsSObjectTable(aSObject)){
VisuGUI_SetupPlot2dDlg* aDlg = new VisuGUI_SetupPlot2dDlg(aSObject, GetDesktop(this));
if(aDlg->exec() == QDialog::Accepted){
- _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
+ _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
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;
- QList<int> verIndices, zIndices;
- aDlg->getCurvesSource( horIndex, verIndices, zIndices );
+ QList<int> verIndices, ver1Indices, ver2Indices, zIndices;
+ aDlg->getCurvesSource( horIndex, verIndices, ver2Indices, zIndices );
+ verIndices = ver1Indices + ver2Indices;
if ( horIndex >= 0 && verIndices.count() > 0 ) {
VISU::Table_var aTableObject = GetVisuGen(this)->CreateTable(aSObject->GetID().c_str());
if(!CORBA::is_nil(aTableObject)){
- VISU::Container_var aContainerObject = GetVisuGen(this)->CreateContainer();
+ VISU::Container_var aContainerObject = GetVisuGen(this)->CreateContainer();
VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainerObject).in());
- for ( int i = 0; i < verIndices.count(); i++ ) {
- VISU::Curve_var aCurveObject = GetVisuGen(this)->CreateCurveWithZ
- ( aTableObject, horIndex+1, verIndices[i]+1, zIndices[i]+1 );
- if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurveObject).in())){
- bool isAuto;
- int marker, line, lineWidth;
- QColor color;
- if ( aDlg->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.;
- aCurve->SetColor( c );
- aCurve->SetMarker( ( VISU::Curve::MarkerType )marker );
- aCurve->SetLine( ( VISU::Curve::LineType )line, lineWidth );
- }
- aContainerObject->AddCurve(aCurveObject);
- }
- }
- UpdateObjBrowser(this);
- PlotContainer( this, aContainer, VISU::eDisplay );
- }
- }
+ for ( int i = 0; i < verIndices.count(); i++ ) {
+ bool isV2 = ver2Indices.contains(verIndices[i]);
+ VISU::Curve_var aCurveObject = GetVisuGen(this)->CreateCurveWithZExt
+ ( aTableObject, horIndex+1, verIndices[i]+1, zIndices[i]+1, isV2 );
+ if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurveObject).in())){
+ bool isAuto;
+ int marker, line, lineWidth;
+ QColor color;
+ if ( aDlg->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.;
+ aCurve->SetColor( c );
+ aCurve->SetMarker( ( VISU::Curve::MarkerType )marker );
+ aCurve->SetLine( ( VISU::Curve::LineType )line, lineWidth );
+ }
+ aContainerObject->AddCurve(aCurveObject);
+ }
+ }
+ UpdateObjBrowser(this);
+ PlotContainer( this, aContainer, VISU::eDisplay );
+ }
+ }
} else {
- // get name of SObject
- QString aSObjectName;
- _PTR(GenericAttribute) anAttr;
- if(aSObject->FindAttribute(anAttr, "AttributeName")){
- _PTR(AttributeName) aName = anAttr;
- aSObjectName = QString( aName->Value().c_str() );
- }
+ // get name of SObject
+ QString aSObjectName;
+ _PTR(GenericAttribute) anAttr;
+ if(aSObject->FindAttribute(anAttr, "AttributeName")){
+ _PTR(AttributeName) aName = anAttr;
+ aSObjectName = QString( aName->Value().c_str() );
+ }
// if study is locked just get curves info and plot them
QList<Plot2d_Curve*> container;
aDlg->getCurves( container );
if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBase)){
if(aContainer && aContainer->GetNbCurves() > 0){
aContainer->Clear();
+ VISU::updateContainerVisibility(aContainer);
UpdateObjBrowser(this);
}
}
if (aDlg->exec()) {
aDlg->storeToPrsObject(aContainer);
UpdateObjBrowser(this, true);
+ delete aDlg;
+ VISU::updateContainerVisibility(aContainer);
}
- delete aDlg;
}
//----------------------------------------------------------------------------
ViewManagerList aViewManagerList;
getApp()->viewManagers(SPlot2d_Viewer::Type(), aViewManagerList);
SUIT_ViewManager* aViewManager;
- foreach( aViewManager, aViewManagerList ) {
+ foreach( aViewManager, aViewManagerList ) {
if (Plot2d_ViewManager* aManager = dynamic_cast<Plot2d_ViewManager*>(aViewManager)) {
if (SPlot2d_Viewer* aViewer = dynamic_cast<SPlot2d_Viewer*>(aManager->getViewModel()))
aViewer->renameAll( anIO, Name.toLatin1().constData() );
if (!isAny) {
SUIT_MessageBox::warning(GetDesktop(this),
- QObject::tr("WRN_VISU"),
- QObject::tr("WRN_NO_APPROPRIATE_SELECTION"));
+ QObject::tr("WRN_VISU"),
+ QObject::tr("WRN_NO_APPROPRIATE_SELECTION"));
}
}
aAnimationDlg->show();
}
+//----------------------------------------------------------------------------
+void
+VisuGUI
+::OnPointEvolution()
+{
+ _PTR(Study) aCStudy = GetCStudy( GetAppStudy( this ) );
+ VisuGUI_EvolutionDlg* aDlg = new VisuGUI_EvolutionDlg( this, aCStudy );
+
+ LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr( this );
+ SALOME_ListIO aListIO;
+ aSelectionMgr->selectedObjects( aListIO );
+
+ SALOME_ListIteratorOfListIO It( aListIO );
+ for( ; It.More(); It.Next() )
+ {
+ _PTR(SObject) aSObject = aCStudy->FindObjectID( It.Value()->getEntry() );
+ if( !aDlg->setField( aSObject ) )
+ {
+ SUIT_MessageBox::warning( GetDesktop( this ),
+ tr( "WRN_VISU" ),
+ tr( "ERR_CANT_CREATE_EVOLUTION" ) );
+ delete aDlg;
+ return;
+ }
+ }
+ aDlg->show();
+}
+
+//----------------------------------------------------------------------------
+void
+VisuGUI
+::OnShowEvolution()
+{
+ LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr( this );
+ SALOME_ListIO aListIO;
+ aSelectionMgr->selectedObjects( aListIO );
+
+ if( aListIO.Extent() != 1 )
+ return;
+
+ const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
+
+ _PTR(Study) aCStudy = GetCStudy( GetAppStudy( this ) );
+ _PTR(SObject) aSObj = aCStudy->FindObjectID( anIO->getEntry() );
+ if( !aSObj )
+ return;
+
+ VISU::VISUType aType = VISU::Storable::SObject2Type( aSObj );
+ if( aType != VISU::TEVOLUTION )
+ return;
+
+ VisuGUI_EvolutionDlg* aDlg = new VisuGUI_EvolutionDlg( this, aCStudy );
+ aDlg->restoreFromStudy( aSObj );
+ aDlg->show();
+}
+
//----------------------------------------------------------------------------
void
VisuGUI
if( myPanels.find( SelectionPanelId ) != myPanels.end() )
{
if( VisuGUI_SelectionPanel* aSelectionPanel =
- dynamic_cast<VisuGUI_SelectionPanel*>( myPanels[ SelectionPanelId ] ) )
+ dynamic_cast<VisuGUI_SelectionPanel*>( myPanels[ SelectionPanelId ] ) )
{
- if( aSelectionPanel->isVisible() )
- aSelectionPanel->hide();
- else
- aSelectionPanel->show();
+ if( aSelectionPanel->isVisible() )
+ aSelectionPanel->hide();
+ else
+ aSelectionPanel->show();
}
}
}
else if( myPanels.find( SelectionPanelId ) != myPanels.end() )
{
if( VisuGUI_SelectionPanel* aSelectionPanel =
- dynamic_cast<VisuGUI_SelectionPanel*>( myPanels[ SelectionPanelId ] ) )
- aSelectionPanel->setSelectionMode( anId - VISU_ACTOR_SELECTION );
+ dynamic_cast<VisuGUI_SelectionPanel*>( myPanels[ SelectionPanelId ] ) )
+ aSelectionPanel->setSelectionMode( anId - VISU_ACTOR_SELECTION );
}
}
// At least one action must be checked
tr("MEN_LINE_WIDTH"), "", 0, aParent, false,
this, SLOT(OnChangeLines()));
+ createAction( VISU_POINT_MARKER, tr("MEN_POINT_MARKER"), QIcon(),
+ tr("MEN_POINT_MARKER"), "", 0, aParent, false,
+ this, SLOT(OnChangePointMarker()));
+
createAction( VISU_SHRINK_FACTOR, tr("MEN_SHRINK_FACTOR"), QIcon(),
tr("MEN_SHRINK_FACTOR"), "", 0, aParent, false,
this, SLOT(OnChangeShrinkFactor()));
tr("MEN_SUCCCESSIVE_ANIMATION"), "", 0, aParent, false,
this, SLOT(OnSucccessiveTimeAnimation()));
+ createAction( VISU_POINT_EVOLUTION, tr("MEN_POINT_EVOLUTION"), QIcon(),
+ tr("MEN_POINT_EVOLUTION"), "", 0, aParent, false,
+ this, SLOT(OnPointEvolution()));
+
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ERASE_ALL"));
createAction( VISU_ERASE_ALL, tr("MEN_ERASE_ALL"), QIcon(aPixmap),
tr("MEN_ERASE_ALL"), "", 0, aParent, false,
tr("MEN_SHOW_ANIMATION"), "", 0, aParent, false,
this, SLOT(OnShowAnimation()));
+ createAction( VISU_SHOW_EVOLUTION, tr("MEN_SHOW_EVOLUTION"), QIcon(),
+ tr("MEN_SHOW_EVOLUTION"), "", 0, aParent, false,
+ this, SLOT(OnShowEvolution()));
+
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT_3D"));
createAction( VISU_PLOT3D_FROM_CUTPLANE, tr("MEN_PLOT3D_FROM_CUTPLANE"), QIcon(aPixmap),
tr("MEN_PLOT3D_FROM_CUTPLANE"), "", 0, aParent, false,
tr("MEN_FILE_INFO"), "", 0, aParent, false,
this, SLOT(OnFileInfo()));
- createAction( VISU_EXPORT_MED, tr("MEN_EXPORT_MED"), QIcon(),
- tr("MEN_EXPORT_MED"), "", 0, aParent, false,
+ createAction( VISU_EXPORT_MED, tr("VISU_MEN_EXPORT_MED"), QIcon(),
+ tr("VISU_MEN_EXPORT_MED"), "", 0, aParent, false,
this, SLOT(OnExportMED()));
createAction( VISU_FILTERSCALARS, tr("MEN_FILTER_SCALARS"), QIcon(),
tr("MEN_FILTER_SCALARS"), "", 0, aParent, false,
this, SLOT(OnFilterScalars()));
-
+
createAction( VISU_VALUES_LABELING, tr("MEN_VALUES_LABELING"), QIcon(),
tr("MEN_VALUES_LABELING"), "", 0, aParent, true,
- this, SLOT(OnValuesLabeling()));
+ this, SLOT(OnValuesLabeling()));
createAction( VISU_VALUES_LABELING_PARAMS, tr("VISU_VALUES_LABELING_PARAMS"), QIcon(),
tr("VISU_VALUES_LABELING_PARAMS"), "", 0, aParent, false,
- this, SLOT(OnValuesLabelingParams()));
+ this, SLOT(OnValuesLabelingParams()));
- createAction(VISU_ARCQUAD_MODE, tr("MEN_VISU_ARCQUAD_MODE"), QIcon(),
+ createAction(VISU_ARCQUAD_MODE, tr("MEN_VISU_ARCQUAD_MODE"), QIcon(),
tr("MEN_VISU_ARCQUAD_MODE"), "",0, aParent, true,
this, SLOT(OnArcQuadMode()));
-
+
createAction(VISU_LINEQUAD_MODE, tr("MEN_VISU_LINEQUAD_MODE"),QIcon(),
tr("MEN_VISU_LINEQUAD_MODE"), "",0, aParent, true,
this, SLOT(OnLineQuadMode()));
parentId = createMenu( tr( "MEN_2D_QUADRATIC_MODE" ), aMenuId, 10 ); // 2D quadratic mode
createMenu( VISU_LINEQUAD_MODE, parentId, 10 ); // lines
createMenu( VISU_ARCQUAD_MODE, parentId, 10 ); // arcs
-
+
}
void
// delete
mgr->insert( action( VISU_CLEAR_CONTAINER ), -1, -1, -1 );
-
+
// labeling
mgr->insert( separator(), -1, -1, -1 );
mgr->insert( action( VISU_VALUES_LABELING ), -1, -1, -1 );
mgr->insert( action( VISU_COLOR ) , parentId, -1, -1 ); // color
mgr->insert( action( VISU_OPACITY ) , parentId, -1, -1 ); // opacity
mgr->insert( action( VISU_LINE_WIDTH ), parentId, -1, -1 ); // line width
+ mgr->insert( action( VISU_POINT_MARKER ), parentId, -1, -1 ); // point marker
mgr->insert( action( VISU_SHRINK_FACTOR ), parentId, -1, -1 ); // shrink factor
mgr->insert( separator(), -1, -1, -1 );
mgr->insert( separator(), -1, -1, -1 );
+ mgr->insert( action( VISU_POINT_EVOLUTION ), -1, -1, -1 );
+
+ mgr->insert( separator(), -1, -1, -1 );
+
// view parameters commands
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
QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
"'VISU::TCUTLINES' 'VISU::TCUTSEGMENT' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' "
- "'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TCOLOREDPRS3DHOLDER'");
+ "'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TCOLOREDPRS3DHOLDER'");
QString aSimplePrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
- "'VISU::TCUTLINES' 'VISU::TCUTSEGMENT' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' "
- "'VISU::TSCALARMAPONDEFORMEDSHAPE'");
+ "'VISU::TCUTLINES' 'VISU::TCUTSEGMENT' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' "
+ "'VISU::TSCALARMAPONDEFORMEDSHAPE'");
// VISU root commands
QString aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TVISUGEN'";
QString aPrsInvisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "})" + andInvisible + " and (not isPlot2dViewer))";
QString aComponent = "( selcount=1 and canBeDisplayed and isVisuComponent )";
- QString anEraseRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsVisible +
+ QString anEraseRule = "( selcount>0 and ({true} in $canBeDisplayed or type in {'VISU::TCONTAINER' 'VISU::TCURVE'}) and (" + aPrsVisible +
" or ( (" + aTableOrContHide + orCurveVisible + "))) ) or " + aComponent;
- QString aDisplayRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsInvisible +
+ QString aDisplayRule = "( selcount>0 and ({true} in $canBeDisplayed or type in {'VISU::TCONTAINER' 'VISU::TCURVE'}) and (" + aPrsInvisible +
" or ( (" + aTableOrContShow + orCurveInvisible + "))) ) or " + aComponent;
- QString aDOnlyRule = "( selcount>0 and ({true} in $canBeDisplayed) and (($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "})"
+ QString aDOnlyRule = "( selcount>0 and ({true} in $canBeDisplayed or type in {'VISU::TCONTAINER' 'VISU::TCURVE'}) and (($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "})"
" or ( ((type='VISU::TTABLE' and nbChildren>0) or (type='VISU::TCONTAINER' and hasCurves) or"
" (type='VISU::TCURVE')))) ) or" + aComponent;
aRule = "selcount=1 and $type in { " + aSimplePrsAll + "}";
mgr->setRule( action( VISU_FILTERSCALARS ), aRule );
-
+
// labeling
aRule = "hasActor=1 and selcount=1 and $type in { 'VISU::TGAUSSPOINTS'" + aPrsAll + " }";
"or (type='VISU::TDEFORMEDSHAPE' and hasActor=1))" );
mgr->setRule( action( VISU_OPACITY ), aRule + " and hasActor=1" );
mgr->setRule( action( VISU_LINE_WIDTH ), aRule + aLineType + " and hasActor=1" );
+ mgr->setRule( action( VISU_POINT_MARKER ), aRule + aLineType + " and hasActor=1 and representation='VISU::POINT'" );
mgr->setRule( action( VISU_SHRINK_FACTOR ), aRule + aShrinkType + " and isShrunk=1" );
// rename command
mgr->setRule( action( VISU_CLEAR_CONTAINER ), aRule );
mgr->setRule( action( VISU_EDIT_SCALARMAP ),
- "selcount=1 and type='VISU::TSCALARMAP'" );
+ "selcount=1 and type='VISU::TSCALARMAP'" );
mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPE ),
- "selcount=1 and type='VISU::TDEFORMEDSHAPE'" );
+ "selcount=1 and type='VISU::TDEFORMEDSHAPE'" );
mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPEANDSCALARMAP ),
- "selcount=1 and $type in {'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}" );
+ "selcount=1 and $type in {'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}" );
mgr->setRule( action( VISU_EDIT_CUTPLANES ),
- "selcount=1 and type='VISU::TCUTPLANES'" );
+ "selcount=1 and type='VISU::TCUTPLANES'" );
mgr->setRule( action( VISU_EDIT_CUTLINES ),
- "selcount=1 and type='VISU::TCUTLINES'" );
+ "selcount=1 and type='VISU::TCUTLINES'" );
mgr->setRule( action( VISU_EDIT_CUTSEGMENT ),
- "selcount=1 and type='VISU::TCUTSEGMENT'" );
+ "selcount=1 and type='VISU::TCUTSEGMENT'" );
mgr->setRule( action( VISU_EDIT_ISOSURFACES ),
- "selcount=1 and type='VISU::TISOSURFACES'" );
+ "selcount=1 and type='VISU::TISOSURFACES'" );
mgr->setRule( action( VISU_EDIT_VECTORS ),
- "selcount=1 and type='VISU::TVECTORS'" );
+ "selcount=1 and type='VISU::TVECTORS'" );
mgr->setRule( action( VISU_EDIT_STREAMLINES ),
- "selcount=1 and type='VISU::TSTREAMLINES'" );
+ "selcount=1 and type='VISU::TSTREAMLINES'" );
mgr->setRule( action( VISU_EDIT_PLOT3D ),
- "selcount=1 and type='VISU::TPLOT3D'" );
+ "selcount=1 and type='VISU::TPLOT3D'" );
mgr->setRule( action( VISU_EDIT_POINTMAP3D ),
- "selcount=1 and type='VISU::TPOINTMAP3D'" );
+ "selcount=1 and type='VISU::TPOINTMAP3D'" );
aRule = "selcount=1 and $type in {'VISU::TCUTLINES' 'VISU::TCUTSEGMENT'} and nbNamedChildren=0";
mgr->setRule( action( VISU_CREATE_TABLE ), aRule );
- aRule = "selcount=1 and ($type in {" + aSimplePrsAll + "})";
+ aRule = "selcount=1 and ($type in {" + aSimplePrsAll + "}) and isFieldPrs=0";
mgr->setRule( action( VISU_SWEEP ), aRule );
aRule = "client='ObjectBrowser' and selcount>0";
aRule += " and activeView in {'VTKViewer' 'SVTK'}";
mgr->setRule( action( VISU_SUCCCESSIVEANIMATION ), aRule );
+ aRule = "client='ObjectBrowser' and selcount>0";
+ aRule += " and $type in {'VISU::TFIELD'}";
+ aRule += " and medEntity='NODE_ENTITY'";
+ aRule += " and nbTimeStamps>1";
+ mgr->setRule( action( VISU_POINT_EVOLUTION ), aRule );
+
aRule = "client='ObjectBrowser' and $type in {'VISU::TENTITY' 'VISU::TFAMILY' 'VISU::TGROUP'}";
mgr->setRule( action( VISU_CREATE_PRS ), aRule + " and selcount=1" );
mgr->setRule( action( VISU_CREATE_MANY_PRS ), aRule + " and selcount>1" );
mgr->setRule( action( VISU_EDIT_PLOT3D ),
- "selcount=1 and type='VISU::TPLOT3D'" );
+ "selcount=1 and type='VISU::TPLOT3D'" );
//aRule = "client='ObjectBrowser' and type='MEDFIELD'";
//mgr->setRule( action( VISU_IMPORT_MED ), aRule, true );
if (!anIO.IsNull() && anIO->hasEntry()) {
_PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
if ( !aSObject )
- continue;
+ continue;
if ( !isOBClient ) {
- QString aName = QString( aSObject->GetName().c_str() );
- while ( aName.at( aName.length() - 1 ) == ' ' ) // Remove extraspaces in Name of popup
- aName.remove( (aName.length() - 1), 1 );
- theTitle = aName;
+ QString aName = QString( aSObject->GetName().c_str() );
+ while ( aName.at( aName.length() - 1 ) == ' ' ) // Remove extraspaces in Name of popup
+ aName.remove( (aName.length() - 1), 1 );
+ theTitle = aName;
}
CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
if (CORBA::is_nil(aCORBAObject)) {
- VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
- if (aType == VISU::TTIMESTAMP) {
- _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(aSObject);
- _PTR(SObject) aPrs;
- for (; anIter->More(); anIter->Next()) {
- aPrs = anIter->Value();
- if (!aPrs)
- continue;
- std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(this, aPrs);
- nbPrs += aSubList.size();
- }
- }
+ VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
+ if (aType == VISU::TTIMESTAMP) {
+ _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(aSObject);
+ _PTR(SObject) aPrs;
+ for (; anIter->More(); anIter->Next()) {
+ aPrs = anIter->Value();
+ if (!aPrs)
+ continue;
+ std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(this, aPrs);
+ nbPrs += aSubList.size();
+ }
+ }
}
}
}
if (!anIO.IsNull() && anIO->hasEntry()) {
_PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
if ( !aSObject )
- continue;
+ continue;
VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
if (aType == VISU::TCURVE) {
- isCurves = true;
+ isCurves = true;
} else {
- VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
- if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase)){
- if (aPrsObject->GetType() == VISU::TCUTPLANES) {
- if (VISU::CutPlanes_i* aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject))
- isOneCutPlane = aCutPrs->GetNbPlanes() == 1;
- }
- }
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
+ if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase)){
+ if (aPrsObject->GetType() == VISU::TCUTPLANES) {
+ if (VISU::CutPlanes_i* aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject))
+ isOneCutPlane = aCutPrs->GetNbPlanes() == 1;
+ }
+ }
}
}
}
VISU::VISUType aType = VISU::Storable::RestoringMap2Type( aMap );
if (aType == VISU::TANIMATION) {
theMenu->addAction( action( VISU_SHOW_ANIMATION ) );
+ } else if (aType == VISU::TEVOLUTION) {
+ theMenu->addAction( action( VISU_SHOW_EVOLUTION ) );
} else if (isOBClient) {
if (IsSObjectTable(aSObject)) {
/* action( VISU_SHOW_TABLE )->addTo(theMenu);
if (aSFather1) {
std::string aValue = aSFather1->GetName();
if (strcmp(aValue.c_str(), "MEDFIELD") == 0) {
- theMenu->addAction( action( VISU_IMPORT_MED_FIELD ) ); // "Import Field"
+ theMenu->addAction( action( VISU_IMPORT_MED_FIELD ) ); // "Import Field"
}
}
}
setMenuShown( true );
setToolShown( true );
+ // import Python module that manages VISU plugins (need to be here because SalomePyQt API uses active module)
+ PyGILState_STATE gstate = PyGILState_Ensure();
+ PyObject* pluginsmanager=PyImport_ImportModule((char*)"salome_pluginsmanager");
+ if(pluginsmanager==NULL)
+ PyErr_Print();
+ else
+ {
+ PyObject* result=PyObject_CallMethod( pluginsmanager, (char*)"initialize", (char*)"isss",1,"visu",tr("MEN_VISUALIZATION").toStdString().c_str(),tr("VISU_PLUGINS_OTHER").toStdString().c_str());
+ if(result==NULL)
+ PyErr_Print();
+ Py_XDECREF(result);
+ }
+ PyGILState_Release(gstate);
+ // end of GEOM plugins loading
+
// Reset actions accelerator keys
QList<QKeySequence> shortcuts;
shortcuts.append( QKeySequence(Qt::CTRL + Qt::Key_I) );
action(VISU_RENAME )->setEnabled(false); // Rename: Key_F2
bool aResult = SalomeApp_Module::deactivateModule( theStudy );
-
+
emit moduleDeactivated();
return aResult;
void VisuGUI::studyActivated()
{
GetVisuGen(this)->SetCurrentStudy(GetDSStudy(GetCStudy(GetAppStudy(this))));
-
+
}
/*
void VisuGUI::createPreferences()
{
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+
+ // TAB: General
+ int genTab = addPreference( tr( "VISU_PREF_GENERAL" ) );
+ // Quantities with individual precision settings
+ int precGroup = addPreference( tr( "VISU_PREF_GROUP_PRECISION" ), genTab );
+ setPreferenceProperty( precGroup, "columns", 2 );
+
+ // Default precision used by some input fieklds and data visualization code
+ // Moved here from "Representation" tab to have all precisions in the same place
+ int point_precision = addPreference( tr( "VISU_PREF_visual_data_precision" ), precGroup,
+ LightApp_Preferences::IntSpin, "VISU", "visual_data_precision" );
+ setPreferenceProperty( point_precision, "min", -16 );
+ setPreferenceProperty( point_precision, "max", 16 );
+ setPreferenceProperty( point_precision, "step", 1 );
+
+ const int nbQuantities = 5;
+ int precs[nbQuantities], ii = 0;
+ precs[ii++] = addPreference( tr( "VISU_PREF_length_precision" ), precGroup,
+ LightApp_Preferences::IntSpin, "VISU", "length_precision" );
+ precs[ii++] = addPreference( tr( "VISU_PREF_angle_precision" ), precGroup,
+ LightApp_Preferences::IntSpin, "VISU", "angle_precision" );
+ precs[ii++] = addPreference( tr( "VISU_PREF_len_tol_precision" ), precGroup,
+ LightApp_Preferences::IntSpin, "VISU", "len_tol_precision" );
+ precs[ii++] = addPreference( tr( "VISU_PREF_parametric_precision" ), precGroup,
+ LightApp_Preferences::IntSpin, "VISU", "parametric_precision" );
+ precs[ii ] = addPreference( tr( "VISU_PREF_memory_precision" ), precGroup,
+ LightApp_Preferences::IntSpin, "VISU", "memory_precision" );
+
+ // Set property for precision value for spinboxes
+ for ( ii = 0; ii < nbQuantities; ii++ ){
+ setPreferenceProperty( precs[ii], "min", ii == 2 ? 0 : -14 );
+ setPreferenceProperty( precs[ii], "max", ii == 2 ? 3 : 14 );
+ setPreferenceProperty( precs[ii], "precision", 2 );
+ }
+
+
// TAB: "MED import"
int importTab = addPreference( tr( "MED import" ) );
//printf( "++++++++++++++++++ Tab index %d\n", importTab );
int imposedGr = addPreference( tr( "VISU_MINMAX_IMPOSED_RANGE" ), sbarTab );
setPreferenceProperty( imposedGr, "columns", 4 );
- int min = addPreference( tr( "VISU_MIN" ), imposedGr, LightApp_Preferences::DblSpin, "VISU", "scalar_range_min" );
- int max = addPreference( tr( "VISU_MAX" ), imposedGr, LightApp_Preferences::DblSpin, "VISU", "scalar_range_max" );
- setPreferenceProperty( min, "step", 0.1 );
- setPreferenceProperty( max, "step", 0.1 );
+ int min = addPreference( tr( "VISU_MIN" ), imposedGr, LightApp_Preferences::Double, "VISU", "scalar_range_min" );
+ int max = addPreference( tr( "VISU_MAX" ), imposedGr, LightApp_Preferences::Double, "VISU", "scalar_range_max" );
+ setPreferenceProperty( min, "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
+ setPreferenceProperty( max, "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
// group: "Font"
int fontGr = addPreference( tr( "VISU_FONT" ), sbarTab );
setPreferenceProperty( numcol, "max", 256 );
addPreference( tr( "VISU_IS_UNITS" ), colorsLabelsGr,
- LightApp_Preferences::Bool, "VISU", "scalar_bar_display_units" );
+ LightApp_Preferences::Bool, "VISU", "scalar_bar_display_units" );
int numlab = addPreference( tr( "VISU_NB_LABELS" ), colorsLabelsGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_labels" );
setPreferenceProperty( lPrec, "min", 1 );
setPreferenceProperty( lPrec, "max", 100 );
-
+
int frame = addPreference( "", sbarTab, LightApp_Preferences::Frame, "", "" );
//setPreferenceProperty( frame, "orientation", "vertical" );
setPreferenceProperty( frame, "columns", "2" );
//setPreferenceProperty( psSzFrame, "columns", "2" );
int posVSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_VERTICAL" ),
- frame, LightApp_Preferences::GroupBox );
+ frame, LightApp_Preferences::GroupBox );
setPreferenceProperty( posVSizeGr, "columns", 2 );
int xv = addPreference( tr( "VISU_X" ), posVSizeGr,
LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_x" );
int twv = addPreference( tr( "VISU_TITLE_SIZE" ), posVSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_title_size" );
-
+
int lwv = addPreference( tr( "VISU_LABEL_SIZE" ), posVSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_label_size" );
-
+
int bwv = addPreference( tr( "VISU_BAR_WIDTH" ), posVSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_bar_width" );
int bhv = addPreference( tr( "VISU_BAR_HEIGHT" ), posVSizeGr,
// group: "Origin & Size Horizontal"
int posHSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_HORIZONTAL" ),
- frame, LightApp_Preferences::GroupBox );
+ frame, LightApp_Preferences::GroupBox );
setPreferenceProperty( posHSizeGr, "columns", 2 );
int xh = addPreference( tr( "VISU_X" ), posHSizeGr,
int twh = addPreference( tr( "VISU_TITLE_SIZE" ), posHSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_title_size" );
-
+
int lwh = addPreference( tr( "VISU_LABEL_SIZE" ), posHSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_label_size" );
-
+
int bwh = addPreference( tr( "VISU_BAR_WIDTH" ), posHSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_bar_width" );
int bhh = addPreference( tr( "VISU_BAR_HEIGHT" ), posHSizeGr,
addPreference( tr( "Generate data table" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_data_table" );
addPreference( tr( "Generate curves" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_curves" );
+ // TAB: "StreamLines"
+ int streamLinesTab = addPreference( tr( "VISU_STREAM_LINES" ) );
+
+ // group: "StreamLines preferences"
+ int streamLinesGr = addPreference( tr( "VISU_STREAM_LINES_PREF" ), streamLinesTab );
+ setPreferenceProperty( cutLineGr, "columns", 1 );
+ int usedPoints = addPreference( tr( "VISU_STREAM_LINES_USED_POINTS" ), streamLinesGr,
+ LightApp_Preferences::DblSpin, "VISU", "stream_lines_used_points" );
+ setPreferenceProperty( usedPoints, "min", 0 );
+ setPreferenceProperty( usedPoints, "max", 1 );
+ setPreferenceProperty( usedPoints, "step", 0.1 );
+
// TAB: "Sweep, Animation, 3D Cache"
int animationTab = addPreference( tr( "Sweep, Animation" ) );
{
{
int cacheGroup = addPreference( tr( "VISU_3DCACHE_PREFERENCES" ), animationTab );
setPreferenceProperty( cacheGroup, "columns", 2 );
-
+
int memory_mode = addPreference( tr( "VISU_MEMORY_MODE" ), cacheGroup,
- LightApp_Preferences::Selector, "VISU", "cache_memory_mode" );
-
+ LightApp_Preferences::Selector, "VISU", "cache_memory_mode" );
+
modes.clear();
modes.append( tr( "VISU_MINIMAL" ) );
modes.append( tr( "VISU_LIMITED" ) );
setPreferenceProperty( memory_mode, "strings", modes );
-
+
indices.clear();
indices.append( 0 );
indices.append( 1 );
setPreferenceProperty( memory_mode, "indexes", indices );
-
+
int memory_limit = addPreference( tr( "VISU_MEMORY_LIMIT" ), cacheGroup,
- LightApp_Preferences::IntSpin, "VISU", "cache_memory_limit" );
+ LightApp_Preferences::IntSpin, "VISU", "cache_memory_limit" );
setPreferenceProperty( memory_limit, "min", 1 );
setPreferenceProperty( memory_limit, "max", 5000 );
setPreferenceProperty( memory_limit, "step", 10 );
// group: "Animation preferences"
{
int animationGroup = addPreference( tr( "VISU_ANIMATION_PREFERENCES" ), animationTab );
- setPreferenceProperty( animationGroup, "columns", 3 );
-
- int speed = addPreference( tr( "Speed" ), animationGroup, LightApp_Preferences::IntSpin, "VISU", "speed" );
- addPreference( tr( "Cycled animation" ), animationGroup, LightApp_Preferences::Bool, "VISU", "cycled_animation" );
- addPreference( tr( "Use proportional timing" ), animationGroup, LightApp_Preferences::Bool, "VISU", "use_proportional_timing" );
- addPreference( tr( "Clean memory at each frame" ), animationGroup, LightApp_Preferences::Bool, "VISU", "clean_memory_at_each_frame" );
-
+ setPreferenceProperty( animationGroup, "columns", 1 );
+
+ int speed = addPreference( tr( "Speed" ), animationGroup,
+ LightApp_Preferences::IntSpin, "VISU", "speed" );
+ addPreference( tr( "Cycled animation" ), animationGroup,
+ LightApp_Preferences::Bool, "VISU", "cycled_animation" );
+ addPreference( tr( "Use proportional timing" ), animationGroup,
+ LightApp_Preferences::Bool, "VISU", "use_proportional_timing" );
+ addPreference( tr( "Clean memory at each frame" ), animationGroup,
+ LightApp_Preferences::Bool, "VISU", "clean_memory_at_each_frame" );
+
setPreferenceProperty( speed, "min", 1 );
setPreferenceProperty( speed, "max", 99 );
+
+ int dump_mode = addPreference( tr( "VISU_DUMP_MODE" ), animationGroup,
+ LightApp_Preferences::Selector, "VISU", "dump_mode" );
+
+ modes.clear();
+ modes.append( tr( "VISU_NO_DUMP" ) );
+ modes.append( tr( "VISU_DUMP_PICTURES" ) );
+ modes.append( tr( "VISU_DUMP_VIDEO" ) );
+ setPreferenceProperty( dump_mode, "strings", modes );
+
+ indices.clear();
+ indices.append( 0 );
+ indices.append( 1 );
+ indices.append( 2 );
+ setPreferenceProperty( dump_mode, "indexes", indices );
+
+ int time_stamp_frequency = addPreference( tr( "VISU_TIME_STAMP_FREQUENCY" ), animationGroup,
+ LightApp_Preferences::IntSpin, "VISU", "time_stamp_frequency" );
+ setPreferenceProperty( time_stamp_frequency, "min", 1 );
+ setPreferenceProperty( time_stamp_frequency, "max", 100 );
}
// group: "Sweeping preferences"
{
int sweepGroup = addPreference( tr( "VISU_SWEEPING_PREF" ), animationTab );
setPreferenceProperty( sweepGroup, "columns", 2 );
-
- int modeSw = addPreference( tr( "VISU_SWEEPING_MODES" ), sweepGroup, LightApp_Preferences::Selector, "VISU", "sweeping_modes" );
+
+ int modeSw = addPreference( tr( "VISU_SWEEPING_MODES" ), sweepGroup,
+ LightApp_Preferences::Selector, "VISU", "sweeping_modes" );
QStringList sweep_modes;
sweep_modes.append( tr( "VISU_LINEAR_SWEEP" ) );
sweep_modes.append( tr( "VISU_COS_SWEEP" ) );
indices.append( 2 );
setPreferenceProperty( modeSw, "strings", sweep_modes );
setPreferenceProperty( modeSw, "indexes", indices );
-
+
int timestep = addPreference( tr( "VISU_TIME_STEP" ), sweepGroup,
- LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
+ LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
/* int nbcycles = addPreference( tr( "VISU_NB_CYCLES" ), sweepGroup,
- LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );*/
+ LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );*/
int nbsteps = addPreference( tr( "VISU_NB_STEPS" ), sweepGroup,
- LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
+ LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
int rangeSw = addPreference( tr( "VISU_IS2PI" ), sweepGroup, LightApp_Preferences::Selector, "VISU", "sweeping_is2PI" );
QStringList ranges;
ranges.append( tr( "PERIOD_PI" ) );
indices.append( 1 );
setPreferenceProperty( rangeSw, "strings", ranges );
setPreferenceProperty( rangeSw, "indexes", indices );
-
+
setPreferenceProperty( timestep, "min", 0.1 );
setPreferenceProperty( timestep, "step", 0.1 );
setPreferenceProperty( timestep, "max", 1000 );
setPreferenceProperty( scalar_def_represent, "indexes", indices1 );
addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_def_shrink" );
- int point_precision = addPreference( tr( "VISU_FLOATING_POINT_PRECISION" ), representGr,
- LightApp_Preferences::IntSpin, "VISU", "floating_point_precision" );
- setPreferenceProperty( point_precision, "min", 1 );
- setPreferenceProperty( point_precision, "max", 16 );
- setPreferenceProperty( point_precision, "step", 1 );
- addPreference( "", representGr, LightApp_Preferences::Space );
-
-
int quadraticmode = addPreference( tr( "QUADRATIC_REPRESENT_MODE" ), representGr, LightApp_Preferences::Selector, "VISU", "quadratic_mode" );
QStringList quadraticModes;
quadraticModes.append("Lines");
setPreferenceProperty( maxAngle, "min", 1 );
setPreferenceProperty( maxAngle, "max", 90 );
+ int elem0DSize = addPreference( tr( "VISU_ELEM0D_SIZE" ), representGr, LightApp_Preferences::IntSpin, "VISU", "elem0d_size" );
+ setPreferenceProperty( elem0DSize, "min", 1 );
+ setPreferenceProperty( elem0DSize, "max", 10 );
+ addPreference( "", representGr, LightApp_Preferences::Space );
+
int shrFac = addPreference( tr( "VISU_SHRINK_FACTOR" ), representGr, LightApp_Preferences::IntSpin, "VISU", "shrink_factor" );
setPreferenceProperty( shrFac, "min", 20 );
setPreferenceProperty( shrFac, "max", 100 );
addPreference( tr( "VISU_EDGE_COLOR" ), representGr, LightApp_Preferences::Color, "VISU", "edge_color" );
addPreference( "", representGr, LightApp_Preferences::Space );
+ int typeOfMarker = addPreference( tr( "VISU_TYPE_OF_MARKER" ), representGr, LightApp_Preferences::Selector, "VISU", "type_of_marker" );
+
+ QList<QVariant> aMarkerTypeIndicesList;
+ QList<QVariant> aMarkerTypeIconsList;
+ for ( int i = VTK::MT_POINT; i <= VTK::MT_O_X; i++ ) {
+ QString icoFile = QString( "ICON_VERTEX_MARKER_%1" ).arg( i );
+ QPixmap pixmap = aResourceMgr->loadPixmap( "VTKViewer", tr( qPrintable( icoFile ) ) );
+ aMarkerTypeIndicesList << i;
+ aMarkerTypeIconsList << pixmap;
+ }
+ setPreferenceProperty( typeOfMarker, "indexes", aMarkerTypeIndicesList );
+ setPreferenceProperty( typeOfMarker, "icons", aMarkerTypeIconsList );
+
+ int markerScale = addPreference( tr( "VISU_MARKER_SCALE" ), representGr, LightApp_Preferences::Selector, "VISU", "marker_scale" );
+
+ QList<QVariant> aMarkerScaleIndicesList;
+ QStringList aMarkerScaleValuesList;
+ for ( int i = VISU::MS_10; i <= VISU::MS_70; i++ ) {
+ aMarkerScaleIndicesList << i;
+ aMarkerScaleValuesList << QString::number( (i-(int)VISU::MS_10)*0.5 + 1.0 );
+ }
+ setPreferenceProperty( markerScale, "strings", aMarkerScaleValuesList );
+ setPreferenceProperty( markerScale, "indexes", aMarkerScaleIndicesList );
+
addPreference( tr( "VISU_USE_SHADING" ), representGr, LightApp_Preferences::Bool, "VISU", "represent_shading" );
sp = addPreference( "", representGr, LightApp_Preferences::Space );
setPreferenceProperty( sp, "hstretch", 0 );
addPreference( tr( "VISU_AUTOMATIC_FIT_ALL" ), representGr,
LightApp_Preferences::Bool, "VISU", "automatic_fit_all" );
+ // TAB: Tables ; group: "Tables editing properties"
+ int tablesTab = addPreference( tr( "VISU_TABLES" ) );
+
+ int tablesGr = addPreference( tr( "VISU_TABLES_EDITING_PROPS" ), tablesTab );
+ setPreferenceProperty( tablesGr, "columns", 1 );
+
+ addPreference( tr( "VISU_TABLES_ENABLE_EDITING" ), tablesGr, LightApp_Preferences::Bool, "VISU", "tables_enable_editing" );
+
+ int sortPolicyPref = addPreference( tr( "VISU_TABLES_SORT_POLICY" ), tablesGr, LightApp_Preferences::Selector, "VISU", "tables_sort_policy" );
+ QStringList policies;
+ policies.append( tr( "VISU_TABLES_EMPTY_LOWEST" ) );
+ policies.append( tr( "VISU_TABLES_EMPTY_HIGHEST" ) );
+ policies.append( tr( "VISU_TABLES_EMPTY_FIRST" ) );
+ policies.append( tr( "VISU_TABLES_EMPTY_LAST" ) );
+ policies.append( tr( "VISU_TABLES_EMPTY_IGNORE" ) );
+ indices.clear();
+ indices.append( 0 );
+ indices.append( 1 );
+ indices.append( 2 );
+ indices.append( 3 );
+ indices.append( 4 );
+ setPreferenceProperty( sortPolicyPref, "strings", policies );
+ setPreferenceProperty( sortPolicyPref, "indexes", indices );
+
// TAB: Feature edges ; group: "Feature edges properties"
int featureEdgesTab = addPreference( tr( "VISU_FEATURE_EDGES" ) );
setPreferenceProperty( featureEdgesGr, "columns", 2 );
int featureEdgesAnglePref = addPreference( tr( "VISU_FEATURE_EDGES_ANGLE" ), featureEdgesGr,
- LightApp_Preferences::DblSpin, "VISU", "feature_edges_angle" );
+ LightApp_Preferences::DblSpin, "VISU", "feature_edges_angle" );
setPreferenceProperty( featureEdgesAnglePref, "step", 10.0 );
setPreferenceProperty( featureEdgesAnglePref, "min", 0.0 );
setPreferenceProperty( featureEdgesAnglePref, "max", 90.0 );
addPreference( tr( "VISU_SHOW_MANIFOLD_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_manifold_edges" );
addPreference( tr( "VISU_SHOW_NON_MANIFOLD_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_non_manifold_edges" );
//addPreference( tr( "VISU_FEATURE_EDGES_COLORING" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "feature_edges_coloring" );
-
+
// TAB: "Values labels"
-
+
int valLblTab = addPreference( tr( "VALUES_LABELING" ) );
// "Font" group
addVtkFontPref( tr( "LABELS" ), valLblFontGr, "values_labeling_font", true );
// color
- addPreference( tr( "COLOR" ), valLblFontGr,
+ addPreference( tr( "COLOR" ), valLblFontGr,
LightApp_Preferences::Color, "VISU", "values_labeling_color" );
}
aResourceMgr->setValue("VISU", "scalar_bar_horizontal_y", sbY1);
aResourceMgr->setValue("VISU", "scalar_bar_horizontal_height",sbH);
}
- }
-
+ }
+ else if(b == "visual_data_precision") {
+ LightApp_Preferences* pref = preferences();
+ QtxPreferenceItem* min = pref->findItem( tr( "VISU_MIN" ), true );
+ QtxPreferenceItem* max = pref->findItem( tr( "VISU_MAX" ), true );
+ if ( min )
+ setPreferenceProperty( min->id(), "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
+ if ( max )
+ setPreferenceProperty( max->id(), "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
+ }
+
if ( !aWarning.isEmpty() ){
aWarning += "The default values are applied instead.";
SUIT_MessageBox::warning(GetDesktop(this),
SUIT_ViewManager*
VisuGUI
::getViewManager(const QString& theType,
- const bool theIsCreate)
+ const bool theIsCreate)
{
return getApp()->getViewManager(theType,theIsCreate);
}
if (!anIO.IsNull() && anIO->hasEntry()) {
aSObject = aCStudy->FindObjectID(anIO->getEntry());
if ( !aSObject )
- continue;
+ continue;
VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase)){
if (aPrsObject->GetType() == VISU::TCUTPLANES) {
- aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
- if (aCutPrs)
- break;
+ aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
+ if (aCutPrs)
+ break;
}
}
}
Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aTimeStampSObj);
VISU::VISUType aType = VISU::Storable::RestoringMap2Type( aRestoringMap );
if (aType != TTIMESTAMP )
- return;
+ return;
QString aMeshName = aRestoringMap["myMeshName"];
QString anEntity = aRestoringMap["myEntityId"];
int aPos;
SUIT_ViewWindow* aViewWindow = 0;
// if (anIsVVTK) {
-// aViewWindow = GetViewWindow<VVTK_Viewer>(this);
-// aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<VVTK_ViewWindow*>(aViewWindow));
+// aViewWindow = GetViewWindow<VVTK_Viewer>(this);
+// aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<VVTK_ViewWindow*>(aViewWindow));
// } else {
- aViewWindow = GetViewWindow<SVTK_Viewer>(this);
- aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<SVTK_ViewWindow*>(GetViewWindow<SVTK_Viewer>(this)));
- // }
+ aViewWindow = GetViewWindow<SVTK_Viewer>(this);
+ aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<SVTK_ViewWindow*>(GetViewWindow<SVTK_Viewer>(this)));
+ // }
GetResourceMgr()->setValue("VISU", "scalar_bar_position_num", aPos);
VISU::Plot3D_i* aPrs3d =
CreatePrs3dFromFactory<VISU::Plot3D_i>(this,
- aTimeStampSObj,
- (const char*)aMeshName.toLatin1(),
- (Entity)anEntity.toInt(),
- (const char*)aFieldName.toLatin1(),
- aTimeStampId.toInt(),
- ColoredPrs3d_i::EPublishUnderTimeStamp);
+ aTimeStampSObj,
+ (const char*)aMeshName.toLatin1(),
+ (Entity)anEntity.toInt(),
+ (const char*)aFieldName.toLatin1(),
+ aTimeStampId.toInt(),
+ ColoredPrs3d_i::EPublishUnderTimeStamp);
if (aPrs3d) {
- SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
- int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0);
- if (!aValue) {
- VisuGUI_Plot3DDlg* aDlg = new VisuGUI_Plot3DDlg(this);
- aDlg->initFromPrsObject(aPrs3d, true);
- int aOrient = aCutPrs->GetOrientationType(); // Plot3d has the same orientation type
- double aRotX = aCutPrs->GetRotateX();
- double aRotY = aCutPrs->GetRotateY();
- double aPlanePos = aCutPrs->GetPlanePosition(0);
- aDlg->setPlane(aOrient, aRotX, aRotY, aPlanePos);
-
- if (!(runAndWait(aDlg, 0) && (aDlg->storeToPrsObject(aPrs3d)))) {
- DeletePrs3d(this, aPrs3d);
- delete aDlg;
- return;
- }
- delete aDlg;
- UpdateObjBrowser(this, true, aTimeStampSObj);
- }
- SVTK_ViewWindow* aSVtkWindow = dynamic_cast<SVTK_ViewWindow*>(aViewWindow);
- if ( aSVtkWindow ) {
- PublishInView(this, aPrs3d, aSVtkWindow, /*highlight = */true);
- aSVtkWindow->onFitAll();
-
- AddScalarBarPosition(this, aSVtkWindow, aPrs3d, aPos);
- }
- if (aPrs3d)
- emit presentationCreated(aPrs3d);
+ SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
+ int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0);
+ if (!aValue) {
+ VisuGUI_Plot3DDlg* aDlg = new VisuGUI_Plot3DDlg(this);
+ aDlg->initFromPrsObject(aPrs3d, true);
+ int aOrient = aCutPrs->GetOrientationType(); // Plot3d has the same orientation type
+ double aRotX = aCutPrs->GetRotateX();
+ double aRotY = aCutPrs->GetRotateY();
+ double aPlanePos = aCutPrs->GetPlanePosition(0);
+ aDlg->setPlane(aOrient, aRotX, aRotY, aPlanePos);
+
+ if (!(runAndWait(aDlg, 0) && (aDlg->storeToPrsObject(aPrs3d)))) {
+ DeletePrs3d(this, aPrs3d);
+ delete aDlg;
+ return;
+ }
+ delete aDlg;
+ UpdateObjBrowser(this, true, aTimeStampSObj);
+ }
+ SVTK_ViewWindow* aSVtkWindow = dynamic_cast<SVTK_ViewWindow*>(aViewWindow);
+ if ( aSVtkWindow ) {
+ PublishInView(this, aPrs3d, aSVtkWindow, /*highlight = */true);
+ aSVtkWindow->onFitAll();
+
+ AddScalarBarPosition(this, aSVtkWindow, aPrs3d, aPos);
+ }
+ if (aPrs3d)
+ emit presentationCreated(aPrs3d);
}
}
application()->putInfo(QObject::tr("INF_DONE"));
QFileInfo aFileInfo =
SUIT_FileDlg::getFileName(GetDesktop(this),
- aPath,
- aFilter,
- tr("MEN_EXPORT_MED"), // "Export To Med File"
- false);
+ aPath,
+ aFilter,
+ tr("VISU_MEN_EXPORT_MED"), // "Export To Med File"
+ false);
QString aFile = aFileInfo.filePath();
if ( aFile.length() > 0 ) {
}
/*!
- \brief SLOT called when "Labeling" popup menu item of presentation is clicked
- activates/deactivates labeling of results of the screen. This functionality works
- to numbering in SMESH module but is intended for showing results on the screen
+ \brief SLOT called when "Labeling" popup menu item of presentation is clicked
+ activates/deactivates labeling of results of the screen. This functionality works
+ to numbering in SMESH module but is intended for showing results on the screen
instead of elements numbers
\sa OnValuesLabelingParams()
*/
TSelectionItem aSelectionItem = GetSelectedObjects(this).front();
VISU::Prs3d_i* aPrs3d = GetPrs3dFromBase(aSelectionItem.myObjectInfo.myBase);
- if(!aPrs3d)
+ if (!aPrs3d)
return;
SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this);
- if(!aViewWindow)
+ if (!aViewWindow)
return;
VISU_Actor* anActor = FindActor(aViewWindow, aPrs3d);
- if(!anActor)
+ if (!anActor)
return;
- if( VISU_ScalarMapAct* aScalarMapActor = dynamic_cast<VISU_ScalarMapAct*>(anActor) )
+ if ( VISU_ScalarMapAct* aScalarMapActor = dynamic_cast<VISU_ScalarMapAct*>(anActor) )
{
aScalarMapActor->SetValuesLabeled( !aScalarMapActor->GetValuesLabeled() );
aViewWindow->Repaint();
}
- else if( VISU_GaussPtsAct* aGaussPtsAct = dynamic_cast<VISU_GaussPtsAct*>(anActor) )
+ else if ( VISU_GaussPtsAct* aGaussPtsAct = dynamic_cast<VISU_GaussPtsAct*>(anActor) )
{
aGaussPtsAct->SetValuesLabeled( !aGaussPtsAct->GetValuesLabeled() );
aViewWindow->Repaint();
}
/*!
- \brief SLOT called when "Labeling parameters" popup menu item of presentation
+ \brief SLOT called when "Labeling parameters" popup menu item of presentation
is clicked launch dialog box for changing parameters of labeling
\sa OnValuesLabeling()
*/
{
Handle(SALOME_InteractiveObject) anIO;
if ( VISU::Prs3d_i* aPrs3d = GetPrsToModify( this, anIO ) )
- EditPrs3d<VISU::ColoredPrs3d_i, VisuGUI_ValuesLabelingDlg, 1>(this, anIO, aPrs3d);
+ EditPrs3d<VISU::ColoredPrs3d_i, VisuGUI_ValuesLabelingDlg, 1>(this, anIO, aPrs3d);
}
/*!
\brief Adds preferences for dfont of VTK viewer
\param param parameter
\return identifier of preferences
*/
-int VisuGUI::addVtkFontPref(
- const QString& label,
- const int pId,
- const QString& param,
+int VisuGUI::addVtkFontPref(
+ const QString& label,
+ const int pId,
+ const QString& param,
const bool useSize )
{
int tfont = addPreference( label, pId, LightApp_Preferences::Font, "VISU", param );
-
+
setPreferenceProperty( tfont, "mode", QtxFontEdit::Custom );
QStringList fam;
}
/*!
- \brief SLOT called when "2D Quadratic -> Arcs" popup menu item
+ \brief SLOT called when "2D Quadratic -> Arcs" popup menu item
\ of presentation is cliked
*/
void VisuGUI::OnArcQuadMode(){
}
/*!
- \brief SLOT called when "2D Quadratic -> Lines" popup menu item
+ \brief SLOT called when "2D Quadratic -> Lines" popup menu item
\ of presentation is cliked
*/
void VisuGUI::OnLineQuadMode(){
ChangeQuadratic2DRepresentation(this,VISU::LINES);
}
-