X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Group_i.cxx;h=9f4c705f3aadbe423ed1258ec8420e4b540d51ad;hp=47236abcc9b194f64a56a73a234650b350e590c1;hb=64c772da5a9dd285f16f1f7efa07bb4c7fbdd4c3;hpb=c38c10811a065cf5b13e8807ed71864d92ca7d80 diff --git a/src/SMESH_I/SMESH_Group_i.cxx b/src/SMESH_I/SMESH_Group_i.cxx index 47236abcc..9f4c705f3 100644 --- a/src/SMESH_I/SMESH_Group_i.cxx +++ b/src/SMESH_I/SMESH_Group_i.cxx @@ -16,7 +16,7 @@ // 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.salome-platform.org or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -120,11 +120,7 @@ SMESHDS_GroupBase* SMESH_GroupBase_i::GetGroupDS() const void SMESH_GroupBase_i::SetName( const char* theName ) { // Update Python script - TCollection_AsciiString aStr, aStrName ((char*)theName); - SMESH_Gen_i::AddObject(aStr, _this()) += ".SetName(\""; - aStr += aStrName + "\")"; - - SMESH_Gen_i::AddToCurrentPyScript(aStr); + TPythonDump() << _this() << ".SetName( '" << theName << "' )"; // Perform renaming ::SMESH_Group* aGroup = GetSmeshGroup(); @@ -219,10 +215,7 @@ CORBA::Boolean SMESH_GroupBase_i::IsEmpty() void SMESH_Group_i::Clear() { // Update Python script - TCollection_AsciiString aStr; - SMESH_Gen_i::AddObject(aStr, _this()) += ".Clear()"; - - SMESH_Gen_i::AddToCurrentPyScript(aStr); + TPythonDump() << _this() << ".Clear()"; // Clear the group SMESHDS_Group* aGroupDS = dynamic_cast( GetGroupDS() ); @@ -257,11 +250,7 @@ CORBA::Boolean SMESH_GroupBase_i::Contains( CORBA::Long theID ) CORBA::Long SMESH_Group_i::Add( const SMESH::long_array& theIDs ) { // Update Python script - TCollection_AsciiString aStr ("nbAdd = "); - SMESH_Gen_i::AddObject(aStr, _this()) += ".Add("; - SMESH_Gen_i::AddArray(aStr, theIDs) += ")"; - - SMESH_Gen_i::AddToCurrentPyScript(aStr); + TPythonDump() << "nbAdd = " << _this() << ".Add( " << theIDs << " )"; // Add elements to the group SMESHDS_Group* aGroupDS = dynamic_cast( GetGroupDS() ); @@ -287,11 +276,7 @@ CORBA::Long SMESH_Group_i::Add( const SMESH::long_array& theIDs ) CORBA::Long SMESH_Group_i::Remove( const SMESH::long_array& theIDs ) { // Update Python script - TCollection_AsciiString aStr ("nbDel = "); - SMESH_Gen_i::AddObject(aStr, _this()) += ".Remove("; - SMESH_Gen_i::AddArray(aStr, theIDs) += ")"; - - SMESH_Gen_i::AddToCurrentPyScript(aStr); + TPythonDump() << "nbDel = " << _this() << ".Remove( " << theIDs << " )"; // Remove elements from the group SMESHDS_Group* aGroupDS = dynamic_cast( GetGroupDS() ); @@ -434,3 +419,69 @@ GEOM::GEOM_Object_ptr SMESH_GroupOnGeom_i::GetShape() return aGeomObj._retn(); } +//============================================================================= +/*! + * + */ +//============================================================================= +SALOMEDS::Color SMESH_GroupBase_i::GetColor() +{ + SMESHDS_GroupBase* aGroupDS = GetGroupDS(); + if (aGroupDS) + { + Quantity_Color aQColor = aGroupDS->GetColor(); + SALOMEDS::Color aColor; + aColor.R = aQColor.Red(); + aColor.G = aQColor.Green(); + aColor.B = aQColor.Blue(); + + return aColor; + } + MESSAGE("get color of a group"); + return SALOMEDS::Color(); +} + +//============================================================================= +/*! + * + */ +//============================================================================= +void SMESH_GroupBase_i::SetColor(const SALOMEDS::Color& color) +{ + SMESHDS_GroupBase* aGroupDS = GetGroupDS(); + if (aGroupDS) + { + Quantity_Color aQColor( color.R, color.G, color.B, Quantity_TOC_RGB ); + return aGroupDS->SetColor(aQColor); + } + MESSAGE("set color of a group"); + return ; +} + +//============================================================================= +/*! + * + */ +//============================================================================= +CORBA::Long SMESH_GroupBase_i::GetColorNumber() +{ + SMESHDS_GroupBase* aGroupDS = GetGroupDS(); + if (aGroupDS) + return aGroupDS->GetColorGroup(); + MESSAGE("get color number of a group"); + return 0; +} + +//============================================================================= +/*! + * + */ +//============================================================================= +void SMESH_GroupBase_i::SetColorNumber(CORBA::Long color) +{ + SMESHDS_GroupBase* aGroupDS = GetGroupDS(); + if (aGroupDS) + return aGroupDS->SetColorGroup(color); + MESSAGE("set color number of a group"); + return ; +}