1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
26 #include "manualViewBaseContour.h"
29 // ----------------------------------------------------------------------------
30 // ----------------------------------------------------------------------------
31 // ----------------------------------------------------------------------------
33 manualViewBaseContour::manualViewBaseContour()
38 _wxvtkbaseview = NULL;
40 _posibleSelected = false;
41 _viewControlPoints = false;
44 _contourVtkActor = NULL;
47 _sizePointsContour = 100;
57 _coulorSelection_r = 0;
58 _coulorSelection_g = 1;
59 _coulorSelection_b = 0;
62 // ----------------------------------------------------------------------------
63 manualViewBaseContour::~manualViewBaseContour()
65 int i,size=_lstViewPoints.size();
66 for (i=0;i<size; i++){
67 delete _lstViewPoints[i];
69 _lstViewPoints.clear();
71 // ----------------------------------------------------------------------------
74 int manualViewBaseContour::GetType() // virtual
77 //int manualViewBaseContour::GetType() 0;
78 //int manualViewContour::GetType() 1;
79 //int manualViewRoi::GetType() 2;
80 //int manualViewCircle::GetType() 3;
81 //int manualViewStar::GetType() 4;
82 //int manualViewLine::GetType() 6;
83 //int manualViewPoints::GetType() 7;
88 // ----------------------------------------------------------------------------
90 void manualViewBaseContour::Save(FILE *pFile)
92 fprintf(pFile,"TypeView %d\n", GetType() );
95 // ----------------------------------------------------------------------------
96 void manualViewBaseContour::Open(FILE *pFile)
100 // ----------------------------------------------------------------------------
101 void manualViewBaseContour :: AddCompleteContourActor( bool ifControlPoints )
103 _viewControlPoints = ifControlPoints;
104 /*vtkRenderer * theRenderer = */ _wxvtkbaseview->GetRenderer(); // JPRx ??
109 //Adding each control point
110 if( ifControlPoints )
117 // ---------------------------------------------------------------------------
119 void manualViewBaseContour::RemoveCompleteContourActor()
121 /*vtkRenderer * theRenderer =*/ _wxvtkbaseview->GetRenderer(); // JPRx ??
122 //Removing the spline
126 //Removing each point
127 RemoveControlPoints();
131 // ---------------------------------------------------------------------------
132 manualViewBaseContour * manualViewBaseContour :: Clone( )//virtual
134 manualViewBaseContour * clone = new manualViewBaseContour();
135 CopyAttributesTo(clone);
140 // ---------------------------------------------------------------------------
142 void manualViewBaseContour::CopyAttributesTo( manualViewBaseContour * cloneObject)
145 //XXXX::CopyAttributesTo(cloneObject);
147 cloneObject-> SetWxVtkBaseView( this->_wxvtkbaseview );
148 cloneObject-> SetSelected( this->GetSelected() );
149 cloneObject-> SetPosibleSelected( this->GetPosibleSelected() );
150 cloneObject-> SetIfViewControlPoints( this->GetIfViewControlPoints() );
151 cloneObject-> SetRange( this->GetRange() );
152 cloneObject-> SetZ( this->GetZ() );
153 cloneObject-> SetSpacing( _spc );
154 cloneObject-> SetColorNormalContour( _coulorNormal_r, _coulorNormal_g, _coulorNormal_b );
155 cloneObject-> SetColorEditContour( _coulorEdit_r, _coulorEdit_g, _coulorEdit_b );
156 cloneObject-> SetColorSelectContour( _coulorSelection_r, _coulorSelection_g, _coulorSelection_b );
158 int i, size = _lstViewPoints.size();
159 for ( i=0; i<size; i++ )
161 cloneObject->AddPoint( );
165 // ----------------------------------------------------------------------------
166 void manualViewBaseContour :: AddSplineActor()
168 vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer();
169 if (_contourVtkActor!=NULL)
170 theRenderer->AddActor( _contourVtkActor );
172 // ----------------------------------------------------------------------------
173 void manualViewBaseContour :: RemoveSplineActor() // virtual
175 vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer();
176 if (_contourVtkActor!=NULL)
177 theRenderer->RemoveActor( _contourVtkActor );
179 // ----------------------------------------------------------------------------
180 void manualViewBaseContour :: RemoveControlPoints()
182 if (_wxvtkbaseview!=NULL){
183 vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer();
184 int i,size=_lstViewPoints.size();
185 for (i=0;i<size; i++)
187 vtkActor * pointActor = _lstViewPoints[i]->GetVtkActor();
188 theRenderer->RemoveActor( pointActor );
191 SetIfViewControlPoints( false );
193 // ----------------------------------------------------------------------------
194 void manualViewBaseContour::AddControlPoints()
196 vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer();
197 SetIfViewControlPoints( true );
198 if( _viewControlPoints )
200 int i,size=_lstViewPoints.size();
201 for (i=0;i<size; i++)
203 vtkActor * pointActor = _lstViewPoints[i]->GetVtkActor();
204 theRenderer->AddActor( pointActor );
208 // ----------------------------------------------------------------------------
209 void manualViewBaseContour::AddTextActor()
213 _wxvtkbaseview->GetRenderer()->AddActor2D( _textActor );
214 _wxvtkbaseview->GetRenderer()->AddActor2D( _textActor2 );
217 // ----------------------------------------------------------------------------
218 void manualViewBaseContour::RemoveTextActor()
222 _wxvtkbaseview->GetRenderer()->RemoveActor2D( _textActor );
223 _wxvtkbaseview->GetRenderer()->RemoveActor2D( _textActor2 );
226 // ----------------------------------------------------------------------------
227 void manualViewBaseContour::DeleteVtkObjects()
229 if ( _contourVtkActor != NULL ) { _contourVtkActor -> Delete(); }
230 if ( _bboxMapper != NULL ) { _bboxMapper -> Delete(); }
231 if ( _pts != NULL ) { _pts -> Delete(); }
232 if ( _pd != NULL ) { _pd -> Delete(); }
233 _contourVtkActor = NULL;
240 // ----------------------------------------------------------------------------
241 void manualViewBaseContour::SetWidthLine(double width)
244 this->UpdateColorActor();
246 // for the control points
247 int id, size = _lstViewPoints.size();
248 for( id=0; id<size; id++)
250 this->_lstViewPoints[id]->SetWidthLine(_widthline);
255 // ----------------------------------------------------------------------------
256 double manualViewBaseContour::GetWidthLine()
261 // ----------------------------------------------------------------------------
262 void manualViewBaseContour::ConstructVTKObjects()
266 //JSTG 29-02-08 -----------------------------------------------
267 //int i , nps = _sizePointsContour;
269 int nps = _manContModel->GetNumberOfPointsSpline();
270 //-------------------------------------------------------------
273 _pts = vtkPoints::New();
274 _pts->SetNumberOfPoints(nps);
275 for (i=0 ; i<nps ; i++)
277 _pts->SetPoint(i, 0 , 0 , 0 );
279 // This is for the boundaring inicialisation
282 //_pts->SetPoint(0, 0 , 0 , -1000 );
283 //_pts->SetPoint(1, 0 , 0 , 1000 );
286 // _pts->SetPoint(0, -1000 , -1000 , -1000 );
287 // _pts->SetPoint(1, 1000 , 1000 , 1000 );
289 // This is the structure for the spline
290 _splineCell = vtkCellArray::New();
291 _splineCell->InsertNextCell( nps /* +1 */ );
292 for ( i=0 ; i<nps+1 ; i++ )
294 _splineCell->InsertCellPoint(i % nps );
297 // This is the structure for the spline justo to points (line)
298 // This will be use in the refresh part, in case the spline have only 2 points
299 _lineCell = vtkCellArray::New();
300 _lineCell->InsertNextCell(2);
301 _lineCell->InsertCellPoint(0);
302 _lineCell->InsertCellPoint(1);
304 _pd = vtkPolyData::New();
305 _pd->SetPoints( _pts );
306 _pd->SetLines( _splineCell );
307 // lines->Delete(); //do not delete lines ??
309 _contourVtkActor = vtkActor::New();
310 _bboxMapper = vtkPolyDataMapper::New();
311 _bboxMapper->ScalarVisibilityOff( );
314 //EED 2017-01-01 Migration VTK7
315 #if VTK_MAJOR_VERSION <= 5
316 _bboxMapper->SetInput(_pd);
318 _bboxMapper->SetInputData(_pd);
322 _bboxMapper->ImmediateModeRenderingOn();
323 _contourVtkActor->SetMapper(_bboxMapper);
324 _contourVtkActor->GetProperty()->BackfaceCullingOff();
328 _pd->ComputeBounds();
333 // ----------------------------------------------------------------------------
334 void manualViewBaseContour::SetCellArray(bool type)
338 _pd->SetLines( _splineCell );
340 _pd->SetLines( _lineCell );
344 // ----------------------------------------------------------------------------
345 void manualViewBaseContour::InitTextActor()
348 _textActor = vtkTextActor::New();
349 // _textActor->SetDisplayPosition(200, 200);
350 _textActor->SetInput("00");
351 // Set coordinates to match the old vtkScaledTextActor default value
352 // _textActor->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport();
353 // _textActor->GetPosition2Coordinate()->SetValue( 0.2 , 0.2 );
354 _textActor->GetPositionCoordinate()->SetCoordinateSystemToWorld ();
355 // _textActor->GetPositionCoordinate()->SetValue( 0.8 , 0.8 );
357 vtkTextProperty *tprop = _textActor->GetTextProperty();
358 tprop->SetFontSize(14);
359 tprop->SetFontFamilyToArial();
360 tprop->SetColor(1, 1, 0);
364 _textActor2 = vtkTextActor::New();
365 // _textActor->SetDisplayPosition(200, 200);
366 _textActor2->SetInput("00");
367 // Set coordinates to match the old vtkScaledTextActor default value
368 // _textActor2->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport();
369 // _textActor2->GetPosition2Coordinate()->SetValue( 0.2 , 0.2 );
370 _textActor2->GetPositionCoordinate()->SetCoordinateSystemToWorld ();
371 // _textActor2->GetPositionCoordinate()->SetValue( 0.8 , 0.8 );
373 vtkTextProperty *tprop2 = _textActor2->GetTextProperty();
374 tprop2->SetFontSize(14);
375 tprop2->SetFontFamilyToArial();
376 tprop2->SetColor(1, 1, 0);
380 // ----------------------------------------------------------------------------
381 void manualViewBaseContour::CreateNewContour()
383 ConstructVTKObjects();
385 _wxvtkbaseview->GetRenderer()->AddActor( _contourVtkActor );
386 _wxvtkbaseview->GetRenderer()->AddActor2D(_textActor);*/
387 AddCompleteContourActor();
389 // ----------------------------------------------------------------------------
390 void manualViewBaseContour::UpdateViewPoint(int id) // virtual
392 manualPoint *mp = _manContModel->GetManualPoint(id);
395 double XX=mp->GetX(),YY=mp->GetY(),ZZ=mp->GetZ();
396 // wxVtk2DBaseView *wxvtk2Dbasevie = (wxVtk2DBaseView*)this->GetWxVtkBaseView();
397 // wxvtk2Dbasevie->TransformCoordinate_spacing_ModelToView(XX,YY,ZZ);
399 _lstViewPoints[id]->SetPositionXY( XX , YY ,_range, ZZ );
402 // ----------------------------------------------------------------------------
403 void manualViewBaseContour::UpdateViewPoints()
405 int id, size = _lstViewPoints.size();
406 for( id=0; id<size; id++)
408 UpdateViewPoint( id );
412 // ----------------------------------------------------------------------------
413 void manualViewBaseContour::AddPoint()
415 manualViewPoint *mvp = new manualViewPoint( this->GetWxVtkBaseView() );
418 // ----------------------------------------------------------------------------
419 void manualViewBaseContour::AddPoint( manualViewPoint * manualViewPoint )
421 _lstViewPoints.push_back( manualViewPoint );
424 manualViewPoint->SetSpacing(_spc);
426 vtkActor *actor = manualViewPoint->CreateVtkPointActor();
427 _wxvtkbaseview->GetRenderer()->AddActor( actor );
430 // ----------------------------------------------------------------------------
431 void manualViewBaseContour::InsertPoint(int id)
433 manualViewPoint *mvp = new manualViewPoint( this->GetWxVtkBaseView() );
436 mvp->SetSpacing(_spc);
438 std::vector<manualViewPoint*>::iterator itNum = _lstViewPoints.begin() + id;
439 _lstViewPoints.insert(itNum,mvp);
440 _wxvtkbaseview->GetRenderer()->AddActor( mvp->CreateVtkPointActor() );
442 // ----------------------------------------------------------------------------
443 void manualViewBaseContour::DeleteContour()
445 RemoveCompleteContourActor();
446 /*if (_contourVtkActor!=NULL){
447 _wxvtkbaseview->GetRenderer()->RemoveActor( _contourVtkActor );
450 int i,size=_lstViewPoints.size();
451 for (i=0;i<size;i++){
452 manualViewBaseContour::DeletePoint(0);
456 // ----------------------------------------------------------------------------
457 void manualViewBaseContour::DeletePoint(int id) // virtual
459 int size=_lstViewPoints.size();
460 if ( (id>=0) && (id<size) ){
461 manualViewPoint *mvp =_lstViewPoints[id];
463 // _handlePicker->DeletePickList(mvp->GetVtkActor());
464 _wxvtkbaseview->GetRenderer()->RemoveActor( mvp->GetVtkActor() );
465 std::vector<manualViewPoint*>::iterator itNum = _lstViewPoints.begin() + id;
466 _lstViewPoints.erase(itNum);
471 // ----------------------------------------------------------------------------
472 void manualViewBaseContour::DeletePoint(int x, int y, int z)
474 int id=GetIdPoint(x,y,z);
479 // ----------------------------------------------------------------------------
480 void manualViewBaseContour::SetSelected(bool selected)
484 // ----------------------------------------------------------------------------
485 void manualViewBaseContour::SetPosibleSelected(bool posibleSelected)
487 _posibleSelected=posibleSelected;
489 // ----------------------------------------------------------------------------
490 bool manualViewBaseContour::GetEditable()
494 // ----------------------------------------------------------------------------
495 void manualViewBaseContour::SetEditable( bool * condition )
497 _editable = condition;
499 // ----------------------------------------------------------------------------
500 bool manualViewBaseContour::GetSelected()
504 // ----------------------------------------------------------------------------
505 bool manualViewBaseContour::GetPosibleSelected()
507 return _posibleSelected;
509 // ----------------------------------------------------------------------------
510 void manualViewBaseContour::DeleteSelectedPoints()
512 int i,size=_lstViewPoints.size();
513 for (i=size-1;i>=0;i--){
514 if (_lstViewPoints[i]->GetSelected()==true){
520 // ----------------------------------------------------------------------------
521 void manualViewBaseContour::SelectPoint(int i, bool select)
523 _lstViewPoints[i]->SetSelected(select);
525 // ----------------------------------------------------------------------------
526 void manualViewBaseContour::SelectLstPoints()
530 // ----------------------------------------------------------------------------
531 void manualViewBaseContour::SelectAllPoints(bool select)
533 int i,size=_lstViewPoints.size();
534 for (i=0;i<size;i++){
535 SelectPoint(i,select);
538 //-----------------------------------------------------------------------------
539 void manualViewBaseContour:: SetIfViewControlPoints(bool ifShow)
541 _viewControlPoints = ifShow;
543 // ----------------------------------------------------------------------------
544 bool manualViewBaseContour:: GetIfViewControlPoints()
546 return _viewControlPoints;
549 // ----------------------------------------------------------------------------
550 void manualViewBaseContour::SetPointPosibleSelected(int id,bool select)
552 _lstViewPoints[id]->SetPosibleSelected(select);
554 // ----------------------------------------------------------------------------
555 void manualViewBaseContour::SetPointSelected(int id,bool select)
557 _lstViewPoints[id]->SetSelected(select);
559 // ----------------------------------------------------------------------------
560 void manualViewBaseContour::SelectAllPossibleSelected(bool select)
562 int i,size=_lstViewPoints.size();
563 for (i=0;i<size;i++){
564 SetPointPosibleSelected(i,select);
567 // ----------------------------------------------------------------------------
568 int manualViewBaseContour::SelectPosiblePoint(int x, int y, int z) // virtual
570 SelectAllPossibleSelected(false);
572 int id = GetIdPoint(x,y,z);
575 SetPointPosibleSelected(id,true);
579 // ----------------------------------------------------------------------------
580 bool manualViewBaseContour::SelectPosibleContour(int x, int y, int z)
583 SetPosibleSelected(result);
584 int id = GetIdPoint(x,y,z);
586 if( !GetEditable() && !_selected && id!= -1)
589 _posibleSelected=true;
593 if ( (GetEditable()==true) && (id==-1 ) && (this->_lstViewPoints.size()>=2) )
595 if (ifTouchContour(x,y,z)==true)
598 SetPosibleSelected(result);
602 if (GetEditable()==false)
604 if (ifTouchContour(x,y,z)==true)
607 SetPosibleSelected(result);
613 // ----------------------------------------------------------------------------
614 bool manualViewBaseContour::ifTouchContour(int x,int y, int z) // virtual
618 // ----------------------------------------------------------------------------
619 void manualViewBaseContour::UnSelectPoint(int i){
620 _lstViewPoints[i]->SetSelected(false);
623 // ----------------------------------------------------------------------------
624 void manualViewBaseContour::UnSelectLstPoints(){
627 // ----------------------------------------------------------------------------
628 void manualViewBaseContour::UnSelectAllPoints(){
629 int i,size=_lstViewPoints.size();
630 for (i=0;i<size;i++){
635 // ----------------------------------------------------------------------------
636 void manualViewBaseContour::SetModel(manualBaseModel *manContModel){
637 _manContModel=manContModel;
639 // ----------------------------------------------------------------------------
640 void manualViewBaseContour::SetWxVtkBaseView(wxVtkBaseView *wxvtkbaseview){
641 _wxvtkbaseview = wxvtkbaseview;
643 // ----------------------------------------------------------------------------
644 void manualViewBaseContour::RefreshContour() // Virtual
647 // ----------------------------------------------------------------------------
648 double* manualViewBaseContour::GetVectorPointsXManualContour(){
650 int i,size = _sizePointsContour;
651 double *vx = (double*)malloc(sizeof(double)*size);
652 for (i=0;i<size;i++){
653 _pts->GetPoint(i,pp);
658 // ----------------------------------------------------------------------------
659 double* manualViewBaseContour::GetVectorPointsYManualContour()
662 int i,size = _sizePointsContour;
663 double *vy = (double*)malloc(sizeof(double)*size);
664 for (i=0;i<size;i++){
665 _pts->GetPoint(i,pp);
670 // ----------------------------------------------------------------------------
671 double* manualViewBaseContour::GetVectorPointsZManualContour()
674 int i,size = _sizePointsContour;
675 double *vz = (double*)malloc(sizeof(double)*size);
676 for (i=0;i<size;i++){
677 _pts->GetPoint(i,pp);
682 // ----------------------------------------------------------------------------
683 void manualViewBaseContour::Refresh() // virtual
685 if (_contourVtkActor!=NULL)
689 int i,size=_lstViewPoints.size();
690 for (i=0;i<size;i++){
692 _lstViewPoints[i]->UpdateColorActor();
696 if (_show_text==true)
701 vtkRenderWindowInteractor *vri = _wxvtkbaseview->GetWxVTKRenderWindowInteractor ();
704 _wxvtkbaseview->GetRenWin()->Render();
705 printf("EED %p How to optimize manualViewBaseContour::Refresh() \n",this);
709 // ----------------------------------------------------------------------------
710 void manualViewBaseContour::RefreshText() // virtual
712 if( _textActor!=NULL)
714 _textActor -> SetInput("00");
715 _textActor2 -> SetInput("00");
718 // ----------------------------------------------------------------------------
719 void manualViewBaseContour::SetColorNormalContour(double r, double g, double b)
725 // ----------------------------------------------------------------------------
726 void manualViewBaseContour::GetColorNormalContour(double &r, double &g, double &b)
732 // ----------------------------------------------------------------------------
733 void manualViewBaseContour::SetColorEditContour(double r, double g, double b)
739 // ----------------------------------------------------------------------------
740 void manualViewBaseContour::GetColorEditContour(double &r, double &g, double &b)
746 // ----------------------------------------------------------------------------
747 void manualViewBaseContour::SetColorSelectContour(double r, double g, double b)
749 _coulorSelection_r = r;
750 _coulorSelection_g = g;
751 _coulorSelection_b = b;
753 // ----------------------------------------------------------------------------
754 void manualViewBaseContour::GetColorSelectContour(double &r, double &g, double &b)
756 r = _coulorSelection_r;
757 g = _coulorSelection_g;
758 b = _coulorSelection_b;
760 // ----------------------------------------------------------------------------
761 void manualViewBaseContour::UpdateColorActor()
763 if (_contourVtkActor!=NULL)
765 _contourVtkActor->GetProperty()->SetLineWidth( _widthline );
766 _contourVtkActor->GetProperty()->SetDiffuseColor( _coulorNormal_r , _coulorNormal_g , _coulorNormal_b );
767 if (_posibleSelected || (_posibleSelected && GetEditable() ) )
769 _contourVtkActor->GetProperty()->SetDiffuseColor( _coulorEdit_r , _coulorEdit_g , _coulorEdit_b );
773 _contourVtkActor->GetProperty()->SetDiffuseColor( _coulorSelection_r , _coulorSelection_g , _coulorSelection_b );
777 // ----------------------------------------------------------------------------
778 int manualViewBaseContour::GetIdPoint(int x, int y, int z) // virtual
781 if (_manContModel!=NULL){
785 TransfromCoordViewWorld(xx,yy,zz);
786 ii=_manContModel->GetIdPoint(xx,yy,zz,_range,-1);
791 // ----------------------------------------------------------------------------
794 int manualViewBaseContour::GetNumberOfPoints()
796 return _lstViewPoints.size();
799 // ----------------------------------------------------------------------------
801 //JSTG 25-02-08 ---------------------------------------------------------------
802 /*int manualViewBaseContour::GetNumberOfPointsSpline()
804 return _sizePointsContour;
806 //----------------------------------------------------------------------------
808 //JSTG 25-02-08 ---------------------------------------------------------------
809 /*void manualViewBaseContour::SetNumberOfPointsSpline(int size)
811 _sizePointsContour = size;
813 //----------------------------------------------------------------------------
815 void manualViewBaseContour::TransfromCoordViewWorld(double &X, double &Y, double &Z, int type) // Virtual
817 _wxvtkbaseview->TransFromCoordScreenToWorld(X, Y, Z,false, type);
822 // wxVtk2DBaseView *wxvtk2Dbaseview = (wxVtk2DBaseView*)_wxvtkbaseview;
823 // wxvtk2Dbaseview->TransformCoordinate_spacing_ModelToView(X,Y,Z);
826 // ----------------------------------------------------------------------------
827 void manualViewBaseContour::SetRange(double range)
831 // ----------------------------------------------------------------------------
832 double manualViewBaseContour::GetRange()
836 // ----------------------------------------------------------------------------
837 void manualViewBaseContour::SetZ(int z)
841 // ----------------------------------------------------------------------------
842 int manualViewBaseContour::GetZ()
847 // ----------------------------------------------------------------------------
848 void manualViewBaseContour::InitMove(int x, int y, int z) // virtual
852 // ----------------------------------------------------------------------------
853 void manualViewBaseContour::MoveContour(int x, int y, int z) // virtual
856 // ----------------------------------------------------------------------------
857 void manualViewBaseContour::MoveContour(int horizontalUnits, int verticalUnits )// virtual
861 // ----------------------------------------------------------------------------
862 void manualViewBaseContour::GetMinMax( double &minX,double &minY, double &minZ, double &maxX, double &maxY, double &maxZ )// virtual
867 int size=_manContModel->GetSizeLstPoints();
872 bool ifFindZ = minZ!=-1.0 && maxZ!=-1.0;
878 for( i = 0; i < size; i++ )
880 mp=_manContModel->GetManualPoint(i);
932 // ----------------------------------------------------------------------------
933 void manualViewBaseContour::ClearContour()
935 if (_contourVtkActor!=NULL){
936 _wxvtkbaseview->GetRenderer()->RemoveActor( _contourVtkActor );
939 int i,size=_lstViewPoints.size();
940 for (i=0;i<size;i++){
945 // ----------------------------------------------------------------------------
946 void manualViewBaseContour::ClearPoint(int id)
950 // ----------------------------------------------------------------------------
951 void manualViewBaseContour::SetVisible(bool ok)
961 int i,size=_lstViewPoints.size();
962 for (i=0;i<size;i++){
963 actor = _lstViewPoints[i]->GetVtkActor();
964 actor->GetProperty()->SetOpacity( opacity );
966 _contourVtkActor->GetProperty()->SetOpacity( opacity );
967 _textActor->GetProperty()->SetOpacity( opacity );
968 _textActor->SetInput("00");
969 _textActor2->GetProperty()->SetOpacity( opacity );
970 _textActor2->SetInput("00");
973 // ----------------------------------------------------------------------------
974 void manualViewBaseContour::SetShowText(bool ok)
977 if (_show_text==false && _textActor!=NULL)
979 _textActor->SetInput("00");
980 _textActor2->SetInput("00");
983 // ----------------------------------------------------------------------------
984 wxVtkBaseView *manualViewBaseContour::GetWxVtkBaseView()
986 return this->_wxvtkbaseview;
988 // ----------------------------------------------------------------------------
989 void manualViewBaseContour::GetSpacing(double spc[3])
995 // ----------------------------------------------------------------------------
996 void manualViewBaseContour::SetSpacing(double spc[3])