]> Creatis software - bbtkGEditor.git/blob - lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.h
9904c583bbcbed5b97109008a22c341604fb4a80
[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     class GObjectModel : public Observable {
62     public:
63
64         //Constructors
65         GObjectModel( );
66         ~ GObjectModel( );
67
68         //Public methods
69
70         // Method to get the values of Inic or Final point passed as references in the parameters
71         void getInicPoint( double& x, double& y, double& z );
72         void getFinalPoint( double& x, double& y, double& z );
73
74         // Returns the center of the enclosing rectangle
75         void getCenter( double& x, double& y, double& z );
76
77         // Method to set the values of Inic or Final point 
78         virtual void setInicPoint( double& x, double& y, double& z );
79         virtual void setFinalPoint( double& x, double& y, double& z );
80
81         // Changes the inic(top-left point) point of the rectangle
82         virtual void move( double xx, double yy, double zz );
83
84         // Returns true if (x,y,z) is inside the rectangle 
85         virtual bool isPointInside( double x, double y, double z );
86
87         // Get the type of the graphical objects (See the GlobalConstants.h file)
88         int getGObjectType( );
89         void setGObjectType( int obtype );
90
91         // The type in BBTK, for boxes for example in a BBS line like (new LoadHola abcd), LoadHola is the type
92         std::string getBBTKType( );
93         void setBBTKType( std::string obtype );
94
95         // The name in BBTK, for boxes for example in a BBS line like (new LoadHola abcd), abcd is the name
96         std::string getBBTKName( );
97         void setBBTKName( std::string obname );
98
99         // The description in BBTK, for boxes 
100         std::string getBBTKDescription( );
101         void setBBTKDescription( std::string obdescription );
102                 
103                 
104         // Object ID
105         int getObjectId( );
106         void setObjectId( int id );
107
108         // Status bar message
109         virtual std::string getStatusText( );
110
111         virtual void save( std::string &content );
112
113     private:
114
115         //Private Attributes
116
117         //Private Methods
118
119     protected:
120
121         //Protected Attributes
122
123         double _xInic;
124         double _yInic;
125         double _zInic;
126         double _xFin;
127         double _yFin;
128         double _zFin;
129
130         int _objectId;
131
132         // The type of the graphical objects (See the GlobalConstants.h file)
133         int _gObjectType;
134
135         // The type in BBTK, for boxes for example in a BBS line like (new LoadHola abcd), LoadHola is the type
136         std::string _bbtkType;
137
138         // The name in BBTK, for boxes for example in a BBS line like (new LoadHola abcd), abcd is the name
139         std::string _bbtkName;
140                 
141         // The description in BBTK, for boxes 
142         std::string _bbtkDescription;
143
144         //Protected methods
145
146     };
147
148
149 }
150 // namespace bbtk
151 #endif
152