]> Creatis software - bbtkGEditor.git/blob - lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.cxx
The actual version updates the status bar with the highlighted object ... Also it...
[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         }
54
55         //=========================================================================
56         GObjectModel::~GObjectModel()
57         {
58         }
59         //=========================================================================
60
61         void GObjectModel::getInicPoint(double& x, double& y, double& z)
62         {
63                 x = _xInic;
64                 y = _yInic;
65                 z = _zInic;
66         }
67         //=========================================================================
68
69         void GObjectModel::getFinalPoint(double& x, double& y, double& z)
70         {
71                 x = _xFin;
72                 y = _yFin;
73                 z = _zFin;
74         }
75         //=========================================================================
76
77         void GObjectModel::getCenter(double& x, double& y, double& z)
78         {
79                 x = (_xInic+_xFin)/2;
80                 y = (_yInic+_yFin)/2;
81                 z = (_zInic+_zFin)/2;
82         }
83         //=========================================================================
84
85         void GObjectModel::setInicPoint(double& x, double& y, double& z)
86         {
87                 _xInic = x;
88                 _yInic = y;
89                 _zInic = z;
90                 
91         }
92         //=========================================================================
93
94         void GObjectModel::setFinalPoint(double& x, double& y, double& z)
95         {
96                 _xFin = x;
97                 _yFin = y;
98                 _zFin = z;
99         }
100         //=========================================================================
101
102         void GObjectModel::setGObjectType(int gObjectType)
103         {
104                 _gObjectType = gObjectType;
105         }
106
107         //=========================================================================
108
109         int GObjectModel::getGObjectType()
110         {
111                 return _gObjectType;
112         }
113
114         //=========================================================================
115
116         bool GObjectModel::isPointInside(double x,double y, double z)//virtual
117         {
118                 if(x>=_xInic && x<=_xFin && y<=_yInic && y>=_yFin)
119                 {
120                         return true;
121                 }
122                 else
123                 {
124                         return false;
125                 }
126         }
127
128         //=========================================================================
129
130         void GObjectModel::updateBlackBox(BlackBoxDescriptor::Pointer descriptor)//virtual
131         {
132         }
133
134         //=========================================================================
135
136         void GObjectModel::move(double xx,double yy,double zz)//virtual
137         {
138                 setInicPoint(xx,yy,zz);
139         }
140
141         //=========================================================================
142
143         std::string GObjectModel::getBBTKType()
144         {
145                 return _bbtkType; 
146         }
147
148         //=========================================================================
149
150         void GObjectModel::setBBTKType(std::string obtype)
151         {
152                 _bbtkType = obtype;
153         }
154
155         //=========================================================================
156                 
157         std::string GObjectModel::getBBTKName()
158         {
159                 return _bbtkName;
160         }
161
162         //=========================================================================
163
164         void GObjectModel::setBBTKName(std::string obname)
165         {
166                 _bbtkName = obname;
167         }
168
169         //=========================================================================
170
171         std::string GObjectModel::getStatusText()//virtual
172         {
173                 std::string virt = "";
174                 return virt;
175         }
176
177         //=========================================================================
178
179
180 }  // EO namespace bbtk
181
182 // EOF
183