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;
60 _coulorSelection_r = 0;
61 _coulorSelection_g = 1;
62 _coulorSelection_b = 0;
67 // ----------------------------------------------------------------------------
68 manualViewBaseContour::~manualViewBaseContour()
70 int i,size=_lstViewPoints.size();
71 for (i=0;i<size; i++){
72 delete _lstViewPoints[i];
74 _lstViewPoints.clear();
76 // ----------------------------------------------------------------------------
79 int manualViewBaseContour::GetType() // virtual
82 //int manualViewBaseContour::GetType() 0;
83 //int manualViewContour::GetType() 1;
84 //int manualViewRoi::GetType() 2;
85 //int manualViewCircle::GetType() 3;
86 //int manualViewStar::GetType() 4;
87 //int manualViewLine::GetType() 6;
88 //int manualViewPoints::GetType() 7;
93 // ----------------------------------------------------------------------------
95 void manualViewBaseContour::Save(FILE *pFile)
97 fprintf(pFile,"TypeView %d\n", GetType() );
100 // ----------------------------------------------------------------------------
101 void manualViewBaseContour::Open(FILE *pFile)
105 // ----------------------------------------------------------------------------
106 void manualViewBaseContour :: AddCompleteContourActor( bool ifControlPoints )
108 _viewControlPoints = ifControlPoints;
109 /*vtkRenderer * theRenderer = */ _wxvtkbaseview->GetRenderer(); // JPRx ??
114 //Adding each control point
115 if( ifControlPoints )
120 // ---------------------------------------------------------------------------
122 void manualViewBaseContour :: RemoveCompleteContourActor()
124 /*vtkRenderer * theRenderer =*/ _wxvtkbaseview->GetRenderer(); // JPRx ??
125 //Removing the spline
129 //Removing each point
130 RemoveControlPoints();
134 // ---------------------------------------------------------------------------
135 manualViewBaseContour * manualViewBaseContour :: Clone( )//virtual
137 manualViewBaseContour * clone = new manualViewBaseContour();
138 CopyAttributesTo(clone);
143 // ---------------------------------------------------------------------------
145 void manualViewBaseContour::CopyAttributesTo( manualViewBaseContour * cloneObject)
148 //XXXX::CopyAttributesTo(cloneObject);
150 cloneObject-> SetWxVtkBaseView( this->_wxvtkbaseview );
151 cloneObject-> SetSelected( this->GetSelected() );
152 cloneObject-> SetPosibleSelected( this->GetPosibleSelected() );
153 cloneObject-> SetIfViewControlPoints( this->GetIfViewControlPoints() );
154 cloneObject-> SetRange( this->GetRange() );
155 cloneObject-> SetZ( this->GetZ() );
156 cloneObject-> SetSpacing( _spc );
157 cloneObject-> SetColorNormalContour( _coulorNormal_r, _coulorNormal_g, _coulorNormal_b );
158 cloneObject-> SetColorEditContour( _coulorEdit_r, _coulorEdit_g, _coulorEdit_b );
159 cloneObject-> SetColorSelectContour( _coulorSelection_r, _coulorSelection_g, _coulorSelection_b );
161 int i, size = _lstViewPoints.size();
162 for ( i=0; i<size; i++ )
164 cloneObject->AddPoint( );
168 // ----------------------------------------------------------------------------
169 void manualViewBaseContour :: AddSplineActor()
171 vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer();
172 if (_contourVtkActor!=NULL)
173 theRenderer->AddActor( _contourVtkActor );
175 // ----------------------------------------------------------------------------
176 void manualViewBaseContour :: RemoveSplineActor() // virtual
178 vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer();
179 if (_contourVtkActor!=NULL)
180 theRenderer->RemoveActor( _contourVtkActor );
182 // ----------------------------------------------------------------------------
183 void manualViewBaseContour :: RemoveControlPoints()
185 if (_wxvtkbaseview!=NULL){
186 vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer();
187 int i,size=_lstViewPoints.size();
188 for (i=0;i<size; i++)
190 vtkActor * pointActor = _lstViewPoints[i]->GetVtkActor();
191 theRenderer->RemoveActor( pointActor );
194 SetIfViewControlPoints( false );
196 // ----------------------------------------------------------------------------
197 void manualViewBaseContour::AddControlPoints()
199 vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer();
200 SetIfViewControlPoints( true );
201 if( _viewControlPoints )
203 int i,size=_lstViewPoints.size();
204 for (i=0;i<size; i++)
206 vtkActor * pointActor = _lstViewPoints[i]->GetVtkActor();
207 theRenderer->AddActor( pointActor );
211 // ----------------------------------------------------------------------------
212 void manualViewBaseContour::AddTextActor()
216 _wxvtkbaseview->GetRenderer()->AddActor2D( _textActor );
217 _wxvtkbaseview->GetRenderer()->AddActor2D( _textActor2 );
220 // ----------------------------------------------------------------------------
221 void manualViewBaseContour::RemoveTextActor()
225 _wxvtkbaseview->GetRenderer()->RemoveActor2D( _textActor );
226 _wxvtkbaseview->GetRenderer()->RemoveActor2D( _textActor2 );
229 // ----------------------------------------------------------------------------
230 void manualViewBaseContour::DeleteVtkObjects()
232 if ( _contourVtkActor != NULL ) { _contourVtkActor -> Delete(); }
233 if ( _bboxMapper != NULL ) { _bboxMapper -> Delete(); }
234 if ( _pts != NULL ) { _pts -> Delete(); }
235 if ( _pd != NULL ) { _pd -> Delete(); }
236 _contourVtkActor = NULL;
243 // ----------------------------------------------------------------------------
244 void manualViewBaseContour::SetWidthLine(double width)
247 this->UpdateColorActor();
249 // for the control points
250 int id, size = _lstViewPoints.size();
251 for( id=0; id<size; id++)
253 this->_lstViewPoints[id]->SetWidthLine(_widthline);
258 // ----------------------------------------------------------------------------
259 double manualViewBaseContour::GetWidthLine()
264 // ----------------------------------------------------------------------------
265 void manualViewBaseContour::ConstructVTKObjects()
269 //JSTG 29-02-08 -----------------------------------------------
270 //int i , nps = _sizePointsContour;
272 int nps = _manContModel->GetNumberOfPointsSpline();
273 //-------------------------------------------------------------
276 _pts = vtkPoints::New();
277 _pts->SetNumberOfPoints(nps);
278 for (i=0 ; i<nps ; i++){
279 _pts->SetPoint(i, 0 , 0 , 0 );
281 // This is for the boundaring inicialisation
284 //_pts->SetPoint(0, 0 , 0 , -1000 );
285 //_pts->SetPoint(1, 0 , 0 , 1000 );
286 _pts->SetPoint(0, -1000 , -1000 , -1000 );
287 _pts->SetPoint(1, 1000 , 1000 , 1000 );
289 vtkCellArray *lines = vtkCellArray::New();
290 lines->InsertNextCell( nps /* +1 */ );
291 for ( i=0 ; i<nps+1 ; i++ ){
292 lines->InsertCellPoint(i % nps );
294 _pd = vtkPolyData::New();
295 _pd->SetPoints( _pts );
296 _pd->SetLines( lines );
297 lines->Delete(); //do not delete lines ??
299 _contourVtkActor = vtkActor::New();
300 _bboxMapper = vtkPolyDataMapper::New();
301 _bboxMapper->ScalarVisibilityOff( );
303 _bboxMapper->SetInput(_pd);
304 _bboxMapper->ImmediateModeRenderingOn();
305 _contourVtkActor->SetMapper(_bboxMapper);
306 _contourVtkActor->GetProperty()->BackfaceCullingOff();
310 _pd->ComputeBounds();
315 // ----------------------------------------------------------------------------
316 void manualViewBaseContour::InitTextActor()
319 _textActor = vtkTextActor::New();
320 // _textActor->SetDisplayPosition(200, 200);
321 _textActor->SetInput("00");
322 // Set coordinates to match the old vtkScaledTextActor default value
323 // _textActor->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport();
324 // _textActor->GetPosition2Coordinate()->SetValue( 0.2 , 0.2 );
325 _textActor->GetPositionCoordinate()->SetCoordinateSystemToWorld ();
326 // _textActor->GetPositionCoordinate()->SetValue( 0.8 , 0.8 );
328 vtkTextProperty *tprop = _textActor->GetTextProperty();
329 tprop->SetFontSize(14);
330 tprop->SetFontFamilyToArial();
331 tprop->SetColor(0, 0, 1);
335 _textActor2 = vtkTextActor::New();
336 // _textActor->SetDisplayPosition(200, 200);
337 _textActor2->SetInput("00");
338 // Set coordinates to match the old vtkScaledTextActor default value
339 // _textActor2->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport();
340 // _textActor2->GetPosition2Coordinate()->SetValue( 0.2 , 0.2 );
341 _textActor2->GetPositionCoordinate()->SetCoordinateSystemToWorld ();
342 // _textActor2->GetPositionCoordinate()->SetValue( 0.8 , 0.8 );
344 vtkTextProperty *tprop2 = _textActor2->GetTextProperty();
345 tprop2->SetFontSize(14);
346 tprop2->SetFontFamilyToArial();
347 tprop2->SetColor(0, 0, 1);
351 // ----------------------------------------------------------------------------
352 void manualViewBaseContour::CreateNewContour()
354 ConstructVTKObjects();
356 _wxvtkbaseview->GetRenderer()->AddActor( _contourVtkActor );
357 _wxvtkbaseview->GetRenderer()->AddActor2D(_textActor);*/
358 AddCompleteContourActor();
360 // ----------------------------------------------------------------------------
361 void manualViewBaseContour::UpdateViewPoint(int id) // virtual
363 manualPoint *mp = _manContModel->GetManualPoint(id);
366 double XX=mp->GetX(),YY=mp->GetY(),ZZ=mp->GetZ();
367 // wxVtk2DBaseView *wxvtk2Dbasevie = (wxVtk2DBaseView*)this->GetWxVtkBaseView();
368 // wxvtk2Dbasevie->TransformCoordinate_spacing_ModelToView(XX,YY,ZZ);
370 _lstViewPoints[id]->SetPositionXY( XX , YY ,_range, ZZ );
373 // ----------------------------------------------------------------------------
374 void manualViewBaseContour::UpdateViewPoints()
376 int id, size = _lstViewPoints.size();
377 for( id=0; id<size; id++)
379 UpdateViewPoint( id );
383 // ----------------------------------------------------------------------------
384 void manualViewBaseContour::AddPoint()
386 manualViewPoint *mvp = new manualViewPoint( this->GetWxVtkBaseView() );
389 // ----------------------------------------------------------------------------
390 void manualViewBaseContour::AddPoint( manualViewPoint * manualViewPoint )
392 _lstViewPoints.push_back( manualViewPoint );
395 manualViewPoint->SetSpacing(_spc);
397 vtkActor *actor = manualViewPoint->CreateVtkPointActor();
398 _wxvtkbaseview->GetRenderer()->AddActor( actor );
401 // ----------------------------------------------------------------------------
402 void manualViewBaseContour::InsertPoint(int id)
404 manualViewPoint *mvp = new manualViewPoint( this->GetWxVtkBaseView() );
407 mvp->SetSpacing(_spc);
409 std::vector<manualViewPoint*>::iterator itNum = _lstViewPoints.begin() + id;
410 _lstViewPoints.insert(itNum,mvp);
411 _wxvtkbaseview->GetRenderer()->AddActor( mvp->CreateVtkPointActor() );
413 // ----------------------------------------------------------------------------
414 void manualViewBaseContour::DeleteContour()
416 RemoveCompleteContourActor();
417 /*if (_contourVtkActor!=NULL){
418 _wxvtkbaseview->GetRenderer()->RemoveActor( _contourVtkActor );
421 int i,size=_lstViewPoints.size();
422 for (i=0;i<size;i++){
423 manualViewBaseContour::DeletePoint(0);
427 // ----------------------------------------------------------------------------
428 void manualViewBaseContour::DeletePoint(int id) // virtual
430 int size=_lstViewPoints.size();
431 if ( (id>=0) && (id<size) ){
432 manualViewPoint *mvp =_lstViewPoints[id];
434 // _handlePicker->DeletePickList(mvp->GetVtkActor());
435 _wxvtkbaseview->GetRenderer()->RemoveActor( mvp->GetVtkActor() );
436 std::vector<manualViewPoint*>::iterator itNum = _lstViewPoints.begin() + id;
437 _lstViewPoints.erase(itNum);
442 // ----------------------------------------------------------------------------
443 void manualViewBaseContour::DeletePoint(int x, int y, int z)
445 int id=GetIdPoint(x,y,z);
450 // ----------------------------------------------------------------------------
451 void manualViewBaseContour::SetSelected(bool selected)
455 // ----------------------------------------------------------------------------
456 void manualViewBaseContour::SetPosibleSelected(bool posibleSelected)
458 _posibleSelected=posibleSelected;
460 // ----------------------------------------------------------------------------
461 bool manualViewBaseContour::GetEditable()
465 // ----------------------------------------------------------------------------
466 void manualViewBaseContour::SetEditable( bool * condition )
468 _editable = condition;
470 // ----------------------------------------------------------------------------
471 bool manualViewBaseContour::GetSelected()
475 // ----------------------------------------------------------------------------
476 bool manualViewBaseContour::GetPosibleSelected()
478 return _posibleSelected;
480 // ----------------------------------------------------------------------------
481 void manualViewBaseContour::DeleteSelectedPoints()
483 int i,size=_lstViewPoints.size();
484 for (i=size-1;i>=0;i--){
485 if (_lstViewPoints[i]->GetSelected()==true){
491 // ----------------------------------------------------------------------------
492 void manualViewBaseContour::SelectPoint(int i, bool select)
494 _lstViewPoints[i]->SetSelected(select);
496 // ----------------------------------------------------------------------------
497 void manualViewBaseContour::SelectLstPoints()
501 // ----------------------------------------------------------------------------
502 void manualViewBaseContour::SelectAllPoints(bool select)
504 int i,size=_lstViewPoints.size();
505 for (i=0;i<size;i++){
506 SelectPoint(i,select);
509 //-----------------------------------------------------------------------------
510 void manualViewBaseContour:: SetIfViewControlPoints(bool ifShow)
512 _viewControlPoints = ifShow;
514 // ----------------------------------------------------------------------------
515 bool manualViewBaseContour:: GetIfViewControlPoints()
517 return _viewControlPoints;
520 // ----------------------------------------------------------------------------
521 void manualViewBaseContour::SetPointPosibleSelected(int id,bool select)
523 _lstViewPoints[id]->SetPosibleSelected(select);
525 // ----------------------------------------------------------------------------
526 void manualViewBaseContour::SetPointSelected(int id,bool select)
528 _lstViewPoints[id]->SetSelected(select);
530 // ----------------------------------------------------------------------------
531 void manualViewBaseContour::SelectAllPossibleSelected(bool select)
533 int i,size=_lstViewPoints.size();
534 for (i=0;i<size;i++){
535 SetPointPosibleSelected(i,select);
538 // ----------------------------------------------------------------------------
539 int manualViewBaseContour::SelectPosiblePoint(int x, int y, int z) // virtual
541 SelectAllPossibleSelected(false);
543 int id = GetIdPoint(x,y,z);
546 SetPointPosibleSelected(id,true);
550 // ----------------------------------------------------------------------------
551 bool manualViewBaseContour::SelectPosibleContour(int x, int y, int z)
554 SetPosibleSelected(result);
555 int id = GetIdPoint(x,y,z);
557 if( !GetEditable() && !_selected && id!= -1)
560 _posibleSelected=true;
564 if ( (GetEditable()==true) && (id==-1 ) && (this->_lstViewPoints.size()>=2) )
566 if (ifTouchContour(x,y,z)==true)
569 SetPosibleSelected(result);
573 if (GetEditable()==false)
575 if (ifTouchContour(x,y,z)==true)
578 SetPosibleSelected(result);
584 // ----------------------------------------------------------------------------
585 bool manualViewBaseContour::ifTouchContour(int x,int y, int z) // virtual
589 // ----------------------------------------------------------------------------
590 void manualViewBaseContour::UnSelectPoint(int i){
591 _lstViewPoints[i]->SetSelected(false);
594 // ----------------------------------------------------------------------------
595 void manualViewBaseContour::UnSelectLstPoints(){
598 // ----------------------------------------------------------------------------
599 void manualViewBaseContour::UnSelectAllPoints(){
600 int i,size=_lstViewPoints.size();
601 for (i=0;i<size;i++){
606 // ----------------------------------------------------------------------------
607 void manualViewBaseContour::SetModel(manualBaseModel *manContModel){
608 _manContModel=manContModel;
610 // ----------------------------------------------------------------------------
611 void manualViewBaseContour::SetWxVtkBaseView(wxVtkBaseView *wxvtkbaseview){
612 _wxvtkbaseview = wxvtkbaseview;
614 // ----------------------------------------------------------------------------
615 void manualViewBaseContour::RefreshContour() // Virtual
618 // ----------------------------------------------------------------------------
619 double* manualViewBaseContour::GetVectorPointsXManualContour(){
621 int i,size = _sizePointsContour;
622 double *vx = (double*)malloc(sizeof(double)*size);
623 for (i=0;i<size;i++){
624 _pts->GetPoint(i,pp);
629 // ----------------------------------------------------------------------------
630 double* manualViewBaseContour::GetVectorPointsYManualContour()
633 int i,size = _sizePointsContour;
634 double *vy = (double*)malloc(sizeof(double)*size);
635 for (i=0;i<size;i++){
636 _pts->GetPoint(i,pp);
641 // ----------------------------------------------------------------------------
642 double* manualViewBaseContour::GetVectorPointsZManualContour()
645 int i,size = _sizePointsContour;
646 double *vz = (double*)malloc(sizeof(double)*size);
647 for (i=0;i<size;i++){
648 _pts->GetPoint(i,pp);
653 // ----------------------------------------------------------------------------
654 void manualViewBaseContour::Refresh() // virtual
656 if (_contourVtkActor!=NULL){
659 int i,size=_lstViewPoints.size();
660 for (i=0;i<size;i++){
662 _lstViewPoints[i]->UpdateColorActor();
666 if (_show_text==true)
671 vtkRenderWindowInteractor *vri = _wxvtkbaseview->GetWxVTKRenderWindowInteractor ();
674 _wxvtkbaseview->GetRenWin()->Render();
675 printf("EED %p How to optimize manualViewBaseContour::Refresh() \n",this);
679 // ----------------------------------------------------------------------------
680 void manualViewBaseContour::RefreshText() // virtual
682 if( _textActor!=NULL)
684 _textActor -> SetInput("00");
685 _textActor2 -> SetInput("00");
688 // ----------------------------------------------------------------------------
689 void manualViewBaseContour::SetColorNormalContour(double r, double g, double b)
695 // ----------------------------------------------------------------------------
696 void manualViewBaseContour::GetColorNormalContour(double &r, double &g, double &b)
702 // ----------------------------------------------------------------------------
703 void manualViewBaseContour::SetColorEditContour(double r, double g, double b)
709 // ----------------------------------------------------------------------------
710 void manualViewBaseContour::GetColorEditContour(double &r, double &g, double &b)
716 // ----------------------------------------------------------------------------
717 void manualViewBaseContour::SetColorSelectContour(double r, double g, double b)
719 _coulorSelection_r = r;
720 _coulorSelection_g = g;
721 _coulorSelection_b = b;
723 // ----------------------------------------------------------------------------
724 void manualViewBaseContour::GetColorSelectContour(double &r, double &g, double &b)
726 r = _coulorSelection_r;
727 g = _coulorSelection_g;
728 b = _coulorSelection_b;
730 // ----------------------------------------------------------------------------
731 void manualViewBaseContour::UpdateColorActor()
733 if (_contourVtkActor!=NULL)
735 _contourVtkActor->GetProperty()->SetLineWidth( _widthline );
736 _contourVtkActor->GetProperty()->SetDiffuseColor( _coulorNormal_r , _coulorNormal_g , _coulorNormal_b );
737 if (_posibleSelected || (_posibleSelected && GetEditable() ) )
739 _contourVtkActor->GetProperty()->SetDiffuseColor( _coulorEdit_r , _coulorEdit_g , _coulorEdit_b );
743 _contourVtkActor->GetProperty()->SetDiffuseColor( _coulorSelection_r , _coulorSelection_g , _coulorSelection_b );
747 // ----------------------------------------------------------------------------
748 int manualViewBaseContour::GetIdPoint(int x, int y, int z) // virtual
751 if (_manContModel!=NULL){
755 TransfromCoordViewWorld(xx,yy,zz);
756 ii=_manContModel->GetIdPoint(xx,yy,zz,_range,-1);
761 // ----------------------------------------------------------------------------
764 int manualViewBaseContour::GetNumberOfPoints()
766 return _lstViewPoints.size();
769 // ----------------------------------------------------------------------------
771 //JSTG 25-02-08 ---------------------------------------------------------------
772 /*int manualViewBaseContour::GetNumberOfPointsSpline()
774 return _sizePointsContour;
776 //----------------------------------------------------------------------------
778 //JSTG 25-02-08 ---------------------------------------------------------------
779 /*void manualViewBaseContour::SetNumberOfPointsSpline(int size)
781 _sizePointsContour = size;
783 //----------------------------------------------------------------------------
785 void manualViewBaseContour::TransfromCoordViewWorld(double &X, double &Y, double &Z, int type) // Virtual
787 _wxvtkbaseview->TransFromCoordScreenToWorld(X, Y, Z,false, type);
792 // wxVtk2DBaseView *wxvtk2Dbaseview = (wxVtk2DBaseView*)_wxvtkbaseview;
793 // wxvtk2Dbaseview->TransformCoordinate_spacing_ModelToView(X,Y,Z);
796 // ----------------------------------------------------------------------------
797 void manualViewBaseContour::SetRange(double range)
801 // ----------------------------------------------------------------------------
802 double manualViewBaseContour::GetRange()
806 // ----------------------------------------------------------------------------
807 void manualViewBaseContour::SetZ(int z)
811 // ----------------------------------------------------------------------------
812 int manualViewBaseContour::GetZ()
817 // ----------------------------------------------------------------------------
818 void manualViewBaseContour::InitMove(int x, int y, int z) // virtual
822 // ----------------------------------------------------------------------------
823 void manualViewBaseContour::MoveContour(int x, int y, int z) // virtual
826 // ----------------------------------------------------------------------------
827 void manualViewBaseContour::MoveContour(int horizontalUnits, int verticalUnits )// virtual
831 // ----------------------------------------------------------------------------
832 void manualViewBaseContour::GetMinMax( double &minX,double &minY, double &minZ, double &maxX, double &maxY, double &maxZ )// virtual
837 int size=_manContModel->GetSizeLstPoints();
842 bool ifFindZ = minZ!=-1.0 && maxZ!=-1.0;
848 for( i = 0; i < size; i++ )
850 mp=_manContModel->GetManualPoint(i);
902 // ----------------------------------------------------------------------------
903 void manualViewBaseContour::ClearContour()
905 if (_contourVtkActor!=NULL){
906 _wxvtkbaseview->GetRenderer()->RemoveActor( _contourVtkActor );
909 int i,size=_lstViewPoints.size();
910 for (i=0;i<size;i++){
915 // ----------------------------------------------------------------------------
916 void manualViewBaseContour::ClearPoint(int id)
920 // ----------------------------------------------------------------------------
921 void manualViewBaseContour::SetVisible(bool ok)
931 int i,size=_lstViewPoints.size();
932 for (i=0;i<size;i++){
933 actor = _lstViewPoints[i]->GetVtkActor();
934 actor->GetProperty()->SetOpacity( opacity );
936 _contourVtkActor->GetProperty()->SetOpacity( opacity );
937 _textActor->GetProperty()->SetOpacity( opacity );
938 _textActor->SetInput("00");
939 _textActor2->GetProperty()->SetOpacity( opacity );
940 _textActor2->SetInput("00");
943 // ----------------------------------------------------------------------------
944 void manualViewBaseContour::SetShowText(bool ok)
947 if (_show_text==false && _textActor!=NULL)
949 _textActor->SetInput("00");
950 _textActor2->SetInput("00");
953 // ----------------------------------------------------------------------------
954 wxVtkBaseView *manualViewBaseContour::GetWxVtkBaseView()
956 return this->_wxvtkbaseview;
958 // ----------------------------------------------------------------------------
959 void manualViewBaseContour::GetSpacing(double spc[3])
965 // ----------------------------------------------------------------------------
966 void manualViewBaseContour::SetSpacing(double spc[3])