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:");
VISU::PrsMerger_i
::SameAs(const Prs3d_i* theOrigin)
{
- if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::SameAs:");
+ if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::SameAs: this="<<this);
TSuperClass::SameAs(theOrigin);
if(const PrsMerger_i* aPrs3d = dynamic_cast<const PrsMerger_i*>(theOrigin)){
PrsMerger_i* anOrigin = const_cast<PrsMerger_i*>(aPrs3d);
+ if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::SameAs: theOrigin="<<anOrigin);
this->SetScalarMap(myMeshName.c_str(),VISU::Entity(myEntity),myFieldName.c_str(),myIteration);
string_array_var aGroupNames = anOrigin->getGroupNames();
+ RemoveAllGeom();
for(int i=0;i<aGroupNames->length();i++){
this->AddMeshOnGroup(myMeshName.c_str(),aGroupNames[i]);
}
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="<<this);
+ return VISU::ScalarMap_i::CreateActor(theIO, toSupressShrinking);
}
VISU_Actor* VISU::PrsMerger_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
}
void VISU::PrsMerger_i::UpdateActor(VISU_Actor* theActor) {
- if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::UpdateActor");
+ if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::UpdateActor this="<<this);
+
TSuperClass::UpdateActor(theActor);
}
AddMeshOnGroup(const char* theMeshName,
const char* theGroupName)
{
- if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::AddMeshOnGroup |"<< theGroupName <<"|");
+ if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::AddMeshOnGroup |"<< theGroupName <<"| this="<<this);
CORBA::Long aRetVal = -1;
VISU::PIDMapper anIDMapper;
anIDMapper = myResult->GetInput()->GetMeshOnGroup(theMeshName,theGroupName);
if(!anIDMapper)
MESSAGE("Warning: There are no mesh with group=|"<<theGroupName<<"|");
- VISU_MeshPL* aTmpMesh = VISU_MeshPL::New();
- aTmpMesh->SetIDMapper(anIDMapper);
-
- aRetVal = myPrsMergerPL->AddBackGeometry(aTmpMesh);
+ if (MYDEBUG) MESSAGE("AddMeshOnGroup nbGeoms defore ="<<myPrsMergerPL->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 ="<<myPrsMergerPL->GetNbGeometry());
- UpdateIcon();
-
return aRetVal;
}
const char* theFieldName,
CORBA::Long theStampsNum)
{
- if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::SetScalarMap");
+ if (MYDEBUG) MESSAGE("VISU::PrsMerger_i::SetScalarMap this="<<this);
VISU::PIDMapper anIDMapper;
anIDMapper = myResult->GetInput()->GetTimeStampOnMesh(theMeshName,(VISU::TEntity)theEntity,theFieldName,int(theStampsNum));