]> Creatis software - bbtkGEditor.git/blob - lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.cxx
Move box and refresh position ... ports don't refresh automatically their position...
[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::setInicPoint(double& x, double& y, double& z)
79         {
80                 _xInic = x;
81                 _yInic = y;
82                 _zInic = z;
83                 
84         }
85         //=========================================================================
86
87         void GObjectModel::setFinalPoint(double& x, double& y, double& z)
88         {
89                 _xFin = x;
90                 _yFin = y;
91                 _zFin = z;
92         }
93         //=========================================================================
94
95         void GObjectModel::setState(int state)
96         {
97                 _state = state;
98         }
99
100         //=========================================================================
101
102         int GObjectModel::getState()
103         {
104                 return _state;
105         }
106
107         //=========================================================================
108
109         void GObjectModel::setGObjectType(int gObjectType)
110         {
111                 _gObjectType = gObjectType;
112         }
113
114         //=========================================================================
115
116         int GObjectModel::getGObjectType()
117         {
118                 return _gObjectType;
119         }
120
121         //=========================================================================
122
123         bool GObjectModel::isPointInside(double x,double y, double z)//virtual
124         {
125                 if(x>=_xInic && x<=_xFin && y<=_yInic && y>=_yFin)
126                 {
127                         return true;
128                 }
129                 else
130                 {
131                         return false;
132                 }
133         }
134
135         //=========================================================================
136
137         void GObjectModel::updateBlackBox(BlackBoxDescriptor::Pointer descriptor)//virtual
138         {
139         }
140
141         //=========================================================================
142
143         void GObjectModel::move(double xx,double yy,double zz)//virtual
144         {
145                 setInicPoint(xx,yy,zz);
146         }
147
148         //=========================================================================
149
150 }  // EO namespace bbtk
151
152 // EOF
153