GetTimeStampOnMesh(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
- int theStampsNum) = 0;
+ int theTimeStampNumber) = 0;
//! Get Gauss Points mesh with attached values for corresponding MED TIMESTAMP
virtual
GetTimeStampOnGaussPts(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
- int theStampsNum) = 0;
+ int theTimeStampNumber) = 0;
//! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on mesh
virtual
GetTimeStampOnMeshSize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
- int theStampsNum) = 0;
+ int theTimeStampNumber,
+ bool& theIsEstimated) = 0;
//! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on Gauss Points
virtual
GetTimeStampOnGaussPtsSize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
- int theStampsNum) = 0;
+ int theTimeStampNumber,
+ bool& theIsEstimated) = 0;
//! Get amount of memory to build all MED TIMESTAMPS for corresponding MED FIELD
virtual
GetTimeStamp(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
- int theStampsNum) = 0;
+ int theTimeStampNumber) = 0;
//! Allow to generate pretty name for MED TIMESTAMP
static
::GetTimeStampOnMeshSize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
- int theStampsNum)
+ int theTimeStampNumber,
+ bool& theIsEstimated)
{
size_t aSize = 0;
TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
theEntity,
theFieldName,
- theStampsNum);
+ theTimeStampNumber);
VISU::PValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
VISU::PUnstructuredGridIDMapperImpl anUnstructuredGridIDMapper = aValForTime->myUnstructuredGridIDMapper;
VISU::PIDMapper anIDMapper = GetTimeStampOnMesh(theMeshName,
theEntity,
theFieldName,
- theStampsNum);
+ theTimeStampNumber);
anIDMapper->GetOutput();
aSize += anIDMapper->GetMemorySize();
}else
- aSize += GetTimeStampSize(theMeshName, theEntity, theFieldName, theStampsNum);
+ aSize += GetTimeStampSize(theMeshName, theEntity, theFieldName, theTimeStampNumber);
+
+ theIsEstimated = !(anUnstructuredGridIDMapper->myIsVTKDone);
//cout<<"VISU_Convertor_impl::GetTimeStampOnMeshSize - "<<aSize<<"; "<<(anIDMapperFilter->myIsVTKDone)<<endl;
return aSize;
::GetTimeStampOnGaussPtsSize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
- int theStampsNum)
+ int theTimeStampNumber,
+ bool& theIsEstimated)
{
size_t aSize = 0;
TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
theEntity,
theFieldName,
- theStampsNum);
+ theTimeStampNumber);
VISU::PValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
VISU::PGaussPtsIDFilter aGaussPtsIDFilter = aValForTime->myGaussPtsIDFilter;
VISU::PGaussPtsIDMapper aGaussPtsIDMapper = GetTimeStampOnGaussPts(theMeshName,
theEntity,
theFieldName,
- theStampsNum);
+ theTimeStampNumber);
aGaussPtsIDMapper->GetOutput();
aSize += aGaussPtsIDMapper->GetMemorySize();
}else
- aSize += GetTimeStampSize(theMeshName, theEntity, theFieldName, theStampsNum);
+ aSize += GetTimeStampSize(theMeshName, theEntity, theFieldName, theTimeStampNumber);
+
+ theIsEstimated = !(aGaussPtsIDFilter->myIsVTKDone);
//cout<<"VISU_Convertor_impl::GetTimeStampOnGaussPtsSize - "<<aSize<<"; "<<(aGaussPtsIDFilter->myIsVTKDone)<<endl;
return aSize;
GetTimeStampOnMesh(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
- int theStampsNum);
+ int theTimeStampNumber);
//! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on mesh
virtual
GetTimeStampOnMeshSize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
- int theStampsNum);
+ int theTimeStampNumber,
+ bool& theIsEstimated);
//! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on Gauss Points
virtual
GetTimeStampOnGaussPtsSize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
- int theStampsNum);
+ int theTimeStampNumber,
+ bool& theIsEstimated);
//! Implemention of the VISU_Convertor::GetTimeStampOnGaussPts
virtual
GetTimeStampOnGaussPts(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
- int theStampsNum);
+ int theTimeStampNumber);
//! Implemention of the VISU_Convertor::GetFieldOnMeshSize
virtual
theTimeId);
else
{
- float aRequiredMemory = 0.0;
+ CORBA::Float anUsedMemory = 0.0;
+ CORBA::Float aRequiredMemory = 0.0;
VISU::ColoredPrs3dCache::EnlargeType anEnlargeType =
VISU::GetRequiredCacheMemory<TPrs3d_i>(aResult,
theMeshName,
theEntity,
theFieldName,
theTimeId,
+ anUsedMemory,
aRequiredMemory);
if( anEnlargeType == VISU::ColoredPrs3dCache::IMPOSSIBLE )
{
- long aMb = 1024 * 1024;
- double aFreeMemory = (double)VISU_PipeLine::GetAvailableMemory( 2048 * aMb ) / (double)aMb;
+ size_t aMb = 1024 * 1024;
+ double aFreeMemory = double(VISU_PipeLine::GetAvailableMemory(2048*aMb)) / double(aMb);
+ CORBA::Float aNecessaryMemory = aRequiredMemory - aFreeMemory - anUsedMemory;
SUIT_MessageBox::warn1(GetDesktop(theModule),
QObject::tr("WRN_VISU"),
- QObject::tr("ERR_NO_MEMORY_TO_BUILD").arg(aRequiredMemory - aFreeMemory),
+ QObject::tr("ERR_NO_MEMORY_TO_BUILD").arg(aNecessaryMemory),
QObject::tr("&OK") );
QApplication::restoreOverrideCursor();
return NULL;
theRequiredMemory = int( aMemoryUsed + aMemoryNeeded ) + 1;
- long aMb = 1024 * 1024;
- double aFreeMemory = (double)VISU_PipeLine::GetAvailableMemory( 2048 * aMb ) / (double)aMb;
- anEnlargeType = theRequiredMemory < aFreeMemory ?
+ size_t aMb = 1024 * 1024;
+ double aFreeMemory = double(VISU_PipeLine::GetAvailableMemory(2048*aMb)) / double(aMb);
+ anEnlargeType = aMemoryNeeded < aFreeMemory ?
VISU::ColoredPrs3dCache::ENLARGE : VISU::ColoredPrs3dCache::IMPOSSIBLE;
}
}
if( fabs( myLimitedMemory - theMemorySize ) < 1 / VTK_LARGE_FLOAT )
return;
- long aMb = 1024 * 1024;
- double aFreeMemory = (double)VISU_PipeLine::GetAvailableMemory( 2048 * aMb ) / (double)aMb;
- if( theMemorySize > aFreeMemory )
+ size_t aMb = 1024 * 1024;
+ double aFreeMemory = double(VISU_PipeLine::GetAvailableMemory(2048*aMb)) / double(aMb);
+ CORBA::Float aMemoryUsed = GetDeviceMemorySize();
+ CORBA::Float aMemoryNeeded = theMemorySize - aMemoryUsed;
+ if( aMemoryNeeded > aFreeMemory )
return;
ClearCache(theMemorySize);
VISU::Entity theEntity,
const std::string& theFieldName,
CORBA::Long theIteration,
+ CORBA::Float& theUsedMemory,
CORBA::Float& theRequiredMemory)
{
VISU::ColoredPrs3dCache::EnlargeType anEnlargeType = VISU::ColoredPrs3dCache::NO_ENLARGE;
SALOMEDS::Study_var aStudy = aResult->GetStudyDocument();
VISU::ColoredPrs3dCache_var aCache = ColoredPrs3dCache_i::GetInstance(aStudy);
+ theUsedMemory = aCache->GetMemorySize();
anEnlargeType = aCache->GetRequiredMemory(theType, anInput, theRequiredMemory);
}
return anEnlargeType;
VISU::Entity theEntity,
const std::string& theFieldName,
CORBA::Long theTimeStampNumber,
+ CORBA::Float& theUsedMemory,
CORBA::Float& theRequiredMemory);
VISU::Entity theEntity,
const std::string& theFieldName,
CORBA::Long theTimeStampNumber,
+ CORBA::Float& theUsedMemory,
CORBA::Float& theRequiredMemory)
{
typedef typename TL::TColoredType2Enum<TColoredPrs3d_i>::TResult TEnum;
theEntity,
theFieldName,
theTimeStampNumber,
+ theUsedMemory,
theRequiredMemory);
}
if(anIsCreatNew)
CreatePipeLine(NULL); // to create proper pipeline
- DoSetInput(anIsCreatNew, theReInit);
+ try{
+ DoSetInput(anIsCreatNew, theReInit);
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ throw;
+ }catch(...){
+ INFOS("Unknown exception was occured!");
+ throw;
+ }
// To update title according to the new input
- SetTitle(GetCTitle().c_str());
+ SetTitle(GetCFieldName().c_str());
return anIsCreatNew;
}
if(theEntity == VISU::NODE)
return aResult;
try{
+ bool anIsEstimated = true;
VISU::Result_i::TInput* anInput = theResult->GetInput();
size_t aSize = anInput->GetTimeStampOnGaussPtsSize(theMeshName,
(VISU::TEntity)theEntity,
theFieldName,
- theTimeStampNumber);
+ theTimeStampNumber,
+ anIsEstimated);
aResult = 1;
if(theIsMemoryCheck){
- aSize *= INCMEMORY;
+ if(anIsEstimated)
+ aSize *= INCMEMORY;
aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
if(MYDEBUG)
MESSAGE("GaussPoints_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
theFieldName);
if(aField->myNbComp <= 1)
return 0;
+
+ bool anIsEstimated = true;
size_t aSize = anInput->GetTimeStampOnMeshSize(theMeshName,
(VISU::TEntity)theEntity,
theFieldName,
- theTimeStampNumber);
- aSize *= INCMEMORY;
+ theTimeStampNumber,
+ anIsEstimated);
+ if(anIsEstimated)
+ aSize *= INCMEMORY;
aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
MESSAGE("ScalarMapOnDeformedShape_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
}
size_t aResult = 0;
try{
if(theResult){
+ bool anIsEstimated = true;
VISU::Result_i::TInput* anInput = theResult->GetInput();
size_t aSize = anInput->GetTimeStampOnMeshSize(theMeshName,
(VISU::TEntity)theEntity,
theFieldName,
- theTimeStampNumber);
+ theTimeStampNumber,
+ anIsEstimated);
aResult = 1;
if(theIsMemoryCheck){
- aSize *= INCMEMORY;
+ if(anIsEstimated)
+ aSize *= INCMEMORY;
aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
if(MYDEBUG)
MESSAGE("ScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
theTimeStampNumber,
false);
if(theIsMemoryCheck && aResult){
+ bool anIsEstimated = true;
VISU::Result_i::TInput* anInput = theResult->GetInput();
size_t aSize = anInput->GetTimeStampOnMeshSize(theMeshName,
(VISU::TEntity)theEntity,
theFieldName,
- theTimeStampNumber);
- aSize *= INCMEMORY;
+ theTimeStampNumber,
+ anIsEstimated);
+ if(anIsEstimated)
+ aSize *= INCMEMORY;
aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
if(MYDEBUG)
MESSAGE("Vectors_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);