bbtk::manualConnectorContourController Class Reference

#include <manualConnectorContourController.h>

List of all members.

Public Member Functions

 manualConnectorContourController ()
 ~manualConnectorContourController ()
virtual void MouseClickRight (int x, int y)
virtual void MouseClickLeft (int x, int y)
virtual void MouseMove (int x, int y)
void endContourCreation ()


Detailed Description

Definition at line 62 of file manualConnectorContourController.h.


Constructor & Destructor Documentation

bbtk::manualConnectorContourController::manualConnectorContourController (  ) 

Definition at line 44 of file manualConnectorContourController.cxx.

00045         {               
00046         }

bbtk::manualConnectorContourController::~manualConnectorContourController (  ) 

Definition at line 50 of file manualConnectorContourController.cxx.

00051         {
00052         }


Member Function Documentation

void bbtk::manualConnectorContourController::endContourCreation (  ) 

Definition at line 182 of file manualConnectorContourController.cxx.

Referenced by bbtk::GConnectorController::endContourCreation(), and MouseClickLeft().

00183         {
00184                 SetCompleteCreation( true );
00185                 SetKeyBoardMoving( false );
00186                 GetManualContourModel()->SetCloseContour(false);
00187 
00188                 SetEditable( false );
00189                 SetPosibleToMove( false );
00190                 SetState(0);
00191         }

Here is the caller graph for this function:

void bbtk::manualConnectorContourController::MouseClickLeft ( int  x,
int  y 
) [virtual]

Definition at line 96 of file manualConnectorContourController.cxx.

References endContourCreation().

Referenced by bbtk::GConnectorController::OnLeftButtonDown().

00097         {
00098 
00099                 bool ok = false;
00100                 int z   = GetZ();
00101                 int size= GetManualViewBaseContour()->GetNumberOfPoints();
00102 
00103                 // Insert a Control Point with shift+ClickLeft
00104                 vtkRenderWindowInteractor *vtkrenderwindowinteractor = _vtkInteractorStyleBaseView->GetInteractor();
00105                 if( IsEditable() )
00106                 {
00107                         if ( (_vtkInteractorStyleBaseView!=NULL) && (GetState()==0) && ( (vtkrenderwindowinteractor!=NULL) && (vtkrenderwindowinteractor->GetShiftKey()==1) ) )
00108                         {
00109                                 ok=true;
00110                                 InsertPoint(x,y,z);
00111                                 size++;
00112                         }
00113                         // Start to Insert Control Points with ClickLeft (Empty contour)
00114                         if ((GetState()==0) && (size==0) && (_easyCreation==true) )
00115                         {
00116                                 ok=true;
00117                                 SetState(1);
00118                                 GetManualContourModel()->SetCloseContour(false);
00119                                 AddPoint(x,y,z);
00120                         }
00121 
00122                         // RaC Just create 2 points
00123                         if ((GetState()==1) && (_easyCreation==true) && GetNumberOfPointsManualContour()==2)
00124                         {
00125                                 ok=true;
00126                                 endContourCreation();
00127                         }
00128 
00129                         // Continue to Insert Control Points with ClickLeft (After being empty the contour)
00130                         if ((GetState()==1) && (_easyCreation==true) )
00131                         {
00132                                 ok=true;
00133                                 AddPoint(x,y,z);
00134                                 _bakIdPoint=GetNumberOfPointsManualContour() - 1;
00135                         }
00136 
00137                         // Insert Control Points IF Contour si Selected
00138                         if ((GetState()==0) && GetManualViewBaseContour()->GetPosibleSelected() )
00139                         {
00140                                 ok=true;
00141                                 InsertPoint(x,y,z);
00142                                 _bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
00143                                 SetState(6);
00144                         }
00145                         // Chose id of Control Point to be move
00146                         if ( (GetState()==0 || GetState()==6) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)!=-1 ) )
00147                         {
00148                                 ok=true;
00149                                 _bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
00150                                 if(_bakIdPoint!=0 && _bakIdPoint!=GetManualViewBaseContour()->GetNumberOfPoints()-1)
00151                                 {
00152                                         SetState(5);
00153                                 }
00154                         }
00155                         // If nothing selected _state=7
00156                         if ( (GetState()==0) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)==-1 ) )
00157                         {
00158                                 //ok=true;
00159                                 _bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
00160                                 SetState(7);
00161                         }
00162                 }else{
00163                         SetPosibleToMove( true );
00164                         GetManualViewBaseContour()->SetSelected( GetManualViewBaseContour()->GetPosibleSelected() );
00165                 } // IsEditable
00166                 
00167                 if ( GetState() == 0 && GetManualViewBaseContour()->GetPosibleSelected() )
00168                 {
00169                         SetMoving( true );
00170                         ok=true;
00171                         GetManualViewBaseContour()->InitMove(x,y,z);
00172                         SetState(6);
00173                 }
00174                 if (ok==true)
00175                 {
00176                         GetManualViewBaseContour()->Refresh();
00177                 }
00178         }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::manualConnectorContourController::MouseClickRight ( int  x,
int  y 
) [virtual]

Definition at line 82 of file manualConnectorContourController.cxx.

Referenced by bbtk::GConnectorController::OnRightButtonDown().

00083         {
00084                 SetCompleteCreation( true );
00085                 SetKeyBoardMoving( false );
00086                 GetManualContourModel()->SetCloseContour(false);
00087 
00088                 SetEditable( false );
00089                 SetPosibleToMove( false );
00090                 SetState(0);
00091                 
00092         }

Here is the caller graph for this function:

void bbtk::manualConnectorContourController::MouseMove ( int  x,
int  y 
) [virtual]

Definition at line 56 of file manualConnectorContourController.cxx.

Referenced by bbtk::GConnectorController::OnMouseMove().

00057         {
00058                 int z=GetZ();
00059                 GetManualViewBaseContour()->SelectPosiblePoint(x,y,z);
00060                 GetManualViewBaseContour()->SelectPosibleContour(x,y,z);
00061                 if (GetState()==1){     SetPoint( _bakIdPoint , x , y ,z); }
00062                 if (GetState()==5){     SetPoint( _bakIdPoint , x , y ,z); }
00063                 if ( GetState()==6 && !IsEditable() && GetPosibleToMove() &&IsMoving() )
00064                 {
00065                         //GetManualViewBaseContour()->MoveContour(x,y,z);
00066                 }
00067                 if (GetState()!=7 || GetManualViewBaseContour()->GetPosibleSelected() ){
00068                         GetManualViewBaseContour()->Refresh();
00069                         this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
00070                 }
00071                 if (!IsEditable())
00072                 {
00073                         GetManualViewBaseContour()->RemoveControlPoints();
00074                         GetManualViewBaseContour()->Refresh();
00075                         this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
00076                 }
00077 
00078         }

Here is the caller graph for this function:


The documentation for this class was generated from the following files:

Generated on Thu May 31 15:13:41 2012 for bbtkGEditor by  doxygen 1.5.7.1