*/
interface ColoredPrs3dCache : PrsObject, SALOME::GenericObj
{
+ /*!
+ * This enumeration contains the cache memory modes.
+ */
+ enum MemoryMode {
+ MINIMAL, /*!< Minimal memory mode (default behaviour). */
+ LIMITED /*!< Limited memory mode (fixed memory size for presentations). */
+ };
+
+ /*!
+ * Sets a memory mode.
+ */
+ void SetMemoryMode(in MemoryMode theMode);
+
+ /*!
+ * Sets a memory size for limited mode.
+ */
+ void SetLimitedMemory(in long theMemorySize);
+
/*!
* Creates %ColoredPrs3dHolder.
*/
<parameter name="recorder_fps" value="17.3" />
<parameter name="recorder_quality" value="100" />
<parameter name="recorder_progressive" value="true" />
+ <parameter name="cache_is_limited_memory" value="false" />
+ <parameter name="cache_limited_memory" value="1" />
</section>
<section name="resources">
<!-- Module resources -->
VisuGUI_TransparencyDlg.cxx \
VisuGUI_Timer.cxx \
VisuGUI_Slider.cxx \
- VisuGUI_InputPane.cxx
+ VisuGUI_InputPane.cxx \
+ VisuGUI_CacheDlg.cxx
LIB_MOC = VisuGUI.h \
VisuGUI_Module.h \
VisuGUI_BuildProgressDlg.h \
VisuGUI_TransparencyDlg.h \
VisuGUI_Slider.h \
- VisuGUI_InputPane.h
+ VisuGUI_InputPane.h \
+ VisuGUI_CacheDlg.h
LIB_CLIENT_IDL = SALOME_Exception.idl \
VISU_Gen.idl \
msgid "VisuGUI::MEN_PLOT3D_FROM_CUTPLANE"
msgstr "Plot3d"
+msgid "VisuGUI::MEN_CACHE_PROPERTIES"
+msgstr "Properties"
+
msgid "VisuGUI::ERR_ERROR_DURING_EXPORT"
msgstr "Error has been occured during exporting to file"
msgid "VisuGUI_TransparencyDlg::BUT_CLOSE"
msgstr "Close"
+msgid "VisuGUI_CacheDlg::CACHE_TITLE"
+msgstr "Cache properties"
+
+msgid "VisuGUI_CacheDlg::MEMORY_MODE"
+msgstr "Memory mode"
+
+msgid "VisuGUI_CacheDlg::MINIMAL_MEMORY"
+msgstr "Minimal memory"
+
+msgid "VisuGUI_CacheDlg::LIMITED_MEMORY"
+msgstr "Limited memory"
+
msgid "VVTK_ViewManager::VTK_VIEW_TITLE"
msgstr "Gauss scene:%1 - viewer:%2"
#include "VISU_View_i.hh"
#include "VISU_ViewManager_i.hh"
#include "VISU_Plot3D_i.hh"
+#include "VISU_ColoredPrs3dCache_i.hh"
+#include "VISU_ColoredPrs3dHolder_i.hh"
#include "VISU_Actor.h"
#include "VisuGUI_Displayer.h"
#include "VisuGUI_BuildProgressDlg.h"
#include "VisuGUI_TransparencyDlg.h"
+#include "VisuGUI_CacheDlg.h"
#include "VISU_ScalarMap_i.hh"
#include "VisuGUI_ScalarBarDlg.h"
#include "VISU_Vectors_i.hh"
#include "VisuGUI_VectorsDlg.h"
-#include "VISU_ColoredPrs3dHolder_i.hh"
-
#include "VisuGUI_TableDlg.h"
#include "SALOMEconfig.h"
createAction( VISU_PLOT3D_FROM_CUTPLANE, tr("MEN_PLOT3D_FROM_CUTPLANE"), QIconSet(aPixmap),
tr("MEN_PLOT3D_FROM_CUTPLANE"), "", 0, aParent, false,
this, SLOT(OnPlot3dFromCutPlane()));
+
+ createAction( VISU_CACHE_PROPERTIES, tr("MEN_CACHE_PROPERTIES"), QIconSet(),
+ tr("MEN_CACHE_PROPERTIES"), "", 0, aParent, false,
+ this, SLOT(OnCacheProperties()));
}
void
if (isOneCutPlane)
action( VISU_PLOT3D_FROM_CUTPLANE )->addTo(theMenu);
+ Handle(SALOME_InteractiveObject) anIO;
+ VISU::Storable::TRestoringMap aMap;
+ CORBA::Object_var anObject = GetSelectedObj( this, &anIO, &aMap);
+
+ if (!CORBA::is_nil(anObject)) {
+ VISU::Base_i* aBase = dynamic_cast<VISU::Base_i*>(VISU::GetServant(anObject).in());
+ if (aBase && aBase->GetType() == VISU::TCOLOREDPRS3DCACHE)
+ action( VISU_CACHE_PROPERTIES )->addTo(theMenu);
+ }
+
theMenu->insertSeparator();
// Check if some (nb > 0) removable objects selected
// Check single selection
if (aListIO.Extent() != 1) return;
- Handle(SALOME_InteractiveObject) anIO;
- VISU::Storable::TRestoringMap aMap;
- CORBA::Object_var anObject = GetSelectedObj( this, &anIO, &aMap);
-
_PTR(SObject) SO = aCStudy->FindObjectID(anIO->getEntry());
if ( !SO )
return;
application()->putInfo(QObject::tr("INF_DONE"));
}
}
+
+void VisuGUI::OnCacheProperties()
+{
+ CORBA::Object_var anObject = GetSelectedObj( this );
+ if( CORBA::is_nil( anObject ) )
+ return;
+
+ VISU::ColoredPrs3dCache_i* aCache = dynamic_cast<VISU::ColoredPrs3dCache_i*>(VISU::GetServant(anObject).in());
+ if( !aCache )
+ return;
+
+ VisuGUI_CacheDlg* aDlg = new VisuGUI_CacheDlg( this,
+ aCache->GetMemoryMode() == VISU::ColoredPrs3dCache::LIMITED,
+ aCache->GetLimitedMemory() );
+ if( !aDlg->exec() )
+ return;
+
+ if( aDlg->isLimitedMemory() )
+ {
+ aCache->SetMemoryMode( VISU::ColoredPrs3dCache::LIMITED );
+ aCache->SetLimitedMemory( aDlg->getLimitedMemory() );
+ }
+ else
+ aCache->SetMemoryMode( VISU::ColoredPrs3dCache::MINIMAL );
+
+ delete aDlg;
+}
void OnArrangeActors();
void OnPlot3dFromCutPlane();
+ void OnCacheProperties();
+
protected:
virtual LightApp_Selection* createSelection() const;
#define VISU_PLOT3D_FROM_CUTPLANE 4085
+#define VISU_CACHE_PROPERTIES 4090
+
#endif
--- /dev/null
+// VISU VISUGUI : GUI of VISU component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File : VisuGUI_CacheDlg.cxx
+// Author : Oleg UVAROV
+// Module : VISU
+
+#include "VisuGUI_CacheDlg.h"
+
+#include "VisuGUI_Tools.h"
+
+#include "VISU_ColoredPrs3dCache_i.hh"
+
+#include "SUIT_Desktop.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_Session.h"
+
+#include "SalomeApp_Module.h"
+
+#include "LightApp_Application.h"
+
+#include <qbuttongroup.h>
+#include <qgroupbox.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qspinbox.h>
+
+VisuGUI_CacheDlg::VisuGUI_CacheDlg( SalomeApp_Module* theModule, bool theIsLimitedMemory, long theLimitedMemory )
+ : QDialog( VISU::GetDesktop( theModule ), "VisuGUI_CacheDlg", true,
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
+{
+ setCaption( tr( "CACHE_TITLE" ) );
+
+ QVBoxLayout* aTopLayout = new QVBoxLayout( this );
+ aTopLayout->setSpacing( 6 );
+ aTopLayout->setMargin( 6 );
+ aTopLayout->setAutoAdd( true );
+
+ // Settings
+ QButtonGroup* aMemoryGroup = new QButtonGroup( 2, Qt::Vertical, tr( "MEMORY_MODE" ), this );
+ aMemoryGroup->setRadioButtonExclusive( true );
+
+ myLimitedMemoryButton = new QRadioButton( tr( "LIMITED_MEMORY" ), aMemoryGroup );
+ myLimitedMemoryButton->setChecked( theIsLimitedMemory );
+
+ myMimimalMemoryButton = new QRadioButton( tr( "MINIMAL_MEMORY" ), aMemoryGroup );
+ myMimimalMemoryButton->setChecked( !theIsLimitedMemory );
+
+ myLimitedMemory = new QSpinBox( 1, 5000, 1, aMemoryGroup );
+ myLimitedMemory->setSuffix( " Mb" );
+ myLimitedMemory->setValue( theLimitedMemory );
+ myLimitedMemory->setEnabled( theIsLimitedMemory );
+
+ connect( myLimitedMemoryButton, SIGNAL( toggled( bool ) ), myLimitedMemory, SLOT( setEnabled( bool ) ) );
+
+ // Ok / Cancel
+ QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
+ GroupButtons->setColumnLayout(0, Qt::Vertical );
+ GroupButtons->layout()->setSpacing( 0 );
+ GroupButtons->layout()->setMargin( 0 );
+ QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
+ GroupButtonsLayout->setAlignment( Qt::AlignTop );
+ GroupButtonsLayout->setSpacing( 6 );
+ GroupButtonsLayout->setMargin( 11 );
+
+ QPushButton* buttonOk = new QPushButton( tr( "&OK" ), GroupButtons, "buttonOk" );
+ buttonOk->setAutoDefault( TRUE );
+ buttonOk->setDefault( TRUE );
+ GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
+ GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
+
+ QPushButton* buttonCancel = new QPushButton( tr( "&Cancel" ) , GroupButtons, "buttonCancel" );
+ buttonCancel->setAutoDefault( TRUE );
+ GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
+
+ QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" );
+ buttonHelp->setAutoDefault( TRUE );
+ GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
+
+ connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
+ connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+ connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
+}
+
+VisuGUI_CacheDlg::~VisuGUI_CacheDlg()
+{
+}
+
+bool VisuGUI_CacheDlg::isLimitedMemory()
+{
+ return myLimitedMemoryButton->isChecked();
+}
+
+int VisuGUI_CacheDlg::getLimitedMemory()
+{
+ return myLimitedMemory->value();
+}
+
+void VisuGUI_CacheDlg::accept()
+{
+ QDialog::accept();
+}
+
+void VisuGUI_CacheDlg::onHelp()
+{
+ QString aHelpFileName;// = "types_of_gauss_points_presentations.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app)
+ app->onHelpContextModule(app->activeModule() ?
+ app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
--- /dev/null
+// VISU VISUGUI : GUI of VISU component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File : VisuGUI_CacheDlg.h
+// Author : Oleg UVAROV
+// Module : VISU
+
+#ifndef VISUGUI_CACHEDLG_H
+#define VISUGUI_CACHEDLG_H
+
+#include <qdialog.h>
+
+class QRadioButton;
+class QSpinBox;
+
+class SalomeApp_Module;
+
+namespace VISU
+{
+ class ColoredPrs3dCache_i;
+}
+
+class VisuGUI_CacheDlg : public QDialog
+{
+ Q_OBJECT
+
+public:
+ VisuGUI_CacheDlg( SalomeApp_Module* theModule, bool theIsLimitedMemory, long theLimitedMemory );
+ virtual ~VisuGUI_CacheDlg();
+
+public:
+ bool isLimitedMemory();
+ int getLimitedMemory();
+
+protected slots:
+ virtual void accept();
+
+ void onHelp();
+
+private:
+ QRadioButton* myMimimalMemoryButton;
+ QRadioButton* myLimitedMemoryButton;
+ QSpinBox* myLimitedMemory;
+};
+
+#endif
#include "VISU_Vectors_i.hh"
#include "VISU_StreamLines_i.hh"
+#include "SUIT_ResourceMgr.h"
+
#include "VVTK_ViewWindow.h"
using namespace VISU;
SALOMEDS::SComponent_var aSComponent = VISU::FindOrCreateVisuComponent(theStudy);
CORBA::String_var aFatherEntry = aSComponent->GetID();
CreateAttributes(GetStudyDocument(), aFatherEntry.in(), "", anIOR.in(), myName, "", "", true);
+
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+
+ bool anIsLimitedMemory = aResourceMgr->booleanValue( "VISU", "cache_is_limited_memory", true );
+ SetMemoryMode( anIsLimitedMemory ? VISU::ColoredPrs3dCache::LIMITED : VISU::ColoredPrs3dCache::MINIMAL );
+
+ int aLimitedMemory = aResourceMgr->integerValue( "VISU", "cache_limited_memory", 10 );
+ SetLimitedMemory( aLimitedMemory );
+
}
}
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3dCache_i::
+SetMemoryMode(VISU::ColoredPrs3dCache::MemoryMode theMode)
+{
+ myMemoryMode = theMode;
+ cout << theMode << endl;
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3dCache_i::
+SetLimitedMemory(CORBA::Long theMemorySize)
+{
+ myLimitedMemory = theMemorySize;
+ cout << theMemorySize << endl;
+}
+
+
//----------------------------------------------------------------------------
VISU::ColoredPrs3dHolder_ptr
VISU::ColoredPrs3dCache_i::
~ColoredPrs3dCache_i();
//----------------------------------------------------------------------------
+ /*!
+ * Sets a memory mode.
+ */
+ void
+ SetMemoryMode(VISU::ColoredPrs3dCache::MemoryMode theMode);
+
+ /*!
+ * Sets a memory size for limited mode.
+ */
+ void
+ SetLimitedMemory(CORBA::Long theMemorySize);
+
/*!
* Creates ColoredPrs3dHolder.
*/
const VISU::ColoredPrs3dHolder::BasicInput& theInput);
//----------------------------------------------------------------------------
+ VISU::ColoredPrs3dCache::MemoryMode
+ GetMemoryMode() const { return myMemoryMode; }
+
+ long
+ GetLimitedMemory() const { return myLimitedMemory; }
+
virtual
VISU::VISUType
GetType() { return VISU::TCOLOREDPRS3DCACHE; }
const VISU::ColoredPrs3dHolder::BasicInput& theInput);
private:
- TColoredPrs3dHolderMap myHolderMap;
+ VISU::ColoredPrs3dCache::MemoryMode myMemoryMode;
+ long myLimitedMemory;
+
+ TColoredPrs3dHolderMap myHolderMap;
};
}