]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / manualContour / manualViewBaseContour.cpp
index 4ab822f8630bbde4369abdf19d404dc2f207b542..bc2cfd2ad133d8eb24b1f0032ebc7ec4d27cc761 100644 (file)
@@ -60,6 +60,7 @@ int manualViewBaseContour::GetType() // virtual
 //int manualViewCircle::GetType()                      3;
 //int manualViewStar::GetType()                                4;
 //int manualViewLine::GetType()                                6;
+//int manualViewPoints::GetType()                      7;
 
 
        return 0;
@@ -230,33 +231,33 @@ double manualViewBaseContour::GetWidthLine()
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::ConstructVTKObjects()
 {
+
+
 //JSTG 29-02-08 -----------------------------------------------
        //int i , nps = _sizePointsContour;
        int i;
        int nps = _manContModel->GetNumberOfPointsSpline();
 //-------------------------------------------------------------
+
        DeleteVtkObjects();
        _pts = vtkPoints::New();
        _pts->SetNumberOfPoints(nps);
-
        for (i=0 ; i<nps ; i++){
                _pts->SetPoint(i,       0       , 0     , 0 );
        }
        // This is for the boundaring inicialisation
 
 //EED 29Mars2009       
-       _pts->SetPoint(0,       0       , 0     , -1000 );
-       _pts->SetPoint(1,       0       , 0     ,  1000 );
-//     _pts->SetPoint(0,       -1000   , -1000 , -1000 );
-//     _pts->SetPoint(1,       1000    , 1000  , 1000  );
-
+       //_pts->SetPoint(0,     0       , 0     , -1000 );
+       //_pts->SetPoint(1,     0       , 0     ,  1000 );
+       _pts->SetPoint(0,       -1000   , -1000 , -1000 );
+       _pts->SetPoint(1,       1000    , 1000  , 1000  );
 
        vtkCellArray *lines = vtkCellArray::New();
        lines->InsertNextCell( nps /* +1 */ );
        for ( i=0 ; i<nps+1 ; i++ ){
                lines->InsertCellPoint(i % nps );
        }
-
        _pd = vtkPolyData::New();
        _pd->SetPoints( _pts );
        _pd->SetLines( lines );
@@ -266,15 +267,24 @@ void manualViewBaseContour::ConstructVTKObjects()
     _bboxMapper                        =       vtkPolyDataMapper::New();
     _bboxMapper->ScalarVisibilityOff( );
 
+
        _bboxMapper->SetInput(_pd);
        _bboxMapper->ImmediateModeRenderingOn();
        _contourVtkActor->SetMapper(_bboxMapper);
        _contourVtkActor->GetProperty()->BackfaceCullingOff();
 
+
        UpdateColorActor();
 
        _pd->ComputeBounds();
 
+       InitTextActor();
+       
+       
+}
+
+void manualViewBaseContour::InitTextActor()
+{
        //      Text
        _textActor = vtkTextActor::New();
 //     _textActor->SetDisplayPosition(200, 200);
@@ -290,6 +300,7 @@ void manualViewBaseContour::ConstructVTKObjects()
        tprop->SetFontFamilyToArial();
        tprop->SetColor(0, 0, 1);
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::CreateNewContour()
 {
@@ -495,10 +506,11 @@ bool manualViewBaseContour::SelectPosibleContour(int x, int y, int z)
        bool result=false;
        SetPosibleSelected(result);
     int id = GetIdPoint(x,y,z);
+       
        if( !GetEditable() && !_selected && id!= -1)
        {
                result=true;
-               SetPosibleSelected(result);
+               _posibleSelected=true;          
        }
        else
        {
@@ -520,7 +532,6 @@ bool manualViewBaseContour::SelectPosibleContour(int x, int y, int z)
                        }
                }
 
-
        }
        return result;
 }
@@ -547,7 +558,7 @@ void manualViewBaseContour::UnSelectAllPoints(){
        Refresh();
 }
 // ----------------------------------------------------------------------------
-void manualViewBaseContour::SetModel(manualContourModel *manContModel){
+void manualViewBaseContour::SetModel(manualBaseModel *manContModel){
        _manContModel=manContModel;
 }
 // ----------------------------------------------------------------------------