00001 /*========================================================================= 00002 Program: bbtk 00003 Module: $RCSfile: GObjectModel.cxx,v $ 00004 Language: C++ 00005 Date: $Date: 2010/05/17 14:44:24 $ 00006 Version: $Revision: 1.14 $ 00007 =========================================================================*/ 00008 00009 /* --------------------------------------------------------------------- 00010 00011 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) 00012 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux 00013 * 00014 * This software is governed by the CeCILL-B license under French law and 00015 * abiding by the rules of distribution of free software. You can use, 00016 * modify and/ or redistribute the software under the terms of the CeCILL-B 00017 * license as circulated by CEA, CNRS and INRIA at the following URL 00018 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 00019 * or in the file LICENSE.txt. 00020 * 00021 * As a counterpart to the access to the source code and rights to copy, 00022 * modify and redistribute granted by the license, users are provided only 00023 * with a limited warranty and the software's author, the holder of the 00024 * economic rights, and the successive licensors have only limited 00025 * liability. 00026 * 00027 * The fact that you are presently reading this means that you have had 00028 * knowledge of the CeCILL-B license and that you accept its terms. 00029 * ------------------------------------------------------------------------ */ 00030 00037 #include "GObjectModel.h" 00038 00039 namespace bbtk 00040 { 00041 00042 00043 //========================================================================= 00044 GObjectModel::GObjectModel() 00045 { 00046 00047 _xInic = 0; 00048 _yInic = 0; 00049 _zInic = 900; 00050 _xFin = 0; 00051 _yFin = 0; 00052 _zFin = 900; 00053 } 00054 00055 //========================================================================= 00056 GObjectModel::~GObjectModel() 00057 { 00058 } 00059 //========================================================================= 00060 00061 void GObjectModel::getInicPoint(double& x, double& y, double& z) 00062 { 00063 x = _xInic; 00064 y = _yInic; 00065 z = _zInic; 00066 } 00067 //========================================================================= 00068 00069 void GObjectModel::getFinalPoint(double& x, double& y, double& z) 00070 { 00071 x = _xFin; 00072 y = _yFin; 00073 z = _zFin; 00074 } 00075 //========================================================================= 00076 00077 void GObjectModel::getCenter(double& x, double& y, double& z) 00078 { 00079 x = (_xInic+_xFin)/2; 00080 y = (_yInic+_yFin)/2; 00081 z = (_zInic+_zFin)/2; 00082 } 00083 //========================================================================= 00084 00085 void GObjectModel::setInicPoint(double& x, double& y, double& z) 00086 { 00087 _xInic = x; 00088 _yInic = y; 00089 _zInic = z; 00090 00091 } 00092 //========================================================================= 00093 00094 void GObjectModel::setFinalPoint(double& x, double& y, double& z) 00095 { 00096 _xFin = x; 00097 _yFin = y; 00098 _zFin = z; 00099 } 00100 //========================================================================= 00101 00102 void GObjectModel::setGObjectType(int gObjectType) 00103 { 00104 _gObjectType = gObjectType; 00105 } 00106 00107 //========================================================================= 00108 00109 int GObjectModel::getGObjectType() 00110 { 00111 return _gObjectType; 00112 } 00113 00114 //========================================================================= 00115 00116 bool GObjectModel::isPointInside(double x,double y, double z)//virtual 00117 { 00118 if(x>=_xInic && x<=_xFin && y<=_yInic && y>=_yFin) 00119 { 00120 return true; 00121 } 00122 else 00123 { 00124 return false; 00125 } 00126 } 00127 00128 //========================================================================= 00129 00130 void GObjectModel::move(double xx,double yy,double zz)//virtual 00131 { 00132 setInicPoint(xx,yy,zz); 00133 } 00134 00135 //========================================================================= 00136 00137 std::string GObjectModel::getBBTKType() 00138 { 00139 return _bbtkType; 00140 } 00141 00142 //========================================================================= 00143 00144 void GObjectModel::setBBTKType(std::string obtype) 00145 { 00146 _bbtkType = obtype; 00147 } 00148 00149 //========================================================================= 00150 00151 std::string GObjectModel::getBBTKName() 00152 { 00153 return _bbtkName; 00154 } 00155 00156 //========================================================================= 00157 00158 void GObjectModel::setBBTKName(std::string obname) 00159 { 00160 _bbtkName = obname; 00161 } 00162 00163 //========================================================================= 00164 00165 std::string GObjectModel::getStatusText()//virtual 00166 { 00167 std::string virt = ""; 00168 return virt; 00169 } 00170 00171 //========================================================================= 00172 00173 int GObjectModel::getObjectId() 00174 { 00175 return _objectId; 00176 } 00177 00178 //========================================================================= 00179 00180 void GObjectModel::setObjectId(int id) 00181 { 00182 _objectId=id; 00183 } 00184 00185 //========================================================================= 00186 00187 void GObjectModel::save(std::string &content) 00188 { 00189 //virtual 00190 } 00191 00192 //========================================================================= 00193 00194 } // EO namespace bbtk 00195 00196 // EOF 00197