]> Creatis software - bbtkGEditor.git/blob - lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.h
bfebe6b05a96e4f29a62b4a484ee0899f4fe3343
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsKernelEditorGraphic / GObjectModel.h
1 /*=========================================================================                                                                               
2 Program:   bbtk
3 Module:    $RCSfile$
4 Language:  C++
5 Date:      $Date$
6 Version:   $Revision$
7 =========================================================================*/
8
9 /* ---------------------------------------------------------------------
10
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
13 *
14 *  This software is governed by the CeCILL-B license under French law and 
15 *  abiding by the rules of distribution of free software. You can  use, 
16 *  modify and/ or redistribute the software under the terms of the CeCILL-B 
17 *  license as circulated by CEA, CNRS and INRIA at the following URL 
18 *  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
19 *  or in the file LICENSE.txt.
20 *
21 *  As a counterpart to the access to the source code and  rights to copy,
22 *  modify and redistribute granted by the license, users are provided only
23 *  with a limited warranty  and the software's author,  the holder of the
24 *  economic rights,  and the successive licensors  have only  limited
25 *  liability. 
26 *
27 *  The fact that you are presently reading this means that you have had
28 *  knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */                                                                         
30
31
32
33 /**
34 *  \file 
35 *  \brief Class bbtk::GObjectModel : abstract black-box interface. 
36 */
37
38 /****
39 * Design and Developpement of BBTK GEditor
40 * Ricardo A Corredor J <ra.corredor67@uniandes.edu.co>
41 * RaC - 2010
42 ****/
43
44 #ifndef __GObjectModel_h__
45 #define __GObjectModel_h__
46
47 //Includes same project
48 #include "GlobalConstants.h"
49 #include "Observable.h"
50
51 //Includes creaMaracasVisu
52
53 //Includes std
54 #include <iostream>
55
56 //Includes bbtk
57 #include <bbtkBlackBoxDescriptor.h>
58
59 namespace bbtk
60 {
61
62         class GObjectModel : public Observable
63         {
64
65         public: 
66
67                 //Constructors
68                 GObjectModel();
69                 ~GObjectModel();
70                 
71                 //Public methods
72                 
73                 // Method to get the values of Inic or Final point passed as references in the parameters
74                 void getInicPoint(double& x, double& y, double& z);
75                 void getFinalPoint(double& x, double& y, double& z);
76
77                 // Returns the center of the enclosing rectangle
78                 void getCenter(double& x, double& y, double& z);
79
80                 // Method to set the values of Inic or Final point 
81                 virtual void setInicPoint(double& x, double& y, double& z);
82                 virtual void setFinalPoint(double& x, double& y, double& z);
83                 
84                 // Changes the inic(top-left point) point of the rectangle
85                 virtual void move(double xx,double yy,double zz);
86
87                 // Returns true if (x,y,z) is inside the rectangle 
88                 virtual bool isPointInside(double x,double y, double z);
89
90                 // Get the type of the graphical objects (See the GlobalConstants.h file)
91                 int getGObjectType();
92                 void setGObjectType(int obtype);
93
94                 // The type in BBTK, for boxes for example in a BBS line like (new LoadHola abcd), LoadHola is the type
95                 std::string getBBTKType();
96                 void setBBTKType(std::string obtype);
97
98                 // The name in BBTK, for boxes for example in a BBS line like (new LoadHola abcd), abcd is the name
99                 std::string getBBTKName();
100                 void setBBTKName(std::string obname);
101
102                 // Object ID
103                 int getObjectId();
104                 void setObjectId(int id);
105
106                 // Status bar message
107                 virtual std::string getStatusText();
108
109                 virtual void save(std::string &content);
110                 
111         private:
112
113                 //Private Attributes
114
115                 //Private Methods
116
117         protected:
118                 
119                 //Protected Attributes
120                 
121                 double _xInic;
122                 double _yInic;
123                 double _zInic;
124                 double _xFin;
125                 double _yFin;
126                 double _zFin;
127
128                 int _objectId;
129
130                 // The type of the graphical objects (See the GlobalConstants.h file)
131                 int  _gObjectType;
132
133                 // The type in BBTK, for boxes for example in a BBS line like (new LoadHola abcd), LoadHola is the type
134                 std::string _bbtkType;
135
136                 // The name in BBTK, for boxes for example in a BBS line like (new LoadHola abcd), abcd is the name
137                 std::string _bbtkName;
138
139                 //Protected methods
140                 
141         };
142
143
144 }
145 // namespace bbtk
146 #endif
147