X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsKernelEditorGraphic%2FGObjectModel.cxx;h=b33bb80e65f94a3350c81ca0cec9b027f57f2838;hb=50851761f4216d932217db8e8fe56dd5aac6b0fb;hp=bcfd60d3b3b2a7429db36b6d7e9175eccdc73316;hpb=c8402dc4438aae412055d54bacf221c1449a83d6;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.cxx b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.cxx index bcfd60d..b33bb80 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.cxx +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.cxx @@ -50,7 +50,6 @@ namespace bbtk _xFin = 0; _yFin = 0; _zFin = 900; - _state = NOTHING_HAPPENS; } //========================================================================= @@ -69,12 +68,20 @@ namespace bbtk void GObjectModel::getFinalPoint(double& x, double& y, double& z) { - x = _xInic+BOX_SIDE; - y = _yInic-BOX_SIDE; + x = _xFin; + y = _yFin; z = _zFin; } //========================================================================= + void GObjectModel::getCenter(double& x, double& y, double& z) + { + x = (_xInic+_xFin)/2; + y = (_yInic+_yFin)/2; + z = (_zInic+_zFin)/2; + } + //========================================================================= + void GObjectModel::setInicPoint(double& x, double& y, double& z) { _xInic = x; @@ -92,16 +99,16 @@ namespace bbtk } //========================================================================= - void GObjectModel::setState(int state) + void GObjectModel::setGObjectType(int gObjectType) { - _state = state; + _gObjectType = gObjectType; } //========================================================================= - int GObjectModel::getState() + int GObjectModel::getGObjectType() { - return _state; + return _gObjectType; } //========================================================================= @@ -109,9 +116,13 @@ namespace bbtk bool GObjectModel::isPointInside(double x,double y, double z)//virtual { if(x>=_xInic && x<=_xFin && y<=_yInic && y>=_yFin) + { return true; + } else + { return false; + } } //========================================================================= @@ -121,6 +132,43 @@ namespace bbtk } //========================================================================= + + void GObjectModel::move(double xx,double yy,double zz)//virtual + { + setInicPoint(xx,yy,zz); + } + + //========================================================================= + + std::string GObjectModel::getBBTKType() + { + return _bbtkType; + } + + //========================================================================= + + void GObjectModel::setBBTKType(std::string obtype) + { + _bbtkType = obtype; + } + + //========================================================================= + + std::string GObjectModel::getBBTKName() + { + return _bbtkName; + } + + //========================================================================= + + void GObjectModel::setBBTKName(std::string obname) + { + _bbtkName = obname; + } + + //========================================================================= + + } // EO namespace bbtk // EOF