]> SALOME platform Git repositories - modules/gui.git/blob - src/LightApp/LightApp_DataOwner.cxx
Salome HOME
Fix for bug 10505: Explode with 'Select Sub Shapes' is impossible
[modules/gui.git] / src / LightApp / LightApp_DataOwner.cxx
1 #include "LightApp_DataOwner.h"
2
3 #include "LightApp_DataObject.h"
4
5 #ifndef WNT
6 #include <typeinfo>
7 #define _typeinfo std::type_info
8 #else
9 #include <typeinfo.h>
10 #define _typeinfo type_info
11 #endif
12
13 #include <iostream>
14
15 /*!Constructor. Initialize by \a theEntry.*/
16 LightApp_DataOwner
17 ::LightApp_DataOwner( const QString& theEntry ): 
18   myEntry( theEntry )
19 {
20 }
21
22 /*!Constructor. Initialize by \a SALOME_InteractiveObject.*/
23 LightApp_DataOwner
24 ::LightApp_DataOwner( const Handle(SALOME_InteractiveObject)& theIO ):
25   myEntry(!theIO.IsNull()? theIO->getEntry(): ""),
26   myIO(theIO)
27 {
28 }
29
30 /*!Destructor. Do nothing.*/
31 LightApp_DataOwner
32 ::~LightApp_DataOwner()
33 {
34 }
35
36 /*!Checks: Is current data owner equal \a obj.*/
37 bool
38 LightApp_DataOwner
39 ::isEqual( const SUIT_DataOwner& obj ) const
40 {
41   const _typeinfo& ti1 = typeid( obj );
42   const _typeinfo& ti2 = typeid( *(this) );
43
44   if (ti1 != ti2)
45     return false;
46
47   const LightApp_DataOwner* other = dynamic_cast<const LightApp_DataOwner*>( &obj );
48
49   return other && entry() == other->entry();
50 }
51
52 /*!Gets entry.*/
53 QString
54 LightApp_DataOwner
55 ::entry() const
56 {
57   return myEntry;
58 }
59
60 /*!Gets SALOME_InteractiveObject.*/
61 const Handle(SALOME_InteractiveObject)&
62 LightApp_DataOwner
63 ::IO() const
64 {
65   return myIO;
66 }