Salome HOME
Initial version
[modules/gui.git] / src / OBJECT / SALOME_InteractiveObject.cxx
1 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : SALOME_InteractiveObject.cxx
25 //  Author : Nicolas REJNERI
26 //  Module : SALOME
27 //  $Header$
28
29 //using namespace std;
30 /*!
31   \class SALOME_InteractiveObject SALOME_InteractiveObject.hxx
32   \brief ...
33 */
34
35 #include "SALOME_InteractiveObject.ixx"
36
37 SALOME_InteractiveObject::SALOME_InteractiveObject()
38 {
39   myEntry = "";
40   myName  = "";
41   myComponentDataType = "";
42   myReference = "";
43 }
44
45 SALOME_InteractiveObject::SALOME_InteractiveObject(const char* anEntry, 
46                                                    const char* aComponentDataType,
47                                                    const char* aName):
48   myEntry(anEntry), 
49   myName(aName), 
50   myComponentDataType(aComponentDataType), 
51   myReference("")
52 {}
53
54 void SALOME_InteractiveObject::setEntry(const char* anEntry){
55   myEntry = anEntry;
56 }
57
58 const char* SALOME_InteractiveObject::getEntry(){
59   return myEntry.c_str();
60 }
61
62 void SALOME_InteractiveObject::setComponentDataType(const char* aComponentDataType){
63   myComponentDataType = aComponentDataType; 
64 }
65
66 const char* SALOME_InteractiveObject::getComponentDataType(){
67   return myComponentDataType.c_str();
68 }
69
70 void SALOME_InteractiveObject::setName(const char* aName){
71   myName = aName;
72 }
73
74 const char* SALOME_InteractiveObject::getName(){
75   return myName.c_str();
76 }
77
78 Standard_Boolean SALOME_InteractiveObject::hasEntry(){
79   return myEntry != "";
80 }
81
82 Standard_Boolean SALOME_InteractiveObject::isSame(const Handle(SALOME_InteractiveObject)& anIO ){
83   if ( anIO->hasEntry() && this->hasEntry() ) {
84     if ( myEntry == anIO->getEntry() )
85       return Standard_True;
86   }
87   
88   return Standard_False;
89 }
90
91 Standard_Boolean SALOME_InteractiveObject::isComponentType(const char* ComponentDataType){
92   if ( myComponentDataType == ComponentDataType )
93     return Standard_True;
94   else
95     return Standard_False;
96 }
97
98 Standard_Boolean SALOME_InteractiveObject::hasReference()
99 {
100   return myReference != "";
101 }
102
103 const char* SALOME_InteractiveObject::getReference()
104 {
105   return myReference.c_str();
106 }
107
108 void SALOME_InteractiveObject::setReference(const char* aReference)
109 {
110   myReference = aReference;
111 }