]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourBaseControler.cpp
no message
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / manualContour / manualContourBaseControler.cpp
index 519061ddd9f204766b38d6d4e774367228b40e3c..c32d56913c1839f8e747963fc927590d0d289c1b 100644 (file)
@@ -224,8 +224,6 @@ bool manualContourBaseControler::OnRightButtonDown()
                wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
                wxVTKiren->GetEventPosition(X, Y);
 
-               SetCompleteCreation( true );
-               SetKeyBoardMoving( false );
                MouseClickRight(X,Y);
        }
        return true;
@@ -236,13 +234,13 @@ bool manualContourBaseControler::OnRightButtonUp()
        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;
 }
@@ -259,6 +257,10 @@ void manualContourBaseControler::MouseClickLeft(int x, int y) // virtual
 // ----------------------------------------------------------------------------
 void manualContourBaseControler::MouseClickRight(int x, int y)
 {
+       SetCompleteCreation( true );
+       SetKeyBoardMoving( false );
+       this->GetManualContourModel()->SetCloseContour(true);
+
 //     if (_state==1)
 //     {
 //             _state=0;
@@ -288,10 +290,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 +427,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,8 +457,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);
-               /*int   id              =*/  GetManualContourModel()->AddPoint(xx,yy,zz);  // JPRx
+               
+               GetManualViewBaseContour()->TransfromCoordViewWorld(xx,yy,zz);
+               GetManualContourModel()->AddPoint(xx,yy,zz);
                GetManualViewBaseContour()->AddPoint();
 //             GetManualViewBaseContour()->UpdateViewPoint(id);
        }
@@ -467,7 +473,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 +493,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 +506,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 +518,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 +530,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);