]> SALOME platform Git repositories - modules/gui.git/blobdiff - src/OBJECT/SALOME_InteractiveObject.cxx
Salome HOME
Redesign SALOME documentation: update link to youtube channel
[modules/gui.git] / src / OBJECT / SALOME_InteractiveObject.cxx
index 7d60d59e672ebec2e6620f4e89df7e6e0deb76a8..3fba48c65120eeb0e3c4da93c9349e57de14e1bc 100755 (executable)
-//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
 //
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-//  File   : SALOME_InteractiveObject.cxx
-//  Author : Nicolas REJNERI
-//  Module : SALOME
-//  $Header$
 
-//using namespace std;
 /*!
   \class SALOME_InteractiveObject SALOME_InteractiveObject.hxx
   \brief ...
 */
 
-#include "SALOME_InteractiveObject.ixx"
+#include "SALOME_InteractiveObject.hxx"
 
-SALOME_InteractiveObject::SALOME_InteractiveObject()
+IMPLEMENT_STANDARD_RTTIEXT(SALOME_InteractiveObject, Standard_Transient)
+
+/*!
+  Default constructor
+*/
+SALOME_InteractiveObject::SALOME_InteractiveObject():
+  myEntry(""),
+  myName(""),
+  myComponentDataType(""),
+  myReference("")
 {
-  myEntry = "";
-  myName  = "";
-  myComponentDataType = "";
-  myReference = "";
 }
 
+/*!
+  Constructor
+  \param anEntry - entry of object
+  \param aComponentDataType - component data type name
+  \param aName - name of object
+*/
 SALOME_InteractiveObject::SALOME_InteractiveObject(const char* anEntry, 
-                                                  const char* aComponentDataType,
-                                                  const char* aName):
+                                                   const char* aComponentDataType,
+                                                   const char* aName):
   myEntry(anEntry), 
   myName(aName), 
   myComponentDataType(aComponentDataType), 
   myReference("")
 {}
 
-void SALOME_InteractiveObject::setEntry(const char* anEntry){
+/*!
+  Destructor
+*/
+SALOME_InteractiveObject::~SALOME_InteractiveObject()
+{
+}
+
+/*!
+  Sets entry
+  \param anEntry - new entry of object
+*/
+void SALOME_InteractiveObject::setEntry(const char* anEntry)
+{
   myEntry = anEntry;
 }
 
-const char* SALOME_InteractiveObject::getEntry(){
+/*!
+  \return entry
+*/
+const char* SALOME_InteractiveObject::getEntry()
+{
   return myEntry.c_str();
 }
 
-void SALOME_InteractiveObject::setComponentDataType(const char* aComponentDataType){
+/*!
+  Sets component data type
+  \param aComponentDataType - component data type name
+*/
+void SALOME_InteractiveObject::setComponentDataType(const char* aComponentDataType)
+{
   myComponentDataType = aComponentDataType; 
 }
 
-const char* SALOME_InteractiveObject::getComponentDataType(){
+/*!
+  \return component data type
+*/
+const char* SALOME_InteractiveObject::getComponentDataType()
+{
   return myComponentDataType.c_str();
 }
 
-void SALOME_InteractiveObject::setName(const char* aName){
+/*!
+  Sets name
+  \param aName - new name of object
+*/
+void SALOME_InteractiveObject::setName(const char* aName)
+{
   myName = aName;
 }
 
-const char* SALOME_InteractiveObject::getName(){
+/*!
+  \return name
+*/
+const char* SALOME_InteractiveObject::getName()
+{
   return myName.c_str();
 }
 
-Standard_Boolean SALOME_InteractiveObject::hasEntry(){
+/*!
+  \return true if entry isn't empty
+*/
+Standard_Boolean SALOME_InteractiveObject::hasEntry()
+{
   return myEntry != "";
 }
 
-Standard_Boolean SALOME_InteractiveObject::isSame(const Handle(SALOME_InteractiveObject)& anIO ){
-  if ( anIO->hasEntry() && this->hasEntry() ) {
-    if ( myEntry == anIO->getEntry() )
-      return Standard_True;
-  }
-  
-  return Standard_False;
+/*!
+  \return true if objects have same entries
+  \param anIO - other object
+*/
+Standard_Boolean SALOME_InteractiveObject::isSame(const Handle(SALOME_InteractiveObject)& anIO )
+{
+  Standard_Boolean r = Standard_False;
+  if ( anIO->hasEntry() && this->hasEntry() )
+    r = myEntry == anIO->getEntry();
+  return r;
 }
 
-Standard_Boolean SALOME_InteractiveObject::isComponentType(const char* ComponentDataType){
-  if ( myComponentDataType == ComponentDataType )
-    return Standard_True;
-  else
-    return Standard_False;
+/*!
+  \return true if component data types are same
+  \param ComponentDataType - component data type to be checked
+*/
+Standard_Boolean SALOME_InteractiveObject::isComponentType(const char* ComponentDataType)
+{
+  return myComponentDataType == ComponentDataType;
 }
 
+/*!
+  \return true if object has reference
+*/
 Standard_Boolean SALOME_InteractiveObject::hasReference()
 {
   return myReference != "";
 }
 
+/*!
+  \return reference
+*/
 const char* SALOME_InteractiveObject::getReference()
 {
   return myReference.c_str();
 }
 
+/*!
+  Sets reference
+  \param aReference - new reference
+*/
 void SALOME_InteractiveObject::setReference(const char* aReference)
 {
   myReference = aReference;
 }
+
+/*!
+  Compare two objects
+  \param anIO1 - first object to compare
+  \param anIO1 - second object to compare
+*/
+Standard_Boolean IsEqual(const Handle(SALOME_InteractiveObject)& anIO1,
+                        const Handle(SALOME_InteractiveObject)& anIO2)
+{
+  return anIO1->isSame( anIO2 );
+}