]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0022832: EDF GEOM: Bug with curve construction
authorana <ana@opencascade.com>
Wed, 17 Dec 2014 13:22:00 +0000 (16:22 +0300)
committerana <ana@opencascade.com>
Wed, 17 Dec 2014 13:22:00 +0000 (16:22 +0300)
src/GEOM_I/GEOM_Object_i.cc
src/GEOM_I/GEOM_Object_i.hh

index 54e5c458d28ab550dd224dbd783b89e8cd16ce22..dcaf20289120957a8a933bb96bf9464f7d70c6a5 100644 (file)
@@ -364,15 +364,16 @@ bool GEOM_Object_i::IsShape()
   return !_impl->GetValue().IsNull() && _impl->GetType() != GEOM_MARKER;
 }
 
-bool GEOM_Object_i::IsSame(GEOM::GEOM_Object_ptr other)
+bool GEOM_Object_i::IsSame(GEOM::GEOM_BaseObject_ptr other)
 {
+  GEOM::GEOM_Object_ptr shapePtr = GEOM::GEOM_Object::_narrow( other );
+  if ( CORBA::is_nil( shapePtr ) )
+    return false;
   TopoDS_Shape thisShape  = _impl->GetValue();
   TopoDS_Shape otherShape;
-  if ( !CORBA::is_nil( other ) ) {
-    Handle(GEOM_Object) otherObject = Handle(GEOM_Object)::DownCast
-      ( GEOM_Engine::GetEngine()->GetObject( other->GetStudyID(), other->GetEntry(), false ));
-    if ( !otherObject.IsNull() )
-      otherShape = otherObject->GetValue();
-  }
+  Handle(GEOM_Object) otherObject = Handle(GEOM_Object)::DownCast
+    ( GEOM_Engine::GetEngine()->GetObject( shapePtr->GetStudyID(), shapePtr->GetEntry(), false ));
+  if ( !otherObject.IsNull() )
+    otherShape = otherObject->GetValue();
   return thisShape.IsSame( otherShape );
 }
index da7f035edec011d7aefcd2b5efe1dd2e95464aa2..b2002026960df70b98e94ee10e380ac53195a5a2 100644 (file)
@@ -75,7 +75,7 @@ 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 IsSame(GEOM::GEOM_BaseObject_ptr other);
 
   virtual bool IsShape();