]> Creatis software - bbtkGEditor.git/blob - lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.cxx
Necessary changes to manage the basic action . First prototype totally completed...
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsKernelEditorGraphic / GObjectModel.cxx
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 *  \file 
33 *  \brief Class bbtk::GObjectModel 
34 */
35
36
37 #include "GObjectModel.h"
38
39 namespace bbtk
40 {
41
42
43         //=========================================================================
44         GObjectModel::GObjectModel()
45         {
46
47                 _xInic = 0;
48                 _yInic = 0;
49                 _zInic = 900;
50                 _xFin = 0;
51                 _yFin = 0;
52                 _zFin = 900;
53                 _state = NOTHING_HAPPENS;
54         }
55
56         //=========================================================================
57         GObjectModel::~GObjectModel()
58         {
59         }
60         //=========================================================================
61
62         void GObjectModel::getInicPoint(double& x, double& y, double& z)
63         {
64                 x = _xInic;
65                 y = _yInic;
66                 z = _zInic;
67         }
68         //=========================================================================
69
70         void GObjectModel::getFinalPoint(double& x, double& y, double& z)
71         {
72                 x = _xFin;
73                 y = _yFin;
74                 z = _zFin;
75         }
76         //=========================================================================
77
78         void GObjectModel::getCenter(double& x, double& y, double& z)
79         {
80                 x = (_xInic+_xFin)/2;
81                 y = (_yInic+_yFin)/2;
82                 z = (_zInic+_zFin)/2;
83         }
84         //=========================================================================
85
86         void GObjectModel::setInicPoint(double& x, double& y, double& z)
87         {
88                 _xInic = x;
89                 _yInic = y;
90                 _zInic = z;
91                 
92         }
93         //=========================================================================
94
95         void GObjectModel::setFinalPoint(double& x, double& y, double& z)
96         {
97                 _xFin = x;
98                 _yFin = y;
99                 _zFin = z;
100         }
101         //=========================================================================
102
103         void GObjectModel::setState(int state)
104         {
105                 _state = state;
106         }
107
108         //=========================================================================
109
110         int GObjectModel::getState()
111         {
112                 return _state;
113         }
114
115         //=========================================================================
116
117         void GObjectModel::setGObjectType(int gObjectType)
118         {
119                 _gObjectType = gObjectType;
120         }
121
122         //=========================================================================
123
124         int GObjectModel::getGObjectType()
125         {
126                 return _gObjectType;
127         }
128
129         //=========================================================================
130
131         bool GObjectModel::isPointInside(double x,double y, double z)//virtual
132         {
133                 if(x>=_xInic && x<=_xFin && y<=_yInic && y>=_yFin)
134                 {
135                         return true;
136                 }
137                 else
138                 {
139                         return false;
140                 }
141         }
142
143         //=========================================================================
144
145         void GObjectModel::updateBlackBox(BlackBoxDescriptor::Pointer descriptor)//virtual
146         {
147         }
148
149         //=========================================================================
150
151         void GObjectModel::move(double xx,double yy,double zz)//virtual
152         {
153                 setInicPoint(xx,yy,zz);
154         }
155
156         //=========================================================================
157
158         std::string GObjectModel::getBBTKType()
159         {
160                 return _bbtkType; 
161         }
162
163         //=========================================================================
164
165         void GObjectModel::setBBTKType(std::string obtype)
166         {
167                 _bbtkType = obtype;
168         }
169
170         //=========================================================================
171                 
172         std::string GObjectModel::getBBTKName()
173         {
174                 return _bbtkName;
175         }
176
177         //=========================================================================
178
179         void GObjectModel::setBBTKName(std::string obname)
180         {
181                 _bbtkName = obname;
182         }
183
184         //=========================================================================
185
186 }  // EO namespace bbtk
187
188 // EOF
189