wxVtkBaseView_SceneManager Class Reference

#include <wxVtkBaseView_SceneManager.h>

Collaboration diagram for wxVtkBaseView_SceneManager:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 wxVtkBaseView_SceneManager (wxVtkBaseView *theWxBaseViewToManage, wxEvtHandler *theEventHandler, double *spc)
 ~wxVtkBaseView_SceneManager ()
void sendEnvent (WXTYPE theEventType, std::string text)
void setWxVtkViewBase (wxVtkBaseView *theBaseView)
void setWxEventHandler (wxEvtHandler *theEventHandler)
wxVtkBaseView * getWxVtkViewBase ()
void configureViewControlTo (std::string theKeyName, manualBaseModel *manContourControl, double *spc, int typeContour)
void configureSelectionROI (double *spc)
ContourWrap_ViewControlinsertWrap (std::string theKeyName, manualContourBaseControler *manContourControl, manualViewBaseContour *manViewerContour)
void desconfigureViewControlOf (std::string theKeyName)
void removeWrap (std::string theKeyName)
ContourWrap_ViewControlgetContourWrap_ViewControlOf (std::string theName)
ContourWrap_ViewControlgetContourWrap_ViewControlOf (std::string theName, std::map< std::string, ContourWrap_ViewControl * > *theMap)
manualContourBaseControler * getControlerOf (std::string theName)
manualViewBaseContour * getViewerOf (std::string theName)
void set_creatingMULT_ROI (bool condition)
void set_editingROI (bool condition)
void set_toIncludeAtInteractionGroup (bool condition)
void set_waiting (bool condition)
bool get_creatingMULT_ROI ()
bool get_editingROI ()
bool get_toIncludeAtInteractionGroup ()
bool get_waiting ()
bool get_creatingROI ()
void set_creatingROI (bool theCondition)
void createCopyContourOf (std::string anExistingKName, std::string cloneName, manualBaseModel *manualModel, bool append=false)
void removeFromScene (ContourWrap_ViewControl *contourWRP, bool visualization=true, bool control=true)
void removeFromScene (std::string theKeyName, bool visualization=true, bool control=true)
void removeSceneContours ()
void removeAllOutlines ()
void addToScene (std::string theKeyName, bool append=true, bool visualization=true, bool control=true, bool ifActive=true, bool ifShowCtrlPoints=true)
void addToScene (std::string theKeyName, ContourWrap_ViewControl *contourWRP, bool append=true, bool visualization=true, bool control=true, bool ifActive=true, bool ifShowCtrlPoints=true)
void removeFromScene (std::vector< std::string > theKeyNameVector, bool visualization=true, bool control=true)
void addToScene (std::vector< std::string > theKeyNameVector, bool append=true, bool visualization=true, bool control=true, bool ifActive=true, bool ifShowCtrlPoints=true)
void setControlActiveStateOfALL (bool stateCondition)
void setControlActiveStateOf (std::string theKeyName, bool stateCondition)
void setControlActiveStateOf (ContourWrap_ViewControl *contourWRP, bool stateCondition)
void setVisibleStateOf (std::string theKeyName, bool stateCondition)
std::vector< std::string > getSelectedObjects ()
void selectObjects (std::vector< std::string > theExistingObjectsToSelect)
void selectObjects (std::map< std::string, ContourWrap_ViewControl * > *theMap)
void setControlActiveStateOf (std::vector< std::string > &theKeyNameVector, bool controlCondition=false)
void setControlActiveStateOf (std::map< std::string, ContourWrap_ViewControl * > *theMap, bool controlCondition=false)
void drawSelectionROI ()
void setSelection2DROIInternalOutlines ()
void writeCoords (std::string method)
void SaveThingName (FILE *ff, std::string nameThing)
void GetPointsOfActualContour (std::vector< double > *vecX, std::vector< double > *vecY, std::vector< double > *vecZ)
vtkImageData * GetImageData ()
std::vector< std::string > GetlstContoursNameActualSlice ()
virtual bool OnChar ()
virtual bool OnMouseMove ()
virtual bool OnLeftButtonDown ()
virtual bool OnLeftButtonUp ()
virtual bool OnMiddleButtonDown ()
virtual bool OnMiddleButtonUp ()
virtual bool OnRightButtonDown ()
virtual bool OnRightButtonUp ()
virtual bool OnLeftDClick ()
virtual bool OnRightDClick ()
virtual bool OnMiddleDClick ()
virtual bool OnMouseWheel ()
int GetImageDataSizeZ ()
void GetImageDataRange (double *range)
void SetWidthContour (double width)
bool isEditableCControler (std::string theKeyName)
void deleteCViewerCControler (std::string theKeyName)
bool isCtrlPressed ()
bool isShiftPressed ()
char getLastKeyCode ()

Private Attributes

std::map< std::string,
ContourWrap_ViewControl * > * 
_contours_ViewControl
std::map< std::string,
ContourWrap_ViewControl * > * 
_sceneContours_ViewControl
wxVtkBaseView * _wxVtk_BaseView
wxEvtHandler * _eventHandler
ContourWrap_ViewControl_lastInteraction
std::string _lastInteractionName
std::map< std::string,
ContourWrap_ViewControl * > * 
_workingGroup
bool _creatingMULT_ROI
bool _editingROI
bool _toIncludeAtInteractionGroup
bool _waiting
bool _creatingROI
int _enventID
int _leftClickCount
int _rigthClickCount
int clickX
int clickY
char _lastKeyCode
long int onCharCallBackTimeEnd
long int onCharNeeded
bool _drawingSelectionROI
manualRoiControler * _controlerSelectionROI
manualViewRoi * _viewerSelectionROI
manualBaseModel * _modelSelectionROI
double _widthOfContour
double _widthOfControlPoint
bool _ctrlKey
bool _shiftKey


Detailed Description

file wxVtkBaseView_SceneManager.h

Definition at line 68 of file wxVtkBaseView_SceneManager.h.


Constructor & Destructor Documentation

wxVtkBaseView_SceneManager::wxVtkBaseView_SceneManager ( wxVtkBaseView *  theWxBaseViewToManage,
wxEvtHandler *  theEventHandler,
double *  spc 
)

Definition at line 41 of file wxVtkBaseView_SceneManager.cxx.

00042         {
00043                 
00044                 _lastInteraction                                = NULL;
00045                 _lastInteractionName                            = "";
00046                 _eventHandler                                   = theEventHandler;
00047                 _leftClickCount                                 = 0;
00048                 _rigthClickCount                                = 0;
00049                 
00050                 _contours_ViewControl                           = new std::map< std::string, ContourWrap_ViewControl * >();
00051                 _sceneContours_ViewControl                      = new std::map< std::string, ContourWrap_ViewControl * >();
00052                 _workingGroup                                   = new std::map< std::string, ContourWrap_ViewControl * >();
00053 
00054                 _creatingMULT_ROI                               = false;
00055                 _editingROI                                     = false;
00056                 _toIncludeAtInteractionGroup                    = false;
00057                 _waiting                                        = false;
00058                 _creatingROI                                    = false;
00059                 _drawingSelectionROI                            = false;
00060                 SetWidthContour(1.0);
00061                 
00062                 _wxVtk_BaseView = theWxBaseViewToManage;
00063                 if( _wxVtk_BaseView!=NULL )
00064                 {
00065                         vtkInteractorStyleBaseView* theInteractorStyleBaseView = (vtkInteractorStyleBaseView*)_wxVtk_BaseView->GetInteractorStyleBaseView();
00066                         theInteractorStyleBaseView->AddInteractorStyleMaracas( this );
00067                         SetVtkInteractorStyleBaseView( theInteractorStyleBaseView );                    
00068                 }
00069                 configureSelectionROI( spc );
00070         }

wxVtkBaseView_SceneManager::~wxVtkBaseView_SceneManager (  ) 

Definition at line 72 of file wxVtkBaseView_SceneManager.cxx.

References _contours_ViewControl, _lastInteraction, and _workingGroup.

00073         {
00074                 std::map <std::string, ContourWrap_ViewControl *>::iterator iter = _contours_ViewControl->begin(); 
00075                 int size = _contours_ViewControl->size();
00076                 for ( int i = 0; i<size; iter++ )
00077                 {
00078                         _contours_ViewControl->erase( iter );
00079                         i++;
00080                 }
00081                 _contours_ViewControl->clear();         
00082                 delete _contours_ViewControl;           
00083                 _workingGroup->clear();
00084                 delete _lastInteraction;
00085                 delete _workingGroup;
00086                 //delete _contours_ViewControl;
00087         }


Member Function Documentation

void wxVtkBaseView_SceneManager::addToScene ( std::vector< std::string >  theKeyNameVector,
bool  append = true,
bool  visualization = true,
bool  control = true,
bool  ifActive = true,
bool  ifShowCtrlPoints = true 
)

