1 // Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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, or (at your option) any later version.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 \class SALOME_InteractiveObject SALOME_InteractiveObject.hxx
28 #include "SALOME_InteractiveObject.hxx"
30 IMPLEMENT_STANDARD_HANDLE (SALOME_InteractiveObject, MMgt_TShared)
31 IMPLEMENT_STANDARD_RTTIEXT(SALOME_InteractiveObject, MMgt_TShared)
36 SALOME_InteractiveObject::SALOME_InteractiveObject():
39 myComponentDataType(""),
46 \param anEntry - entry of object
47 \param aComponentDataType - component data type name
48 \param aName - name of object
50 SALOME_InteractiveObject::SALOME_InteractiveObject(const char* anEntry,
51 const char* aComponentDataType,
55 myComponentDataType(aComponentDataType),
62 SALOME_InteractiveObject::~SALOME_InteractiveObject()
68 \param anEntry - new entry of object
70 void SALOME_InteractiveObject::setEntry(const char* anEntry)
78 const char* SALOME_InteractiveObject::getEntry()
80 return myEntry.c_str();
84 Sets component data type
85 \param aComponentDataType - component data type name
87 void SALOME_InteractiveObject::setComponentDataType(const char* aComponentDataType)
89 myComponentDataType = aComponentDataType;
93 \return component data type
95 const char* SALOME_InteractiveObject::getComponentDataType()
97 return myComponentDataType.c_str();
102 \param aName - new name of object
104 void SALOME_InteractiveObject::setName(const char* aName)
112 const char* SALOME_InteractiveObject::getName()
114 return myName.c_str();
118 \return true if entry isn't empty
120 Standard_Boolean SALOME_InteractiveObject::hasEntry()
122 return myEntry != "";
126 \return true if objects have same entries
127 \param anIO - other object
129 Standard_Boolean SALOME_InteractiveObject::isSame(const Handle(SALOME_InteractiveObject)& anIO )
131 Standard_Boolean r = Standard_False;
132 if ( anIO->hasEntry() && this->hasEntry() )
133 r = myEntry == anIO->getEntry();
138 \return true if component data types are same
139 \param ComponentDataType - component data type to be checked
141 Standard_Boolean SALOME_InteractiveObject::isComponentType(const char* ComponentDataType)
143 return myComponentDataType == ComponentDataType;
147 \return true if object has reference
149 Standard_Boolean SALOME_InteractiveObject::hasReference()
151 return myReference != "";
157 const char* SALOME_InteractiveObject::getReference()
159 return myReference.c_str();
164 \param aReference - new reference
166 void SALOME_InteractiveObject::setReference(const char* aReference)
168 myReference = aReference;
173 \param anIO1 - first object to compare
174 \param anIO1 - second object to compare
176 Standard_Boolean IsEqual(const Handle(SALOME_InteractiveObject)& anIO1,
177 const Handle(SALOME_InteractiveObject)& anIO2)
179 return anIO1->isSame( anIO2 );