Salome HOME
b8c484e4d156f8ab91f5152878cf8ea2c4f6b7cf
[modules/geom.git] / src / OBJECT / GEOM_InteractiveObject.cxx
1 using namespace std;
2 //  File      : GEOM_InteractiveObject.cxx
3 //  Created   : Wed Feb 20 17:24:59 2002
4 //  Author    : Christophe ATTANASIO
5 //  Project   : SALOME
6 //  Module    : GEOM
7 //  Copyright : Open CASCADE 2002
8 //  $Header$
9
10 /*!
11   \class GEOM_InteractiveObject GEOM_InteractiveObject.hxx
12   \brief ....
13 */
14
15 #include "GEOM_InteractiveObject.ixx"
16
17 GEOM_InteractiveObject::GEOM_InteractiveObject()
18   : SALOME_InteractiveObject()
19 {
20   myIOR       = "";
21   myFatherIOR = "";
22 }
23
24 GEOM_InteractiveObject::GEOM_InteractiveObject(const Standard_CString anIOR,
25                                                const Standard_CString aFatherIOR,
26                                                const Standard_CString aComponentDataType,
27                                                const Standard_CString anEntry)
28   : SALOME_InteractiveObject(anEntry,aComponentDataType)
29 {
30   myIOR       = new char [strlen(anIOR)+1];
31   strcpy( myIOR, anIOR);
32   myFatherIOR = new char [strlen(aFatherIOR)+1];
33   strcpy( myFatherIOR, aFatherIOR);
34 }
35
36 Standard_CString GEOM_InteractiveObject::getIOR(){
37   return myIOR;
38 }
39 Standard_CString GEOM_InteractiveObject::getFatherIOR(){
40   return myFatherIOR;
41 }
42
43 Standard_Boolean GEOM_InteractiveObject::isSame(const Handle(SALOME_InteractiveObject)& anIO ){
44   if ( anIO->hasEntry() && this->hasEntry() ) {
45     if ( strcmp(myEntry, anIO->getEntry() ) == 0 )
46       return Standard_True;
47   }
48   
49   if ( anIO->IsKind(STANDARD_TYPE(GEOM_InteractiveObject))) {
50     Handle(GEOM_InteractiveObject) theIO = Handle(GEOM_InteractiveObject)::DownCast( anIO );
51     if ( strcmp(myIOR, theIO->getIOR() ) == 0 )
52       return Standard_True;
53   }
54
55   return Standard_False;
56 }