Definition at line 524 of file wxVtkBaseView_SceneManager.cxx.

References addToScene().

00525         {
00526                 int i, size = theKeyNameVector.size();
00527                 for( i=0; i< size; i++ )
00528                 {
00529                         addToScene( theKeyNameVector[i], append, visualization, control, ifActive, ifShowCtrlPoints );
00530                 }
00531         }

Here is the call graph for this function:

void wxVtkBaseView_SceneManager::addToScene ( std::string  theKeyName,
ContourWrap_ViewControl contourWRP,
bool  append = true,
bool  visualization = true,
bool  control = true,
bool  ifActive = true,
bool  ifShowCtrlPoints = true 
)

Definition at line 490 of file wxVtkBaseView_SceneManager.cxx.

References _sceneContours_ViewControl, _wxVtk_BaseView, ContourWrap_ViewControl::getControler(), ContourWrap_ViewControl::getViewer(), and removeSceneContours().

00491         {
00492                 if( !append )
00493                 {
00494                         removeSceneContours();                  
00495                 }               
00496                 _sceneContours_ViewControl->insert(std::pair <std::string, ContourWrap_ViewControl *> ( theKeyName, contourWRP ) );             
00497                 if ( visualization )
00498                 {
00499                         contourWRP->getViewer()->AddCompleteContourActor( ifShowCtrlPoints );
00500                 }
00501 
00502                 if( control )
00503                 {
00504                         ((vtkInteractorStyleBaseView*)_wxVtk_BaseView->GetInteractorStyleBaseView())->AddInteractorStyleMaracas( contourWRP->getControler() );
00505                 }
00506                 if( ifActive )
00507                 {
00508                         contourWRP->getControler()->SetActive( true );  
00509                         contourWRP->getViewer()->RemoveTextActor();
00510                 }
00511         }

Here is the call graph for this function:

void wxVtkBaseView_SceneManager::addToScene ( std::string  theKeyName,
bool  append = true,
bool  visualization = true,
bool  control = true,
bool  ifActive = true,
bool  ifShowCtrlPoints = true 
)

Definition at line 477 of file wxVtkBaseView_SceneManager.cxx.

References _sceneContours_ViewControl, getContourWrap_ViewControlOf(), and removeSceneContours().

Referenced by wxContourViewPanel::addNameWrapperToScene(), addToScene(), configureViewControlTo(), and createCopyContourOf().

00478         {
00479                 if( !append )
00480                 {
00481                         removeSceneContours();                  
00482                 }
00483                 ContourWrap_ViewControl * contourWRP =  getContourWrap_ViewControlOf( theKeyName );
00484                 _sceneContours_ViewControl->insert(std::pair <std::string, ContourWrap_ViewControl *> ( theKeyName, contourWRP ) );             
00485 
00486                 addToScene( theKeyName, contourWRP, true, visualization, control, ifActive, ifShowCtrlPoints);
00487         }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkBaseView_SceneManager::configureSelectionROI ( double *  spc  ) 

Definition at line 221 of file wxVtkBaseView_SceneManager.cxx.

References _controlerSelectionROI, _modelSelectionROI, _viewerSelectionROI, and _wxVtk_BaseView.

00222         {
00223                 _controlerSelectionROI = new manualRoiControler();
00224                 _viewerSelectionROI = new manualViewRoi();
00225                 _modelSelectionROI = new manualContourModel();
00226                 
00227                 _viewerSelectionROI->SetModel( _modelSelectionROI );
00228                 _viewerSelectionROI->SetWxVtkBaseView( _wxVtk_BaseView );
00229                 _viewerSelectionROI->SetRange( 2 );
00230                 _viewerSelectionROI->SetZ( -900 );
00231                 _viewerSelectionROI->SetColorNormalContour(0.6, 0.8, 0);
00232 
00233                 _viewerSelectionROI->SetSpacing( spc );
00234 
00235                 _controlerSelectionROI->SetModelView( _modelSelectionROI , _viewerSelectionROI );
00236                 ((vtkInteractorStyleBaseView*)_wxVtk_BaseView->GetInteractorStyleBaseView())->AddInteractorStyleMaracas( _controlerSelectionROI );
00237                 _controlerSelectionROI->SetActive(false);
00238         }

void wxVtkBaseView_SceneManager::configureViewControlTo ( std::string  theKeyName,
manualBaseModel *  manContourControl,
double *  spc,
int  typeContour 
)

Definition at line 127 of file wxVtkBaseView_SceneManager.cxx.

References _creatingROI, _lastInteraction, _lastInteractionName, _waiting, _widthOfContour, _widthOfControlPoint, _wxVtk_BaseView, addToScene(), ContourWrap_ViewControl::getControler(), ContourWrap_ViewControl::getViewer(), and insertWrap().

Referenced by wxContourViewPanel::configureViewControlTo(), wxContourMainFrame::createContour(), wxContourMainFrame::onCreateContourBullEye(), and wxContourMainFrame::openContours().

00128         {
00129                 //setControlActiveStateOfALL( false );
00130                 _creatingROI = true;
00131                 _waiting = false;       
00132                 if( _lastInteraction!=NULL )
00133                 {
00134                         _lastInteraction->getControler()->SetEditable( false );
00135                         _lastInteraction->getViewer()->Refresh();
00136                         _lastInteraction->getControler()->SetActive( false );
00137                         this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
00138                 }
00139 
00140 
00141                 manualContourBaseControler *manContourControl;
00142                 manualViewBaseContour           *manViewerContour;
00143 
00144                 // Creating the view manualViewContour and the manualContourControler
00145                 // NOTE: The model is created in the KernelManagerContour class, factoryManualContourModel method
00146                 if (typeContour==1)
00147                 {
00148                         manContourControl       = new manualContourControler();
00149                         manViewerContour        = new manualViewContour();
00150                 }
00151 
00152                 if (typeContour==2)
00153                 {
00154                         manContourControl       = new manualRoiControler();
00155                         manViewerContour        = new manualViewRoi();
00156                 }
00157 
00158                 if (typeContour==3)
00159                 {
00160                         manContourControl       = new manualCircleControler();
00161                         manViewerContour        = new manualViewCircle();
00162                 }
00163 
00164                 if (typeContour==4)
00165                 {
00166                         manContourControl       = new manualRoiControler();
00167                         manViewerContour        = new manualViewBullEye();
00168                 }
00169 
00170                 if (typeContour==6)
00171                 {
00172                         manContourControl       = new manualLineControler();
00173                         manViewerContour        = new manualViewLine();
00174                 }
00175 
00176                 //Points
00177                 if (typeContour==7)
00178                 {
00179                         manContourControl       = new manualContourControler();
00180                         manViewerContour        = new manualViewPoints();
00181                 }
00182 
00183                 //Polygon
00184                 if (typeContour==10)
00185                 {
00186                         manContourControl       = new manualContourControler();
00187                         manViewerContour        = new manualViewContour();
00188                 }
00189 
00190 
00191 
00192         _lastInteraction = insertWrap( theKeyName, manContourControl, manViewerContour );
00193                 _lastInteractionName = theKeyName;
00194 
00195                 //Configuring the relations between the contour members representation                  
00196                 manViewerContour->SetModel( manModelContour );
00197                 manViewerContour->SetWxVtkBaseView( _wxVtk_BaseView );
00198                 manViewerContour->SetRange( _widthOfControlPoint );
00199                 manViewerContour->SetZ( -900 ); 
00200 
00201                 manViewerContour->SetSpacing(spc);
00202 
00203                 manViewerContour->SetColorNormalContour(0, 0, 1);
00204                 manViewerContour->SetColorEditContour(0.5, 0.5, 0.5);
00205                 manViewerContour->SetColorSelectContour(1, 0.8, 0);
00206                 manViewerContour->SetWidthLine(_widthOfContour);
00207 
00208                 manContourControl->SetModelView( manModelContour , manViewerContour );
00209                 manContourControl->Configure();
00210                 int i,sizeLstPoints = manModelContour->GetSizeLstPoints();
00211                 for ( i=0; i<sizeLstPoints; i++ )
00212                 {
00213                         manViewerContour->AddPoint();
00214                 }
00215 
00216                 manContourControl->CreateNewManualContour();
00217                 manViewerContour->RefreshContour();                     
00218                 addToScene( theKeyName );
00219         }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkBaseView_SceneManager::createCopyContourOf ( std::string  anExistingKName,
std::string  cloneName,
manualBaseModel *  manualModel,
bool  append = false 
)

Definition at line 350 of file wxVtkBaseView_SceneManager.cxx.

References _contours_ViewControl, _lastInteraction, _workingGroup, addToScene(), insertWrap(), and setControlActiveStateOf().

Referenced by wxContourMainFrame::createCopyContourOf(), and wxContourMainFrame::createMirrorContourOf().

