return "";
}
+ unsigned long int
+ TNamedPointCoords
+ ::GetMemorySize()
+ {
+ size_t aSize = TPointCoords::GetMemorySize();
+ aSize += myObj2VTKID.size() * sizeof(vtkIdType) * 2;
+ aSize += myVectorID.size() * sizeof(vtkIdType);
+ return aSize;
+ }
+
+
//---------------------------------------------------------------
TMeshImpl::TMeshImpl():
myPoints(vtkPoints::New()),
}else
aSize += GetTimeStampSize(theMeshName, theEntity, theFieldName, theStampsNum);
- cout<<"VISU_Convertor_impl::GetTimeStampOnMeshSize - "<<aSize<<"; "<<(anIDMapperFilter->myIsVTKDone)<<endl;
+ //cout<<"VISU_Convertor_impl::GetTimeStampOnMeshSize - "<<aSize<<"; "<<(anIDMapperFilter->myIsVTKDone)<<endl;
return aSize;
}
}else
aSize += GetTimeStampSize(theMeshName, theEntity, theFieldName, theStampsNum);
- cout<<"VISU_Convertor_impl::GetTimeStampOnGaussPtsSize - "<<aSize<<"; "<<(aGaussPtsIDFilter->myIsVTKDone)<<endl;
+ //cout<<"VISU_Convertor_impl::GetTimeStampOnGaussPtsSize - "<<aSize<<"; "<<(aGaussPtsIDFilter->myIsVTKDone)<<endl;
return aSize;
}
protected:
typedef TVector<std::string> TPointsDim;
TPointsDim myPointsDim; //!< Keeps name of each dimension
- TVectorID myVectorID; //!< Keeps object¶ numeration
+ TVectorID myVectorID; //!< Keeps objects numeration
TObj2VTKID myObj2VTKID; //!< Keeps mapping from object number to VTK one
public:
virtual
std::string
GetNodeName(vtkIdType theObjID) const;
+
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
};
typedef SharedPtr<TNamedPointCoords> PNamedPointCoords;
TMEDNamedPointCoords
::Init(vtkIdType theNbPoints,
vtkIdType theDim,
- const MED::PNodeInfo& theNodeInfo)
+ const MED::PNodeInfo& theNodeInfo,
+ MED::EVersion theVersion)
{
+ myVersion = theVersion;
if(theNodeInfo->IsElemNum())
TNamedPointCoords::Init(theNbPoints,theDim,theNodeInfo->myElemNum);
else
TNamedPointCoords::Init(theNbPoints,theDim);
if(theNodeInfo->IsElemNames())
- myNodeInfo = theNodeInfo;
+ myElemNames = theNodeInfo->myElemNames;
}
void
TNamedPointCoords::Init(theNbPoints,theDim);
}
+ MED::TInt
+ GetPNOMLength(MED::EVersion theVersion)
+ {
+ if(theVersion == MED::eV2_1)
+ return MED::GetPNOMLength<MED::eV2_1>();
+ return MED::GetPNOMLength<MED::eV2_2>();
+ }
+
std::string
TMEDNamedPointCoords
::GetNodeName(vtkIdType theObjID) const
{
- if(myNodeInfo)
- return myNodeInfo->GetElemName(theObjID);
+ if(!myElemNames.empty())
+ return GetString(theObjID, GetPNOMLength(myVersion), myElemNames);
return TNamedPointCoords::GetNodeName(theObjID);
}
+ unsigned long int
+ TMEDNamedPointCoords
+ ::GetMemorySize()
+ {
+ size_t aSize = TNamedPointCoords::GetMemorySize();
+ aSize += myElemNames.size() * sizeof(char);
+ return aSize;
+ }
+
//---------------------------------------------------------------
vtkIdType
//---------------------------------------------------------------
void
TMEDSubMesh
- ::Init(const MED::PElemInfo& theElemInfo)
+ ::Init(const MED::PElemInfo& theElemInfo,
+ MED::EVersion theVersion)
{
myIsElemNum = theElemInfo->IsElemNum();
myElemNum = theElemInfo->myElemNum;
if(theElemInfo->IsElemNames())
- myElemInfo = theElemInfo;
+ myElemNames = theElemInfo->myElemNames;
}
TMEDSubMesh
::GetElemName(vtkIdType theObjID) const
{
- if(myElemInfo)
- return myElemInfo->GetElemName(theObjID);
+ if(!myElemNames.empty())
+ return GetString(theObjID, GetPNOMLength(myVersion), myElemNames);
return TSubMeshImpl::GetElemName(theObjID);
}
+ unsigned long int
+ TMEDSubMesh
+ ::GetMemorySize()
+ {
+ size_t aSize = TSubMeshImpl::GetMemorySize();
+ aSize += myElemNum.size() * sizeof(MED::TInt);
+ aSize += myElemNames.size() * sizeof(char);
+ return aSize;
+ }
+
struct TSetIsDone
{
bool& myIsDone;
PMEDNamedPointCoords aNamedPointCoords = theMesh->myNamedPointCoords;
TMEDNamedPointCoords& aCoords = aNamedPointCoords;
- aCoords.Init(aNbElem,aDim,aNodeInfo);
+ aCoords.Init(aNbElem,aDim,aNodeInfo,theMed->GetVersion());
for(int iDim = 0; iDim < aDim; iDim++)
aCoords.GetName(iDim) = aNodeInfo->GetCoordName(iDim);
TGeom2SubMesh& aGeom2SubMesh = aMeshOnEntity->myGeom2SubMesh;
PMEDSubMesh aSubMesh = aGeom2SubMesh[VISU::ePOINT1](new TMEDSubMesh());
- aSubMesh->Init(MED::PElemInfo(aNodeInfo));
+ aSubMesh->Init(MED::PElemInfo(aNodeInfo),theMed->GetVersion());
aSubMesh->myNbCells = theMesh->myNbPoints;
aSubMesh->myCellsSize = 2*theMesh->myNbPoints;
if(aNbElem > 0){
PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new TMEDSubMesh());
- aSubMesh->Init(MED::PElemInfo(aPolygoneInfo));
+ aSubMesh->Init(MED::PElemInfo(aPolygoneInfo),theMed->GetVersion());
aSubMesh->myNbCells = aNbElem;
TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
if(aNbElem > 0){
PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new TMEDSubMesh());
- aSubMesh->Init((MED::PElemInfo)aPolyedreInfo);
+ aSubMesh->Init(MED::PElemInfo(aPolyedreInfo),theMed->GetVersion());
aSubMesh->myNbCells = aNbElem;
TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
if(aNbElem > 0){
PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new TMEDSubMesh());
- aSubMesh->Init((MED::PElemInfo)aCellInfo);
+ aSubMesh->Init(MED::PElemInfo(aCellInfo), theMed->GetVersion());
aSubMesh->myNbCells = aNbElem;
aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1);
namespace VISU
{
- typedef TVector<TName> TNames;
-
//---------------------------------------------------------------
class TMEDNamedPointCoords: public virtual TNamedPointCoords
{
- MED::PNodeInfo myNodeInfo;
- TNames myPointNames;
+ MED::EVersion myVersion;
+ MED::TString myElemNames;
public:
void
Init(vtkIdType theNbPoints,
vtkIdType theDim,
- const MED::PNodeInfo& theNodeInfo);
+ const MED::PNodeInfo& theNodeInfo,
+ MED::EVersion theVersion);
void
Init(vtkIdType theNbPoints,
virtual
std::string
GetNodeName(vtkIdType theObjID) const;
+
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
};
typedef SharedPtr<TMEDNamedPointCoords> PMEDNamedPointCoords;
MED::EBooleen myIsElemNum;
MED::TElemNum myElemNum;
- MED::PElemInfo myElemInfo;
+
+ MED::EVersion myVersion;
+ MED::TString myElemNames;
void
- Init(const MED::PElemInfo& theElemInfo);
+ Init(const MED::PElemInfo& theElemInfo,
+ MED::EVersion theVersion);
void
Init(const MED::PGrilleInfo& theGrilleInfo);
virtual
std::string
GetElemName(vtkIdType theObjID) const;
+
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
};
typedef SharedPtr<TMEDSubMesh> PMEDSubMesh;
CORBA::Long theTimeStampNumber,
bool theIsMemoryCheck)
{
+ size_t aResult = 0;
+ if(theEntity == VISU::NODE)
+ return aResult;
try{
- if(theEntity == VISU::NODE)
- return 0;
- size_t aResult = VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theTimeStampNumber,false);
- if(theIsMemoryCheck && aResult){
- VISU::Result_i::TInput* anInput = theResult->GetInput();
- size_t aSize = anInput->GetTimeStampOnGaussPtsSize(theMeshName,
- (VISU::TEntity)theEntity,
- theFieldName,
- theTimeStampNumber);
+ VISU::Result_i::TInput* anInput = theResult->GetInput();
+ size_t aSize = anInput->GetTimeStampOnGaussPtsSize(theMeshName,
+ (VISU::TEntity)theEntity,
+ theFieldName,
+ theTimeStampNumber);
+ aResult = 1;
+ if(theIsMemoryCheck){
aSize *= INCMEMORY;
aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
if(MYDEBUG)
MESSAGE("GaussPoints_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;
}
//----------------------------------------------------------------------------
GetTimeStampNumber());
// Convert to mega bytes
aMemorySize += aSize / (1024.0 * 1024.0);
- cout<<"GaussPoints_i::GetMemorySize - "<<this<<"; anInput = "<<aMemorySize<<endl;
- cout<<endl;
+ //cout<<"GaussPoints_i::GetMemorySize - "<<this<<"; anInput = "<<aMemorySize<<endl;
+ //cout<<endl;
return aMemorySize;
}
{
// To calculate memory used by VISU PipeLine
CORBA::Float aSize = GetPipeLine()->GetMemorySize();
- cout<<"Prs3d_i::GetMemorySize - "<<this<<"; GetPipeLine = "<<aSize / (1024.0 * 1024.0)<<endl;
+ //cout<<"Prs3d_i::GetMemorySize - "<<this<<"; GetPipeLine = "<<aSize / (1024.0 * 1024.0)<<endl;
// To calculate memory used by VISU Actos
int anEnd = myActorCollection->GetNumberOfItems();
if(vtkObject* anObject = myActorCollection->GetItemAsObject(anId))
if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anObject)){
aSize += anActor->GetMemorySize();
- cout<<"Prs3d_i::GetMemorySize - "<<this<<"; anActor = "<<aSize / (1024.0 * 1024.0)<<endl;
+ //cout<<"Prs3d_i::GetMemorySize - "<<this<<"; anActor = "<<aSize / (1024.0 * 1024.0)<<endl;
}
// Convert to mega bytes
(VISU::TEntity)theEntity,
theFieldName,
theTimeStampNumber);
- aSize *= INCMEMORY;
aResult = 1;
if(theIsMemoryCheck){
+ aSize *= INCMEMORY;
aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
if(MYDEBUG)
MESSAGE("ScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
GetTimeStampNumber());
// Convert to mega bytes
aMemorySize += aSize / (1024.0 * 1024.0);
- cout<<"ScalarMap_i::GetMemorySize - "<<this<<"; anInput = "<<aMemorySize<<endl;
- cout<<endl;
+ //cout<<"ScalarMap_i::GetMemorySize - "<<this<<"; anInput = "<<aMemorySize<<endl;
+ //cout<<endl;
return aMemorySize;
}