]> Creatis software - bbtkGEditor.git/blob - lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.cxx
386663f75b2f3b04e3e3ad05f3f03e9b5c958111
[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 = GPOSITION_Z;
50                 _xFin = 0;
51                 _yFin = 0;
52                 _zFin = GPOSITION_Z;
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::move(double xx,double yy,double zz)//virtual
131         {
132                 setInicPoint(xx,yy,zz);
133         }
134
135         //=========================================================================
136
137         std::string GObjectModel::getBBTKType()
138         {
139                 return _bbtkType; 
140         }
141
142         //=========================================================================
143
144         void GObjectModel::setBBTKType(std::string obtype)
145         {
146                 _bbtkType = obtype;
147         }
148
149         //=========================================================================
150                 
151         std::string GObjectModel::getBBTKName()
152         {
153                 return _bbtkName;
154         }
155
156         //=========================================================================
157
158         void GObjectModel::setBBTKName(std::string obname)
159         {
160                 _bbtkName = obname;
161         }
162
163         //=========================================================================
164
165         std::string GObjectModel::getStatusText()//virtual
166         {
167                 std::string virt = "";
168                 return virt;
169         }
170
171         //=========================================================================
172
173         int GObjectModel::getObjectId()
174         {
175                 return _objectId;
176         }
177
178         //=========================================================================
179         
180         void GObjectModel::setObjectId(int id)
181         {
182                 _objectId=id;
183         }
184
185         //=========================================================================
186
187         void GObjectModel::save(std::string &content)
188         {
189                 //virtual
190         }
191         
192         //=========================================================================
193
194 }  // EO namespace bbtk
195
196 // EOF
197