00351         {
00352                 if ( !append )
00353                 {
00354                         setControlActiveStateOf( _workingGroup, false );
00355                         _workingGroup->clear();
00356                 }
00357         std::map <std::string, ContourWrap_ViewControl *>::iterator iter; 
00358 
00359 
00360                 iter = _contours_ViewControl->find( anExistingKName );
00361 
00362                 manualBaseModel                 *cModule        = manualModel;
00363                 manualViewBaseContour           *cViewer        = iter->second->getViewer()->Clone();
00364                 manualContourBaseControler      *cControl       = iter->second->getControler()->Clone(  );
00365 
00366                 cViewer->SetModel(cModule);
00367                 cControl->SetModelView( cModule , cViewer );
00368                 cControl->CreateNewManualContour();
00369                 cControl->SetActive( true );    
00370                 cControl->SetEditable( false );         
00371 
00372         cViewer->RefreshContour();     
00373                 cViewer->Refresh();
00374                 this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
00375                 this->_vtkInteractorStyleBaseView->EvaluateToRefresh();
00376 
00377                 _lastInteraction = insertWrap( cloneName, cControl, cViewer );
00378                 _workingGroup->insert(std::pair <std::string, ContourWrap_ViewControl *> ( cloneName, _lastInteraction ));              
00379         addToScene( cloneName );
00380         }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkBaseView_SceneManager::deleteCViewerCControler ( std::string  theKeyName  ) 

Definition at line 1220 of file wxVtkBaseView_SceneManager.cxx.

References getContourWrap_ViewControlOf(), ContourWrap_ViewControl::getControler(), ContourWrap_ViewControl::getViewer(), removeFromScene(), and removeWrap().

Referenced by wxContourViewPanel::removeFromScene().

01220                                                                                     {
01221                 
01222 
01223                 ContourWrap_ViewControl* ccon = getContourWrap_ViewControlOf(theKeyName);
01224 
01225                 manualViewBaseContour       * cViewer = ccon->getViewer();
01226                 manualContourBaseControler  * cControler = ccon->getControler();
01227 
01228                 removeFromScene(theKeyName);
01229                 removeWrap(theKeyName);
01230 
01231                 delete cViewer;         
01232                 delete cControler;
01233         }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkBaseView_SceneManager::desconfigureViewControlOf ( std::string  theKeyName  ) 

Definition at line 252 of file wxVtkBaseView_SceneManager.cxx.

00253         {
00254                 
00255         }

void wxVtkBaseView_SceneManager::drawSelectionROI (  ) 

Definition at line 1024 of file wxVtkBaseView_SceneManager.cxx.

References _controlerSelectionROI, _drawingSelectionROI, _lastInteraction, _lastInteractionName, _viewerSelectionROI, _workingGroup, ContourWrap_ViewControl::getControler(), and ContourWrap_ViewControl::getViewer().

01025         {
01026                 _drawingSelectionROI = true;
01027                 _workingGroup->clear();
01028                 _controlerSelectionROI->CreateNewManualContour();       
01029                 if (_lastInteraction!=NULL)
01030                 {
01031                         _lastInteraction->getControler()->SetEditable( false );
01032                         _lastInteraction->getControler()->SetActive( false ); 
01033                         _lastInteraction->getControler()->SetPosibleToMove( false );
01034                         _lastInteraction->getViewer()->Refresh();
01035                 }
01036                 std::map<std::string, ContourWrap_ViewControl *>::iterator iter = _workingGroup->begin();
01037                 int i, workSize = _workingGroup->size();
01038                 for( i=0; i< workSize; i++ )
01039                 {
01040                         manualContourBaseControler * control = iter->second->getControler();
01041                         control->SetEditable( false );
01042                         control->SetActive( false );
01043                         control->SetPosibleToMove( false );
01044                         iter->second->getViewer()->Refresh();
01045 
01046                         iter++;
01047                 }
01048                 _lastInteraction = NULL;
01049                 _lastInteractionName = "";
01050 
01051                 _viewerSelectionROI->AddCompleteContourActor( true );   
01052                 _controlerSelectionROI->SetActive( true );
01053                 
01054                 _viewerSelectionROI->RefreshContour();
01055                 this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
01056         }

Here is the call graph for this function:

bool wxVtkBaseView_SceneManager::get_creatingMULT_ROI (  ) 

Definition at line 314 of file wxVtkBaseView_SceneManager.cxx.

References _creatingMULT_ROI.

00315         {
00316                 return _creatingMULT_ROI;
00317         }

bool wxVtkBaseView_SceneManager::get_creatingROI (  ) 

Definition at line 336 of file wxVtkBaseView_SceneManager.cxx.

References _creatingROI.

00337         {
00338                 return _creatingROI;
00339         }

bool wxVtkBaseView_SceneManager::get_editingROI (  ) 

Definition at line 319 of file wxVtkBaseView_SceneManager.cxx.

References _editingROI.

00320         {
00321                 return _editingROI;
00322         }

bool wxVtkBaseView_SceneManager::get_toIncludeAtInteractionGroup (  ) 

Definition at line 324 of file wxVtkBaseView_SceneManager.cxx.

References _toIncludeAtInteractionGroup.

00325         {
00326                 return _toIncludeAtInteractionGroup;
00327         }

bool wxVtkBaseView_SceneManager::get_waiting (  ) 

Definition at line 330 of file wxVtkBaseView_SceneManager.cxx.

References _waiting.

00331         {
00332                 return _waiting;
00333         }

ContourWrap_ViewControl * wxVtkBaseView_SceneManager::getContourWrap_ViewControlOf ( std::string  theName,
std::map< std::string, ContourWrap_ViewControl * > *  theMap 
)

Definition at line 277 of file wxVtkBaseView_SceneManager.cxx.

00278         {
00279                 std::map<std::string, ContourWrap_ViewControl *> :: iterator iter;
00280                 iter = theMap->find( theName );
00281                 return iter->second;
00282         }

ContourWrap_ViewControl * wxVtkBaseView_SceneManager::getContourWrap_ViewControlOf ( std::string  theName  ) 

Definition at line 269 of file wxVtkBaseView_SceneManager.cxx.

References _contours_ViewControl.

Referenced by addToScene(), deleteCViewerCControler(), getControlerOf(), getViewerOf(), isEditableCControler(), setControlActiveStateOf(), and setVisibleStateOf().

00270         {
00271                 std::map<std::string, ContourWrap_ViewControl *> :: iterator iter;
00272                 iter = _contours_ViewControl->find( theName );
00273                 return iter->second;
00274                 //return iter->first;
00275         }

Here is the caller graph for this function:

manualContourBaseControler * wxVtkBaseView_SceneManager::getControlerOf ( std::string  theName  ) 

Definition at line 284 of file wxVtkBaseView_SceneManager.cxx.

References getContourWrap_ViewControlOf(), and ContourWrap_ViewControl::getControler().

Referenced by GetPointsOfActualContour().

00285         {
00286                 return getContourWrap_ViewControlOf ( theName )->getControler();
00287         }

Here is the call graph for this function:

Here is the caller graph for this function:

vtkImageData * wxVtkBaseView_SceneManager::GetImageData (  ) 

Definition at line 1145 of file wxVtkBaseView_SceneManager.cxx.

References _wxVtk_BaseView.

Referenced by wxContourViewPanel::getImageData(), GetImageDataRange(), and GetImageDataSizeZ().

01146         {
01147                 wxVtk2DBaseView *wxvtk2dbaseview =(wxVtk2DBaseView*)_wxVtk_BaseView;
01148                 return wxvtk2dbaseview->GetVtkBaseData()->GetImageData();
01149         }

Here is the caller graph for this function:

void wxVtkBaseView_SceneManager::GetImageDataRange ( double *  range  ) 

Definition at line 1166 of file wxVtkBaseView_SceneManager.cxx.

References GetImageData(), and GetImageDataSizeZ().

Referenced by wxContourViewPanel::GetImageDataRange().

01167         {
01168                 int ext[6];
01169                 vtkImageData    *imagedata      = GetImageData();
01170                 imagedata->GetExtent(ext);
01171                 int sizeX       = ext[1]-ext[0]+1;
01172                 int sizeY       = ext[3]-ext[2]+1;
01173                 int sizeZ       = GetImageDataSizeZ();
01174                 int sizeXYZ = sizeX*sizeY*sizeZ;
01175                 long int i;
01176                 range[0]=9999999;
01177                 range[1]=-9999999;
01178                 unsigned short *p = (unsigned short *)imagedata->GetScalarPointer(0,0,0);
01179                 for (i=0;i<sizeXYZ;i++)
01180                 {
01181                         if ( p[i]<range[0] ) range[0]=p[i];
01182                         if ( p[i]>range[1] ) range[1]=p[i]; 
01183                 }
01184         }

Here is the call graph for this function:

