From 5a556666ab9fa2ef09feb2f8c1773ca94dba5ede Mon Sep 17 00:00:00 2001 From: jfa Date: Mon, 27 Jun 2005 10:11:39 +0000 Subject: [PATCH] IPAL9284: Presentation on Group --- src/VISU_I/VISU_Mesh_i.cc | 115 ++++++++++++++++++++++---------------- src/VISU_I/VISU_Mesh_i.hh | 43 +++++++------- 2 files changed, 88 insertions(+), 70 deletions(-) diff --git a/src/VISU_I/VISU_Mesh_i.cc b/src/VISU_I/VISU_Mesh_i.cc index 27b69a65..72a86645 100644 --- a/src/VISU_I/VISU_Mesh_i.cc +++ b/src/VISU_I/VISU_Mesh_i.cc @@ -1,23 +1,23 @@ // VISU OBJECT : interactive object for VISU entities implementation // // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org // // // File : VISU_PrsObject_i.cxx @@ -49,8 +49,8 @@ const string VISU::Mesh_i::myComment = "MESH"; const char* VISU::Mesh_i::GetComment() const { return myComment.c_str();} VISU::Mesh_i:: -Mesh_i(Result_i* theResult) : - PrsObject_i(theResult->GetStudyDocument()), +Mesh_i(Result_i* theResult) : + PrsObject_i(theResult->GetStudyDocument()), Prs3d_i(theResult,false), myMeshPL(VISU_MeshPL::New()) { @@ -59,9 +59,9 @@ Mesh_i(Result_i* theResult) : VISU::Mesh_i:: -Mesh_i(Result_i* theResult, - SALOMEDS::SObject_ptr theSObject) : - PrsObject_i(theResult->GetStudyDocument()), +Mesh_i(Result_i* theResult, + SALOMEDS::SObject_ptr theSObject) : + PrsObject_i(theResult->GetStudyDocument()), Prs3d_i(theResult,theSObject), myMeshPL(VISU_MeshPL::New()) { @@ -74,13 +74,16 @@ void VISU::Mesh_i::RemoveFromStudy(){ } -void VISU::Mesh_i::SameAs(const Mesh_i* theOrigin){ +void VISU::Mesh_i::SameAs (const Mesh_i* theOrigin) +{ return; // "SameAs" command for mesh is not valid in current architecture } -int VISU::Mesh_i::IsPossible(Result_i* theResult, const char* theMeshName, Entity theEntity, const char* theFamilyName){ +int VISU::Mesh_i::IsPossible (Result_i* theResult, const char* theMeshName, + Entity theEntity, const char* theFamilyName) +{ try{ MESSAGE("Mesh_i::IsPossible - theMeshName = '"<NewBuilder(); aStudyBuilder->NewCommand(); // There is a transaction - try{ - if(myResult->GetInput() == NULL) + try { + if (myResult->GetInput() == NULL) throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!"); - if(!theRestoring){ + if (!theRestoring) { myPresentType = VISU::SHADED; myName = GenerateName().latin1(); myCellColor.R = 0.0; myCellColor.G = myCellColor.B = 1.0; myNodeColor.R = myNodeColor.G = 1.0; myNodeColor.B = 1.0; myLinkColor.R = myLinkColor.G = myLinkColor.B = 83/255.; } - if(int(myEntity) >= 0) - if(mySubMeshName == "") - myType = VISU::TENTITY; - else + //jfa IPAL9284:if (int(myEntity) >= 0) + if (myEntity >= 0) //jfa IPAL9284 + if (mySubMeshName == "") + myType = VISU::TENTITY; + else myType = VISU::TFAMILY; - else + else myType = VISU::TGROUP; if(MYDEBUG) MESSAGE("Mesh_i::Build - myType = "<GetInput()->GetMeshOnEntity(myMeshName,myEntity); + case VISU::TENTITY : + //jfa IPAL9284:anOutput = myResult->GetInput()->GetMeshOnEntity(myMeshName,myEntity); + anOutput = myResult->GetInput()->GetMeshOnEntity(myMeshName,(VISU::TEntity)myEntity);//jfa IPAL9284 aComment.sprintf("myComment=ENTITY;myType=%d;myMeshName=%s;myId=%d", VISU::TENTITY,myMeshName.c_str(),myEntity); break; - case VISU::TFAMILY : - anOutput = myResult->GetInput()->GetMeshOnEntity(myMeshName,myEntity,mySubMeshName); + case VISU::TFAMILY : + //jfa IPAL9284:anOutput = myResult->GetInput()->GetMeshOnEntity(myMeshName,myEntity,mySubMeshName); + anOutput = myResult->GetInput()->GetMeshOnEntity + (myMeshName,(VISU::TEntity)myEntity,mySubMeshName);//jfa IPAL9284 aComment.sprintf("myComment=FAMILY;myType=%d;myMeshName=%s;myEntityId=%d;myName=%s", VISU::TFAMILY,myMeshName.c_str(),myEntity,mySubMeshName.c_str()); break; - case VISU::TGROUP : + case VISU::TGROUP : anOutput = myResult->GetInput()->GetMeshOnGroup(myMeshName,mySubMeshName); aComment.sprintf("myComment=GROUP;myType=%d;myMeshName=%s;myName=%s", VISU::TGROUP,myMeshName.c_str(),mySubMeshName.c_str()); @@ -237,7 +254,7 @@ VISU::Storable* VISU::Mesh_i::Build(int theRestoring){ SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(mySObject,"AttributeIOR"); SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); CORBA::String_var aString = GetID(); - anIOR->SetValue(aString); + anIOR->SetValue(aString); } }catch(std::exception& exc){ INFOS("Follow exception was occured :\n"<CommitCommand(); return this; } -VISU_Actor* VISU::Mesh_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) +VISU_Actor* VISU::Mesh_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) { VISU_MeshAct* anActor = VISU_MeshAct::New(); try{ @@ -263,7 +280,7 @@ VISU_Actor* VISU::Mesh_i::CreateActor(const Handle(SALOME_InteractiveObject)& th } return anActor; } - + void VISU::Mesh_i::UpdateActor(VISU_Actor* theActor) { if(VISU_MeshAct* anActor = dynamic_cast(theActor)){ diff --git a/src/VISU_I/VISU_Mesh_i.hh b/src/VISU_I/VISU_Mesh_i.hh index a9e164ae..70e4e6ae 100644 --- a/src/VISU_I/VISU_Mesh_i.hh +++ b/src/VISU_I/VISU_Mesh_i.hh @@ -1,23 +1,23 @@ // VISU OBJECT : interactive object for VISU entities implementation // // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org // // // File : VISU_PrsObject_i.hxx @@ -42,7 +42,7 @@ namespace VISU{ explicit Mesh_i(Result_i* theResult); explicit - Mesh_i(Result_i* theResult, + Mesh_i(Result_i* theResult, SALOMEDS::SObject_ptr theSObject); virtual void SameAs(const Mesh_i* theOrigin); virtual ~Mesh_i(); @@ -71,7 +71,8 @@ namespace VISU{ VISU_MeshPL* myMeshPL; string myMeshName; - TEntity myEntity; + //jfa IPAL9284:TEntity myEntity; + int myEntity;//jfa IPAL9284 string mySubMeshName; VISU::VISUType myType; @@ -81,14 +82,14 @@ namespace VISU{ public: static int IsPossible(Result_i* theResult, const char* theMeshName, Entity theEntity, const char* theFamilyName = ""); virtual Storable* Create(const char* theMeshName, Entity theEntity, const char* theFamilyName = ""); - + static int IsPossible(Result_i* theResult, const char* theMeshName, const char* theGroupName); virtual Storable* Create(const char* theMeshName, const char* theGroupName); const std::string& GetMeshName() const { return myMeshName;} VISU::Entity GetEntity() const { return VISU::Entity(myEntity);} const string& GetSubMeshName() const { return mySubMeshName;} - + virtual void ToStream(std::ostringstream& theStr); virtual const char* GetComment() const; -- 2.39.2