Back to index

salome-geom  6.5.0
GEOM_InteractiveObject.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  GEOM OBJECT : interactive object for Geometry entities visualization
00024 //  File   : GEOM_InteractiveObject.cxx
00025 //  Author : Christophe ATTANASIO
00026 //  Module : GEOM
00027 //  $Header: /home/server/cvs/GEOM/GEOM_SRC/src/OBJECT/GEOM_InteractiveObject.cxx,v 1.9.2.1.6.2.14.1 2012-04-13 05:48:21 vsr Exp $
00028 //
00034 #include "GEOM_InteractiveObject.ixx"
00035 
00036 GEOM_InteractiveObject::GEOM_InteractiveObject()
00037   : SALOME_InteractiveObject()
00038 {
00039   myIOR       = "";
00040   myFatherIOR = "";
00041 }
00042 
00043 GEOM_InteractiveObject::GEOM_InteractiveObject(const char* anIOR,
00044                                                const char* aFatherIOR,
00045                                                const char* aComponentDataType,
00046                                                const char* anEntry)
00047   : SALOME_InteractiveObject(anEntry,aComponentDataType)
00048 {
00049   myIOR       = anIOR;
00050   myFatherIOR = aFatherIOR;
00051 }
00052 
00053 const char* GEOM_InteractiveObject::getIOR(){
00054   return myIOR.c_str();
00055 }
00056 
00057 const char* GEOM_InteractiveObject::getFatherIOR(){
00058   return myFatherIOR.c_str();
00059 }
00060 
00061 Standard_Boolean GEOM_InteractiveObject::isSame(const Handle(SALOME_InteractiveObject)& anIO ){
00062   if ( anIO->hasEntry() && this->hasEntry() ) {
00063     if ( myEntry == anIO->getEntry() )
00064       return Standard_True;
00065   }
00066   
00067   if ( anIO->IsKind(STANDARD_TYPE(GEOM_InteractiveObject))) {
00068     Handle(GEOM_InteractiveObject) theIO = Handle(GEOM_InteractiveObject)::DownCast( anIO );
00069     if ( myIOR == theIO->getIOR() )
00070       return Standard_True;
00071   }
00072 
00073   return Standard_False;
00074 }