X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2FEditorGraphicBBS%2FbbsKernelEditorGraphic%2FGObjectModel.cxx;h=41148af3db9acf02bf04752c096cc48da3e8fb31;hb=61a38c679e47c9f102d2834c835c3c6eac487a9b;hp=4ab7fbf4647d3f12b99a463d013e7534bd7bc6af;hpb=098558ac7780900858114a8ae01fe93847d67043;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.cxx b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.cxx index 4ab7fbf..41148af 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,51 +99,96 @@ 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; } //========================================================================= - void GObjectModel::setGObjectType(int gObjectType) + bool GObjectModel::isPointInside(double x,double y, double z)//virtual { - _gObjectType = gObjectType; + if(x>=_xInic && x<=_xFin && y<=_yInic && y>=_yFin) + { + return true; + } + else + { + return false; + } } //========================================================================= - int GObjectModel::getGObjectType() + void GObjectModel::move(double xx,double yy,double zz)//virtual { - return _gObjectType; + setInicPoint(xx,yy,zz); } //========================================================================= - bool GObjectModel::isPointInside(double x,double y, double z)//virtual + std::string GObjectModel::getBBTKType() { - if(x>=_xInic && x<=_xFin && y<=_yInic && y>=_yFin) - return true; - else - return false; + return _bbtkType; } //========================================================================= - void GObjectModel::updateBlackBox(BlackBoxDescriptor::Pointer descriptor)//virtual + void GObjectModel::setBBTKType(std::string obtype) { + _bbtkType = obtype; } //========================================================================= + + std::string GObjectModel::getBBTKName() + { + return _bbtkName; + } + + //========================================================================= + + void GObjectModel::setBBTKName(std::string obname) + { + _bbtkName = obname; + } + //========================================================================= + + std::string GObjectModel::getStatusText()//virtual + { + std::string virt = ""; + return virt; + } + + //========================================================================= + int GObjectModel::getObjectId() + { + return _objectId; + } + + //========================================================================= + + void GObjectModel::setObjectId(int id) + { + _objectId=id; + } + + //========================================================================= + + void GObjectModel::save(std::string &content) + { + //virtual + } + //========================================================================= } // EO namespace bbtk