Here is the caller graph for this function:

int wxVtkBaseView_SceneManager::GetImageDataSizeZ (  ) 

Definition at line 1152 of file wxVtkBaseView_SceneManager.cxx.

References GetImageData().

Referenced by wxContourMainFrame::deleteAllContours(), GetImageDataRange(), wxContourViewPanel::GetImageDataSizeZ(), and wxContourMainFrame::SaveValuesXYZ().

01153         {
01154                         int ext[6];
01155                         vtkImageData    *imagedata      = GetImageData();
01156                         imagedata->GetExtent(ext);
01157                         int sizeZ = ext[5]-ext[4]+1;
01158 
01159 //EED OJO   Machete
01160 //                      sizeZ = sizeZ-1;
01161 
01162                         return sizeZ;
01163         }

Here is the call graph for this function:

Here is the caller graph for this function:

char wxVtkBaseView_SceneManager::getLastKeyCode (  ) 

Definition at line 663 of file wxVtkBaseView_SceneManager.cxx.

References _lastKeyCode.

Referenced by wxContourViewPanel::onActionButtonPressed().

00664         { 
00665                 return _lastKeyCode;
00666         }

Here is the caller graph for this function:

std::vector< std::string > wxVtkBaseView_SceneManager::GetlstContoursNameActualSlice (  ) 

Definition at line 425 of file wxVtkBaseView_SceneManager.cxx.

References _sceneContours_ViewControl.

Referenced by wxContourMainFrame::onDeleteContoursActSlice().

00426         {
00427                 std::vector<std::string> lstContoursNameActualSlice;
00428                 std::map <std::string, ContourWrap_ViewControl *>::iterator iter = _sceneContours_ViewControl->begin(); 
00429                 int i,size = _sceneContours_ViewControl->size();
00430                 for ( i = 0; i<size; i++ )
00431                 {
00432                         lstContoursNameActualSlice.push_back( iter->first );
00433                         iter++;
00434                 }
00435                 return lstContoursNameActualSlice;
00436         }

Here is the caller graph for this function:

void wxVtkBaseView_SceneManager::GetPointsOfActualContour ( std::vector< double > *  vecX,
std::vector< double > *  vecY,
std::vector< double > *  vecZ 
)

Definition at line 1125 of file wxVtkBaseView_SceneManager.cxx.

References getControlerOf(), and getSelectedObjects().

Referenced by wxContourViewPanel::GetPointsOfActualContour().

01126         {
01127                 std::vector<std::string> currentSelection = this->getSelectedObjects();
01128                 if (currentSelection.size()>=1){
01129                         
01130                         manualContourBaseControler *cControler  = this->getControlerOf( currentSelection[0] );
01131                         manualBaseModel *cModel                         = cControler->GetManualContourModel();
01132                         int i,size = cModel->GetNumberOfPointsSpline();
01133                         double x,y,z;
01134                         for (i=0; i<size; i++) 
01135                         {
01136                                 cModel->GetSpline_i_Point(i, &x, &y, &z);
01137                                 vecX->push_back(x);
01138                                 vecY->push_back(y);
01139                                 vecZ->push_back(z);
01140                         }
01141                 }
01142         }

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< std::string > wxVtkBaseView_SceneManager::getSelectedObjects (  ) 

Definition at line 563 of file wxVtkBaseView_SceneManager.cxx.

References _workingGroup.

Referenced by GetPointsOfActualContour(), wxContourViewPanel::getSelectedObjects(), wxContourViewPanel::onActionButtonPressed(), and wxContourMainFrame::onDeleteContour().

00564         {
00565                 std::vector< std::string > selectedObjects;
00566                 std::map <std::string, ContourWrap_ViewControl *>::iterator iter = _workingGroup->begin(); 
00567                 int size = _workingGroup->size();
00568                 for ( int i = 0; i<size; i++ )
00569                 {
00570 //EED???                        manualViewBaseContour * viewer = iter->second->getViewer();
00571                         selectedObjects.push_back( iter->first);        
00572 
00573                         iter++;
00574                 }       
00575                 return selectedObjects;
00576         }

Here is the caller graph for this function:

manualViewBaseContour * wxVtkBaseView_SceneManager::getViewerOf ( std::string  theName  ) 

Definition at line 289 of file wxVtkBaseView_SceneManager.cxx.

References getContourWrap_ViewControlOf(), and ContourWrap_ViewControl::getViewer().

00290         {
00291                 return getContourWrap_ViewControlOf ( theName )->getViewer();
00292         }

Here is the call graph for this function:

wxVtkBaseView * wxVtkBaseView_SceneManager::getWxVtkViewBase (  ) 

Definition at line 122 of file wxVtkBaseView_SceneManager.cxx.

References _wxVtk_BaseView.

Referenced by wxContourViewPanel::setImageSlice().

00123         {
00124                 return _wxVtk_BaseView;
00125         }

Here is the caller graph for this function:

ContourWrap_ViewControl * wxVtkBaseView_SceneManager::insertWrap ( std::string  theKeyName,
manualContourBaseControler *  manContourControl,
manualViewBaseContour *  manViewerContour 
)

Definition at line 241 of file wxVtkBaseView_SceneManager.cxx.

References _contours_ViewControl.

Referenced by configureViewControlTo(), and createCopyContourOf().

00242         {       
00243                 ContourWrap_ViewControl * newContourWrap = new ContourWrap_ViewControl(manContourControl, manViewerContour);
00244                 if(_contours_ViewControl == NULL)
00245                 {
00246                         _contours_ViewControl = new std::map< std::string, ContourWrap_ViewControl * >();
00247                 }
00248                 _contours_ViewControl->insert(std::pair <std::string, ContourWrap_ViewControl *> ( theKeyName, newContourWrap ));
00249                 return newContourWrap;
00250         } 

Here is the caller graph for this function:

bool wxVtkBaseView_SceneManager::isCtrlPressed (  ) 

Definition at line 655 of file wxVtkBaseView_SceneManager.cxx.

References _ctrlKey.

Referenced by wxContourViewPanel::onActionButtonPressed().

00656         { 
00657                 return _ctrlKey;
00658         }

Here is the caller graph for this function:

bool wxVtkBaseView_SceneManager::isEditableCControler ( std::string  theKeyName  ) 

Definition at line 1208 of file wxVtkBaseView_SceneManager.cxx.

References getContourWrap_ViewControlOf(), and ContourWrap_ViewControl::getControler().

Referenced by wxContourViewPanel::isEditableCControler().

01208                                                                                  {
01209                 
01210                 ContourWrap_ViewControl* ccon = getContourWrap_ViewControlOf(theKeyName);
01211                 if(ccon != NULL ){
01212                         manualContourBaseControler* cControler = ccon->getControler();
01213                         if(cControler != NULL && cControler->IsEditable() == false){
01214                                 return true;
01215                         }
01216                 }
01217                 return false;
01218         }

Here is the call graph for this function:

Here is the caller graph for this function:

bool wxVtkBaseView_SceneManager::isShiftPressed (  ) 

Definition at line 659 of file wxVtkBaseView_SceneManager.cxx.

References _shiftKey.

00660         { 
00661                 return _shiftKey;
00662         }

bool wxVtkBaseView_SceneManager::OnChar (  )  [virtual]

Definition at line 667 of file wxVtkBaseView_SceneManager.cxx.

References _ctrlKey, _eventHandler, _lastKeyCode, and _shiftKey.

00668         { 
00669 
00670                 _ctrlKey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey() == 1;
00671                 _shiftKey = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey() == 1;
00672 
00673                 _lastKeyCode = _vtkInteractorStyleBaseView->GetInteractor()-> GetKeyCode();
00674 
00675                 wxCommandEvent cevent( wxEVT_COMMAND_BUTTON_CLICKED );
00676                 _eventHandler->ProcessEvent( cevent );
00677                 
00678                                 
00679                 /*if( _eventHandler!=NULL )
00680                 {
00681                         char * toolCommand = NULL;
00682 
00683                         if ( _lastKeyCode == 3 && ctrlKey ) //'C' || 'c' 
00684                         {
00685                                 toolCommand = &(COPY_TOOL);
00686                         }
00687                         else if(  _lastKeyCode == 22 && ctrlKey ) //'V' || 'v' 
00688                         {
00689                                 toolCommand = &(PASTE_TOOL);
00690                         }
00691                         else if(  _lastKeyCode == 8 || (_lastKeyCode==127) ) // Delete 
00692                         {
00693                                 toolCommand = &(DELETE_KEY);
00694                         }
00695                         else if(  _lastKeyCode == 14 && ctrlKey ) //'N' || 'n' 
00696                         {
00697                                 toolCommand = &(CREATE_CONTOUR_KEY);
00698                         }
00699                         else if(  _lastKeyCode == 15 && ctrlKey ) //'O' || 'o' 
00700                         {
00701                                 toolCommand = &(OPEN_TOOL);
00702                         }
00703                         else if(  _lastKeyCode == 19 && ctrlKey ) //'S' || 's' 
00704                         {
00705                                 toolCommand = &(SAVE_KEY);
00706                         }
00707 
00708                         if ( toolCommand!=NULL )
00709                         {
00710                                 currentkey = toolCommand;
00711                                 wxCommandEvent cevent( wxEVT_COMMAND_BUTTON_CLICKED );
00712                                 cevent.SetClientData( (void *) toolCommand);
00713                                 _eventHandler->ProcessEvent( cevent );
00714                         }                               
00715                 }*/
00716                 
00717         
00718         //      long int endtime = clock();             
00719 
00720                 return true; 
00721         }

