}
+ //---------------------------------------------------------------------------
+ inline
+ std::string
+ GetBoolean(bool theArgument)
+ {
+ if(theArgument)
+ return "True";
+
+ return "False";
+ }
+
//---------------------------------------------------------------------------
typedef void (*TDumpToPython)(SALOMEDS::Study_ptr theStudy,
CORBA::Boolean theIsPublished,
}
}
+
//---------------------------------------------------------------------------
void
theStr<<thePrefix<<aName<<" = aVisu.CreateResult('"<<aFileName<<"')"<<endl;
theStr<<thePrefix<<aName<<".SetBuildGroups("<<
- aServant->IsGroupsDone()<<")"<<
+ GetBoolean(aServant->IsGroupsDone())<<")"<<
endl;
theStr<<thePrefix<<aName<<".SetBuildFields("<<
- aServant->IsFieldsDone()<<", "<<
- aServant->IsMinMaxDone()<<")"<<
+ GetBoolean(aServant->IsFieldsDone())<<", "<<
+ GetBoolean(aServant->IsMinMaxDone())<<")"<<
endl;
- theStr<<thePrefix<<aName<<".Build(0,1)"<<endl;
+ theStr<<thePrefix<<aName<<".Build(False, True)"<<endl;
theStr<<thePrefix<<"if "<<aName<<".IsDone() :"<<endl;
break;
}
thePrefix += PREFIX;
+ {
+ VISU::Result::EntityNames_var aMeshNames = aServant->GetMeshNames();
+ if (aMeshNames->length() > 0) {
+ for(size_t aMeshId = 0; aMeshId < aMeshNames->length(); aMeshId++){
+ CORBA::String_var aMeshName = aMeshNames[aMeshId];
+ VISU::Result::EntityNames_var aParts = aServant->GetPartNames(aMeshName);
+ if (aParts->length() > 0) {
+ for(size_t aPartId = 0; aPartId < aParts->length(); aPartId++){
+ CORBA::String_var aPart = aParts[aPartId];
+ VISU::Result::Resolution aResolution = aServant->GetResolution(aMeshName, aPart);
+ std::string aParam;
+ switch(aResolution){
+ case VISU::Result::FULL:
+ aParam = "VISU.Result.FULL";
+ break;
+ case VISU::Result::MEDIUM:
+ aParam = "VISU.Result.MEDIUM";
+ break;
+ case VISU::Result::LOW:
+ aParam = "VISU.Result.LOW";
+ break;
+ case VISU::Result::HIDDEN:
+ aParam = "VISU.Result.HIDDEN";
+ break;
+ }
+ theStr<<thePrefix<<aName<<".SetResolution('"<<aMeshName.in()<<"', '"<<aPart.in()<<"', "<<aParam<<")"<<endl;
+ }
+ theStr<<thePrefix<<endl;
+ }
+ }
+ }
+ }
theArgumentName = aName;
DumpChildrenToPython(theStudy,
myMultiprObj.create(theFileName);
if (myMultiprObj.isValidDistributedMEDFile()) {
aTargetFileName = myMultiprObj.getSequentialMEDFilename();
+ SetFileName(aFileInfo.filePath().latin1());
myIsBuildParts = true;
}
}
//---------------------------------------------------------------
VISU::Result::EntityNames*
VISU::MultiResult_i
-::GetParts(const char* theMeshName)
+::GetPartNames(const char* theMeshName)
{
+ VISU::Result::EntityNames_var aResult = new VISU::Result::EntityNames();
+ if(!myIsBuildParts)
+ return aResult._retn();
+
MultiResult_i::TParts aMeshParts;
MultiResult_i::TParts aParts = myMultiprObj.getParts();
for (size_t aPartID = 0 ; aPartID < aParts.size() ; aPartID++) {
aMeshParts.push_back(aPartName);
}
- VISU::Result::EntityNames_var aResult = new VISU::Result::EntityNames();
if(aMeshParts.empty())
return aResult._retn();
const char* thePartName)
{
VISU::Result::Resolutions_var aResult = new VISU::Result::Resolutions();
+ if(!myIsBuildParts)
+ return aResult._retn();
+
MultiResult_i::TParts aParts = myMultiprObj.getParts();
for (size_t aPartID = 0 ; aPartID < aParts.size() ; aPartID++) {
const MultiResult_i::TPartName& aPartName = aParts[aPartID];
return;
TPartName2Resolution::iterator anIter = myPartName2Resolution.find(thePartName);
+ if(anIter == myPartName2Resolution.end())
+ return;
+
VISU::Result::Resolution& aResolution = anIter->second;
if(aResolution == theResolution)
return;
virtual
VISU::Result::EntityNames*
- GetParts(const char* theMeshName);
+ GetPartNames(const char* theMeshName);
virtual
VISU::Result::Resolutions*
aComment.sprintf("myComment=%s;myFileName=%s;myInitFileName=%s",
GetComment(),
myFileInfo.filePath().latin1(),
- myInitFileName.c_str()); // Restoring of Python dump
+ GetFileName().c_str()); // Restoring of Python dump
std::string aResultEntry =
CreateAttributes(myStudy,
aSComponentEntry.in(),
{
try {
myFileInfo.setFile(theFileName);
- myInitFileName = myFileInfo.filePath().latin1();
+ if(!myIsBuildParts)
+ SetFileName(myFileInfo.filePath().latin1());
myName = VISU::GenerateName(myFileInfo.fileName()).latin1();
if(mySourceId == eRestoredFile){
std::string aTmpDir(SALOMEDS_Tool::GetTmpDir());
string aCompDataType = GetComponentDataType(theMedSObject);
myFileInfo.setFile(aCompDataType.c_str());
- myInitFileName = aCompDataType;
+ SetFileName(aCompDataType);
myName = VISU::GenerateName("aResult").latin1();
string aCompDataType = "MED";
myFileInfo.setFile(aCompDataType.c_str());
- myInitFileName = aCompDataType;
+ SetFileName(aCompDataType);
myName = VISU::GenerateName("aResult").latin1();
myStudyDocument = mySObject->GetStudy();
mySComponent = mySObject->GetFatherComponent();
myName = VISU::Storable::FindValue(theMap, "myName").latin1();
- myInitFileName = VISU::Storable::FindValue(theMap, "myInitFileName").latin1();
+ SetFileName(VISU::Storable::FindValue(theMap, "myInitFileName").latin1());
SALOMEDS::SObject_var aRefSObj, aTargetRefSObj;
if (mySObject->FindSubObject(1, aRefSObj) &&
aComment.sprintf("myComment=%s;myFileName=%s;myInitFileName=%s",
GetComment(),
myFileInfo.filePath().latin1(),
- myInitFileName.c_str()); // Restoring of Python dump
+ GetFileName().c_str()); // Restoring of Python dump
SALOMEDS::GenericAttribute_var anAttr;
if (!theSObject->FindAttribute(anAttr, "AttributeString"))
throw std::runtime_error("Build - There is no AttributeString for the SObject !!!");
VISU::Result::EntityNames*
VISU::Result_i
-::GetParts(const char* theMeshName)
+::GetPartNames(const char* theMeshName)
{
VISU::Result::EntityNames_var aResult = new VISU::Result::EntityNames();
return aResult._retn();
{
if(MYDEBUG) MESSAGE(GetComment());
Storable::DataToStream(theStr,"myName",myName.c_str());
- Storable::DataToStream(theStr,"myInitFileName",myInitFileName.c_str());
+ Storable::DataToStream(theStr,"myInitFileName",GetFileName().c_str());
Storable::DataToStream(theStr,"myCreationId",myCreationId);
Storable::DataToStream(theStr,"myIsBuildFields",myIsFieldsDone);
Storable::DataToStream(theStr,"myIsBuildMinMax",myIsMinMaxDone);
//---------------------------------------------------------------
const std::string&
VISU::Result_i
-::GetName() const
+::GetFileName() const
{
- return myName;
+ return myInitFileName;
}
-const QFileInfo&
+void
VISU::Result_i
-::GetFileInfo() const
+::SetFileName(const std::string& theFileName)
{
- return myFileInfo;
+ myInitFileName = theFileName;
}
+//---------------------------------------------------------------
const std::string&
VISU::Result_i
-::GetFileName() const
+::GetName() const
{
- return myInitFileName;
+ return myName;
}
+const QFileInfo&
+VISU::Result_i
+::GetFileInfo() const
+{
+ return myFileInfo;
+}
+
const VISU::Result_i::ECreationId&
VISU::Result_i
::GetCreationId() const
virtual
VISU::Result::EntityNames*
- GetParts(const char* theMeshName);
+ GetPartNames(const char* theMeshName);
virtual
VISU::Result::Resolutions*
const std::string& theFieldName = "",
CORBA::Long theTimeStampNumber = -1);
+ virtual
+ const std::string&
+ GetFileName() const;
+
+ virtual
+ void
+ SetFileName(const std::string& theFileName);
+
const std::string&
GetName() const;
const QFileInfo&
GetFileInfo() const;
- const std::string&
- GetFileName() const;
-
const ECreationId&
GetCreationId() const;