HEADERS += CAM_DataModel.h
HEADERS += CAM_DataObject.h
HEADERS += CAM_Module.h
-HEADERS += CAM_RootObject.h
HEADERS += CAM_Study.h
SOURCES = CAM_Application.cxx
SOURCES += CAM_DataModel.cxx
SOURCES += CAM_DataObject.cxx
SOURCES += CAM_Module.cxx
-SOURCES += CAM_RootObject.cxx
SOURCES += CAM_Study.cxx
TRANSLATIONS = resources/CAM_images.ts \
return;
if ( myRoot )
- myRoot->disconnect( this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
+ myRoot->disconnect( SIGNAL( destroyed( SUIT_DataObject* ) ),
+ this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
myRoot = (CAM_DataObject*)newRoot;
if ( myRoot )
- myRoot->connect( this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
+ myRoot->connect( SIGNAL( destroyed( SUIT_DataObject* ) ),
+ this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
emit rootChanged( this );
}
/*!
\class CAM_DataObject
- \brief CAM-based implementation of data object.
+ \brief CAM-based implementation of the data object.
In addition to base implementation provides integration
with CAM_DataModel.
*/
CAM_Module* CAM_DataObject::module() const
{
- CAM_Module* mod = 0;
-
- CAM_DataModel* data = dataModel();
- if ( data )
- mod = data->module();
-
- return mod;
+ CAM_DataModel* dm = dataModel();
+ return dm ? dm->module() : 0;
}
/*!
\brief Get CAM data model.
\return data model or 0 if it is not set
- \sa CAM_RootObject class
+ \sa CAM_ModuleObject class
*/
CAM_DataModel* CAM_DataObject::dataModel() const
{
CAM_DataObject* parentObj = dynamic_cast<CAM_DataObject*>( parent() );
+ return parentObj ? parentObj->dataModel() : 0;
+}
+
+/*!
+ \class CAM_ModuleObject
+ \brief CAM data model root object.
+
+ This class is intended for optimized access to CAM_DataModel instance
+ from CAM_DataObject instances.
+
+ To take advantage of this class in a specific application,
+ custom data model root object class should be derived from both CAM_ModuleObject
+ and application-specific DataObject implementation using virtual inheritance.
+*/
+
+/*!
+ \brief Constructor.
+ \param parent parent data object
+*/
+CAM_ModuleObject::CAM_ModuleObject( SUIT_DataObject* parent )
+: CAM_DataObject( parent ),
+ myDataModel( 0 )
+{
+}
+
+/*!
+ \brief Constructor.
+ \param data data model
+ \param parent parent data object
+*/
+CAM_ModuleObject::CAM_ModuleObject( CAM_DataModel* data, SUIT_DataObject* parent )
+: CAM_DataObject( parent ),
+ myDataModel( data )
+{
+}
- if ( !parentObj )
- return 0;
+/*!
+ \brief Destructor.
+
+ Does nothing.
+*/
+CAM_ModuleObject::~CAM_ModuleObject()
+{
+}
+
+/*!
+ \brief Get root object name.
+
+ If the data model is set, this method returns module name.
+ Otherwise returns empty string.
+
+ \return root object name
+*/
+QString CAM_ModuleObject::name() const
+{
+ return myDataModel ? myDataModel->module()->moduleName() : QString();
+}
- return parentObj->dataModel();
+/*!
+ \brief Get data model.
+ \return data model pointer or 0 if it is not set
+*/
+CAM_DataModel* CAM_ModuleObject::dataModel() const
+{
+ return myDataModel;
+}
+
+/*!
+ \brief Set data model.
+ \param dm data model
+*/
+void CAM_ModuleObject::setDataModel( CAM_DataModel* dm )
+{
+ myDataModel = dm;
}
virtual CAM_DataModel* dataModel() const;
};
+class CAM_EXPORT CAM_ModuleObject : public virtual CAM_DataObject
+{
+public:
+ CAM_ModuleObject( SUIT_DataObject* = 0 );
+ CAM_ModuleObject( CAM_DataModel*, SUIT_DataObject* = 0 );
+ virtual ~CAM_ModuleObject();
+
+ virtual QString name() const;
+
+ virtual CAM_DataModel* dataModel() const;
+ virtual void setDataModel( CAM_DataModel* );
+
+private:
+ CAM_DataModel* myDataModel;
+};
+
#endif
#if _MSC_VER > 1000
+++ /dev/null
-// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-//
-// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include "CAM_RootObject.h"
-
-#include "CAM_DataModel.h"
-#include "CAM_Module.h"
-
-/*!
- \class CAM_RootObject
- \brief CAM data model root object.
-
- This class is intended for optimized access to CAM_DataModel instance
- from CAM_DataObject instances.
-
- To take advantage of this class in a specific application,
- custom data model root object class should be derived from both CAM_RootObject
- and application-specific DataObject implementation using virtual inheritance.
-*/
-
-/*!
- \brief Constructor.
- \param parent parent data object
-*/
-CAM_RootObject::CAM_RootObject( SUIT_DataObject* parent )
-: CAM_DataObject( parent ),
- myDataModel( 0 )
-{
-}
-
-/*!
- \brief Constructor.
- \param data data model
- \param parent parent data object
-*/
-CAM_RootObject::CAM_RootObject( CAM_DataModel* data, SUIT_DataObject* parent )
-: CAM_DataObject( parent ),
- myDataModel( data )
-{
-}
-
-/*!
- \brief Destructor.
-
- Does nothing.
-*/
-CAM_RootObject::~CAM_RootObject()
-{
-}
-
-/*!
- \brief Get root object name.
-
- If the data model is set, this method returns module name.
- Otherwise returns empty string.
-
- \return root object name
-*/
-QString CAM_RootObject::name() const
-{
- QString aName = "";
- if (myDataModel)
- aName = myDataModel->module()->moduleName();
- return aName;
-}
-
-/*!
- \brief Get data model.
- \return data model pointer or 0 if it is not set
-*/
-CAM_DataModel* CAM_RootObject::dataModel() const
-{
- return myDataModel;
-}
-
-/*!
- \brief Set data model.
- \param dm data model
-*/
-void CAM_RootObject::setDataModel( CAM_DataModel* dm )
-{
- myDataModel = dm;
-}
+++ /dev/null
-// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-//
-// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef CAM_ROOTOBJECT_H
-#define CAM_ROOTOBJECT_H
-
-#include "CAM_DataObject.h"
-
-class CAM_EXPORT CAM_RootObject : public virtual CAM_DataObject
-{
-public:
- CAM_RootObject( SUIT_DataObject* = 0 );
- CAM_RootObject( CAM_DataModel*, SUIT_DataObject* = 0 );
- virtual ~CAM_RootObject();
-
- virtual QString name() const;
-
- virtual CAM_DataModel* dataModel() const;
- virtual void setDataModel( CAM_DataModel* );
-
-private:
- CAM_DataModel* myDataModel;
-};
-
-#endif
-
-#if _MSC_VER > 1000
-#pragma once
-#endif
#include "CAM_DataModel.h"
#include "CAM_DataObject.h"
-#include "CAM_RootObject.h"
#include "CAM_Module.h"
/*!
if ( !dm )
return true;
- CAM_RootObject* aModelRoot = dynamic_cast<CAM_RootObject*>( dm->root() );
+ CAM_ModuleObject* aModelRoot = dynamic_cast<CAM_ModuleObject*>( dm->root() );
if ( aModelRoot )
aModelRoot->setDataModel( 0 );
CAM_DataModel.h \
CAM_DataObject.h \
CAM_Module.h \
- CAM_Study.h \
- CAM_RootObject.h
+ CAM_Study.h
dist_libCAM_la_SOURCES= \
CAM_Application.cxx \
CAM_DataModel.cxx \
CAM_DataObject.cxx \
CAM_Module.cxx \
- CAM_Study.cxx \
- CAM_RootObject.cxx
+ CAM_Study.cxx
MOC_FILES= \
CAM_Application_moc.cxx \