connect(myUseSrcCombo, SIGNAL(activated(int)), this, SLOT(onSourceTypeChange(int)));
- // Find All prs obj
- //SUIT_Study* aActiveStudy = VISU::(myVisuGUI);
+ // Find all fields and time stamps on it
_PTR(Study) aActiveStudy = VISU::GetCStudy(VISU::GetAppStudy(myVisuGUI));
LightApp_SelectionMgr* aSel = VISU::GetSelectionMgr(myVisuGUI);
SALOME_ListIO selected;
Handle(SALOME_InteractiveObject) aIO = selected.First();
if (aIO->hasEntry()) {
_PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
+
+ _PTR(GenericAttribute) anTmpAttr;
+ if (aSObject->FindAttribute(anTmpAttr, "AttributeComment")) {
+ _PTR(AttributeComment) aTmpComment (anTmpAttr);
+ string aTmpComm = aTmpComment->Value();
+ QString aTmpstrIn (aTmpComm.c_str());
+ VISU::Storable::TRestoringMap aTmpaMap;
+ VISU::Storable::StrToMap(aTmpstrIn,aTmpaMap);
+ bool aTmpisExist;
+ VISU::VISUType aTmpType =
+ (VISU::VISUType)VISU::Storable::FindValue(aTmpaMap,"myType",&aTmpisExist).toInt();
+ switch (aTmpType) {
+ case VISU::TTIMESTAMP:
+ {
+ aSObject = aSObject->GetFather();
+ aSObject = aSObject->GetFather();
+ break;
+ }
+ case VISU::TFIELD:
+ {
+ _PTR(SObject) newSObject;
+ if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject;
+ aSObject = aSObject->GetFather();
+ break;
+ }
+ case VISU::TANIMATION:
+ {
+ _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject);
+ for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) {
+ _PTR(SObject) aTmpChildSObj = aTmpIter->Value();
+ _PTR(SObject) newSObject;
+ if(aTmpChildSObj->ReferencedObject(newSObject)){
+ aSObject = newSObject;
+ aSObject->GetFather();
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
aSObject = aSObject->GetFather();
aSObject = aSObject->GetFather();
- aSObject = aSObject->GetFather();
- aSObject = aSObject->GetFather();
+
mySelectionObj = aSObject;
CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
- VISU::Result_var aResult;
if (CORBA::is_nil(anObject)) {
mySelectionObj = mySelectionObj->GetFather();
}
- _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
-
- for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
- _PTR(SObject) aChildSObj = aIter->Value();
- CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj);
-
- if (!CORBA::is_nil(aChildObject)) {
- VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
- if (!CORBA::is_nil(aPrsObj)) { // if this is a Prs object
- if ((aPrsObj->GetType() != VISU::TSTREAMLINES) &&
- (aPrsObj->GetType() != VISU::TMESH)) {
- _PTR(GenericAttribute) anAttr;
- if (aChildSObj->FindAttribute(anAttr, "AttributeName")) {
- _PTR(AttributeName) aName (anAttr);
- myPrsLst += QString(aName->Value().c_str());
- myPrsList.append(aPrsObj);
- continue;
- }
- }
- }
- }
- // else { // This is not a Prs object
- _PTR(GenericAttribute) anAttr;
- if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) {
- _PTR(AttributeComment) aComment (anAttr);
- string aComm = aComment->Value();
- QString strIn (aComm.c_str());
- VISU::Storable::TRestoringMap aMap;
- VISU::Storable::StrToMap(strIn,aMap);
- bool isExist;
- VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
- if (isExist) {
- if ((aType == VISU::TFAMILY) || (aType == VISU::TGROUP) || (aType == VISU::TENTITY)) {
- _PTR(GenericAttribute) aNameAttr;
- if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) {
- _PTR(AttributeName) aName (aNameAttr);
- VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
- switch (aType) {
- case VISU::TFAMILY:
- myFamilisLst += QString(aName->Value().c_str());
- myFamilyList.append(aPrsObj);
- break;
- case VISU::TGROUP:
- myGroupsLst += QString(aName->Value().c_str());
- myGroupList.append(aPrsObj);
- break;
- case VISU::TENTITY:
- myEntitiesLst += QString(aName->Value().c_str());
- myEntityList.append(aPrsObj);
- break;
- }
- }
- }
- }
- }
+ }
+ }
+
+ if (mySelectionObj) {
+ _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
+
+ for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
+ _PTR(SObject) aChildSObj = aIter->Value();
+ CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj);
+
+ if (!CORBA::is_nil(aChildObject)) {
+ VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
+ if (!CORBA::is_nil(aPrsObj)) { // if this is a Prs object
+ if ((aPrsObj->GetType() != VISU::TSTREAMLINES) &&
+ (aPrsObj->GetType() != VISU::TMESH)) {
+ _PTR(GenericAttribute) anAttr;
+ if (aChildSObj->FindAttribute(anAttr, "AttributeName")) {
+ _PTR(AttributeName) aName (anAttr);
+ myPrsLst += QString(aName->Value().c_str());
+ myPrsList.append(aPrsObj);
+ continue;
+ }
+ }
+ }
+ }
+
+ _PTR(GenericAttribute) anAttr;
+ if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) {
+ _PTR(AttributeComment) aComment (anAttr);
+ string aComm = aComment->Value();
+ QString strIn (aComm.c_str());
+ VISU::Storable::TRestoringMap aMap;
+ VISU::Storable::StrToMap(strIn,aMap);
+ bool isExist;
+ VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
+ if (isExist) {
+ if ((aType == VISU::TFAMILY) || (aType == VISU::TGROUP) || (aType == VISU::TENTITY)) {
+ _PTR(GenericAttribute) aNameAttr;
+ if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) {
+ _PTR(AttributeName) aName (aNameAttr);
+ VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
+ switch (aType) {
+ case VISU::TFAMILY:
+ myFamilisLst += QString(aName->Value().c_str());
+ myFamilyList.append(aPrsObj);
+ break;
+ case VISU::TGROUP:
+ myGroupsLst += QString(aName->Value().c_str());
+ myGroupList.append(aPrsObj);
+ break;
+ case VISU::TENTITY:
+ myEntitiesLst += QString(aName->Value().c_str());
+ myEntityList.append(aPrsObj);
+ break;
+ }
+ }
+ }
+ }
}
}
}
}
-
void VisuGUI_StreamLinesDlg::initFromPrsObject (VISU::StreamLines_i* thePrs)
{
myScalarPane->initFromPrsObject(thePrs);