bool wxVtkBaseView_SceneManager::OnLeftButtonDown (  )  [virtual]

Definition at line 842 of file wxVtkBaseView_SceneManager.cxx.

References _creatingMULT_ROI, _creatingROI, _lastInteraction, _lastInteractionName, _toIncludeAtInteractionGroup, _workingGroup, ContourWrap_ViewControl::getControler(), ContourWrap_ViewControl::getViewer(), and sendEnvent().

00843         { 
00844 
00845 
00846 
00847 //EED???                char aa = _vtkInteractorStyleBaseView->GetInteractor()->GetKeyCode();
00848                 bool condition = false;  
00849                 //vtkCommand * theComand = _wxVtk_BaseView ->GetInteractorStyleBaseView()->GetCommand(
00850 //EED???                vtkRenderWindowInteractor               * vtkRWInteractor1      = _wxVtk_BaseView ->GetWxVTKRenderWindowInteractor(); 
00851 //EED???                wxVTKRenderWindowInteractor             * vtkRWInteractor2      = _wxVtk_BaseView ->GetWxVTKRenderWindowInteractor();//GetInteractorStyleBaseView()->GetInteractor();
00852 //EED??         wxVTKRenderWindowInteractorPlus * vtkRWInteractor3      = (wxVTKRenderWindowInteractorPlus*)_wxVtk_BaseView ->GetWxVTKRenderWindowInteractor();//GetInteractorStyleBaseView()->GetInteractor();
00853                 vtkRenderWindowInteractor               * vtkRWInteractor       = _vtkInteractorStyleBaseView->GetInteractor();
00854                 
00855                 bool ctrlKey = vtkRWInteractor->GetControlKey() == 1;
00856                 bool shftKey = vtkRWInteractor->GetShiftKey() == 1;
00857                 _toIncludeAtInteractionGroup = false;
00858                 if ( ctrlKey || shftKey )
00859                 {
00860                         _toIncludeAtInteractionGroup = true;                    
00861                 }
00862                 else
00863                 {
00864                         if( _lastInteraction!=NULL && !_toIncludeAtInteractionGroup )
00865                         {
00866                                 if( _lastInteraction->getControler()->GetIfCompleteCreation() && !_lastInteraction->getControler()->IsEditable()&& !_lastInteraction->getViewer()->GetPosibleSelected() )
00867                                 {
00868                                         _lastInteraction->getControler()->SetEditable( false );
00869                                         _lastInteraction->getControler()->SetActive( false ); 
00870                                         _lastInteraction->getControler()->SetPosibleToMove( false );
00871                                         _lastInteraction->getViewer()->Refresh();
00872                                         _lastInteraction=NULL;
00873                                 }
00874                         }
00875                 }
00876 
00877 
00878 
00879                 if( !_toIncludeAtInteractionGroup )
00880                 {
00881                         _workingGroup->clear();
00882                 }
00883 
00884                 if( _lastInteraction!=NULL )
00885                 {
00886                         _toIncludeAtInteractionGroup = !_lastInteraction->getControler()->IsEditable();
00887                         _toIncludeAtInteractionGroup &= _lastInteraction->getViewer()->GetSelected();
00888                         _workingGroup->insert(std::pair <std::string, ContourWrap_ViewControl *> ( _lastInteractionName, _lastInteraction ));   
00889                 }
00890                 if( _creatingMULT_ROI && !_creatingROI && !ctrlKey  && !shftKey )
00891                 {
00892                         _creatingROI = true;
00893                         //setControlActiveStateOf( _contours_ViewControl, false );
00894                         sendEnvent( wxEVT_START_CREATE_ROI, "");
00895                 }                       
00896                 condition = true; 
00897 
00898 // FILE *ff = fopen("c:/temp/wxVtkBaseView_SceneManagerStadistics.txt","a+");
00899 // fprintf(ff,"EED wxVtkBaseView_SceneManager::OnLeftButtonDown() contours=%d  sceneContour=%d  workingContours=%d\n",
00900 //                                      _contours_ViewControl->size(), _sceneContours_ViewControl->size(), _workingGroup->size() );
00901 // fclose(ff);
00902 
00903 
00904                 return condition;       
00905         } 

Here is the call graph for this function:

bool wxVtkBaseView_SceneManager::OnLeftButtonUp (  )  [virtual]

Definition at line 908 of file wxVtkBaseView_SceneManager.cxx.

References _drawingSelectionROI, and setSelection2DROIInternalOutlines().

00909         {
00910                 bool condition = false; 
00911                 condition = true; 
00912                                 
00913                 if( _drawingSelectionROI )
00914                 {
00915                         setSelection2DROIInternalOutlines();
00916                 }
00917                 return condition;       
00918         }

Here is the call graph for this function:

bool wxVtkBaseView_SceneManager::OnLeftDClick (  )  [virtual]

Definition at line 981 of file wxVtkBaseView_SceneManager.cxx.

00982         {
00983                 bool condition = false; 
00984                 condition = true; 
00985                 
00986                 return condition;       
00987         }

bool wxVtkBaseView_SceneManager::OnMiddleButtonDown (  )  [virtual]

Definition at line 920 of file wxVtkBaseView_SceneManager.cxx.

00921         {
00922                 bool condition = false; 
00923                 condition = true; 
00924                         
00925                 return condition;       
00926         }

bool wxVtkBaseView_SceneManager::OnMiddleButtonUp (  )  [virtual]

Definition at line 928 of file wxVtkBaseView_SceneManager.cxx.

00929         {
00930                 bool condition = false; 
00931                 condition = true; 
00932                         
00933                 return condition;       
00934         }

bool wxVtkBaseView_SceneManager::OnMiddleDClick (  )  [virtual]

Definition at line 1008 of file wxVtkBaseView_SceneManager.cxx.

01009         {
01010                 bool condition = false; 
01011                 condition = true; 
01012                 
01013                 return condition;       
01014         }

bool wxVtkBaseView_SceneManager::OnMouseMove (  )  [virtual]

Definition at line 724 of file wxVtkBaseView_SceneManager.cxx.

References _creatingMULT_ROI, _creatingROI, _lastInteraction, _lastInteractionName, _sceneContours_ViewControl, _toIncludeAtInteractionGroup, _waiting, _workingGroup, ContourWrap_ViewControl::getControler(), ContourWrap_ViewControl::getViewer(), and sendEnvent().

