1 // SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
3 // Copyright (C) 2003 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.
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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SALOME_InteractiveObject.cxx
25 // Author : Nicolas REJNERI
31 \class SALOME_InteractiveObject SALOME_InteractiveObject.hxx
35 #include "SALOME_InteractiveObject.ixx"
37 SALOME_InteractiveObject::SALOME_InteractiveObject()
41 myComponentDataType = "";
45 SALOME_InteractiveObject::SALOME_InteractiveObject(const Standard_CString anEntry,
46 const Standard_CString aComponentDataType,
47 const Standard_CString aName)
49 myEntry = new char [strlen(anEntry)+1];
50 strcpy( myEntry, anEntry);
52 myName = new char [strlen(aName)+1];
53 strcpy( myName, aName);
55 myComponentDataType = new char [strlen(aComponentDataType)+1];
56 strcpy( myComponentDataType, aComponentDataType);
58 myReference = new char [strlen("")+1];
59 strcpy( myReference, "");
62 void SALOME_InteractiveObject::setEntry(const Standard_CString anEntry){
63 myEntry = new char [strlen(anEntry)+1];
64 strcpy( myEntry, anEntry);
67 Standard_CString SALOME_InteractiveObject::getEntry(){
71 void SALOME_InteractiveObject::setComponentDataType(const Standard_CString aComponentDataType){
72 myComponentDataType = new char [strlen(aComponentDataType)+1];
73 strcpy( myComponentDataType, aComponentDataType);
76 Standard_CString SALOME_InteractiveObject::getComponentDataType(){
77 return myComponentDataType;
80 void SALOME_InteractiveObject::setName(const Standard_CString aName){
81 myName = new char [strlen(aName)+1];
82 strcpy( myName, aName);
85 Standard_CString SALOME_InteractiveObject::getName(){
89 Standard_Boolean SALOME_InteractiveObject::hasEntry(){
90 return !( strcmp(myEntry, "" ) == 0 );
93 Standard_Boolean SALOME_InteractiveObject::isSame(const Handle(SALOME_InteractiveObject)& anIO ){
94 if ( anIO->hasEntry() && this->hasEntry() ) {
95 if ( strcmp(myEntry, anIO->getEntry() ) == 0 )
99 return Standard_False;
102 Standard_Boolean SALOME_InteractiveObject::isComponentType(const Standard_CString ComponentDataType){
103 if ( strcmp( myComponentDataType, ComponentDataType) == 0 )
104 return Standard_True;
106 return Standard_False;
109 Standard_Boolean SALOME_InteractiveObject::hasReference()
111 return !( strcmp(myReference, "" ) == 0 );
114 Standard_CString SALOME_InteractiveObject::getReference()
119 void SALOME_InteractiveObject::setReference(const Standard_CString aReference)
121 myReference = new char [strlen(aReference)+1];
122 strcpy( myReference, aReference);