]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Eliminate useless GetSubShape() lines in the python dump
authorvsr <vsr@opencascade.com>
Mon, 10 Jan 2011 10:16:57 +0000 (10:16 +0000)
committervsr <vsr@opencascade.com>
Mon, 10 Jan 2011 10:16:57 +0000 (10:16 +0000)
idl/GEOM_Gen.idl
src/GEOM_I/GEOM_Object_i.cc
src/GEOM_I/GEOM_Object_i.hh

index 21ed9b2f8f55a4d19ee061a42c0ba78a537963d0..1da35ccd4c117b45b9d08d7da6bce371cc3f5c10 100644 (file)
@@ -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,
index 0dd22bdf4a0f28284cd7500133e77132296302c9..849f2cce1a8843733c8541542f747b5a707cccce 100644 (file)
@@ -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);
index c7ed4c7583158acb50d80784cadaf9fc6e858bc0..e7cb4817748cb08f58649ae9eba07b9f9d0963f7 100644 (file)
@@ -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);