00725         { 
00726 
00727                 bool condition = true;  
00728                 int X,Y;
00729                 wxVTKRenderWindowInteractor *_wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
00730                 _wxVTKiren->GetEventPosition( X , Y );
00731 
00732                 bool ctrlKey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey() == 1;
00733 //???           bool shiftKey = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey() == 1;
00734 
00735                 if( _waiting && !ctrlKey )
00736                 {
00737                         sendEnvent( wxEVT_CHANGED_DEEP, "Update");
00738                         //toca ver como decirle al viewer que no se mueva mientras no se este esperando que se pueda mover                      
00739                 }
00740                 
00741                 if ( !_creatingROI && !_creatingMULT_ROI )
00742                 {
00743                         
00744                         /*if( ctrlKey || shiftKey )
00745                         {
00746                                 
00747                         }
00748                         else
00749                         {
00750                                 _toIncludeAtInteractionGroup = false;
00751                         }*/
00752                         
00753                         bool preserveState = _lastInteraction!=NULL? _lastInteraction->getViewer()->GetSelected() : false;
00754                         std::string preservingName = preserveState ? _lastInteractionName : "";
00755 
00756                         std::map<std::string, ContourWrap_ViewControl *>::iterator iter = _sceneContours_ViewControl->begin();
00757                         int i, size = _sceneContours_ViewControl->size();
00758                         bool foundOne = false;
00759 
00760                         manualContourBaseControler      * control       = _lastInteraction != NULL ? _lastInteraction->getControler() : NULL;
00761                         manualViewBaseContour           * viewer        = NULL; 
00762                         
00763                         
00764                         bool singleMoving = true;
00765                         int selectionSize = _workingGroup->size();
00766                         if( selectionSize > 1 ) 
00767                         {
00768                                 //Multiple moving
00769                                 
00770 //EED???                                bool ckecking = false;
00771                                 for( i =0; i<size ; i++ ) 
00772                                 {
00773                                         control = iter->second->getControler();
00774                                         viewer = iter->second->getViewer();
00775                                         /*ckecking = */control->SetActive( true );
00776                                 }
00777                                 if (_lastInteraction != NULL)
00778                                 {
00779                                         singleMoving = !_lastInteraction->getViewer()->GetSelected();
00780 
00781                                 }
00782                                 if( !singleMoving )
00783                                 {
00784                                         size = selectionSize;
00785                                         iter = _workingGroup->begin();
00786                                 }
00787                         }                       
00788                         else
00789                         {
00790                                 
00791                                 _toIncludeAtInteractionGroup = false;
00792                         }
00793                         
00794                         if( ((_lastInteraction != NULL && !control->IsEditable() && !control->IsMoving() ) || _lastInteraction==NULL ))
00795                         {                                       
00796 
00797                                 _lastInteraction=NULL;
00798                                 for( i =0; i<size ; i++ )
00799                                 {
00800                                         control = iter->second->getControler();
00801                                         viewer = iter->second->getViewer();
00802 //                                      _wxVtk_BaseView->GetInteractorStyleBaseView()->AddInteractorStyleMaracas( control );
00803                                         control->SetActive( true );                                     
00804                                         
00805                                         foundOne = control->OnMouseMove();
00806                                         foundOne &= viewer->GetPosibleSelected();                               
00807                                         
00808                                         if ( !foundOne && singleMoving )
00809                                         {
00810                                                 control->SetActive( false );
00811 //                                              _wxVtk_BaseView->GetInteractorStyleBaseView()->RemoveInteractorStyleMaracas( control );
00812                                                 control->SetPosibleToMove( false );
00813                                         }
00814                                         else
00815                                         {                                               
00816                                                 if( _toIncludeAtInteractionGroup && preserveState && _lastInteractionName.compare( preservingName)==0 )
00817                                                 {
00818                                                         _lastInteraction->getControler()->SetActive( true );
00819                                                 }
00820 
00821                                                 _lastInteraction                = iter->second;
00822                                                 _lastInteractionName    = iter->first;
00823 
00824                                                 viewer->UpdateColorActor();
00825                                                 control->SetPosibleToMove( true );
00826                                                 // viewer->AddCompleteContourActor();
00827                                         }
00828                                         iter++;
00829                                 }
00830                                 control = NULL;
00831                                 viewer = NULL;  
00832                         }                               
00833                 }
00834                 return condition;       
00835         }

Here is the call graph for this function:

bool wxVtkBaseView_SceneManager::OnMouseWheel (  )  [virtual]

Definition at line 1016 of file wxVtkBaseView_SceneManager.cxx.

01017         {
01018                 bool condition = false; 
01019                 condition = true; 
01020                 return condition;       
01021         }

bool wxVtkBaseView_SceneManager::OnRightButtonDown (  )  [virtual]

Definition at line 936 of file wxVtkBaseView_SceneManager.cxx.

References _waiting.

00937         {
00938                 bool condition = false; 
00939 //EED???                vtkRenderWindowInteractor * vtkRWInteractor = _vtkInteractorStyleBaseView->GetInteractor();
00940 //EED???                bool ctrlKey = vtkRWInteractor->GetControlKey() == 1;
00941                 _waiting = true; 
00942                 
00943                 condition = true;               
00944                 
00945                 return condition;       
00946         }

bool wxVtkBaseView_SceneManager::OnRightButtonUp (  )  [virtual]

Definition at line 948 of file wxVtkBaseView_SceneManager.cxx.

References _creatingMULT_ROI, _creatingROI, _lastInteraction, _toIncludeAtInteractionGroup, _waiting, ContourWrap_ViewControl::getControler(), ContourWrap_ViewControl::getViewer(), and sendEnvent().

00949         {
00950                 bool condition = false; 
00951                 condition = true; 
00952                 //setControlActiveStateOfALL( false );//************************************************
00953                 if ( _creatingMULT_ROI )
00954                 {
00955                         //setControlActiveStateOfALL( false );
00956                 }
00957                 if( _creatingROI )
00958                 {
00959                         sendEnvent( wxEVT_STOP_CREATE_ROI, "Activate");
00960                         _creatingROI = false;
00961                 }
00962                 else
00963                 {
00964                         if(_lastInteraction!=NULL && !_toIncludeAtInteractionGroup)
00965                         {
00966                                 manualContourBaseControler * control = _lastInteraction->getControler();
00967                                 //_lastInteraction->getControler()->SetPosibleToMove( false );
00968                                 control->SetActive( false );
00969                                 control->SetEditable( false );                          
00970                                 control->SetPosibleToMove( false );
00971 //                              _wxVtk_BaseView->GetInteractorStyleBaseView()->RemoveInteractorStyleMaracas( control );
00972                                 _lastInteraction->getViewer()->Refresh();                       
00973                                 this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
00974                         }       
00975                 }
00976                 _waiting = false; 
00977                 return condition;       
00978         }

Here is the call graph for this function:

bool wxVtkBaseView_SceneManager::OnRightDClick (  )  [virtual]

Definition at line 989 of file wxVtkBaseView_SceneManager.cxx.

00990         { 
00991                 bool condition = false;  condition = true; 
00992 //EED???                vtkRenderWindowInteractor * vtkRWInteractor = _vtkInteractorStyleBaseView->GetInteractor();
00993                 /*vtkRenderWindowInteractor * vtkRWInteractor1 =*/ _vtkInteractorStyleBaseView->OnChar();
00994 //EED???                wxVTKRenderWindowInteractor * wxVtkRWInterator = _wxVtk_BaseView ->GetWxVTKRenderWindowInteractor();
00995                 
00996                 /*if( _waiting )
00997                 {
00998                         sendEnvent( wxEVT_START_CREATE_MULT_ROI, "Multiple");
00999                         set_creatingMULT_ROI( !_creatingMULT_ROI );
01000                         _waiting = false;
01001                 }
01002                 else
01003                         _waiting = true;*/
01004 
01005                 return condition;       
01006         }  

void wxVtkBaseView_SceneManager::removeAllOutlines (  ) 

Definition at line 456 of file wxVtkBaseView_SceneManager.cxx.

References _contours_ViewControl, and removeWrap().

Referenced by wxContourMainFrame::deleteAllContours().

00457         {
00458                 manualViewBaseContour           * cViewer;
00459                 manualContourBaseControler      * cControler;
00460 
00461                 std::map <std::string, ContourWrap_ViewControl *>::iterator iter; 
00462                 int i,size=_contours_ViewControl->size();
00463                 for (i=0;i<size;i++)
00464                 {
00465                         iter = _contours_ViewControl->begin(); 
00466                         cControler      = iter->second->getControler();
00467                         cViewer         = iter->second->getViewer();
00468                         removeWrap( iter->first );
00469                         delete cViewer;
00470                         delete cControler;
00471                 }// for
00472 
00473         }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkBaseView_SceneManager::removeFromScene ( std::vector< std::string >  theKeyNameVector,
bool  visualization = true,
bool  control = true 
)

Definition at line 514 of file wxVtkBaseView_SceneManager.cxx.

References removeFromScene().

00515         {
00516                 int i, size = theKeyNameVector.size();
00517                 for( i=0; i< size; i++ )
00518                 {
00519                         removeFromScene( theKeyNameVector[i], visualization, control );
00520                 }
00521         }

Here is the call graph for this function:

void wxVtkBaseView_SceneManager::removeFromScene ( std::string  theKeyName,
bool  visualization = true,
bool  control = true 
)

Definition at line 410 of file wxVtkBaseView_SceneManager.cxx.

References _sceneContours_ViewControl, and removeFromScene().

00411         {
00412 
00413                 std::map<std::string, ContourWrap_ViewControl *> :: iterator iter;
00414                 iter = _sceneContours_ViewControl->find( theKeyName );
00415                 if (iter != _sceneContours_ViewControl->end())
00416                 {
00417                         ContourWrap_ViewControl * contourWRP =   iter->second;
00418                         removeFromScene( contourWRP );  
00419                         _sceneContours_ViewControl->erase(iter);
00420                 }       
00421         }

Here is the call graph for this function:

void wxVtkBaseView_SceneManager::removeFromScene ( ContourWrap_ViewControl contourWRP,
bool  visualization = true,
bool  control = true 
)

Definition at line 384 of file wxVtkBaseView_SceneManager.cxx.

References _lastInteraction, _lastInteractionName, _wxVtk_BaseView, ContourWrap_ViewControl::getControler(), and ContourWrap_ViewControl::getViewer().

Referenced by deleteCViewerCControler(), removeFromScene(), removeSceneContours(), setControlActiveStateOf(), and setVisibleStateOf().

