* for further construction of graphical presentations.
*/
interface Result : RemovableObject, SALOME::GenericObj {
- //interface Result : Base{
/*! Reads all data from the corresponding sources. By default the data is loaded on demand.
*/
boolean BuildAll();
+ /*! Start to parse the source MED file and publish all its entities into the study*/
+ boolean Build(in boolean theIsBuildAll, in boolean theIsAtOnce);
+
+ /*! Allow to check is all requested MED entites already loaded or not */
+ boolean IsDone();
+
+ /*! Allow to check is corresponding MED entites already loaded or not */
+ boolean IsEntitiesDone();
+
+ /*! Choose to parse MED fields and perform global min / max on the MED timestamps.*/
+ void SetBuildFields(in boolean theIsBuildFields, in boolean theIsCalculateMinMax);
+
/*! Allow to check is corresponding MED fields already loaded or not */
boolean IsFieldsDone();
+ /*! Choose to parse MED groups.*/
+ void SetBuildGroups(in boolean theIsBuildGroups);
+
/*! Allow to check is corresponding MED groups and families already loaded or not */
boolean IsGroupsDone();
*/
Result ImportFile(in string theFileName);
+ /*!
+ * Create result and initialize its with the file. The access to this file will be conserved outside of the application.
+ * \param theFileName String parameter defining the name of the file
+ * from which the data will be imported.
+ */
+ Result CreateResult(in string theFileName);
+
/*!
* Imports data from a file. The access to this file will closed.
* \param theFileName String parameter defining the name of the file
VISU_Convertor
::GetMeshMap()
{
- if(!myIsDone) { myIsDone = true; Build();}
return myMeshMap;
}
VISU_Convertor_impl
::Build()
{
+ if(!myIsDone){
+ myIsDone = true;
+ BuildEntities();
+ BuildFields();
+ BuildMinMax();
+ BuildGroups();
+ }
return this;
}
return myElemInfo->GetElemName(theObjID);
return TSubMeshImpl::GetElemName(theObjID);
}
+
+ struct TSetIsDone
+ {
+ bool& myIsDone;
+ TSetIsDone(bool& theIsDone):
+ myIsDone(theIsDone)
+ {}
+
+ ~TSetIsDone()
+ {
+ myIsDone = true;
+ }
+
+ };
}
}
VISU_MedConvertor
-::VISU_MedConvertor(const string& theFileName)
+::VISU_MedConvertor(const string& theFileName):
+ myIsEntitiesDone(false),
+ myIsFieldsDone(false),
+ myIsGroupsDone(false),
+ myIsMinMaxDone(false)
{
myFileInfo.setFile(QString(theFileName.c_str()));
myName = myFileInfo.baseName().latin1();
VISU_MedConvertor
::BuildEntities()
{
+ if(myIsEntitiesDone)
+ return this;
+
+ TSetIsDone aSetIsDone(myIsEntitiesDone);
TTimerLog aTimerLog(MYDEBUG,"BuildEntities");
MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
VISU_MedConvertor
::BuildFields()
{
+ if(myIsFieldsDone)
+ return this;
+
+ TSetIsDone aSetIsDone(myIsFieldsDone);
TTimerLog aTimerLog(MYDEBUG,"BuildFields");
MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
VISU_MedConvertor
::BuildMinMax()
{
+ if(myIsMinMaxDone)
+ return this;
+
+ TSetIsDone aSetIsDone(myIsMinMaxDone);
TTimerLog aTimerLog(MYDEBUG,"BuildMinMax");
MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
VISU_MedConvertor
::BuildGroups()
{
+ if(myIsGroupsDone)
+ return this;
+
+ TSetIsDone aSetIsDone(myIsGroupsDone);
TTimerLog aTimerLog(MYDEBUG,"BuildGroups");
MED::PWrapper aMed = MED::CrWrapper(myFileInfo.absFilePath().latin1());
VISU_MedConvertor();
VISU_MedConvertor(const VISU_MedConvertor&);
+ bool myIsEntitiesDone;
+ bool myIsFieldsDone;
+ bool myIsGroupsDone;
+ bool myIsMinMaxDone;
+
public:
VISU_MedConvertor(const std::string& theFileName);
}
+ Result_ptr VISU_Gen_i::CreateResult(const char* theFileName){
+ return myVisuGen->CreateResult(theFileName);
+ }
+
+
Result_ptr VISU_Gen_i::CopyAndImportFile(const char* theFileName){
return myVisuGen->CopyAndImportFile(theFileName);
}
//Create Result
virtual Result_ptr ImportFile(const char* theFileName);
+ virtual Result_ptr CreateResult(const char* theFileName);
virtual Result_ptr CopyAndImportFile(const char* theFileName);
virtual Result_ptr ImportMed(SALOMEDS::SObject_ptr theMedSObject);
virtual Result_ptr ImportMedField(SALOME_MED::FIELD_ptr theField);