myMapper->Update();
}
-int
-VISU_PipeLine
-::CheckAvailableMemory(const vtkFloatingPointType& theSize)
-{
- try{
- if(theSize > ULONG_MAX) return 0;
- size_t aSize = size_t(theSize);
- char *aCheck = new char[aSize];
- if(aCheck) delete [] aCheck;
- if(MYDEBUG && aCheck == NULL)
- MESSAGE("CheckAvailableMemory("<<theSize<<") - cannot alloacate such amount of memory!!!");
- return aCheck != NULL;
- //return theSize < 1000*1024*1024;
- }catch(std::bad_alloc& exc){
- if(MYDEBUG)
- MESSAGE("CheckAvailableMemory("<<theSize<<") " << exc.what());
- } catch(...) {
- if(MYDEBUG)
- MESSAGE("CheckAvailableMemory("<<theSize<<") - unexpected exception was caught!!!");
+size_t
+VISU_PipeLine
+::CheckAvailableMemory(size_t theSize)
+{
+ if(theSize < ULONG_MAX){
+ try{
+ if(char *aCheck = new char[theSize]){
+ delete [] aCheck;
+ return theSize;
+ }
+ }catch(std::bad_alloc& exc){
+ }catch(...){
+ }
}
return 0;
}
-vtkFloatingPointType
+size_t
VISU_PipeLine
-::GetAvailableMemory(vtkFloatingPointType theSize,
- vtkFloatingPointType theMinSize)
+::GetAvailableMemory(size_t theSize,
+ size_t theMinSize)
{
- while(!CheckAvailableMemory(theSize))
- if(theSize > theMinSize)
- theSize /= 2;
+ // Finds acceptable memory size by half-deflection methods
+ static size_t EPSILON = 2 * 1024;
+ size_t aMax = std::max(theSize, theMinSize);
+ size_t aMin = std::min(theSize, theMinSize);
+ cout<<"GetAvailableMemory - "<<aMax<<"; "<<aMin;
+ while(CheckAvailableMemory(aMax) == 0 && CheckAvailableMemory(aMin) > 0 && (aMax - aMin) > EPSILON){
+ size_t aRoot = (aMax + aMin) / 2;
+ if(CheckAvailableMemory(aRoot))
+ aMin = aRoot;
else
- return 0;
- return theSize;
+ aMax = aRoot;
+ }
+ cout<<"; "<<aMax<<endl;
+ return aMax;
}
//------------------------ Clipping planes -----------------------------------
Update();
static
- int
- CheckAvailableMemory(const vtkFloatingPointType& theSize);
+ size_t
+ CheckAvailableMemory(size_t theSize);
static
- vtkFloatingPointType
- GetAvailableMemory(vtkFloatingPointType theSize = 16*1024*1024.0,
- vtkFloatingPointType theMinSize = 1024*1024.0);
+ size_t
+ GetAvailableMemory(size_t theSize = 16*1024*1024,
+ size_t theMinSize = 1024*1024);
// Clipping planes
void
}
-vtkFloatingPointType
+size_t
VISU_StreamLinesPL
::GetNecasseryMemorySize(vtkIdType theNbOfPoints,
vtkFloatingPointType theStepLength,
vtkFloatingPointType anAssignedDataSize = aCellsSize*4.0*sizeof(vtkFloatingPointType);
vtkFloatingPointType anOutputDataSetSize = aMeshSize + anAssignedDataSize;
- vtkFloatingPointType aResult = aStreamArraySize*aNbCells + anOutputDataSetSize;
+ size_t aResult = size_t(aStreamArraySize*aNbCells + anOutputDataSetSize);
return aResult;
}
-int
+size_t
VISU_StreamLinesPL
::FindPossibleParams(vtkPointSet* theDataSet,
vtkFloatingPointType& theStepLength,
{
static vtkFloatingPointType aPercentsDecrease = 3.0, aStepLengthIncrease = 9.0;
vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints();
- vtkFloatingPointType aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents);
- int isPoss = CheckAvailableMemory(aSize);
- if(!isPoss){
+ size_t aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents);
+ size_t anIsPossible = CheckAvailableMemory(aSize);
+ if(!anIsPossible){
vtkFloatingPointType aMaxStepLength = max(GetMaxStepLength(theDataSet),thePropogationTime);
vtkFloatingPointType aMinStepLength = GetMinStepLength(theDataSet);
vtkFloatingPointType aDeltaStepLength = (aMaxStepLength - aMinStepLength)/aStepLengthIncrease;
}
aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents);
if(CheckAvailableMemory(aSize)){
- isPoss = i;
+ anIsPossible = i;
break;
}
}
}
- if(MYDEBUG) MESSAGE("FindPossibleParams - aSize = "<<aSize<<"; isPoss = "<<isPoss);
- return isPoss;
+ if(MYDEBUG) MESSAGE("FindPossibleParams - aSize = "<<aSize<<"; anIsPossible = "<<anIsPossible);
+ return anIsPossible;
}
}
-int
+size_t
VISU_StreamLinesPL
::IsPossible(vtkPointSet* theDataSet,
vtkFloatingPointType thePercents)
aPointsFilter->SetInput(theDataSet);
vtkPointSet* aDataSet = aPointsFilter->GetOutput();
aDataSet->Update();
- int aRes = FindPossibleParams(aDataSet,aStepLength,aBasePropTime,thePercents);
+ size_t aRes = FindPossibleParams(aDataSet,aStepLength,aBasePropTime,thePercents);
aPointsFilter->UnRegisterAllOutputs();
aPointsFilter->Delete();
return aRes;
vtkFloatingPointType aBasePropTime = GetBasePropagationTime(theDataSet)/GetVelocityCoeff(theDataSet);
thePercents = 1.0;
vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints();
- vtkFloatingPointType aSize = GetNecasseryMemorySize(aNbOfPoints,anStepLength,aBasePropTime,thePercents);
- vtkFloatingPointType aRealSize = GetAvailableMemory(aSize);
+ size_t aSize = GetNecasseryMemorySize(aNbOfPoints,anStepLength,aBasePropTime,thePercents);
+ size_t aRealSize = GetAvailableMemory(aSize);
vtkFloatingPointType anAverageVolume = aVolume / aRealSize;
vtkFloatingPointType aStep = pow(double(anAverageVolume), double(1.0/double(degree)));
return aStep;
GetVelocityCoeff(vtkPointSet* theDataSet);
static
- int
+ size_t
IsPossible(vtkPointSet* theDataSet,
vtkFloatingPointType thePercents = 0.3);
protected:
static
- vtkFloatingPointType
+ size_t
GetNecasseryMemorySize(vtkIdType theNbOfPoints,
vtkFloatingPointType theStepLength,
vtkFloatingPointType thePropogationTime,
vtkFloatingPointType thePercents = 0.3);
static
- int
+ size_t
FindPossibleParams(vtkPointSet* theDataSet,
vtkFloatingPointType& theStepLength,
vtkFloatingPointType& thePropogationTime,
#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_TransparencyDlg.h"
#include "VisuGUI_CacheDlg.h"
-#include "VISU_ColoredPrs3dHolder_i.hh"
-
#include "VISU_ScalarMap_i.hh"
#include "VisuGUI_ScalarBarDlg.h"
typedef typename TL::TColoredEnum2Type<colored_prs3d_type_enum>::TResult TColoredPrs3d;
TColoredPrs3d* aColoredPrs3d = dynamic_cast<TColoredPrs3d*>(thePrs3d);
TColoredPrs3d* aSameColoredPrs3d = new TColoredPrs3d(VISU::ColoredPrs3d_i::EPublishUnderTimeStamp);
+ aSameColoredPrs3d->SetCResult(aColoredPrs3d->GetCResult());
+ aSameColoredPrs3d->SetMeshName(aColoredPrs3d->GetCMeshName().c_str());
+ aSameColoredPrs3d->SetEntity(aColoredPrs3d->GetEntity());
+ aSameColoredPrs3d->SetFieldName(aColoredPrs3d->GetCFieldName().c_str());
+ aSameColoredPrs3d->SetTimeStampNumber(aColoredPrs3d->GetTimeStampNumber());
aSameColoredPrs3d->SameAs(aColoredPrs3d);
}
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 )
+ CORBA::Object_var anObject = GetSelectedObj(this);
+ VISU::ColoredPrs3dCache_var aCache = VISU::GetInterface<VISU::ColoredPrs3dCache>(anObject);
+ if( CORBA::is_nil( aCache ) )
return;
VisuGUI_CacheDlg* aDlg = new VisuGUI_CacheDlg( this,
#include "VisuGUI_Tools.h"
#include "VISU_PipeLine.hxx"
-#include "VISU_ColoredPrs3dCache_i.hh"
#include "SUIT_Desktop.h"
#include "SUIT_MessageBox.h"
#ifndef VisuGUI_Prs3dTools_HeaderFile
#define VisuGUI_Prs3dTools_HeaderFile
+#include "VISUConfig.hh"
+#include "VisuGUI_Tools.h"
#include "VisuGUI_ViewTools.h"
-#include "VisuGUI_DialogRunner.h"
#include "VISU_ColoredPrs3dFactory.hh"
#include "VISU_ColoredPrs3dCache_i.hh"
namespace VISU
{
- class ColoredPrs3d_i;
- class CutLines_i;
-
- //---------------------------------------------------------------
- inline
- int
- runAndWait( QDialog* dlg, const bool modal )
- {
- VisuGUI_DialogRunner r( dlg );
- return r.run( modal );
- }
-
//---------------------------------------------------------------
template<class TPrs3d_i, class TViewer, class TDlg, int TIsDlgModal>
void
//----------------------------------------------------------------------------
- VISU::Prs3d_i*
- GetPrs3d(CORBA::Object_ptr theObject)
+ template<typename TInterface>
+ typename TInterface::_var_type
+ GetInterface(CORBA::Object_ptr theObject)
+ {
+ if(!CORBA::is_nil(theObject))
+ return TInterface::_narrow(theObject);
+ return TInterface::_nil();
+ }
+
+
+ //----------------------------------------------------------------------------
+ template<typename TServant>
+ TServant*
+ GetServantInterface(CORBA::Object_ptr theObject)
{
if(!CORBA::is_nil(theObject)){
- VISU::Base_var aBase = VISU::Base::_narrow(theObject);
- if(!CORBA::is_nil(aBase)){
- PortableServer::ServantBase_var aServant = VISU::GetServant(aBase);
- if(aServant.in())
- return dynamic_cast<VISU::Prs3d_i*>(aServant.in());
- }
+ PortableServer::ServantBase_var aServant = GetServant(theObject);
+ return dynamic_cast<TServant*>(aServant.in());
}
return NULL;
}
myMainWindow( theViewWindow->getMainWindow1() ),
mySelectionMgr( theSelectionMgr )
{
+ VISU::ViewManager_var aViewManager = VISU::GetVisuGen( myModule )->GetViewManager();
+ VISU::View_var aView = aViewManager->GetCurrentView();
+ if(!CORBA::is_nil(aView.in()))
+ myView3D = VISU::View3D::_narrow(aView);
+
//SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
setHorizontallyStretchable( true );
void VisuGUI_Slider::enableControls( bool on )
{
- //mySlider->setMinValue( 0 );
- //mySlider->setMaxValue( 0 );
- //mySlider->setValue( 0 );
-
+ widget()->setEnabled( on );
if( on )
{
- myTimeStampStrings->clear();
- myTimeStampIndices->clear();
-
- if( myHolderList.size() == 0 )
+ if( myHolderList.empty() )
return;
- VISU::ColoredPrs3dHolder_var aHolder = myHolderList[0];
- VISU::ColoredPrs3d_var aPrs = aHolder->GetDevice();
+ myTimeStampStrings->clear();
+ myTimeStampIndices->clear();
- CORBA::Long aTimeStampNumber = aPrs->GetTimeStampNumber();
- VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = aPrs->GetTimeStampsRange();
+ VISU::ColoredPrs3dHolder_var aHolder = myHolderList.front();
+ VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = aHolder->GetTimeStampsRange();
CORBA::Long aLength = aTimeStampsRange->length();
+ VISU::ColoredPrs3dHolder::BasicInput_var anInput = aHolder->GetBasicInput();
+ CORBA::Long aTimeStampNumber = anInput->myTimeStampNumber;
+
mySlider->setMinValue( 0 );
mySlider->setMaxValue( aLength-1 );
myLastTimeStamp->setText( aTimeStampsRange[aLength-1].myTime.in() );
myTimeStampsNumber->setText( QString("(") + QString::number( aLength ) + ")" );
- int current = 0;
- for( int index = 0; index < aLength; index++ )
+ CORBA::Long a_current_index = 0;
+ for( CORBA::Long an_index = 0; an_index < aLength; an_index++ )
{
- VISU::ColoredPrs3d::TimeStampInfo anInfo = aTimeStampsRange[ index ];
- long aNumber = anInfo.myNumber;
+ VISU::ColoredPrs3d::TimeStampInfo anInfo = aTimeStampsRange[ an_index ];
+ CORBA::Long aNumber = anInfo.myNumber;
QString aTime = anInfo.myTime.in();
myTimeStampStrings->insertItem( aTime );
myTimeStampIndices->insertItem( QString::number( aNumber ) );
if( aNumber == aTimeStampNumber )
- current = index;
+ a_current_index = an_index;
}
-
- mySlider->setValue( current );
+ myTimeStampStrings->setFont(myTimeStampStrings->font());
+ myTimeStampStrings->updateGeometry();
+
+ myTimeStampIndices->setFont(myTimeStampStrings->font());
+ myTimeStampIndices->updateGeometry();
+
+ myTimeStampStrings->setCurrentItem( a_current_index );
+ myTimeStampIndices->setCurrentItem( a_current_index );
+ mySlider->setValue( a_current_index );
}
else
{
myPlayButton->setOn( false );
}
- myTimeStampStrings->setFont(myTimeStampStrings->font());
- myTimeStampStrings->updateGeometry();
-
- myTimeStampIndices->setFont(myTimeStampStrings->font());
- myTimeStampIndices->updateGeometry();
-
- widget()->setEnabled( on );
}
void VisuGUI_Slider::onSelectionChanged()
{
//cout << "VisuGUI_Slider::onSelectionChanged()" << endl;
- myHolderList.resize(0);
+ myHolderList.clear();
_PTR(SObject) aSObject;
SALOME_ListIO aListIO;
mySelectionMgr->selectedObjects(aListIO);
SALOME_ListIteratorOfListIO anIter(aListIO);
- for( int k = 0; anIter.More(); anIter.Next() )
- {
+ for(; anIter.More(); anIter.Next() ){
Handle(SALOME_InteractiveObject) anIO = anIter.Value();
if (anIO->hasEntry()) {
SalomeApp_Study* theStudy = dynamic_cast<SalomeApp_Study*>(anApp->activeStudy());
if(!CORBA::is_nil(aHolder))
{
//cout << "ColoredPrs3dHolder" << endl;
- myHolderList.resize(k+1);
- myHolderList[k] = aHolder;
- k++;
+ myHolderList.push_back(aHolder);
}
}
}
}
}
- enableControls( myHolderList.size() != 0 );
+ enableControls( !myHolderList.empty() );
}
void VisuGUI_Slider::onTimeStampActivated( int value )
void VisuGUI_Slider::onValueChanged( int value )
{
- if( myHolderList.size() == 0 )
+ if( myHolderList.empty() )
return;
- VISU::ColoredPrs3dHolder_var aHolder = myHolderList[0];
- VISU::ColoredPrs3d_var aPrs = aHolder->GetDevice();
-
- VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = aPrs->GetTimeStampsRange();
+ VISU::ColoredPrs3dHolder_var aHolder = myHolderList.front();
+ VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = aHolder->GetTimeStampsRange();
CORBA::Long aLength = aTimeStampsRange->length();
if(value < 0 || aLength <= value)
return;
+ VISU::ColoredPrs3dHolder::BasicInput_var anInput = aHolder->GetBasicInput();
+ CORBA::Long aTimeStampNumber = anInput->myTimeStampNumber;
CORBA::Long aNumber = aTimeStampsRange[ value ].myNumber;
+ if(aNumber == aTimeStampNumber)
+ return;
- HolderList::iterator it = myHolderList.begin();
- HolderList::iterator itEnd = myHolderList.end();
- for( ; it != itEnd; ++it )
+ THolderList::const_iterator anIter = myHolderList.begin();
+ THolderList::const_iterator anIterEnd = myHolderList.end();
+ for( ; anIter != anIterEnd; anIter++ )
{
- VISU::ColoredPrs3dHolder_var aHolder = *it;
+ VISU::ColoredPrs3dHolder_var aHolder = *anIter;
if( CORBA::is_nil( aHolder.in() ) )
continue;
- VISU::ColoredPrs3dHolder::BasicInput* anInput = aHolder->GetBasicInput();
+ VISU::ColoredPrs3dHolder::BasicInput_var anInput = aHolder->GetBasicInput();
anInput->myTimeStampNumber = aNumber;
- VISU::View_var aView = VISU::GetVisuGen( myModule )->GetViewManager()->GetCurrentView();
- if( CORBA::is_nil( aView.in() ) )
- continue;
-
- VISU::View3D_var aView3D = VISU::View3D::_narrow( aView );
- if( CORBA::is_nil( aView3D.in() ) )
- continue;
-
- aHolder->Apply( aHolder->GetDevice(), *anInput, aView3D );
+ aHolder->Apply( aHolder->GetDevice(), anInput, myView3D );
}
myTimeStampStrings->setCurrentItem( value );
myTimeStampIndices->setCurrentItem( value );
-
- myMainWindow->Repaint();
}
void VisuGUI_Slider::onSpeedChanged( int value )
class ColoredPrs3dHolder_i;
}
-typedef std::vector<VISU::ColoredPrs3dHolder_var> HolderList;
-
class QCheckBox;
class QComboBox;
class QLabel;
VisuGUI_Module* myModule;
VVTK_MainWindow* myMainWindow;
LightApp_SelectionMgr* mySelectionMgr;
+ VISU::View3D_var myView3D;
QSlider* mySlider;
QLabel* myFirstTimeStamp;
QTimer* myTimer;
- //PrsList myPrsList;
- HolderList myHolderList;
+ typedef std::vector<VISU::ColoredPrs3dHolder_var> THolderList;
+ THolderList myHolderList;
};
#endif
#include "VisuGUI_Tools.h"
+#include "VisuGUI_ViewTools.h"
+#include "VisuGUI_Prs3dTools.h"
+#include "VisuGUI_DialogRunner.h"
#include "VisuGUI.h"
-#include "VisuGUI_ViewTools.h"
#include "VISU_Gen_i.hh"
#include "VISU_Prs3d_i.hh"
//=============================================================================
namespace VISU
{
+ //------------------------------------------------------------
SUIT_Desktop*
GetDesktop(const CAM_Module* theModule)
{
return theModule->application()->desktop();
}
+ //------------------------------------------------------------
LightApp_SelectionMgr*
GetSelectionMgr(const SalomeApp_Module* theModule)
{
return theModule->getApp()->selectionMgr();
}
+ //------------------------------------------------------------
SalomeApp_Study*
GetAppStudy(const CAM_Module* theModule)
{
dynamic_cast<SalomeApp_Study*>(theModule->application()->activeStudy());
}
+ //------------------------------------------------------------
_PTR(Study)
GetCStudy(const SalomeApp_Study* theStudy)
{
return theStudy->studyDS();
}
+ //------------------------------------------------------------
bool
IsStudyLocked( _PTR(Study) theStudy )
{
return true;
}
+ //------------------------------------------------------------
bool
CheckLock( _PTR(Study) theStudy,
QWidget* theWidget )
return false;
}
+ //------------------------------------------------------------
+ int
+ runAndWait( QDialog* dlg, const bool modal )
+ {
+ VisuGUI_DialogRunner r( dlg );
+ return r.run( modal );
+ }
+
+ //------------------------------------------------------------
LightApp_DataObject*
FindDataObject(SUIT_DataObject* theDataObject,
const QString& theEntry,
return NULL;
}
+ //------------------------------------------------------------
LightApp_DataObject*
FindDataObject(CAM_Module* theModule,
_PTR(SObject) theSObject)
return FindDataObject(aRootDataObject,anEntry.c_str(),aLevel);
}
+ //------------------------------------------------------------
void
UpdateObjBrowser(SalomeApp_Module* theModule,
bool theIsUpdateDataModel,
theModule->getApp()->updateActions();
}
+ //------------------------------------------------------------
bool
IsSObjectTable( _PTR(SObject) theSObject )
{
return false;
}
+ //------------------------------------------------------------
VISU_Gen_i*
GetVisuGen(const CAM_Module* theModule)
{
return aGen;
}
+ //------------------------------------------------------------
SALOME_MED::MED_Gen_var
GetMEDEngine()
{
}
- VISU::Storable::TRestoringMap getMapOfValue (_PTR(SObject) theSObject)
+ //------------------------------------------------------------
+ VISU::Storable::TRestoringMap
+ getMapOfValue(_PTR(SObject) theSObject)
{
VISU::Storable::TRestoringMap aMap;
if (theSObject) {
return aMap;
}
- QString getValue (_PTR(SObject) theSObject, QString theKey)
+ //------------------------------------------------------------
+ QString
+ getValue(_PTR(SObject) theSObject, QString theKey)
{
QString aStr("");
VISU::Storable::TRestoringMap aMap = getMapOfValue(theSObject);
return CORBA::Object::_nil();
}
+ //------------------------------------------------------------
CORBA::Object_var
GetSelectedObj(const SalomeApp_Module* theModule,
Handle(SALOME_InteractiveObject)* theIO,
return CORBA::Object::_nil();
}
+ //------------------------------------------------------------
VISU::Prs3d_i*
GetPrsToModify(const SalomeApp_Module* theModule,
Handle(SALOME_InteractiveObject)* theIO,
return NULL;
CORBA::Object_var anObject = GetSelectedObj(theModule, theIO);
- if (CORBA::is_nil(anObject))
- return NULL;
-
- PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
- if (!aServant.in())
- return NULL;
-
- VISU::Base_i* aBase = dynamic_cast<VISU::Base_i*>(aServant.in());
- if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){
- VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
- VISU::ColoredPrs3d_var aColoredPrs3d = aHolder->GetDevice();
- aServant = VISU::GetServant(aColoredPrs3d);
- aBase = dynamic_cast<VISU::Base_i*>(aServant.in());
+ if(VISU::Base_i* aBase = GetServantInterface<VISU::Base_i>(anObject)){
+ if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER){
+ VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
+ VISU::ColoredPrs3d_var aColoredPrs3d = aHolder->GetDevice();
+ aBase = dynamic_cast<VISU::Base_i*>(GetServant(aColoredPrs3d).in());
+ }
+ return dynamic_cast<VISU::Prs3d_i*>(aBase);
}
-
- return dynamic_cast<VISU::Prs3d_i*>(aBase);
+ return NULL;
}
+ //------------------------------------------------------------
void
Add(LightApp_SelectionMgr* theSelectionMgr,
const Handle(SALOME_InteractiveObject)& theIO)
theSelectionMgr->setSelectedObjects(aListIO);
}
+ //------------------------------------------------------------
void
Remove(LightApp_SelectionMgr* theSelectionMgr,
const Handle(SALOME_InteractiveObject)& theIO)
theSelectionMgr->setSelectedObjects(aNewListIO);
}
- /*!
- * Restores selection after presentation creating and editing
- */
+ //------------------------------------------------------------
+ //! Restores selection after presentation creating and editing
void
RestoreSelection(VisuGUI* theModule, VISU::Prs3d_i* thePrs3d)
{
return true;
}
+ //------------------------------------------------------------
void
DeleteSObject(VisuGUI* theModule,
_PTR(Study) theStudy,
}
}
+ //------------------------------------------------------------
void
DeletePrs3d(VisuGUI* theModule,
VISU::Prs3d_i* thePrs)
thePrs->RemoveFromStudy();
}
+ //------------------------------------------------------------
// Presentation management
-
void
ChangeRepresentation (const SalomeApp_Module* theModule,
VISU::PresentationType theType)
{
- SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
- if (!vw)
- return;
-
- Handle(SALOME_InteractiveObject) anIO;
- CORBA::Object_var anObject = GetSelectedObj(theModule, &anIO);
- if (CORBA::is_nil(anObject)) return;
-
- VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
- if (CORBA::is_nil(aVisuObj)) return;
-
- PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
- if (!aServant.in()) return;
-
- VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
- if (aPrs3d) {
- if (VISU_Actor* anActor = GetActor(aPrs3d, vw)) {
- switch (theType) {
- case VISU::SHRINK:
- if (anActor->IsShrunk())
- anActor->UnShrink();
- else
- anActor->SetShrink();
- break;
- default:
- if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
- aMesh->SetPresentationType(theType);
- RecreateActor(theModule, aMesh);
- } else {
- anActor->SetRepresentation(theType);
- }
- }
- vw->Repaint();
+ if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)){
+ if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(theModule)){
+ if (VISU_Actor* anActor = GetActor(aPrs3d, aViewWindow)) {
+ switch (theType) {
+ case VISU::SHRINK:
+ if (anActor->IsShrunk())
+ anActor->UnShrink();
+ else
+ anActor->SetShrink();
+ break;
+ default:
+ if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
+ aMesh->SetPresentationType(theType);
+ RecreateActor(theModule, aMesh);
+ } else {
+ anActor->SetRepresentation(theType);
+ }
+ }
+ aViewWindow->Repaint();
+ }
}
}
}
+ //------------------------------------------------------------
void
SetShading ( const SalomeApp_Module* theModule,
bool theOn )
{
- SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
- if (!vw)
- return;
-
- Handle(SALOME_InteractiveObject) anIO;
- CORBA::Object_var anObject = GetSelectedObj(theModule, &anIO);
- if (CORBA::is_nil(anObject)) return;
-
- VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
- if (CORBA::is_nil(aVisuObj)) return;
-
- PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
- if (!aServant.in()) return;
-
- VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
- if (aPrs3d) {
- if (VISU_Actor* anActor = GetActor(aPrs3d, vw)) {
- if ( VISU_ScalarMapAct* aScalarMapActor = dynamic_cast<VISU_ScalarMapAct*>(anActor) )
- aScalarMapActor->SetShading( theOn );
+ if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule)){
+ if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(theModule)){
+ if (VISU_Actor* anActor = GetActor(aPrs3d, aViewWindow)) {
+ if ( VISU_ScalarMapAct* aScalarMapActor = dynamic_cast<VISU_ScalarMapAct*>(anActor) )
+ aScalarMapActor->SetShading( theOn );
+ }
+ aViewWindow->Repaint();
}
- vw->Repaint();
}
}
+ //------------------------------------------------------------
// SObject type
-
bool
CheckTimeStamp(const SalomeApp_Module* theModule,
_PTR(SObject)& theSObject,
return false;
}
+ //------------------------------------------------------------
VISU::Result_i*
CheckResult(const SalomeApp_Module* theModule,
_PTR(SObject) theSource,
return dynamic_cast<VISU::Result_i*>(VISU::GetServant(anObject).in());
}
+ //------------------------------------------------------------
// VTK View
-
VISU_Actor*
PublishMeshInView(const SalomeApp_Module* theModule,
VISU::Prs3d_i* thePrs,
return aActor;
}
+ //------------------------------------------------------------
void
RepaintViewWindows (const SalomeApp_Module* theModule,
const Handle(SALOME_InteractiveObject)& theIObject)
}
}
+ //------------------------------------------------------------
VISU_Actor*
FindActor(SVTK_ViewWindow* theViewWindow,
const char* theEntry)
return NULL;
}
+ //------------------------------------------------------------
VISU_Actor*
FindActor(SVTK_ViewWindow* theViewWindow,
VISU::Prs3d_i* thePrs)
return NULL;
}
+ //------------------------------------------------------------
void
RecreateActor (const SalomeApp_Module* theModule,
VISU::Prs3d_i* thePrs)
QApplication::restoreOverrideCursor();
}
+ //------------------------------------------------------------
static
bool
ComputeVisiblePropBounds(SVTK_ViewWindow* theViewWindow,
return somethingVisible;
}
+ //------------------------------------------------------------
void SetFitAll(SVTK_ViewWindow* theViewWindow)
{
static vtkFloatingPointType PRECISION = 0.000001;
return NULL;
}
+ //------------------------------------------------------------
// Internal function used by several public functions below
void
UpdateCurve(VISU::Curve_i* theCurve,
}
}
+ //------------------------------------------------------------
void
PlotTable(const SalomeApp_Module* theModule,
VISU::Table_i* table,
}
}
+ //------------------------------------------------------------
void
PlotCurve(const SalomeApp_Module* theModule,
VISU::Curve_i* theCurve,
aPlot->Repaint();
}
+ //------------------------------------------------------------
void
PlotRemoveCurve(const SalomeApp_Module* theModule,
VISU::Curve_i* pCrv)
}
}
+ //------------------------------------------------------------
void
PlotContainer(const SalomeApp_Module* theModule,
VISU::Container_i* container,
aPlot->Repaint();
}
+ //------------------------------------------------------------
void
CreatePlot(SalomeApp_Module* theModule,
_PTR(SObject) theTableSO)
return aList;
}
+ //------------------------------------------------------------
int GetFreePositionOfDefaultScalarBar(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow)
{
int minIndx = 1;
return minIndx;
}
+ //------------------------------------------------------------
void AddScalarBarPosition (VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
VISU::Prs3d_i* thePrs3d, int pos)
{
aMap[theViewWindow].insert(aPair);
}
+ //------------------------------------------------------------
void RemoveScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow,
VISU::Prs3d_i* thePrs3d)
{
return;
}
}
+ //------------------------------------------------------------
}
#include CORBA_SERVER_HEADER(MED_Gen)
class QWidget;
+class QDialog;
class SUIT_Desktop;
class SUIT_ViewWindow;
bool CheckLock( _PTR(Study) theStudy,
QWidget* theWidget );
+ int runAndWait( QDialog* dlg, const bool modal );
+
void UpdateObjBrowser(SalomeApp_Module* theModule,
bool theIsUpdateDataModel = true,
_PTR(SObject) theSObject = _PTR(SObject)());
// Selection
LightApp_SelectionMgr* GetSelectionMgr(const SalomeApp_Module* theModule);
+
CORBA::Object_var GetSelectedObj(const SalomeApp_Study* theStudy,
const QString& theEntry,
VISU::Storable::TRestoringMap* theMap = NULL);
+
CORBA::Object_var GetSelectedObj(const SalomeApp_Module* theModule,
Handle(SALOME_InteractiveObject)* theIO = NULL,
VISU::Storable::TRestoringMap* theMap = NULL);
+
VISU::Prs3d_i* GetPrsToModify(const SalomeApp_Module* theModule,
Handle(SALOME_InteractiveObject)* theIO = NULL,
VISU::Storable::TRestoringMap* theMap = NULL);
public virtual PortableServer::RefCountServantBase
{
public:
+ typedef VISU::Base TInterface;
+
Base_i();
virtual ~Base_i();
virtual char* GetID();
static int MYDEBUG = 0;
#endif
-static int INCMEMORY = 4;
-
static int MEMORY_UNIT = 1000;
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
template<unsigned int colored_prs3d_type_enum>
-int
-CheckIsPossible(const VISU::ColoredPrs3dHolder::BasicInput& theInput)
+size_t
+CheckIsPossible(const VISU::ColoredPrs3dHolder::BasicInput& theInput,
+ bool theMemoryCheck)
{
VISU::Result_i* aResult = dynamic_cast<VISU::Result_i*>( VISU::GetServant(theInput.myResult).in() );
std::string aMeshName = theInput.myMeshName.in();
CORBA::Long aTimeStampNumber = theInput.myTimeStampNumber;
typedef typename VISU::TL::TColoredEnum2Type<colored_prs3d_type_enum>::TResult TColoredPrs3d;
- return TColoredPrs3d::IsPossible(aResult,aMeshName,anEntity,aFieldName,aTimeStampNumber);
+ return TColoredPrs3d::IsPossible(aResult,
+ aMeshName,
+ anEntity,
+ aFieldName,
+ aTimeStampNumber,
+ theMemoryCheck);
}
int
VISU::ColoredPrs3dCache_i
::IsPossible(VISU::VISUType theType,
- const VISU::ColoredPrs3dHolder::BasicInput& theInput,
- bool theMemoryCheck)
+ const VISU::ColoredPrs3dHolder::BasicInput& theInput)
{
//cout << "VISU::ColoredPrs3dCache_i::IsPossible " << endl;
- bool anIsPossible = false;
+ size_t aMemoryNeeded = 0;
switch(theType){
case TSCALARMAP:
- anIsPossible = CheckIsPossible<TSCALARMAP>(theInput);
+ aMemoryNeeded = CheckIsPossible<TSCALARMAP>(theInput, true);
+ break;
case TGAUSSPOINTS:
- anIsPossible = CheckIsPossible<TGAUSSPOINTS>(theInput);
+ aMemoryNeeded = CheckIsPossible<TGAUSSPOINTS>(theInput, true);
+ break;
case TDEFORMEDSHAPE:
- anIsPossible = CheckIsPossible<TDEFORMEDSHAPE>(theInput);
+ aMemoryNeeded = CheckIsPossible<TDEFORMEDSHAPE>(theInput, true);
+ break;
case TSCALARMAPONDEFORMEDSHAPE:
- anIsPossible = CheckIsPossible<TSCALARMAPONDEFORMEDSHAPE>(theInput);
+ aMemoryNeeded = CheckIsPossible<TSCALARMAPONDEFORMEDSHAPE>(theInput, true);
+ break;
case TISOSURFACE:
- anIsPossible = CheckIsPossible<TISOSURFACE>(theInput);
+ aMemoryNeeded = CheckIsPossible<TISOSURFACE>(theInput, true);
+ break;
case TSTREAMLINES:
- anIsPossible = CheckIsPossible<TSTREAMLINES>(theInput);
+ aMemoryNeeded = CheckIsPossible<TSTREAMLINES>(theInput, true);
+ break;
case TPLOT3D:
- anIsPossible = CheckIsPossible<TPLOT3D>(theInput);
+ aMemoryNeeded = CheckIsPossible<TPLOT3D>(theInput, true);
+ break;
case TCUTPLANES:
- anIsPossible = CheckIsPossible<TCUTPLANES>(theInput);
+ aMemoryNeeded = CheckIsPossible<TCUTPLANES>(theInput, true);
+ break;
case TCUTLINES:
- anIsPossible = CheckIsPossible<TCUTLINES>(theInput);
+ aMemoryNeeded = CheckIsPossible<TCUTLINES>(theInput, true);
+ break;
case TVECTORS:
- anIsPossible = CheckIsPossible<TVECTORS>(theInput);
+ aMemoryNeeded = CheckIsPossible<TVECTORS>(theInput, true);
+ break;
}
-
- if( anIsPossible && theMemoryCheck )
- {
- //cout << "Memory checking..." << endl;
- if( GetMemoryMode() == VISU::ColoredPrs3dCache::LIMITED )
- {
- long aMemoryUsed = 0;
-
- VISU::ColoredPrs3d_i* aPrs3d;
- TColoredPrs3dHolderMap::iterator aMapIterator = myHolderMap.begin();
- TColoredPrs3dHolderMap::iterator aMapIteratorEnd = myHolderMap.end();
- for(; aMapIterator != aMapIteratorEnd; ++aMapIterator)
- {
- TLastVisitedPrsList aList = aMapIterator->second;
-
- TLastVisitedPrsList::iterator it = aList.begin();
- TLastVisitedPrsList::iterator itEnd = aList.end();
- for(; it != itEnd; ++it)
- {
- aPrs3d = *it;
- if( aPrs3d )
+ if(aMemoryNeeded > 0){
+ if(GetMemoryMode() == VISU::ColoredPrs3dCache::LIMITED){
+ size_t aMemoryUsed = 0;
+ TColoredPrs3dHolderMap::const_iterator aHolderIter = myHolderMap.begin();
+ TColoredPrs3dHolderMap::const_iterator aHolderIterEnd = myHolderMap.end();
+ for(; aHolderIter != aHolderIterEnd; aHolderIter++){
+ const TLastVisitedPrsList& aPrsList = aHolderIter->second;
+ TLastVisitedPrsList::const_iterator aPrsIter = aPrsList.begin();
+ TLastVisitedPrsList::const_iterator aPrsIterEnd = aPrsList.end();
+ for(; aPrsIter != aPrsIterEnd; aPrsIter++){
+ if(VISU::ColoredPrs3d_i* aPrs3d = *aPrsIter)
aMemoryUsed += aPrs3d->GetMemorySize();
}
}
-
- long aMemoryLimit = GetLimitedMemory() * MEMORY_UNIT;
-
- //cout << "Cache memory : " << aMemoryLimit << endl;
- //cout << "Memory used : " << aMemoryUsed << endl;
-
- VISU::Result_i* aResult = dynamic_cast<VISU::Result_i*>( VISU::GetServant(theInput.myResult).in() );
- std::string aMeshName = theInput.myMeshName.in();
- VISU::Entity anEntity = theInput.myEntity;
- std::string aFieldName = theInput.myFieldName.in();
- long aTimeStampNumber = theInput.myTimeStampNumber;
-
- VISU::Result_i::TInput* anInput = aResult->GetInput();
- float aMemoryNeeded = anInput->GetTimeStampSize(aMeshName,
- (VISU::TEntity)anEntity,
- aFieldName,
- aTimeStampNumber);
- aMemoryNeeded *= INCMEMORY;
- //cout << "Memory needed : " << aMemoryNeeded << endl;
-
- if( aMemoryUsed + aMemoryNeeded > aMemoryLimit )
- anIsPossible = false;
+ size_t aMemoryLimit = GetLimitedMemory() * MEMORY_UNIT;
+ //cout<<"Memory needed: "<<aMemoryNeeded<<"; used: "<<aMemoryUsed<<"; limit: "<<aMemoryLimit<<endl;
+ return aMemoryUsed + aMemoryNeeded < aMemoryLimit;
}
- else
- anIsPossible = false;
}
-
- return anIsPossible;
+ return aMemoryNeeded > 0;
}
VISU::ColoredPrs3dHolder_i* theHolder)
{
thePrs3d->SetHolderEntry( theHolder->GetEntry() );
- GetLastVisitedPrsList(theHolder).push_back(thePrs3d);
+ GetLastVisitedPrsList(theHolder).push_front(thePrs3d);
return thePrs3d;
}
{
TLastVisitedPrsList aList = GetLastVisitedPrsList(theHolder);
if( !aList.empty() )
- return aList.back();
+ return aList.front();
return NULL;
}
::FindPrsByInput(TLastVisitedPrsList& theLastVisitedPrsList,
const VISU::ColoredPrs3dHolder::BasicInput& theInput)
{
- //cout << "VISU::ColoredPrs3dCache_i::FindPrsByInput() ";
- VISU::ColoredPrs3d_i* aPrs3d = NULL;
- VISU::ColoredPrs3dHolder::BasicInput_var anInput;
- TLastVisitedPrsList::iterator it = theLastVisitedPrsList.begin();
- TLastVisitedPrsList::iterator itEnd = theLastVisitedPrsList.end();
- for(; it != itEnd; ++it)
+ // User reverse iteration to start from last visited items
+ TLastVisitedPrsList::iterator anIter = theLastVisitedPrsList.begin();
+ TLastVisitedPrsList::iterator aEndIter = theLastVisitedPrsList.end();
+ for(; anIter != aEndIter; anIter++)
{
- aPrs3d = *it;
- anInput = aPrs3d->GetBasicInput();
-
+ VISU::ColoredPrs3d_i* aPrs3d = *anIter;
+ VISU::ColoredPrs3dHolder::BasicInput_var anInput = aPrs3d->GetBasicInput();
if(anInput->myResult->_is_equivalent(theInput.myResult) &&
!strcmp(anInput->myMeshName.in(), theInput.myMeshName.in()) &&
anInput->myEntity == theInput.myEntity &&
!strcmp(anInput->myFieldName.in(), theInput.myFieldName.in()) &&
anInput->myTimeStampNumber == theInput.myTimeStampNumber )
{
- //cout << "returns " << aPrs3d->GetName() << endl;
+ theLastVisitedPrsList.erase(anIter);
return aPrs3d;
}
}
-
- //cout << "returns NULL" << endl;
return NULL;
}
VISU::View3D_ptr theView3D)
{
//cout << "VISU::ColoredPrs3dCache_i::UpdateLastVisitedPrs" << endl;
+ VISU::ColoredPrs3d_i* aLastVisitedPrs3d = GetLastVisitedPrs(theHolder);
TLastVisitedPrsList& aLastVisitedPrsList = GetLastVisitedPrsList(theHolder);
VISU::ColoredPrs3d_i* aPrs3d = FindPrsByInput(aLastVisitedPrsList, theInput);
- if(aPrs3d)
- {
- aLastVisitedPrsList.pop_front();
- }
- else if(IsPossible(theHolder->GetPrsType(), theInput, true))
- {
+ bool anIsCheckPossible = GetMemoryMode() == VISU::ColoredPrs3dCache::LIMITED;
+ if(aPrs3d){
+ aLastVisitedPrsList.push_front(aPrs3d);
+ //cout << "FindPrsByInput " << aPrs3d;
+ }else if(anIsCheckPossible && IsPossible(theHolder->GetPrsType(), theInput)){
aPrs3d = CreatePrs(theHolder->GetPrsType(), theInput, theHolder);
- //cout << "Created " << aPrs3d->GetName() << endl;
- }
- else
- {
- //cout << "Move only" << endl;
- aPrs3d = aLastVisitedPrsList.front();
- aLastVisitedPrsList.pop_front();
+ //cout << "Created " << aPrs3d;
+ }else{
+ aPrs3d = aLastVisitedPrsList.back();
+ aLastVisitedPrsList.pop_back();
+ aLastVisitedPrsList.push_front(aPrs3d);
+ //cout << "Move only " << aPrs3d;
}
- aLastVisitedPrsList.push_back(aPrs3d);
+ //cout << "; " << aLastVisitedPrsList.size() << endl;
+ aPrs3d->SetResultObject(theInput.myResult);
+ aPrs3d->SetMeshName(theInput.myMeshName);
+ aPrs3d->SetEntity(theInput.myEntity);
+ aPrs3d->SetFieldName(theInput.myFieldName);
+ aPrs3d->SetTimeStampNumber(theInput.myTimeStampNumber);
aPrs3d->SameAs(thePrs);
-
- if(aPrs3d && !CORBA::is_nil(theView3D))
- {
- //cout << "Display " << aPrs3d->GetName() << endl;
- VISU::ColoredPrs3d_var aColoredPrs3d = aPrs3d->_this();
- theView3D->DisplayOnly(aColoredPrs3d);
+ if(!CORBA::is_nil(theView3D)){
+ if(aPrs3d != aLastVisitedPrs3d){
+ VISU::ColoredPrs3d_var aColoredPrs3d = aLastVisitedPrs3d->_this();
+ theView3D->Erase(aColoredPrs3d);
+ aColoredPrs3d = aPrs3d->_this();
+ theView3D->Display(aColoredPrs3d);
+ }else
+ theView3D->Update();
return true;
}
//----------------------------------------------------------------------------
virtual int
IsPossible(VISU::VISUType theType,
- const VISU::ColoredPrs3dHolder::BasicInput& theInput,
- bool theMemoryCheck = false);
+ const VISU::ColoredPrs3dHolder::BasicInput& theInput);
VISU::ColoredPrs3d_i*
FindPrsByInput(TLastVisitedPrsList& theLastVisitedPrsList,
const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- CORBA::Long theIteration)
+ CORBA::Long theTimeStampNumber)
{
typedef typename TPrs3d_i::TInterface TPrs3d;
typename TPrs3d::_var_type aPrs3d;
if(aStudy->GetProperties()->IsLocked())
return NULL;
- if(TPrs3d_i::IsPossible(aResult, theMeshName, theEntity, theFieldName, theIteration)){
+ if(TPrs3d_i::IsPossible(aResult, theMeshName, theEntity, theFieldName, theTimeStampNumber, true)){
TPrs3d_i* aPresent = new TPrs3d_i(ColoredPrs3d_i::EPublishUnderTimeStamp);
- if(CreatColoredPrs3d(aPresent, aResult, theMeshName, theEntity, theFieldName, theIteration))
+ if(CreatColoredPrs3d(aPresent, aResult, theMeshName, theEntity, theFieldName, theTimeStampNumber))
return aPresent;
aPresent->_remove_ref();
//----------------------------------------------------------------------------
- template<typename TPrs3d_i> typename TPrs3d_i::TInterface::_var_type
+ template<typename TPrs3d_i>
+ typename TPrs3d_i::TInterface::_var_type
Prs3dOnField(Result_ptr theResult,
const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- CORBA::Long theIteration)
+ CORBA::Long theTimeStampNumber)
{
- typedef typename TPrs3d_i::TInterface TPrs3d;
- typename TPrs3d::_var_type aPrs3d;
if(TPrs3d_i* aPrs3d = CreatePrs3d<TPrs3d_i>(theResult,
theMeshName,
theEntity,
theFieldName,
- theIteration))
+ theTimeStampNumber))
return aPrs3d->_this();
+ typedef typename TPrs3d_i::TInterface TPrs3d;
return TPrs3d::_nil();
}
//----------------------------------------------------------------------------
#include <strstream>
#include <vtkMapper.h>
+#include <vtkDataSet.h>
#ifdef _DEBUG_
static int MYDEBUG = 0;
VISU::ColoredPrs3d_i
::GetMemorySize()
{
- VISU::Result_i* aResult = dynamic_cast<VISU::Result_i*>( VISU::GetServant(GetResultObject()).in() );
- std::string aMeshName = GetCMeshName();
- VISU::Entity anEntity = GetEntity();
- std::string aFieldName = GetCFieldName();
- long aTimeStampNumber = GetTimeStampNumber();
-
- VISU::Result_i::TInput* anInput = aResult->GetInput();
- float aSize = anInput->GetTimeStampSize(aMeshName,
- (VISU::TEntity)anEntity,
- aFieldName,
- aTimeStampNumber);
- aSize *= INCMEMORY;
-
- return (CORBA::Long)aSize;
+ vtkDataSet* aDataSet = GetPipeLine()->GetMapper()->GetInput();
+ vtkFloatingPointType aSize = aDataSet->GetActualMemorySize() * 1024.0;
+ vtkFloatingPointType aMemorySize = aSize * INCMEMORY;
+ return CORBA::Long(aMemorySize);
}
VISU::ColoredPrs3dHolder::BasicInput*
if(const ColoredPrs3d_i* aPrs3d = dynamic_cast<const ColoredPrs3d_i*>(theOrigin)){
ColoredPrs3d_i* anOrigin = const_cast<ColoredPrs3d_i*>(aPrs3d);
- SetCResult(anOrigin->GetCResult());
- SetMeshName(anOrigin->GetCMeshName().c_str());
- SetEntity(anOrigin->GetEntity());
- SetFieldName(anOrigin->GetCFieldName().c_str());
- SetTimeStampNumber(anOrigin->GetTimeStampNumber());
- OnSetInput();
-
- Build(ESameAs);
+ if(OnSetInput())
+ Build(ESameAs);
TSuperClass::SameAs(theOrigin);
}
}
-//----------------------------------------------------------------------------
-void
-VISU::ColoredPrs3d_i
-::SameAsParams(const ColoredPrs3d_i* theOrigin)
-{
- CORBA::Long aTimeStampNumber = GetTimeStampNumber();
- SameAs(theOrigin);
- SetTimeStampNumber(aTimeStampNumber);
- OnSetInput();
-
- Build(ESameAs);
- Update();
-}
-
//----------------------------------------------------------------------------
CORBA::Long
VISU::ColoredPrs3d_i
::Create(const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber)
+ CORBA::Long theTimeStampNumber)
{
SetMeshName(theMeshName.c_str());
SetEntity(theEntity);
public:
//----------------------------------------------------------------------------
typedef Prs3d_i TSuperClass;
+ typedef VISU::ColoredPrs3d TInterface;
/*!
The enumeration allow to define what mode should be used for the presentation building.
Create(const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber);
+ CORBA::Long theTimeStampNumber);
/*!
Retores state of the presentation
void
SameAs(const Prs3d_i* theOrigin);
- /*!
- * \brief Works like SameAs() method, but keep myTimeStampNumber value unchanged.
- *
- * Is used in VISU_TimeAnimation class implementation.
- */
- void
- SameAsParams(const ColoredPrs3d_i* theOrigin);
-
virtual
bool
IsBoldTitle();
//---------------------------------------------------------------
-int
+size_t
VISU::CutLines_i
::IsPossible(Result_i* theResult,
const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber,
- int isMemoryCheck)
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck)
{
return TSuperClass::IsPossible(theResult,
theMeshName,
theEntity,
theFieldName,
theTimeStampNumber,
- isMemoryCheck);
+ theIsMemoryCheck);
}
//---------------------------------------------------------------
::Create(const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber)
+ CORBA::Long theTimeStampNumber)
{
return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
}
VISU::CutLines_i
::CheckIsPossible()
{
- return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
}
public:
//! Extends VISU_ColoredPrs3d_i::IsPossible
static
- int
+ size_t
IsPossible(Result_i* theResult,
const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber,
- int isMemoryCheck = true);
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck);
//! Extends VISU_ColoredPrs3d_i::Create
virtual
Create(const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber);
+ CORBA::Long theTimeStampNumber);
//! Extends VISU_ColoredPrs3d_i::ToStream
virtual
//----------------------------------------------------------------------------
-int
+size_t
VISU::CutPlanes_i
::IsPossible(Result_i* theResult,
- const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber,
- int isMemoryCheck)
+ const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck)
{
- return TSuperClass::IsPossible(theResult,theMeshName,theEntity,theFieldName,theTimeStampNumber,isMemoryCheck);
+ return TSuperClass::IsPossible(theResult,theMeshName,theEntity,theFieldName,theTimeStampNumber,theIsMemoryCheck);
}
VISU::Storable*
VISU::CutPlanes_i
::Create(const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber)
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber)
{
return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
}
VISU::CutPlanes_i
::CheckIsPossible()
{
- return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
}
//----------------------------------------------------------------------------
public:
//! Redefines VISU_ColoredPrs3d_i::IsPossible
static
- int
+ size_t
IsPossible(Result_i* theResult,
const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber,
- int isMemoryCheck = true);
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck);
//! Redefines VISU_ColoredPrs3d_i::Create
virtual
Create(const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber);
+ CORBA::Long theTimeStampNumber);
//! Redefines VISU_ColoredPrs3d_i::ToStream
virtual
//---------------------------------------------------------------
-int
+size_t
VISU::DeformedShape_i
::IsPossible(Result_i* theResult,
const std::string& theMeshName,
- VISU::Entity theEntity,
+ VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber,
- int isMemoryCheck)
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck)
{
try{
- bool aResult = TSuperClass::IsPossible(theResult,
- theMeshName,
- theEntity,
- theFieldName,
- theTimeStampNumber,
- isMemoryCheck);
+ size_t aResult = TSuperClass::IsPossible(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeStampNumber,
+ theIsMemoryCheck);
if(aResult){
VISU::Result_i::TInput* anInput = theResult->GetInput();
VISU::PField aField = anInput->GetField(theMeshName,
(VISU::TEntity)theEntity,
theFieldName);
- return aField->myNbComp > 1;
+ if(aField->myNbComp > 1)
+ return aResult;
}
}catch(std::exception& exc){
INFOS("Follow exception was occured :\n"<<exc.what());
::Create(const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber)
+ CORBA::Long theTimeStampNumber)
{
myIsColored = false;
myColor.R = myColor.G = myColor.B = 0.5;
VISU::DeformedShape_i
::CheckIsPossible()
{
- return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
}
public:
static
- int
+ size_t
IsPossible(Result_i* theResult,
const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber,
- int isMemoryCheck = true);
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck);
virtual
Storable*
Create(const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber);
+ CORBA::Long theTimeStampNumber);
static const std::string myComment;
#endif
//----------------------------------------------------------------------------
-int
+size_t
VISU::GaussPoints_i
::IsPossible(Result_i* theResult,
const std::string& theMeshName,
- VISU::Entity theEntity,
+ VISU::Entity theEntity,
const std::string& theFieldName,
- int theIteration,
- int isMemoryCheck)
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck)
{
try{
if(theEntity != VISU::NODE)
- return VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
- else
- return false;
+ return VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theTimeStampNumber,theIsMemoryCheck);
}catch(std::exception& exc){
INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
VISU::Storable*
VISU::GaussPoints_i
::Create(const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- int theIteration)
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber)
{
- TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
+ TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
VISU::GaussPoints_i
::CheckIsPossible()
{
- return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
}
public:
static
- int
+ size_t
IsPossible(Result_i* theResult,
const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theIteration,
- int isMemoryCheck = true);
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck);
virtual
Storable*
Create(const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theIteration);
+ CORBA::Long theTimeStampNumber);
static const std::string myComment;
#endif
//---------------------------------------------------------------
-int
+size_t
VISU::IsoSurfaces_i
::IsPossible(Result_i* theResult,
const std::string& theMeshName,
- VISU::Entity theEntity,
+ VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber,
- int isMemoryCheck)
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck)
{
return TSuperClass::IsPossible(theResult,
theMeshName,
theEntity,
theFieldName,
theTimeStampNumber,
- isMemoryCheck);
+ theIsMemoryCheck);
}
//---------------------------------------------------------------
::Create(const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber)
+ CORBA::Long theTimeStampNumber)
{
return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
}
VISU::IsoSurfaces_i
::CheckIsPossible()
{
- return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
}
//---------------------------------------------------------------
public:
static
- int
+ size_t
IsPossible(Result_i* theResult,
const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber,
- int isMemoryCheck = true);
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck);
virtual
Storable*
Create(const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber);
+ CORBA::Long theTimeStampNumber);
static const std::string myComment;
}
+//----------------------------------------------------------------------------
+void
+VISU::Mesh_i
+::SameAs(const Prs3d_i* theOrigin)
+{
+ return; // "SameAs" command for mesh is not valid in current architecture
+}
+
+
//---------------------------------------------------------------
void
VISU::Mesh_i
//----------------------------------------------------------------------------
-void
+void
VISU::Mesh_i
-::SameAs(const Prs3d_i* theOrigin)
-{
- return; // "SameAs" command for mesh is not valid in current architecture
+::SetCellColor(const SALOMEDS::Color& theColor)
+{
+ myCellColor = theColor;
+}
+
+
+//----------------------------------------------------------------------------
+SALOMEDS::Color
+VISU::Mesh_i
+::GetCellColor()
+{
+ return myCellColor;
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU::Mesh_i
+::SetNodeColor(const SALOMEDS::Color& theColor)
+{
+ myNodeColor = theColor;
+}
+
+
+//----------------------------------------------------------------------------
+SALOMEDS::Color
+VISU::Mesh_i
+::GetNodeColor()
+{
+ return myNodeColor;
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU::Mesh_i
+::SetLinkColor(const SALOMEDS::Color& theColor)
+{
+ myLinkColor = theColor;
}
+//----------------------------------------------------------------------------
+SALOMEDS::Color
+VISU::Mesh_i
+::GetLinkColor()
+{
+ return myLinkColor;
+}
+
//----------------------------------------------------------------------------
-int
+void
+VISU::Mesh_i
+::SetPresentationType(VISU::PresentationType theType)
+{
+ myPresentType = theType;
+}
+
+
+//----------------------------------------------------------------------------
+VISU::PresentationType
+VISU::Mesh_i
+::GetPresentationType()
+{
+ return myPresentType;
+}
+
+
+//----------------------------------------------------------------------------
+VISU::Entity
+VISU::Mesh_i
+::GetEntity() const
+{
+ return VISU::Entity(myEntity);
+}
+
+
+//----------------------------------------------------------------------------
+const std::string&
+VISU::Mesh_i
+::GetSubMeshName() const
+{
+ return mySubMeshName;
+}
+
+
+//----------------------------------------------------------------------------
+size_t
VISU::Mesh_i
::IsPossible(Result_i* theResult,
const std::string& theMeshName,
Entity theEntity,
- const char* theFamilyName)
+ const std::string& theFamilyName)
{
try{
MESSAGE("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theEntity = "<<theEntity<<"; theFamilyName = '"<<theFamilyName<<"'");
- float aSize = INCMEMORY*
+ size_t aSize = INCMEMORY*
theResult->GetInput()->GetMeshOnEntitySize(theMeshName,(VISU::TEntity)theEntity);
- bool aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
+ size_t aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
MESSAGE("Mesh_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
return aResult;
}catch(std::exception& exc){
return 0;
}
+//----------------------------------------------------------------------------
VISU::Storable*
VISU::Mesh_i
::Create(const std::string& theMeshName,
Entity theEntity,
- const char* theFamilyName)
+ const std::string& theFamilyName)
{
SetMeshName(theMeshName.c_str());
myEntity = int(theEntity);//jfa IPAL9284
}
-int
+//----------------------------------------------------------------------------
+size_t
VISU::Mesh_i
::IsPossible(Result_i* theResult,
const std::string& theMeshName,
- const char* theGroupName)
+ const std::string& theGroupName)
{
try{
MESSAGE("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theGroupName = '"<<theGroupName<<"'");
- float aSize = INCMEMORY*
+ size_t aSize = INCMEMORY*
theResult->GetInput()->GetMeshOnGroupSize(theMeshName,theGroupName);
- bool aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
+ size_t aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
INFOS("Mesh_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
return aResult;
}catch(std::exception& exc){
}
+//----------------------------------------------------------------------------
VISU::Storable*
VISU::Mesh_i
::Create(const std::string& theMeshName,
- const char* theGroupName)
+ const std::string& theGroupName)
{
SetMeshName(theMeshName.c_str());
myEntity = -1;//jfa IPAL9284
}
+//----------------------------------------------------------------------------
VISU::Storable*
VISU::Mesh_i
::Restore(const Storable::TRestoringMap& theMap)
}
+//----------------------------------------------------------------------------
void
VISU::Mesh_i
::ToStream(std::ostringstream& theStr)
}
+//----------------------------------------------------------------------------
VISU::Mesh_i
::~Mesh_i()
{
}
+//----------------------------------------------------------------------------
VISU::Storable*
VISU::Mesh_i
::Build(int theRestoring)
}
+//----------------------------------------------------------------------------
VISU_Actor*
VISU::Mesh_i
::CreateActor()
}
+//----------------------------------------------------------------------------
void
VISU::Mesh_i
::UpdateActor(VISU_Actor* theActor)
anActor->GetNodeProperty()->SetColor(myNodeColor.R, myNodeColor.G, myNodeColor.B);
}
}
+
+//----------------------------------------------------------------------------
public virtual Prs3d_i
{
static int myNbPresent;
- Mesh_i();
Mesh_i(const Mesh_i&);
+ Mesh_i();
public:
typedef Prs3d_i TSuperClass;
+ typedef VISU::Mesh TInterface;
explicit
Mesh_i(Result_i* theResult);
Mesh_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject);
- virtual void SameAs(const Prs3d_i* theOrigin);
- virtual ~Mesh_i();
- virtual void RemoveFromStudy();
+ virtual
+ ~Mesh_i();
- virtual VISU::VISUType GetType() { return VISU::TMESH;};
+ virtual
+ void
+ SameAs(const Prs3d_i* theOrigin);
- virtual void SetCellColor(const SALOMEDS::Color& theColor) { myCellColor = theColor;}
- virtual SALOMEDS::Color GetCellColor() { return myCellColor;}
+ virtual
+ void
+ RemoveFromStudy();
- virtual void SetNodeColor(const SALOMEDS::Color& theColor) { myNodeColor = theColor;}
- virtual SALOMEDS::Color GetNodeColor() { return myNodeColor;}
+ virtual
+ VISU::VISUType
+ GetType()
+ {
+ return VISU::TMESH;
+ }
- virtual void SetLinkColor(const SALOMEDS::Color& theColor) { myLinkColor = theColor;}
- virtual SALOMEDS::Color GetLinkColor() { return myLinkColor;}
+ virtual
+ void
+ SetCellColor(const SALOMEDS::Color& theColor);
- virtual void SetPresentationType(VISU::PresentationType theType) { myPresentType = theType;}
- virtual PresentationType GetPresentationType() { return myPresentType;}
+ virtual
+ SALOMEDS::Color
+ GetCellColor();
- typedef VISU::Mesh TInterface;
- VISU_MeshPL* GetMeshPL(){ return myMeshPL;}
+ virtual
+ void
+ SetNodeColor(const SALOMEDS::Color& theColor);
+
+ virtual
+ SALOMEDS::Color
+ GetNodeColor();
+
+ virtual
+ void
+ SetLinkColor(const SALOMEDS::Color& theColor);
+
+ virtual
+ SALOMEDS::Color
+ GetLinkColor();
+
+ virtual
+ void
+ SetPresentationType(VISU::PresentationType theType);
+
+ virtual
+ VISU::PresentationType
+ GetPresentationType();
+
+ VISU_MeshPL* GetSpecificPL() const
+ {
+ return myMeshPL;
+ }
protected:
- Storable* Build(int theRestoring);
+ Storable*
+ Build(int theRestoring);
VISU_MeshPL* myMeshPL;
VISU::VISUType myType;
VISU::PresentationType myPresentType;
- struct SALOMEDS::Color myCellColor, myNodeColor, myLinkColor;
+ SALOMEDS::Color myCellColor;
+ SALOMEDS::Color myNodeColor;
+ SALOMEDS::Color myLinkColor;
public:
- static int IsPossible(Result_i* theResult, const std::string& theMeshName,
- Entity theEntity, const char* theFamilyName = "");
- virtual Storable* Create(const std::string& theMeshName, Entity theEntity, const char* theFamilyName = "");
-
- static int IsPossible(Result_i* theResult, const std::string& theMeshName, const char* theGroupName);
- virtual Storable* Create(const std::string& theMeshName, const char* theGroupName);
+ static
+ size_t
+ IsPossible(Result_i* theResult,
+ const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFamilyName = "");
+ virtual
+ Storable*
+ Create(const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFamilyName = "");
+
+ static
+ size_t
+ IsPossible(Result_i* theResult,
+ const std::string& theMeshName,
+ const std::string& theGroupName);
+ virtual
+ Storable*
+ Create(const std::string& theMeshName,
+ const std::string& theGroupName);
+
+ VISU::Entity
+ GetEntity() const;
+
+ const std::string&
+ GetSubMeshName() const;
+
+ virtual
+ void
+ ToStream(std::ostringstream& theStr);
+
+ virtual
+ const char*
+ GetComment() const;
- VISU::Entity GetEntity() const { return VISU::Entity(myEntity);}
- const string& GetSubMeshName() const { return mySubMeshName;}
-
- virtual void ToStream(std::ostringstream& theStr);
-
- virtual const char* GetComment() const;
static const std::string myComment;
- virtual QString GenerateName();
- virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+ virtual
+ QString
+ GenerateName();
+
+ virtual
+ Storable*
+ Restore(const Storable::TRestoringMap& theMap);
- virtual VISU_Actor* CreateActor();
+ virtual
+ VISU_Actor*
+ CreateActor();
- virtual void UpdateActor(VISU_Actor* theActor);
+ virtual
+ void
+ UpdateActor(VISU_Actor* theActor);
};
}
//---------------------------------------------------------------
-int
+size_t
VISU::Plot3D_i
::IsPossible(Result_i* theResult,
const std::string& theMeshName,
- VISU::Entity theEntity,
+ VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber,
- int isMemoryCheck)
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck)
{
return TSuperClass::IsPossible(theResult,
theMeshName,
theEntity,
theFieldName,
theTimeStampNumber,
- isMemoryCheck);
+ theIsMemoryCheck);
}
//---------------------------------------------------------------
::Create(const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber)
+ CORBA::Long theTimeStampNumber)
{
return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
}
VISU::Plot3D_i
::CheckIsPossible()
{
- return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
}
//---------------------------------------------------------------
public:
static
- int
+ size_t
IsPossible(Result_i* theResult,
const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber,
- int isMemoryCheck = true);
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck);
virtual
Storable*
Create(const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber);
+ CORBA::Long theTimeStampNumber);
virtual
void
//---------------------------------------------------------------
-int
+size_t
VISU::Result_i
::IsPossible()
{
try{
float aSize = myInput->GetSize();
- bool aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
+ size_t aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
MESSAGE("Result_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<float(aResult));
return aResult;
}catch(std::exception& exc){
CORBA::Boolean myIsAllDone;
public:
- virtual int IsPossible();
+ virtual size_t IsPossible();
virtual Storable* Create(const char* theFileName);
virtual Storable* Create(SALOMEDS::SObject_ptr theMedSObject);
//---------------------------------------------------------------
-int
+size_t
VISU::ScalarMapOnDeformedShape_i
::IsPossible(Result_i* theResult,
const std::string& theMeshName,
- VISU::Entity theEntity,
+ VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber,
- int isMemoryCheck)
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck)
{
- bool aResult = false;
+ size_t aResult = 0;
try{
aResult = TSuperClass::IsPossible(theResult,
theMeshName,
theFieldName,
theTimeStampNumber,
false);
- if(isMemoryCheck && aResult){
+ if(theIsMemoryCheck && aResult){
VISU::Result_i::TInput* anInput = theResult->GetInput();
const VISU::PField aField = anInput->GetField(theMeshName,
(VISU::TEntity)theEntity,
theFieldName);
if(aField->myNbComp <= 1)
- return false;
- float aSize = anInput->GetTimeStampSize(theMeshName,
- (VISU::TEntity)theEntity,
- theFieldName,
- theTimeStampNumber);
+ return 0;
+ size_t aSize = anInput->GetTimeStampSize(theMeshName,
+ (VISU::TEntity)theEntity,
+ theFieldName,
+ theTimeStampNumber);
aSize *= INCMEMORY;
aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
MESSAGE("ScalarMapOnDeformedShape_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
::Create(const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber)
+ CORBA::Long theTimeStampNumber)
{
myIsColored = true;
myColor.R = myColor.G = myColor.B = 0.5;
VISU::ScalarMapOnDeformedShape_i
::CheckIsPossible()
{
- return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
}
public:
//! Redefines VISU_ColoredPrs3d_i::IsPossible
static
- int
+ size_t
IsPossible(Result_i* theResult,
- const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber,
- int isMemoryCheck = true);
+ const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck);
//! Redefines VISU_ColoredPrs3d_i::IsPossible
virtual
Create(const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber);
+ CORBA::Long theTimeStampNumber);
//! Redefines VISU_ColoredPrs3d_i::ToStream
virtual
//----------------------------------------------------------------------------
-int
+size_t
VISU::ScalarMap_i
::IsPossible(Result_i* theResult,
const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber,
- int isMemoryCheck)
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck)
{
+ size_t aResult = 0;
try{
- bool aResult = true;
if(theResult){
VISU::Result_i::TInput* anInput = theResult->GetInput();
float aSize = anInput->GetTimeStampSize(theMeshName,
theFieldName,
theTimeStampNumber);
aSize *= INCMEMORY;
- if(isMemoryCheck){
+ aResult = 1;
+ if(theIsMemoryCheck){
aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
- if(MYDEBUG) MESSAGE("ScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
+ if(MYDEBUG)
+ MESSAGE("ScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
}
}
- return aResult;
}catch(std::exception& exc){
INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
INFOS("Unknown exception was occured!");
}
- return 0;
+ return aResult;
}
//----------------------------------------------------------------------------
::Create(const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber)
+ CORBA::Long theTimeStampNumber)
{
TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
VISU::ScalarMap_i
::CheckIsPossible()
{
- return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
}
with the given basic parameters or not.
*/
static
- int
+ size_t
IsPossible(Result_i* theResult,
const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber,
- int isMemoryCheck = true);
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck);
//! Redefines VISU_ColoredPrs3d_i::Create
virtual
Create(const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber);
+ CORBA::Long theTimeStampNumber);
virtual
void
//---------------------------------------------------------------
-int
+size_t
VISU::StreamLines_i
::IsPossible(Result_i* theResult,
const std::string& theMeshName,
- VISU::Entity theEntity,
+ VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber,
- int isMemoryCheck)
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck)
{
try{
if(!VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theTimeStampNumber,false))
VISU::PIDMapper anIDMapper =
anInput->GetTimeStampOnMesh(theMeshName,VISU::TEntity(theEntity),theFieldName,theTimeStampNumber);
VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
- bool aResult = VISU_StreamLinesPL::IsPossible(aDataSet);
+ size_t aResult = VISU_StreamLinesPL::IsPossible(aDataSet);
MESSAGE("StreamLines_i::IsPossible - aResult = "<<aResult);
return aResult;
}catch(std::exception& exc){
::Create(const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber)
+ CORBA::Long theTimeStampNumber)
{
return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
}
VISU::StreamLines_i
::CheckIsPossible()
{
- return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
}
public:
//! Extends VISU_ColoredPrs3d_i::IsPossible
static
- int
+ size_t
IsPossible(Result_i* theResult,
const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber,
- int isMemoryCheck = true);
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck);
//! Extends VISU_ColoredPrs3d_i::Create
virtual
Create(const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber);
+ CORBA::Long theTimeStampNumber);
//! Extends VISU_ColoredPrs3d_i::ToStream
virtual
aData.myPrs[0]->GetOffset(aData.myOffset);
for (int i = 1; i < aData.myNbFrames; i++) {
//jfa 03.08.2005:aData.myPrs[i]->SameAs(aData.myPrs[0]);
- aData.myPrs[i]->SameAsParams(aData.myPrs[0]);//jfa 03.08.2005
+ aData.myPrs[i]->SameAs(aData.myPrs[0]);//jfa 03.08.2005
}
}
string aStr = aAnimSObject->GetID();
//---------------------------------------------------------------
-int
+size_t
VISU::Vectors_i
::IsPossible(Result_i* theResult,
const std::string& theMeshName,
- VISU::Entity theEntity,
+ VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber,
- int isMemoryCheck)
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck)
{
- bool aResult = false;
+ size_t aResult = 0;
try{
aResult = TSuperClass::IsPossible(theResult,
theMeshName,
theFieldName,
theTimeStampNumber,
false);
- if(isMemoryCheck && aResult){
+ if(theIsMemoryCheck && aResult){
VISU::Result_i::TInput* anInput = theResult->GetInput();
float aSize = anInput->GetTimeStampSize(theMeshName,
(VISU::TEntity)theEntity,
::Create(const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber)
+ CORBA::Long theTimeStampNumber)
{
return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
}
VISU::Vectors_i
::CheckIsPossible()
{
- return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber());
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
}
//---------------------------------------------------------------
public:
//! Redefines VISU_ColoredPrs3d_i::IsPossible
static
- int IsPossible(Result_i* theResult,
- const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber,
- int isMemoryCheck = true);
+ size_t
+ IsPossible(Result_i* theResult,
+ const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck);
//! Redefines VISU_ColoredPrs3d_i::Create
virtual
Create(const std::string& theMeshName,
VISU::Entity theEntity,
const std::string& theFieldName,
- int theTimeStampNumber);
+ CORBA::Long theTimeStampNumber);
//! Redefines VISU_ColoredPrs3d_i::ToStream
virtual