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 )
122 // ---------------------------------------------------------------------------
124 void manualViewBaseContour :: RemoveCompleteContourActor()
126 /*vtkRenderer * theRenderer =*/ _wxvtkbaseview->GetRenderer(); // JPRx ??
127 //Removing the spline
131 //Removing each point
132 RemoveControlPoints();
136 // ---------------------------------------------------------------------------
137 manualViewBaseContour * manualViewBaseContour :: Clone( )//virtual
139 manualViewBaseContour * clone = new manualViewBaseContour();
140 CopyAttributesTo(clone);
145 // ---------------------------------------------------------------------------
147 void manualViewBaseContour::CopyAttributesTo( manualViewBaseContour * cloneObject)
150 //XXXX::CopyAttributesTo(cloneObject);
152 cloneObject-> SetWxVtkBaseView( this->_wxvtkbaseview );
153 cloneObject-> SetSelected( this->GetSelected() );
154 cloneObject-> SetPosibleSelected( this->GetPosibleSelected() );
155 cloneObject-> SetIfViewControlPoints( this->GetIfViewControlPoints() );
156 cloneObject-> SetRange( this->GetRange() );
157 cloneObject-> SetZ( this->GetZ() );
158 cloneObject-> SetSpacing( _spc );
159 cloneObject-> SetColorNormalContour( _coulorNormal_r, _coulorNormal_g, _coulorNormal_b );
160 cloneObject-> SetColorEditContour( _coulorEdit_r, _coulorEdit_g, _coulorEdit_b );
161 cloneObject-> SetColorSelectContour( _coulorSelection_r, _coulorSelection_g, _coulorSelection_b );
163 int i, size = _lstViewPoints.size();
164 for ( i=0; i<size; i++ )
166 cloneObject->AddPoint( );
170 // ----------------------------------------------------------------------------
171 void manualViewBaseContour :: AddSplineActor()
173 vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer();
174 if (_contourVtkActor!=NULL)
175 theRenderer->AddActor( _contourVtkActor );
177 // ----------------------------------------------------------------------------
178 void manualViewBaseContour :: RemoveSplineActor() // virtual
180 vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer();
181 if (_contourVtkActor!=NULL)
182 theRenderer->RemoveActor( _contourVtkActor );
184 // ----------------------------------------------------------------------------
185 void manualViewBaseContour :: RemoveControlPoints()
187 if (_wxvtkbaseview!=NULL){
188 vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer();
189 int i,size=_lstViewPoints.size();
190 for (i=0;i<size; i++)
192 vtkActor * pointActor = _lstViewPoints[i]->GetVtkActor();
193 theRenderer->RemoveActor( pointActor );
196 SetIfViewControlPoints( false );
198 // ----------------------------------------------------------------------------
199 void manualViewBaseContour::AddControlPoints()
201 vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer();
202 SetIfViewControlPoints( true );
203 if( _viewControlPoints )
205 int i,size=_lstViewPoints.size();
206 for (i=0;i<size; i++)
208 vtkActor * pointActor = _lstViewPoints[i]->GetVtkActor();
209 theRenderer->AddActor( pointActor );
213 // ----------------------------------------------------------------------------
214 void manualViewBaseContour::AddTextActor()
218 _wxvtkbaseview->GetRenderer()->AddActor2D( _textActor );
219 _wxvtkbaseview->GetRenderer()->AddActor2D( _textActor2 );
222 // ----------------------------------------------------------------------------
223 void manualViewBaseContour::RemoveTextActor()
227 _wxvtkbaseview->GetRenderer()->RemoveActor2D( _textActor );
228 _wxvtkbaseview->GetRenderer()->RemoveActor2D( _textActor2 );
231 // ----------------------------------------------------------------------------
232 void manualViewBaseContour::DeleteVtkObjects()
234 if ( _contourVtkActor != NULL ) { _contourVtkActor -> Delete(); }
235 if ( _bboxMapper != NULL ) { _bboxMapper -> Delete(); }
236 if ( _pts != NULL ) { _pts -> Delete(); }
237 if ( _pd != NULL ) { _pd -> Delete(); }
238 _contourVtkActor = NULL;
245 // ----------------------------------------------------------------------------
246 void manualViewBaseContour::SetWidthLine(double width)
249 this->UpdateColorActor();
251 // for the control points
252 int id, size = _lstViewPoints.size();
253 for( id=0; id<size; id++)
255 this->_lstViewPoints[id]->SetWidthLine(_widthline);
260 // ----------------------------------------------------------------------------
261 double manualViewBaseContour::GetWidthLine()
266 // ----------------------------------------------------------------------------
267 void manualViewBaseContour::ConstructVTKObjects()
271 //JSTG 29-02-08 -----------------------------------------------
272 //int i , nps = _sizePointsContour;
274 int nps = _manContModel->GetNumberOfPointsSpline();
275 //-------------------------------------------------------------
278 _pts = vtkPoints::New();
279 _pts->SetNumberOfPoints(nps);
280 for (i=0 ; i<nps ; i++)
282 _pts->SetPoint(i, 0 , 0 , 0 );
284 // This is for the boundaring inicialisation
287 //_pts->SetPoint(0, 0 , 0 , -1000 );
288 //_pts->SetPoint(1, 0 , 0 , 1000 );
291 // _pts->SetPoint(0, -1000 , -1000 , -1000 );
292 // _pts->SetPoint(1, 1000 , 1000 , 1000 );
294 // This is the structure for the spline
295 _splineCell = vtkCellArray::New();
296 _splineCell->InsertNextCell( nps /* +1 */ );
297 for ( i=0 ; i<nps+1 ; i++ )
299 _splineCell->InsertCellPoint(i % nps );
302 // This is the structure for the spline justo to points (line)
303 // This will be use in the refresh part, in case the spline have only 2 points
304 _lineCell = vtkCellArray::New();
305 _lineCell->InsertNextCell(2);
306 _lineCell->InsertCellPoint(0);
307 _lineCell->InsertCellPoint(1);
309 _pd = vtkPolyData::New();
310 _pd->SetPoints( _pts );
311 _pd->SetLines( _splineCell );
312 // lines->Delete(); //do not delete lines ??
314 _contourVtkActor = vtkActor::New();
315 _bboxMapper = vtkPolyDataMapper::New();
316 _bboxMapper->ScalarVisibilityOff( );
319 //EED 2017-01-01 Migration VTK7
320 #if VTK_MAJOR_VERSION <= 5
321 _bboxMapper->SetInput(_pd);
323 _bboxMapper->SetInputData(_pd);
327 _bboxMapper->ImmediateModeRenderingOn();
328 _contourVtkActor->SetMapper(_bboxMapper);
329 _contourVtkActor->GetProperty()->BackfaceCullingOff();
333 _pd->ComputeBounds();
338 // ----------------------------------------------------------------------------
339 void manualViewBaseContour::SetCellArray(bool type)
343 _pd->SetLines( _splineCell );
345 _pd->SetLines( _lineCell );
349 // ----------------------------------------------------------------------------
350 void manualViewBaseContour::InitTextActor()
353 _textActor = vtkTextActor::New();
354 // _textActor->SetDisplayPosition(200, 200);
355 _textActor->SetInput("00");
356 // Set coordinates to match the old vtkScaledTextActor default value
357 // _textActor->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport();
358 // _textActor->GetPosition2Coordinate()->SetValue( 0.2 , 0.2 );
359 _textActor->GetPositionCoordinate()->SetCoordinateSystemToWorld ();
360 // _textActor->GetPositionCoordinate()->SetValue( 0.8 , 0.8 );
362 vtkTextProperty *tprop = _textActor->GetTextProperty();
363 tprop->SetFontSize(14);
364 tprop->SetFontFamilyToArial();
365 tprop->SetColor(1, 1, 0);
369 _textActor2 = vtkTextActor::New();
370 // _textActor->SetDisplayPosition(200, 200);
371 _textActor2->SetInput("00");
372 // Set coordinates to match the old vtkScaledTextActor default value
373 // _textActor2->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport();
374 // _textActor2->GetPosition2Coordinate()->SetValue( 0.2 , 0.2 );
375 _textActor2->GetPositionCoordinate()->SetCoordinateSystemToWorld ();
376 // _textActor2->GetPositionCoordinate()->SetValue( 0.8 , 0.8 );
378 vtkTextProperty *tprop2 = _textActor2->GetTextProperty();
379 tprop2->SetFontSize(14);
380 tprop2->SetFontFamilyToArial();
381 tprop2->SetColor(1, 1, 0);
385 // ----------------------------------------------------------------------------
386 void manualViewBaseContour::CreateNewContour()
388 ConstructVTKObjects();
390 _wxvtkbaseview->GetRenderer()->AddActor( _contourVtkActor );
391 _wxvtkbaseview->GetRenderer()->AddActor2D(_textActor);*/
392 AddCompleteContourActor();
394 // ----------------------------------------------------------------------------
395 void manualViewBaseContour::UpdateViewPoint(int id) // virtual
397 manualPoint *mp = _manContModel->GetManualPoint(id);
400 double XX=mp->GetX(),YY=mp->GetY(),ZZ=mp->GetZ();
401 // wxVtk2DBaseView *wxvtk2Dbasevie = (wxVtk2DBaseView*)this->GetWxVtkBaseView();
402 // wxvtk2Dbasevie->TransformCoordinate_spacing_ModelToView(XX,YY,ZZ);
404 _lstViewPoints[id]->SetPositionXY( XX , YY ,_range, ZZ );
407 // ----------------------------------------------------------------------------
408 void manualViewBaseContour::UpdateViewPoints()
410 int id, size = _lstViewPoints.size();
411 for( id=0; id<size; id++)
413 UpdateViewPoint( id );
417 // ----------------------------------------------------------------------------
418 void manualViewBaseContour::AddPoint()
420 manualViewPoint *mvp = new manualViewPoint( this->GetWxVtkBaseView() );
423 // ----------------------------------------------------------------------------
424 void manualViewBaseContour::AddPoint( manualViewPoint * manualViewPoint )
426 _lstViewPoints.push_back( manualViewPoint );
429 manualViewPoint->SetSpacing(_spc);
431 vtkActor *actor = manualViewPoint->CreateVtkPointActor();
432 _wxvtkbaseview->GetRenderer()->AddActor( actor );
435 // ----------------------------------------------------------------------------
436 void manualViewBaseContour::InsertPoint(int id)
438 manualViewPoint *mvp = new manualViewPoint( this->GetWxVtkBaseView() );
441 mvp->SetSpacing(_spc);
443 std::vector<manualViewPoint*>::iterator itNum = _lstViewPoints.begin() + id;
444 _lstViewPoints.insert(itNum,mvp);
445 _wxvtkbaseview->GetRenderer()->AddActor( mvp->CreateVtkPointActor() );
447 // ----------------------------------------------------------------------------
448 void manualViewBaseContour::DeleteContour()
450 RemoveCompleteContourActor();
451 /*if (_contourVtkActor!=NULL){
452 _wxvtkbaseview->GetRenderer()->RemoveActor( _contourVtkActor );
455 int i,size=_lstViewPoints.size();
456 for (i=0;i<size;i++){
457 manualViewBaseContour::DeletePoint(0);
461 // ----------------------------------------------------------------------------
462 void manualViewBaseContour::DeletePoint(int id) // virtual
464 int size=_lstViewPoints.size();
465 if ( (id>=0) && (id<size) ){
466 manualViewPoint *mvp =_lstViewPoints[id];
468 // _handlePicker->DeletePickList(mvp->GetVtkActor());
469 _wxvtkbaseview->GetRenderer()->RemoveActor( mvp->GetVtkActor() );
470 std::vector<manualViewPoint*>::iterator itNum = _lstViewPoints.begin() + id;
471 _lstViewPoints.erase(itNum);
476 // ----------------------------------------------------------------------------
477 void manualViewBaseContour::DeletePoint(int x, int y, int z)
479 int id=GetIdPoint(x,y,z);
484 // ----------------------------------------------------------------------------
485 void manualViewBaseContour::SetSelected(bool selected)
489 // ----------------------------------------------------------------------------
490 void manualViewBaseContour::SetPosibleSelected(bool posibleSelected)
492 _posibleSelected=posibleSelected;
494 // ----------------------------------------------------------------------------
495 bool manualViewBaseContour::GetEditable()
499 // ----------------------------------------------------------------------------
500 void manualViewBaseContour::SetEditable( bool * condition )
502 _editable = condition;
504 // ----------------------------------------------------------------------------
505 bool manualViewBaseContour::GetSelected()
509 // ----------------------------------------------------------------------------
510 bool manualViewBaseContour::GetPosibleSelected()
512 return _posibleSelected;
514 // ----------------------------------------------------------------------------
515 void manualViewBaseContour::DeleteSelectedPoints()
517 int i,size=_lstViewPoints.size();
518 for (i=size-1;i>=0;i--){
519 if (_lstViewPoints[i]->GetSelected()==true){
525 // ----------------------------------------------------------------------------
526 void manualViewBaseContour::SelectPoint(int i, bool select)
528 _lstViewPoints[i]->SetSelected(select);
530 // ----------------------------------------------------------------------------
531 void manualViewBaseContour::SelectLstPoints()
535 // ----------------------------------------------------------------------------
536 void manualViewBaseContour::SelectAllPoints(bool select)
538 int i,size=_lstViewPoints.size();
539 for (i=0;i<size;i++){
540 SelectPoint(i,select);
543 //-----------------------------------------------------------------------------
544 void manualViewBaseContour:: SetIfViewControlPoints(bool ifShow)
546 _viewControlPoints = ifShow;
548 // ----------------------------------------------------------------------------
549 bool manualViewBaseContour:: GetIfViewControlPoints()
551 return _viewControlPoints;
554 // ----------------------------------------------------------------------------
555 void manualViewBaseContour::SetPointPosibleSelected(int id,bool select)
557 _lstViewPoints[id]->SetPosibleSelected(select);
559 // ----------------------------------------------------------------------------
560 void manualViewBaseContour::SetPointSelected(int id,bool select)
562 _lstViewPoints[id]->SetSelected(select);
564 // ----------------------------------------------------------------------------
565 void manualViewBaseContour::SelectAllPossibleSelected(bool select)
567 int i,size=_lstViewPoints.size();
568 for (i=0;i<size;i++){
569 SetPointPosibleSelected(i,select);
572 // ----------------------------------------------------------------------------
573 int manualViewBaseContour::SelectPosiblePoint(int x, int y, int z) // virtual
575 SelectAllPossibleSelected(false);
577 int id = GetIdPoint(x,y,z);
580 SetPointPosibleSelected(id,true);
584 // ----------------------------------------------------------------------------
585 bool manualViewBaseContour::SelectPosibleContour(int x, int y, int z)
588 SetPosibleSelected(result);
589 int id = GetIdPoint(x,y,z);
591 if( !GetEditable() && !_selected && id!= -1)
594 _posibleSelected=true;
598 if ( (GetEditable()==true) && (id==-1 ) && (this->_lstViewPoints.size()>=2) )
600 if (ifTouchContour(x,y,z)==true)
603 SetPosibleSelected(result);
607 if (GetEditable()==false)
609 if (ifTouchContour(x,y,z)==true)
612 SetPosibleSelected(result);
618 // ----------------------------------------------------------------------------
619 bool manualViewBaseContour::ifTouchContour(int x,int y, int z) // virtual
623 // ----------------------------------------------------------------------------
624 void manualViewBaseContour::UnSelectPoint(int i){
625 _lstViewPoints[i]->SetSelected(false);
628 // ----------------------------------------------------------------------------
629 void manualViewBaseContour::UnSelectLstPoints(){
632 // ----------------------------------------------------------------------------
633 void manualViewBaseContour::UnSelectAllPoints(){
634 int i,size=_lstViewPoints.size();
635 for (i=0;i<size;i++){
640 // ----------------------------------------------------------------------------
641 void manualViewBaseContour::SetModel(manualBaseModel *manContModel){
642 _manContModel=manContModel;
644 // ----------------------------------------------------------------------------
645 void manualViewBaseContour::SetWxVtkBaseView(wxVtkBaseView *wxvtkbaseview){
646 _wxvtkbaseview = wxvtkbaseview;
648 // ----------------------------------------------------------------------------
649 void manualViewBaseContour::RefreshContour() // Virtual
652 // ----------------------------------------------------------------------------
653 double* manualViewBaseContour::GetVectorPointsXManualContour(){
655 int i,size = _sizePointsContour;
656 double *vx = (double*)malloc(sizeof(double)*size);
657 for (i=0;i<size;i++){
658 _pts->GetPoint(i,pp);
663 // ----------------------------------------------------------------------------
664 double* manualViewBaseContour::GetVectorPointsYManualContour()
667 int i,size = _sizePointsContour;
668 double *vy = (double*)malloc(sizeof(double)*size);
669 for (i=0;i<size;i++){
670 _pts->GetPoint(i,pp);
675 // ----------------------------------------------------------------------------
676 double* manualViewBaseContour::GetVectorPointsZManualContour()
679 int i,size = _sizePointsContour;
680 double *vz = (double*)malloc(sizeof(double)*size);
681 for (i=0;i<size;i++){
682 _pts->GetPoint(i,pp);
687 // ----------------------------------------------------------------------------
688 void manualViewBaseContour::Refresh() // virtual
690 if (_contourVtkActor!=NULL)
694 int i,size=_lstViewPoints.size();
695 for (i=0;i<size;i++){
697 _lstViewPoints[i]->UpdateColorActor();
701 if (_show_text==true)
706 vtkRenderWindowInteractor *vri = _wxvtkbaseview->GetWxVTKRenderWindowInteractor ();
709 _wxvtkbaseview->GetRenWin()->Render();
710 printf("EED %p How to optimize manualViewBaseContour::Refresh() \n",this);
714 // ----------------------------------------------------------------------------
715 void manualViewBaseContour::RefreshText() // virtual
717 if( _textActor!=NULL)
719 _textActor -> SetInput("00");
720 _textActor2 -> SetInput("00");
723 // ----------------------------------------------------------------------------
724 void manualViewBaseContour::SetColorNormalContour(double r, double g, double b)
730 // ----------------------------------------------------------------------------
731 void manualViewBaseContour::GetColorNormalContour(double &r, double &g, double &b)
737 // ----------------------------------------------------------------------------
738 void manualViewBaseContour::SetColorEditContour(double r, double g, double b)
744 // ----------------------------------------------------------------------------
745 void manualViewBaseContour::GetColorEditContour(double &r, double &g, double &b)
751 // ----------------------------------------------------------------------------
752 void manualViewBaseContour::SetColorSelectContour(double r, double g, double b)
754 _coulorSelection_r = r;
755 _coulorSelection_g = g;
756 _coulorSelection_b = b;
758 // ----------------------------------------------------------------------------
759 void manualViewBaseContour::GetColorSelectContour(double &r, double &g, double &b)
761 r = _coulorSelection_r;
762 g = _coulorSelection_g;
763 b = _coulorSelection_b;
765 // ----------------------------------------------------------------------------
766 void manualViewBaseContour::UpdateColorActor()
768 if (_contourVtkActor!=NULL)
770 _contourVtkActor->GetProperty()->SetLineWidth( _widthline );
771 _contourVtkActor->GetProperty()->SetDiffuseColor( _coulorNormal_r , _coulorNormal_g , _coulorNormal_b );
772 if (_posibleSelected || (_posibleSelected && GetEditable() ) )
774 _contourVtkActor->GetProperty()->SetDiffuseColor( _coulorEdit_r , _coulorEdit_g , _coulorEdit_b );
778 _contourVtkActor->GetProperty()->SetDiffuseColor( _coulorSelection_r , _coulorSelection_g , _coulorSelection_b );
782 // ----------------------------------------------------------------------------
783 int manualViewBaseContour::GetIdPoint(int x, int y, int z) // virtual
786 if (_manContModel!=NULL){
790 TransfromCoordViewWorld(xx,yy,zz);
791 ii=_manContModel->GetIdPoint(xx,yy,zz,_range,-1);
796 // ----------------------------------------------------------------------------
799 int manualViewBaseContour::GetNumberOfPoints()
801 return _lstViewPoints.size();
804 // ----------------------------------------------------------------------------
806 //JSTG 25-02-08 ---------------------------------------------------------------
807 /*int manualViewBaseContour::GetNumberOfPointsSpline()
809 return _sizePointsContour;
811 //----------------------------------------------------------------------------
813 //JSTG 25-02-08 ---------------------------------------------------------------
814 /*void manualViewBaseContour::SetNumberOfPointsSpline(int size)
816 _sizePointsContour = size;
818 //----------------------------------------------------------------------------
820 void manualViewBaseContour::TransfromCoordViewWorld(double &X, double &Y, double &Z, int type) // Virtual
822 _wxvtkbaseview->TransFromCoordScreenToWorld(X, Y, Z,false, type);
827 // wxVtk2DBaseView *wxvtk2Dbaseview = (wxVtk2DBaseView*)_wxvtkbaseview;
828 // wxvtk2Dbaseview->TransformCoordinate_spacing_ModelToView(X,Y,Z);
831 // ----------------------------------------------------------------------------
832 void manualViewBaseContour::SetRange(double range)
836 // ----------------------------------------------------------------------------
837 double manualViewBaseContour::GetRange()
841 // ----------------------------------------------------------------------------
842 void manualViewBaseContour::SetZ(int z)
846 // ----------------------------------------------------------------------------
847 int manualViewBaseContour::GetZ()
852 // ----------------------------------------------------------------------------
853 void manualViewBaseContour::InitMove(int x, int y, int z) // virtual
857 // ----------------------------------------------------------------------------
858 void manualViewBaseContour::MoveContour(int x, int y, int z) // virtual
861 // ----------------------------------------------------------------------------
862 void manualViewBaseContour::MoveContour(int horizontalUnits, int verticalUnits )// virtual
866 // ----------------------------------------------------------------------------
867 void manualViewBaseContour::GetMinMax( double &minX,double &minY, double &minZ, double &maxX, double &maxY, double &maxZ )// virtual
872 int size=_manContModel->GetSizeLstPoints();
877 bool ifFindZ = minZ!=-1.0 && maxZ!=-1.0;
883 for( i = 0; i < size; i++ )
885 mp=_manContModel->GetManualPoint(i);
937 // ----------------------------------------------------------------------------
938 void manualViewBaseContour::ClearContour()
940 if (_contourVtkActor!=NULL){
941 _wxvtkbaseview->GetRenderer()->RemoveActor( _contourVtkActor );
944 int i,size=_lstViewPoints.size();
945 for (i=0;i<size;i++){
950 // ----------------------------------------------------------------------------
951 void manualViewBaseContour::ClearPoint(int id)
955 // ----------------------------------------------------------------------------
956 void manualViewBaseContour::SetVisible(bool ok)
966 int i,size=_lstViewPoints.size();
967 for (i=0;i<size;i++){
968 actor = _lstViewPoints[i]->GetVtkActor();
969 actor->GetProperty()->SetOpacity( opacity );
971 _contourVtkActor->GetProperty()->SetOpacity( opacity );
972 _textActor->GetProperty()->SetOpacity( opacity );
973 _textActor->SetInput("00");
974 _textActor2->GetProperty()->SetOpacity( opacity );
975 _textActor2->SetInput("00");
978 // ----------------------------------------------------------------------------
979 void manualViewBaseContour::SetShowText(bool ok)
982 if (_show_text==false && _textActor!=NULL)
984 _textActor->SetInput("00");
985 _textActor2->SetInput("00");
988 // ----------------------------------------------------------------------------
989 wxVtkBaseView *manualViewBaseContour::GetWxVtkBaseView()
991 return this->_wxvtkbaseview;
993 // ----------------------------------------------------------------------------
994 void manualViewBaseContour::GetSpacing(double spc[3])
1000 // ----------------------------------------------------------------------------
1001 void manualViewBaseContour::SetSpacing(double spc[3])