]> SALOME platform Git repositories - modules/gui.git/blob - src/CAM/CAM_RootObject.h
Salome HOME
3ab434021a4214a83f38d2a9421dc3e34dd20a46
[modules/gui.git] / src / CAM / CAM_RootObject.h
1 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
2 // 
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either 
6 // version 2.1 of the License.
7 // 
8 // This library is distributed in the hope that it will be useful 
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public  
14 // License along with this library; if not, write to the Free Software 
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/
18 //
19 #ifndef CAM_ROOTOBJECT_H
20 #define CAM_ROOTOBJECT_H
21
22 #include "CAM_DataObject.h"
23
24 /*!
25   CAM_RootObject - class intended for optimized access to CAM_DataModel instance
26   from CAM_DataObject instances.
27
28   To take advantage of this class in a specific application, 
29   custom data model root object class should be derived from both CAM_RootObject
30   and application-specific DataObject implementation using virtual inheritance.
31  */
32 class CAM_EXPORT CAM_RootObject : public virtual CAM_DataObject
33 {
34 public:
35   CAM_RootObject( SUIT_DataObject* = 0 );
36   CAM_RootObject( CAM_DataModel*, SUIT_DataObject* = 0 );
37   virtual ~CAM_RootObject();
38
39   virtual QString        name() const;
40
41   virtual CAM_DataModel* dataModel() const;
42   virtual void           setDataModel( CAM_DataModel* );
43
44 private:
45   CAM_DataModel*         myDataModel; 
46 };
47
48 #endif
49
50 #if _MSC_VER > 1000
51 #pragma once
52 #endif