From: vsr Date: Mon, 10 Jan 2011 10:16:57 +0000 (+0000) Subject: Eliminate useless GetSubShape() lines in the python dump X-Git-Tag: Start_BR_19998_21191~87 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=68aba60ffd17cf889b1a3a9eef7d76f3477e3b4f;p=modules%2Fgeom.git Eliminate useless GetSubShape() lines in the python dump --- diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index 21ed9b2f8..1da35ccd4 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -325,6 +325,12 @@ module GEOM */ boolean IsShape(); + /* + * Return true if passed object is identical to this object + * \param other object being compared with this one + */ + boolean IsSame(in GEOM_Object other); + /*! * Set list of parameters * \param theParameters is a string containing the notebook variables separated by ":" symbol, diff --git a/src/GEOM_I/GEOM_Object_i.cc b/src/GEOM_I/GEOM_Object_i.cc index 0dd22bdf4..849f2cce1 100644 --- a/src/GEOM_I/GEOM_Object_i.cc +++ b/src/GEOM_I/GEOM_Object_i.cc @@ -491,6 +491,18 @@ bool GEOM_Object_i::IsShape() return !_impl->GetValue().IsNull() && _impl->GetType() != GEOM_MARKER; } +bool GEOM_Object_i::IsSame(GEOM::GEOM_Object_ptr other) +{ + TopoDS_Shape thisShape = _impl->GetValue(); + TopoDS_Shape otherShape; + if ( !CORBA::is_nil( other ) ) { + Handle(GEOM_Object) otherObject = GEOM_Engine::GetEngine()->GetObject( other->GetStudyID(), other->GetEntry(), false ); + if ( !otherObject.IsNull() ) + otherShape = otherObject->GetValue(); + } + return thisShape.IsSame( otherShape ); +} + void GEOM_Object_i::SetParameters(const char* theParameters) { _impl->SetParameters((char*)theParameters); diff --git a/src/GEOM_I/GEOM_Object_i.hh b/src/GEOM_I/GEOM_Object_i.hh index c7ed4c758..e7cb48177 100644 --- a/src/GEOM_I/GEOM_Object_i.hh +++ b/src/GEOM_I/GEOM_Object_i.hh @@ -97,6 +97,8 @@ class GEOM_I_EXPORT GEOM_Object_i : public virtual POA_GEOM::GEOM_Object, public virtual GEOM::GEOM_Object_ptr GetMainShape(); + virtual bool IsSame(GEOM::GEOM_Object_ptr other); + virtual bool IsShape(); virtual void SetParameters(const char* theParameters);