]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/manualContour.cpp
BUG histogram
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / manualContour.cpp
index 987cfa56b6cd4076efea38b5fa1b82922b1a44af..af53c28d5423b09f7d35251b4315d741e82f71e7 100644 (file)
@@ -610,6 +610,10 @@ manualContourModel::~manualContourModel()
        }
        _lstPoints.clear();
 
+       _cntSplineX->RemoveAllPoints();
+       _cntSplineY->RemoveAllPoints();
+       _cntSplineZ->RemoveAllPoints();
+       
        _cntSplineX->Delete();
        _cntSplineY->Delete();
        _cntSplineZ->Delete();
@@ -1315,15 +1319,16 @@ vtkActor* manualViewPoint::CreateVtkPointActor()
 
        _pts = vtkPoints::New();
        _pts->SetNumberOfPoints(8);
+
        _pts->SetPoint(0, -1000 , -1000 , 0 );
-       _pts->SetPoint(1,  1000 , -1000 , 0     );
+       _pts->SetPoint(1,  1000 , -1000 , 0 );
        _pts->SetPoint(2,  1000 ,  1000 , 0 );
        _pts->SetPoint(3, -1000 ,  1000 , 0 );
        _pts->SetPoint(4, -1000 ,  1000 , 0 );
        _pts->SetPoint(5, -1000 ,  1000 , 0 );
        _pts->SetPoint(6, -1000 ,  1000 , 0 );
        _pts->SetPoint(7, -1000 ,  1000 , 0 );
-
+       
        vtkCellArray *lines = vtkCellArray::New();
        lines->InsertNextCell(17);
        lines->InsertCellPoint(0);
@@ -1347,17 +1352,17 @@ vtkActor* manualViewPoint::CreateVtkPointActor()
        _pd = vtkPolyData::New();
        _pd->SetPoints( _pts );
        _pd->SetLines( lines );
-       lines->Delete();  //do not delete lines ??
+//     lines->Delete();  //do not delete lines ??
 
        _pointVtkActor  =       vtkActor::New();
     _bboxMapper                =       vtkPolyDataMapper::New();
 
        _bboxMapper->SetInput(_pd);
-       _bboxMapper->ImmediateModeRenderingOn();
+//     _bboxMapper->ImmediateModeRenderingOn();
        _pointVtkActor->SetMapper(_bboxMapper);
-       _pointVtkActor->GetProperty()->BackfaceCullingOn();
+//     _pointVtkActor->GetProperty()->BackfaceCullingOn();
        UpdateColorActor();
-       _pd->ComputeBounds();
+//     _pd->ComputeBounds();
 
        return _pointVtkActor;
 }
@@ -1524,7 +1529,6 @@ void manualViewContour::RefreshContour() // virtual
 // ----------------------------------------------------------------------------
 void manualViewContour::RefreshText()  // virtual
 {
-
        if ((_textActor!=NULL) && ( _textActor->GetProperty()->GetOpacity()!=0 )){
                int size = GetNumberOfPoints();
                char text[50];
@@ -1554,7 +1558,7 @@ void manualViewContour::RefreshText()  // virtual
                }
 
                _textActor->SetInput(resultText);
-
+               
                if (size>=1){
 
                        int i;
@@ -2895,7 +2899,7 @@ void manualViewBaseContour::ConstructVTKObjects()
        //      Text
        _textActor = vtkTextActor::New();
 //     _textActor->SetDisplayPosition(200, 200);
-       _textActor->SetInput("");
+       _textActor->SetInput("00");
        // Set coordinates to match the old vtkScaledTextActor default value
 //     _textActor->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport();
 //     _textActor->GetPosition2Coordinate()->SetValue( 0.2 , 0.2 );
@@ -2954,7 +2958,7 @@ void manualViewBaseContour::AddPoint( manualViewPoint * manualViewPoint )
        manualViewPoint->SetSpacing(_spc);
 
        vtkActor *actor = manualViewPoint->CreateVtkPointActor();
-       _wxvtkbaseview->GetRenderer()->AddActor( actor );
+       _wxvtkbaseview->GetRenderer()->AddActor( actor );       
 }
 
 // ----------------------------------------------------------------------------
@@ -3239,7 +3243,7 @@ void manualViewBaseContour::Refresh() // virtual
 void manualViewBaseContour::RefreshText()  // virtual
 {
        if( _textActor!=NULL)
-               _textActor -> SetInput(" ");
+               _textActor -> SetInput("00");
 }
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::SetColorNormalContour(double r, double g, double b)
@@ -3481,9 +3485,8 @@ void manualViewBaseContour::SetVisible(bool ok)
        {
                opacity=1;
        } else {
-               opacity=0;
+               opacity=0.5;
        }
-
        vtkActor *actor;
        int i,size=_lstViewPoints.size();
        for (i=0;i<size;i++){
@@ -3492,7 +3495,7 @@ void manualViewBaseContour::SetVisible(bool ok)
        }
        _contourVtkActor->GetProperty()->SetOpacity( opacity );
        _textActor->GetProperty()->SetOpacity( opacity );
-       _textActor->SetInput(" ");
+       _textActor->SetInput("00");
 
 }
 // ----------------------------------------------------------------------------
@@ -3501,7 +3504,7 @@ void manualViewBaseContour::SetShowText(bool ok)
        _show_text = ok;
        if (_show_text==false)
        {
-               _textActor->SetInput(" ");
+               _textActor->SetInput("00");
        }
 }
 // ----------------------------------------------------------------------------
@@ -4195,7 +4198,7 @@ void manualContourControler::MouseMove(int x, int y) // virtual
        if (!IsEditable())
        {
                GetManualViewBaseContour()->RemoveControlPoints();
-               GetManualViewBaseContour()->RemoveTextActor();
+//             GetManualViewBaseContour()->RemoveTextActor();
                GetManualViewBaseContour()->Refresh();
                this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
        }
@@ -5192,10 +5195,8 @@ void manualContourBaseControler::MouseReleaseLeft(int x, int y)
        if (_state==7){ _state = 0; }
        SetMoving( false );
        GetManualViewBaseContour()->SelectPosibleContour(x,y,GetZ());
-printf("EED %p manualContourBaseControler::MouseReleaseLeft 01 \n",this);
        if( GetIfCompleteCreation() && IsEditable() && !GetManualViewBaseContour()->GetPosibleSelected() && (GetManualViewBaseContour()->GetIdPoint(x,y,GetZ())==-1)  )
        {
-printf("EED %p manualContourBaseControler::MouseReleaseLeft 02 \n",this);
                SetEditable( false );
                SetPosibleToMove( false );
        }