]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.cxx
v1.1.0 Feature 1407
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsKernelEditorGraphic / GObjectModel.cxx
index bcfd60d3b3b2a7429db36b6d7e9175eccdc73316..1ab4ad3a1d70a3f9b3ca84b884e4f772ff2d3576 100644 (file)
@@ -46,11 +46,10 @@ namespace bbtk
 
                _xInic = 0;
                _yInic = 0;
-               _zInic = 900;
+               _zInic = GPOSITION_Z;
                _xFin = 0;
                _yFin = 0;
-               _zFin = 900;
-               _state = NOTHING_HAPPENS;
+               _zFin = GPOSITION_Z;
        }
 
        //=========================================================================
@@ -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,18 +116,95 @@ 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;
+               }
        }
 
        //=========================================================================
 
-       void GObjectModel::updateBlackBox(BlackBoxDescriptor::Pointer descriptor)//virtual
+       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;
+       }
+
+       //=========================================================================
+       
+       std::string GObjectModel::getBBTKDescription()
+       {
+               return _bbtkDescription;
+       }
+       
+       //=========================================================================
+       
+       void GObjectModel::setBBTKDescription(std::string obdescription)
+       {
+               _bbtkDescription = obdescription;
+       }
+       
+       //=========================================================================
+
+       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
 
 // EOF