if (!CORBA::is_nil(theView3D)) {
VISU::View3D_i* pView = dynamic_cast<VISU::View3D_i*>(GetServant(theView3D).in());
- //QAD_StudyFrame* aStudyFrame = pView->GetStudyFrame();
- //myView = VISU::GetViewFrame(aStudyFrame);
- SUIT_ViewWindow* aVW = pView->myViewWindow;
+ SUIT_ViewWindow* aVW = pView->GetViewWindow();
myView = VISU::GetViewWindow(aVW);
}
//************************************************************************
void VISU_TimeAnimation::addField (SALOMEDS::SObject_ptr theField)
{
- _PTR(SObject) aField = VISU::GetClientSObject(theField, myStudy);
+ SALOMEDS::SObject_var theFieldDup = SALOMEDS::SObject::_duplicate(theField);
+ _PTR(SObject) aField = VISU::GetClientSObject(theFieldDup, myStudy);
addField(aField);
}
}
break;
- case VISU::TPLOT3D: // Cut Planes
+ case VISU::TPLOT3D: // Plot3d
{
VISU::Plot3D_i* aPresent = new VISU::Plot3D_i (pResult, false);
aPresent->Create(aMeshName.latin1(), anEntity,
}
myView->Repaint(false);
- int delay = 100;
if (isDumping) {
+ // We must unlock mutex for some time before grabbing to allow view updating
+ qApp->unlock();
+ msleep(100);
+ qApp->lock();
+
QPixmap px = QPixmap::grabWindow(myView->winId());
QString aFile(myDumpPath);
QString aName = QString("%1").arg(myFieldsLst[0].myTiming[myFrame]);
myFieldsLst[0].myTiming[myFrame]) / aOneVal;
}
}
- delay = (int)(1000. * k / mySpeed);
+ int delay = (int)(1000. * k / mySpeed);
+ qApp->unlock();
+ msleep(delay);
+ qApp->lock();
}
- qApp->unlock();
- msleep(delay);
- qApp->lock();
if (!myIsActive) break;
for (int i = 0; i < getNbFields(); i++) {
FieldData& aData = myFieldsLst[i];
+
_PTR(SObject) newObj = aStudyBuilder->NewObject(aAnimSObject);
aStudyBuilder->Addreference(newObj, aData.myField);
+
if (aData.myPrs.empty()) {
- VISU::CreateAttributes(myStudy, newObj->GetID().c_str(),"","",
- GetPresentationComment(aData.myPrsType).c_str(),"","",true);
- } else {
- ostringstream strOut;
- aData.myPrs[0]->ToStream(strOut);
- string aPrsComment = strOut.str();
- VISU::CreateAttributes(myStudy, newObj->GetID().c_str(),"","",
- aData.myPrs[0]->GetComment(),"",aPrsComment.c_str(),true);
+ generatePresentations(i);
}
+ ostringstream strOut;
+ aData.myPrs[0]->ToStream(strOut);
+ string aPrsComment = strOut.str();
+ VISU::CreateAttributes(myStudy, newObj->GetID().c_str(),"","",
+ aData.myPrs[0]->GetComment(),"",aPrsComment.c_str(),true);
}
aStudyBuilder->CommitCommand();
//************************************************************************
void VISU_TimeAnimation::saveAnimation()
{
- if (myStudy->GetProperties()->IsLocked()) return;
+ if (myStudy->GetProperties()->IsLocked()) return;
if (myAnimEntry.isEmpty()) return;
_PTR(SObject) aAnimSObject = myStudy->FindObjectID(myAnimEntry.latin1());
aCmnt->SetValue(aComment.latin1());
_PTR(ChildIterator) anIter = myStudy->NewChildIterator(aAnimSObject);
- int i;
- for (i = 0, anIter->Init(); anIter->More(); anIter->Next(), i++) {
+ int i = 0, nbf = getNbFields();
+ for (anIter->Init(); anIter->More(); anIter->Next(), i++) {
+ if (i >= nbf) break; // it must not be
FieldData& aData = myFieldsLst[i];
+ // Get presentation name and comment
+ if (aData.myPrs.empty()) {
+ generatePresentations(i);
+ }
+ ostringstream strOut;
+ aData.myPrs[0]->ToStream(strOut);
+ string aPrsComment = strOut.str();
+ string aPrsNameTxt = aData.myPrs[0]->GetComment();
+
+ // Save in study
_PTR(SObject) aRefObj = anIter->Value();
_PTR(ChildIterator) anPrsIter = myStudy->NewChildIterator(aRefObj);
anPrsIter->Init();
- string aPrsComment, aPrsNameTxt;
- if (aData.myPrs.empty()) {
- aPrsComment = "";
- aPrsNameTxt = GetPresentationComment(aData.myPrsType);
- } else {
- ostringstream strOut;
- aData.myPrs[0]->ToStream(strOut);
- aPrsComment = strOut.str();
-
- aPrsNameTxt = aData.myPrs[0]->GetComment();
- }
-
if (anPrsIter->More()) {
_PTR(SObject) aPrsObj = anPrsIter->Value();
anAttr = aStudyBuilder->FindOrCreateAttribute(aPrsObj, "AttributeComment");
}
aData.myPrs[0]->GetOffset(aData.myOffset);
for (int i = 1; i < aData.myNbFrames; i++) {
- aData.myPrs[i]->SameAs(aData.myPrs[0]);
+ //jfa 03.08.2005:aData.myPrs[i]->SameAs(aData.myPrs[0]);
+ aData.myPrs[i]->SameAsParams(aData.myPrs[0]);//jfa 03.08.2005
}
}
string aStr = aAnimSObject->GetID();