Back to index

salome-gui  6.5.0
SALOME_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 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
00024 //  File   : SALOME_InteractiveObject.cxx
00025 //  Author : Nicolas REJNERI
00026 
00032 #include "SALOME_InteractiveObject.ixx"
00033 
00037 SALOME_InteractiveObject::SALOME_InteractiveObject()
00038 {
00039   myEntry = "";
00040   myName  = "";
00041   myComponentDataType = "";
00042   myReference = "";
00043 }
00044 
00051 SALOME_InteractiveObject::SALOME_InteractiveObject(const char* anEntry, 
00052                                                    const char* aComponentDataType,
00053                                                    const char* aName):
00054   myEntry(anEntry), 
00055   myName(aName), 
00056   myComponentDataType(aComponentDataType), 
00057   myReference("")
00058 {}
00059 
00064 void SALOME_InteractiveObject::setEntry(const char* anEntry){
00065   myEntry = anEntry;
00066 }
00067 
00071 const char* SALOME_InteractiveObject::getEntry(){
00072   return myEntry.c_str();
00073 }
00074 
00079 void SALOME_InteractiveObject::setComponentDataType(const char* aComponentDataType){
00080   myComponentDataType = aComponentDataType; 
00081 }
00082 
00086 const char* SALOME_InteractiveObject::getComponentDataType(){
00087   return myComponentDataType.c_str();
00088 }
00089 
00094 void SALOME_InteractiveObject::setName(const char* aName){
00095   myName = aName;
00096 }
00097 
00101 const char* SALOME_InteractiveObject::getName(){
00102   return myName.c_str();
00103 }
00104 
00108 Standard_Boolean SALOME_InteractiveObject::hasEntry(){
00109   return myEntry != "";
00110 }
00111 
00116 Standard_Boolean SALOME_InteractiveObject::isSame(const Handle(SALOME_InteractiveObject)& anIO ){
00117   if ( anIO->hasEntry() && this->hasEntry() ) {
00118     if ( myEntry == anIO->getEntry() )
00119       return Standard_True;
00120   }
00121   
00122   return Standard_False;
00123 }
00124 
00129 Standard_Boolean SALOME_InteractiveObject::isComponentType(const char* ComponentDataType){
00130   if ( myComponentDataType == ComponentDataType )
00131     return Standard_True;
00132   else
00133     return Standard_False;
00134 }
00135 
00139 Standard_Boolean SALOME_InteractiveObject::hasReference()
00140 {
00141   return myReference != "";
00142 }
00143 
00147 const char* SALOME_InteractiveObject::getReference()
00148 {
00149   return myReference.c_str();
00150 }
00151 
00156 void SALOME_InteractiveObject::setReference(const char* aReference)
00157 {
00158   myReference = aReference;
00159 }