00385         {
00386                 if( contourWRP == _lastInteraction )
00387                 {
00388                         _lastInteraction = NULL;
00389                         _lastInteractionName = "";
00390                 }
00391 
00392 
00393                 ((vtkInteractorStyleBaseView*)_wxVtk_BaseView->GetInteractorStyleBaseView())->RemoveInteractorStyleMaracas( contourWRP->getControler() );
00394 
00395                 contourWRP->getControler()->SetActive( control );       
00396                 contourWRP->getControler()->SetEditable( false );               
00397 
00398                 if ( !visualization && control )
00399                 {
00400                         contourWRP->getViewer()->RemoveControlPoints( );
00401                         contourWRP->getViewer()->RemoveTextActor( );
00402                 }
00403                 if ( visualization )
00404                 {
00405                         contourWRP->getViewer()->RemoveCompleteContourActor();                  
00406                 }
00407                 
00408         }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkBaseView_SceneManager::removeSceneContours (  ) 

Definition at line 439 of file wxVtkBaseView_SceneManager.cxx.

References _controlerSelectionROI, _sceneContours_ViewControl, _viewerSelectionROI, and removeFromScene().

Referenced by addToScene(), wxContourMainFrame::deleteAllContours(), wxContourMainFrame::onLoadContours(), and wxContourViewPanel::removeSceneContours().

00440         {
00441                 std::map <std::string, ContourWrap_ViewControl *>::iterator iter = _sceneContours_ViewControl->begin(); 
00442                 int size = _sceneContours_ViewControl->size();
00443                 for ( int i = 0; i<size; i++ )
00444                 {
00445                         removeFromScene( iter->second );
00446                         iter++;
00447                 }
00448                 _sceneContours_ViewControl->clear();
00449 
00450 
00451                 //Removing the selection rectangle to avoid showing when it's innecesary
00452                 _controlerSelectionROI->SetActive( false );             
00453                 _viewerSelectionROI->RemoveCompleteContourActor();      
00454         }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkBaseView_SceneManager::removeWrap ( std::string  theKeyName  ) 

Definition at line 257 of file wxVtkBaseView_SceneManager.cxx.

References _contours_ViewControl, _lastInteraction, _lastInteractionName, and _workingGroup.

Referenced by deleteCViewerCControler(), and removeAllOutlines().

00258         {
00259                 std::map<std::string, ContourWrap_ViewControl *> :: iterator iter;
00260                 iter = _contours_ViewControl->find( theKeyName );
00261                 _contours_ViewControl->erase( iter );
00262                 _lastInteraction=NULL;
00263                 _lastInteractionName = "";
00264                 _workingGroup->clear();
00265                 this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
00266                 this->_vtkInteractorStyleBaseView->EvaluateToRefresh();
00267         } 

Here is the caller graph for this function:

void wxVtkBaseView_SceneManager::SaveThingName ( FILE *  ff,
std::string  nameThing 
)

Definition at line 1106 of file wxVtkBaseView_SceneManager.cxx.

References _contours_ViewControl, ContourWrap_ViewControl::getControler(), and ContourWrap_ViewControl::getViewer().

Referenced by wxContourMainFrame::saveFileWithContours().

01107         {
01108                 std::map <std::string, ContourWrap_ViewControl *>::iterator iter = _contours_ViewControl->find(nameThing); 
01109                 manualViewBaseContour           * cViewer;
01110                 manualContourBaseControler      * cControler;
01111                 ContourWrap_ViewControl *conwraviwcont=iter->second;
01112 
01113                 cViewer         = conwraviwcont->getViewer();
01114                 cViewer->Save(ff);
01115 
01116                 cControler      = conwraviwcont->getControler();
01117 //              cControler->Save(ff);
01118 
01119 //              cModel          = cControler->GetManualContourModel();
01120 //              cModel->Save(ff);
01121         }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkBaseView_SceneManager::selectObjects ( std::map< std::string, ContourWrap_ViewControl * > *  theMap  ) 

Definition at line 605 of file wxVtkBaseView_SceneManager.cxx.

References _contours_ViewControl.

00606         {
00607                 std::map <std::string, ContourWrap_ViewControl *>::iterator iter = theMap->begin(); 
00608                 int size = _contours_ViewControl->size();       
00609                 for ( int i = 0; i<size; i++ )
00610                 {
00611                         manualViewBaseContour * viewer = iter->second->getViewer();     
00612 
00613                         viewer->SetSelected( true );
00614                         /*viewer->SelectAllPoints( true );
00615                         viewer->SelectPosibleContour( true );*/         
00616                         
00617                         iter++;
00618                 }       
00619         }

void wxVtkBaseView_SceneManager::selectObjects ( std::vector< std::string >  theExistingObjectsToSelect  ) 

Definition at line 578 of file wxVtkBaseView_SceneManager.cxx.

References _contours_ViewControl.

00579         {
00580                 std::map <std::string, ContourWrap_ViewControl *>::iterator iter = _contours_ViewControl->begin(); 
00581 //EED???                int size = _contours_ViewControl->size();       
00582 //EED???                bool selected;
00583                 /*for ( int i = 0; i<size; i++ )
00584                 {
00585                         selected = false;
00586                         manualViewBaseContour * viewer = iter->second->getViewer();     
00587                         std::vector <std::string >::iterator iterIN;
00588                         int a = 0;
00589                         for( a = 0, iterIN = theExistingObjectsToSelect.begin() ; !selected && a < theExistingObjectsToSelect.size() ; a++ )
00590                         {
00591                                 if( iter->first.compare( theExistingObjectsToSelect[i] ) )
00592                                 {                                       
00593                                         viewer->SelectAllPoints( true );
00594                                         viewer->SelectPosibleContour( true );           
00595                                         selected = true;
00596                                         theExistingObjectsToSelect.erase( iterIN );                                     
00597                                 }
00598                                 if( !selected )
00599                                         iterIN++;
00600                         }
00601                 }       */
00602         }

void wxVtkBaseView_SceneManager::sendEnvent ( WXTYPE  theEventType,
std::string  text 
)

Definition at line 97 of file wxVtkBaseView_SceneManager.cxx.

References _eventHandler.

Referenced by OnLeftButtonDown(), OnMouseMove(), and OnRightButtonUp().

00098         {
00099                 if ( _eventHandler != NULL )
00100                 {
00101                         wxCommandEvent cevent( theEventType );
00102                         cevent.SetString( wxString( text.c_str(), wxConvUTF8) );
00103                         _eventHandler->ProcessEvent( cevent );
00104                 }
00105         }

Here is the caller graph for this function:

void wxVtkBaseView_SceneManager::set_creatingMULT_ROI ( bool  condition  ) 

Definition at line 294 of file wxVtkBaseView_SceneManager.cxx.

References _creatingMULT_ROI.

00295         {
00296                 _creatingMULT_ROI = condition;
00297         }

void wxVtkBaseView_SceneManager::set_creatingROI ( bool  theCondition  ) 

Definition at line 341 of file wxVtkBaseView_SceneManager.cxx.

References _creatingROI.

00342         {
00343                 _creatingROI = condition;
00344         }

void wxVtkBaseView_SceneManager::set_editingROI ( bool  condition  ) 

Definition at line 299 of file wxVtkBaseView_SceneManager.cxx.

References _editingROI.

00300         {
00301                 _editingROI = condition;
00302         }

void wxVtkBaseView_SceneManager::set_toIncludeAtInteractionGroup ( bool  condition  ) 

Definition at line 304 of file wxVtkBaseView_SceneManager.cxx.

References _toIncludeAtInteractionGroup.

00305         {
00306                 _toIncludeAtInteractionGroup = condition;
00307         }

void wxVtkBaseView_SceneManager::set_waiting ( bool  condition  ) 

Definition at line 309 of file wxVtkBaseView_SceneManager.cxx.

References _waiting.

00310         {
00311                 _waiting = condition;
00312         }

void wxVtkBaseView_SceneManager::setControlActiveStateOf ( std::map< std::string, ContourWrap_ViewControl * > *  theMap,
bool  controlCondition = false 
)

Definition at line 632 of file wxVtkBaseView_SceneManager.cxx.

References removeFromScene().

00633         {
00634                 std::map<std::string, ContourWrap_ViewControl *>::iterator iter = theMap->begin();
00635                 int i, size = theMap->size();
00636                 for( i=0; i< size; i++ )
00637                 {
00638                         removeFromScene( iter->second, false, controlCondition );               
00639                         iter++;
00640                 }               
00641         }

Here is the call graph for this function:

void wxVtkBaseView_SceneManager::setControlActiveStateOf ( std::vector< std::string > &  theKeyNameVector,
bool  controlCondition = false 
)

Definition at line 622 of file wxVtkBaseView_SceneManager.cxx.

