]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourBaseControler.cpp
comparison with string literal results in unspecified behaviour
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / manualContour / manualContourBaseControler.cpp
index 519061ddd9f204766b38d6d4e774367228b40e3c..a2e67a0d9cac1cbd0fb686de2cb4396bb7e9f5a5 100644 (file)
@@ -156,6 +156,7 @@ bool manualContourBaseControler::OnMouseMove()
 // ----------------------------------------------------------------------------
 bool manualContourBaseControler::OnLeftButtonDown()
 {
+       printf("EED %p manualContourBaseControler::OnLeftButtonDown \n",this);
        SetKeyBoardMoving( false );
        if ( _vtkInteractorStyleBaseView!=NULL )
        {
@@ -171,6 +172,7 @@ bool manualContourBaseControler::OnLeftButtonDown()
 // ----------------------------------------------------------------------------
 bool manualContourBaseControler::OnLeftButtonUp()
 {
+       printf("EED %p manualContourBaseControler::OnLeftButtonUp \n",this);
        if ( _vtkInteractorStyleBaseView!=NULL )
        {
                int X,Y;
@@ -184,6 +186,7 @@ bool manualContourBaseControler::OnLeftButtonUp()
 // ----------------------------------------------------------------------------
 bool manualContourBaseControler::OnLeftDClick()
 {
+       printf("EED %p manualContourBaseControler::OnLeftDClick \n",this);
        if ( _vtkInteractorStyleBaseView!=NULL )
        {
                int X,Y;
@@ -217,6 +220,7 @@ bool manualContourBaseControler::OnMiddleButtonUp()
 // ----------------------------------------------------------------------------
 bool manualContourBaseControler::OnRightButtonDown()
 {
+       printf("EED %p manualContourBaseControler::OnRightButtonDown \n",this);
        if( _vtkInteractorStyleBaseView!= NULL )
        {
                int X,Y;
@@ -226,6 +230,7 @@ bool manualContourBaseControler::OnRightButtonDown()
 
                SetCompleteCreation( true );
                SetKeyBoardMoving( false );
+               this->GetManualContourModel()->SetCloseContour(true);
                MouseClickRight(X,Y);
        }
        return true;
@@ -233,16 +238,17 @@ bool manualContourBaseControler::OnRightButtonDown()
 // ----------------------------------------------------------------------------
 bool manualContourBaseControler::OnRightButtonUp()
 {
+       printf("EED %p manualContourBaseControler::OnRightButtonUp \n",this);
        return true;
 }
 // ----------------------------------------------------------------------------
-void manualContourBaseControler::SetModelView(manualContourModel *manContModel, manualViewBaseContour *manViewBaseCont){
+void manualContourBaseControler::SetModelView(manualBaseModel *manContModel, manualViewBaseContour *manViewBaseCont){
        _manContModel           =       manContModel;
        _manViewBaseCont        =       manViewBaseCont;
        _manViewBaseCont->SetEditable( &_editable );
 }
 // ----------------------------------------------------------------------------
-manualContourModel* manualContourBaseControler::GetManualContourModel()
+manualBaseModel* manualContourBaseControler::GetManualContourModel()
 {
        return _manContModel;
 }
@@ -288,10 +294,13 @@ void manualContourBaseControler::MouseDLeft(int x, int y )
 {
        if (_state==0)
        {
+               
                int z=GetZ();
-               GetManualViewBaseContour()->SelectPosibleContour(x,y,z);
-               GetManualViewBaseContour()->SelectPosiblePoint(x,y,z);
-               if ( GetManualViewBaseContour()->GetPosibleSelected() )
+               bool temp = _manViewBaseCont->SelectPosibleContour(x,y,z);
+
+               _manViewBaseCont->SelectPosiblePoint(x,y,z);
+
+               if ( _manViewBaseCont->GetPosibleSelected() )
                {
                        _editable = true;
                }
@@ -422,7 +431,7 @@ void manualContourBaseControler::Magnet(int x, int y)
                        double  xx      = x;
                        double  yy      = y;
                        double  zz      = GetZ();
-                       GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz);
+                       GetManualViewBaseContour()->TransfromCoordViewWorld(xx,yy,zz);
                        int                     id      = GetManualContourModel()->GetIdPoint(xx,yy,zz,32000,-1);
                        if (id!=-1)
                        {
@@ -452,7 +461,9 @@ void manualContourBaseControler::AddPoint(int x, int y, int z) // virtual
                double  xx      = x;
                double  yy      = y;
                double  zz      = z;
-               GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz);
+               
+
+               GetManualViewBaseContour()->TransfromCoordViewWorld(xx,yy,zz);
                /*int   id              =*/  GetManualContourModel()->AddPoint(xx,yy,zz);  // JPRx
                GetManualViewBaseContour()->AddPoint();
 //             GetManualViewBaseContour()->UpdateViewPoint(id);
@@ -467,7 +478,7 @@ void manualContourBaseControler::InsertPoint(int x,int y,int z)  // virtual
                double                          xx              = x;
                double                          yy              = y;
                double                          zz              = z;
-               GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz);
+               GetManualViewBaseContour()->TransfromCoordViewWorld(xx,yy,zz);
                if (GetManualContourModel()->GetSizeLstPoints()>1){
                        id = GetManualContourModel()->InsertPoint(xx,yy,zz);
                        GetManualViewBaseContour()->InsertPoint(id);
@@ -487,7 +498,8 @@ void manualContourBaseControler::SetPoint( int id ,int x , int y , int z){ // vi
                double xx = x;
                double yy = y;
                double zz = z;
-               GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz);
+
+               GetManualViewBaseContour()->TransfromCoordViewWorld(xx,yy,zz);
                manualPoint             *mp             = _manContModel->GetManualPoint(id);
                mp->SetPoint(xx,yy,zz);
                GetManualViewBaseContour()->UpdateViewPoint(id);
@@ -499,7 +511,7 @@ void manualContourBaseControler::SetPointX( int id ,int x  ){
                double xx = x;
                double yy = 0;
                double zz = 0;
-               GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz);
+               GetManualViewBaseContour()->TransfromCoordViewWorld(xx,yy,zz);
                manualPoint             *mp             = _manContModel->GetManualPoint(id);
                mp->SetPointX(xx);
                GetManualViewBaseContour()->UpdateViewPoint(id);
@@ -511,7 +523,7 @@ void manualContourBaseControler::SetPointY( int id ,int y  ){
                double xx = 0;
                double yy = y;
                double zz = 0;
-               GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz);
+               GetManualViewBaseContour()->TransfromCoordViewWorld(xx,yy,zz);
                manualPoint             *mp             = _manContModel->GetManualPoint(id);
                mp->SetPointY(yy);
                GetManualViewBaseContour()->UpdateViewPoint(id);
@@ -523,7 +535,7 @@ void manualContourBaseControler::SetPointZ( int id ,int z  ){
                double xx = 0;
                double yy = 0;
                double zz = z;
-               GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz);
+               GetManualViewBaseContour()->TransfromCoordViewWorld(xx,yy,zz);
                manualPoint             *mp             = _manContModel->GetManualPoint(id);
                mp->SetPointZ(zz);
                GetManualViewBaseContour()->UpdateViewPoint(id);