From: enk Date: Mon, 25 Dec 2006 08:44:57 +0000 (+0000) Subject: Fix for bug Bug IPAL14224: X-Git-Tag: NPAL14357 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c9d30a96b2e0e7b57fa48c314a0c95cc270b3249;p=modules%2Fvisu.git Fix for bug Bug IPAL14224: Wrong work of published animation on group --- diff --git a/src/PIPELINE/VISU_PrsMergerPL.cxx b/src/PIPELINE/VISU_PrsMergerPL.cxx index 229a7287..9b46c9fb 100644 --- a/src/PIPELINE/VISU_PrsMergerPL.cxx +++ b/src/PIPELINE/VISU_PrsMergerPL.cxx @@ -87,6 +87,7 @@ void VISU_PrsMergerPL ::ShallowCopy(VISU_PipeLine *thePipeLine) { + if (MYDEBUG) MESSAGE("ShallowCopy"); VISU_PrsMergerPL* aPipeLine = dynamic_cast(thePipeLine); if(this == aPipeLine){ TSupperClass::ShallowCopy(thePipeLine); @@ -231,6 +232,7 @@ VISU_PrsMergerPL { if(MYDEBUG) MESSAGE("VISU_PrsMergerPL::Update()"); Superclass::Update(); + Execute(); } void diff --git a/src/VISU_I/VISU_PrsMerger_i.cc b/src/VISU_I/VISU_PrsMerger_i.cc index c165e46b..7602c103 100644 --- a/src/VISU_I/VISU_PrsMerger_i.cc +++ b/src/VISU_I/VISU_PrsMerger_i.cc @@ -167,6 +167,13 @@ VISU::Storable* VISU::PrsMerger_i::Restore(const Storable::TRestoringMap& theMap return this; } +void +VISU::PrsMerger_i +::SetMapScale(double theMapScale) +{ + myPrsMergerPL->SetMapScale(theMapScale); +} + void VISU::PrsMerger_i::ToStream(std::ostringstream& theStr) { if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::ToStream:"); @@ -214,14 +221,16 @@ void VISU::PrsMerger_i ::SameAs(const Prs3d_i* theOrigin) { - if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::SameAs:"); + if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::SameAs: this="<(theOrigin)){ PrsMerger_i* anOrigin = const_cast(aPrs3d); + if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::SameAs: theOrigin="<SetScalarMap(myMeshName.c_str(),VISU::Entity(myEntity),myFieldName.c_str(),myIteration); string_array_var aGroupNames = anOrigin->getGroupNames(); + RemoveAllGeom(); for(int i=0;ilength();i++){ this->AddMeshOnGroup(myMeshName.c_str(),aGroupNames[i]); } @@ -233,8 +242,8 @@ VISU_Actor* VISU::PrsMerger_i ::CreateActor(const Handle(SALOME_InteractiveObject)& theIO, bool toSupressShrinking) { - if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::CreateActor:"); - return VISU::ScalarMap_i::CreateActor(theIO, true); + if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::CreateActor this="<SetIDMapper(anIDMapper); - - aRetVal = myPrsMergerPL->AddBackGeometry(aTmpMesh); + if (MYDEBUG) MESSAGE("AddMeshOnGroup nbGeoms defore ="<GetNbGeometry()); - if(aRetVal >-1 ){ - myMeshPLList.push_back(aTmpMesh); - TPairStringAndInt aPair((std::string)theGroupName,-1); - myGeomNameEntityList.push_back(aPair); + bool isGroupInList = false; + TNameAndEntityList::const_iterator aIter = myGeomNameEntityList.begin(); + for(;aIter!=myGeomNameEntityList.end();aIter++){ + if(aIter->first == std::string(theGroupName)) + { + isGroupInList = true; + break; + } + } + + if(!isGroupInList){ + VISU_MeshPL* aTmpMesh = VISU_MeshPL::New(); + aTmpMesh->SetIDMapper(anIDMapper); + + aRetVal = myPrsMergerPL->AddBackGeometry(aTmpMesh); + + if(aRetVal >-1 ){ + myMeshPLList.push_back(aTmpMesh); + TPairStringAndInt aPair((std::string)theGroupName,-1); + myGeomNameEntityList.push_back(aPair); + } + else + aTmpMesh->Delete(); + + UpdateIcon(); + } - else - aTmpMesh->Delete(); if (MYDEBUG) MESSAGE("AddMeshOnGroup nbGeoms after ="<GetNbGeometry()); - UpdateIcon(); - return aRetVal; } @@ -350,7 +375,7 @@ SetScalarMap(const char* theMeshName, const char* theFieldName, CORBA::Long theStampsNum) { - if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::SetScalarMap"); + if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::SetScalarMap this="<GetInput()->GetTimeStampOnMesh(theMeshName,(VISU::TEntity)theEntity,theFieldName,int(theStampsNum)); diff --git a/src/VISU_I/VISU_PrsMerger_i.hh b/src/VISU_I/VISU_PrsMerger_i.hh index 986d1028..88625841 100644 --- a/src/VISU_I/VISU_PrsMerger_i.hh +++ b/src/VISU_I/VISU_PrsMerger_i.hh @@ -103,6 +103,10 @@ namespace VISU{ virtual void ToStream(std::ostringstream& theStr); virtual Storable* Restore(const Storable::TRestoringMap& theMap); + + virtual + void + SetMapScale(double theMapScale = 1.0); static const std::string myComment; virtual const char* GetComment() const;