References setControlActiveStateOf().

00623         {
00624                 int i, size = theKeyNameVector.size();
00625                 for( i=0; i< size; i++ )
00626                 {
00627                         setControlActiveStateOf( theKeyNameVector[i], controlCondition );
00628                 }
00629         }

Here is the call graph for this function:

void wxVtkBaseView_SceneManager::setControlActiveStateOf ( ContourWrap_ViewControl contourWRP,
bool  stateCondition 
)

Definition at line 547 of file wxVtkBaseView_SceneManager.cxx.

References ContourWrap_ViewControl::getControler().

00548         {
00549                 contourWRP->getControler()->SetActive( stateCondition );        
00550                 contourWRP->getControler()->SetEditable( false );               
00551         }

Here is the call graph for this function:

void wxVtkBaseView_SceneManager::setControlActiveStateOf ( std::string  theKeyName,
bool  stateCondition 
)

Definition at line 540 of file wxVtkBaseView_SceneManager.cxx.

References getContourWrap_ViewControlOf().

Referenced by createCopyContourOf(), setControlActiveStateOf(), setControlActiveStateOfALL(), and setSelection2DROIInternalOutlines().

00541         {
00542                 ContourWrap_ViewControl * contourWRP =  getContourWrap_ViewControlOf( theKeyName );
00543                 setControlActiveStateOf( contourWRP, stateCondition );
00544         }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkBaseView_SceneManager::setControlActiveStateOfALL ( bool  stateCondition  ) 

Definition at line 534 of file wxVtkBaseView_SceneManager.cxx.

References _contours_ViewControl, and setControlActiveStateOf().

00535         {
00536                 setControlActiveStateOf( _contours_ViewControl, stateCondition );                       
00537         }

Here is the call graph for this function:

void wxVtkBaseView_SceneManager::setSelection2DROIInternalOutlines (  ) 

Definition at line 1058 of file wxVtkBaseView_SceneManager.cxx.

References _controlerSelectionROI, _drawingSelectionROI, _sceneContours_ViewControl, _viewerSelectionROI, _workingGroup, and setControlActiveStateOf().

Referenced by OnLeftButtonUp().

01059         {
01060                 _drawingSelectionROI = false;
01061                 _workingGroup->clear();
01062                 double minX,minY,maxX,maxY, minX_ROI,minY_ROI,maxX_ROI,maxY_ROI;
01063                 double minZ = -1.0;
01064                 double maxZ = -1.0;
01065                 std::map<std::string, ContourWrap_ViewControl *>::iterator iter = _sceneContours_ViewControl->begin();
01066                 int i, size = _sceneContours_ViewControl->size();
01067                 _viewerSelectionROI->GetMinMax( minX_ROI, minY_ROI, maxX_ROI, maxY_ROI );
01068                 manualViewBaseContour * viewer;
01069                 bool insideRoi = false;
01070                 for ( i=0; i<size; i++ )
01071                 {
01072                         viewer = iter->second->getViewer();
01073                         viewer->GetMinMax( minX, minY, minZ, maxX, maxY, maxZ );
01074                         insideRoi = minX >= minX_ROI && maxX <= maxX_ROI && minY_ROI && maxY <= maxY_ROI;
01075                         if ( insideRoi )
01076                         {
01077                                 viewer->SetSelected( true );
01078                                 viewer->UpdateColorActor();
01079                                 setControlActiveStateOf( iter->second, true );
01080                                 _workingGroup->insert(std::pair <std::string, ContourWrap_ViewControl *> ( iter->first, iter->second ));
01081                         }
01082                         iter++;
01083                 }   
01084                 _viewerSelectionROI->RemoveCompleteContourActor( );     
01085                 _controlerSelectionROI->SetActive( false );
01086         }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkBaseView_SceneManager::setVisibleStateOf ( std::string  theKeyName,
bool  stateCondition 
)

Definition at line 554 of file wxVtkBaseView_SceneManager.cxx.

References getContourWrap_ViewControlOf(), and removeFromScene().

00555         {
00556                 ContourWrap_ViewControl * contourWRP =  getContourWrap_ViewControlOf( theKeyName );
00557 //              contourWRP->getViewer()->SetVisible( stateCondition );
00558                 if ( contourWRP!=NULL )
00559                         removeFromScene( contourWRP, false, stateCondition );
00560         }

Here is the call graph for this function:

void wxVtkBaseView_SceneManager::SetWidthContour ( double  width  ) 

Definition at line 1187 of file wxVtkBaseView_SceneManager.cxx.

References _contours_ViewControl, _widthOfContour, _widthOfControlPoint, and ContourWrap_ViewControl::getViewer().

Referenced by wxContourViewPanel::SetWidthContour().

01188         {
01189                 _widthOfContour         = width;
01190                 _widthOfControlPoint    = _widthOfContour*_widthOfContour/2;
01191                 manualViewBaseContour           *cViewer;
01192                 ContourWrap_ViewControl         *conwraviwcont;
01193                 std::map <std::string, ContourWrap_ViewControl *>::iterator iter; 
01194         
01195                 if (_contours_ViewControl!=NULL)
01196                 {
01197                         for (iter=_contours_ViewControl->begin(); iter!=_contours_ViewControl->end(); iter++ )
01198                         {
01199                                 conwraviwcont           = iter->second;
01200                                 cViewer                 = conwraviwcont->getViewer();
01201                                 cViewer->SetShowText( false );                                  // EED 28Mars2011
01202                                 cViewer->SetWidthLine( _widthOfContour );
01203                                 cViewer->SetRange( _widthOfControlPoint );
01204                         } // for
01205                 } // if 
01206         }

Here is the call graph for this function:

Here is the caller graph for this function:

void wxVtkBaseView_SceneManager::setWxEventHandler ( wxEvtHandler *  theEventHandler  ) 

Definition at line 111 of file wxVtkBaseView_SceneManager.cxx.

References _eventHandler.

00112         {
00113                 _eventHandler = theEventHandler;
00114         }

void wxVtkBaseView_SceneManager::setWxVtkViewBase ( wxVtkBaseView *  theBaseView  ) 

Definition at line 116 of file wxVtkBaseView_SceneManager.cxx.

References _wxVtk_BaseView.

00117         {
00118                 _wxVtk_BaseView = theBaseView;
00119         }

void wxVtkBaseView_SceneManager::writeCoords ( std::string  method  ) 

Definition at line 1088 of file wxVtkBaseView_SceneManager.cxx.

01089         {
01090                 FILE *ff = fopen("c:/temp/wxVtkBaseView_SceneManagerStadistics.txt","a+");
01091                 long int start = clock();
01092 #if(WIN32)
01093                 double sg = (double)(start) / (double)CLK_TCK;
01094 #else
01095                 double sg = (double)(start) / CLOCKS_PER_SEC;
01096 #endif
01097                 int tmpPx,tmpPy;
01098                 wxVTKRenderWindowInteractor *wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
01099                 wxVTKiren->GetEventPosition( tmpPx , tmpPy );
01100                 fprintf(ff,"::%s (x,y) = (%i, %i) t(sg): %f\n  \n",method.c_str(), tmpPx, tmpPy, sg);
01101                 fclose(ff);
01102         }


Member Data Documentation

Definition at line 237 of file wxVtkBaseView_SceneManager.h.

Referenced by isCtrlPressed(), and OnChar().

Definition at line 218 of file wxVtkBaseView_SceneManager.h.

Referenced by get_editingROI(), and set_editingROI().

Definition at line 222 of file wxVtkBaseView_SceneManager.h.

Definition at line 213 of file wxVtkBaseView_SceneManager.h.

Referenced by OnChar(), sendEnvent(), and setWxEventHandler().

Definition at line 227 of file wxVtkBaseView_SceneManager.h.

Referenced by getLastKeyCode(), and OnChar().

Definition at line 223 of file wxVtkBaseView_SceneManager.h.

Definition at line 233 of file wxVtkBaseView_SceneManager.h.

Referenced by configureSelectionROI().

Definition at line 224 of file wxVtkBaseView_SceneManager.h.

Definition at line 238 of file wxVtkBaseView_SceneManager.h.

Referenced by isShiftPressed(), and OnChar().

Definition at line 234 of file wxVtkBaseView_SceneManager.h.

Referenced by configureViewControlTo(), and SetWidthContour().

Definition at line 235 of file wxVtkBaseView_SceneManager.h.

Referenced by configureViewControlTo(), and SetWidthContour().

Definition at line 225 of file wxVtkBaseView_SceneManager.h.

Definition at line 226 of file wxVtkBaseView_SceneManager.h.

Definition at line 228 of file wxVtkBaseView_SceneManager.h.

Definition at line 229 of file wxVtkBaseView_SceneManager.h.


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

Generated on Wed Jun 27 23:28:35 2012 for creaContours_lib by  doxygen 1.5.7.1