]> Creatis software - bbtkGEditor.git/blob - lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.h
a5efed17639eecd0d4c009c4709ea55adc2e27f1
[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         // Object ID
100         int getObjectId( );
101         void setObjectId( int id );
102
103         // Status bar message
104         virtual std::string getStatusText( );
105
106         virtual void save( std::string &content );
107
108     private:
109
110         //Private Attributes
111
112         //Private Methods
113
114     protected:
115
116         //Protected Attributes
117
118         double _xInic;
119         double _yInic;
120         double _zInic;
121         double _xFin;
122         double _yFin;
123         double _zFin;
124
125         int _objectId;
126
127         // The type of the graphical objects (See the GlobalConstants.h file)
128         int _gObjectType;
129
130         // The type in BBTK, for boxes for example in a BBS line like (new LoadHola abcd), LoadHola is the type
131         std::string _bbtkType;
132
133         // The name in BBTK, for boxes for example in a BBS line like (new LoadHola abcd), abcd is the name
134         std::string _bbtkName;
135
136         //Protected methods
137
138     };
139
140
141 }
142 // namespace bbtk
143 #endif
144