creaContours_lib
wxVtkBaseView_SceneManager Class Reference

#include <wxVtkBaseView_SceneManager.h>

Inheritance diagram for wxVtkBaseView_SceneManager:
Collaboration diagram for wxVtkBaseView_SceneManager:

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

Constructor & Destructor Documentation

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

Definition at line 66 of file wxVtkBaseView_SceneManager.cxx.

67  {
68 
69  _lastInteraction = NULL;
71  _eventHandler = theEventHandler;
72  _leftClickCount = 0;
73  _rigthClickCount = 0;
74 
75  _contours_ViewControl = new std::map< std::string, ContourWrap_ViewControl * >();
76  _sceneContours_ViewControl = new std::map< std::string, ContourWrap_ViewControl * >();
77  _workingGroup = new std::map< std::string, ContourWrap_ViewControl * >();
78 
79  _creatingMULT_ROI = false;
80  _editingROI = false;
82  _waiting = false;
83  _creatingROI = false;
84  _drawingSelectionROI = false;
85  SetWidthContour(1.0);
86 
87  _wxVtk_BaseView = theWxBaseViewToManage;
88  if( _wxVtk_BaseView!=NULL )
89  {
90  vtkInteractorStyleBaseView* theInteractorStyleBaseView = (vtkInteractorStyleBaseView*)_wxVtk_BaseView->GetInteractorStyleBaseView();
91  theInteractorStyleBaseView->AddInteractorStyleMaracas( this );
92  SetVtkInteractorStyleBaseView( theInteractorStyleBaseView );
93  }
94  configureSelectionROI( spc );
95  }
wxVtkBaseView_SceneManager::~wxVtkBaseView_SceneManager ( )

Definition at line 97 of file wxVtkBaseView_SceneManager.cxx.

References _contours_ViewControl, _lastInteraction, and _workingGroup.

98  {
99  std::map <std::string, ContourWrap_ViewControl *>::iterator iter = _contours_ViewControl->begin();
100  int size = _contours_ViewControl->size();
101  for ( int i = 0; i<size; iter++ )
102  {
103  _contours_ViewControl->erase( iter );
104  i++;
105  }
106  _contours_ViewControl->clear();
107  delete _contours_ViewControl;
108  _workingGroup->clear();
109  delete _lastInteraction;
110  delete _workingGroup;
111  //delete _contours_ViewControl;
112  }

Member Function Documentation

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 502 of file wxVtkBaseView_SceneManager.cxx.

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

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

503  {
504  if( !append )
505  {
507  }
508  ContourWrap_ViewControl * contourWRP = getContourWrap_ViewControlOf( theKeyName );
509  _sceneContours_ViewControl->insert(std::pair <std::string, ContourWrap_ViewControl *> ( theKeyName, contourWRP ) );
510 
511  addToScene( theKeyName, contourWRP, true, visualization, control, ifActive, ifShowCtrlPoints);
512  }

Here is the call graph for this function:

Here is the caller 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 515 of file wxVtkBaseView_SceneManager.cxx.

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

516  {
517  if( !append )
518  {
520  }
521  _sceneContours_ViewControl->insert(std::pair <std::string, ContourWrap_ViewControl *> ( theKeyName, contourWRP ) );
522  if ( visualization )
523  {
524  contourWRP->getViewer()->AddCompleteContourActor( ifShowCtrlPoints );
525  }
526 
527  if( control )
528  {
529  ((vtkInteractorStyleBaseView*)_wxVtk_BaseView->GetInteractorStyleBaseView())->AddInteractorStyleMaracas( contourWRP->getControler() );
530  }
531  if( ifActive )
532  {
533  contourWRP->getControler()->SetActive( true );
534  contourWRP->getViewer()->RemoveTextActor();
535  }
536  }

Here is the call graph for this function:

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 549 of file wxVtkBaseView_SceneManager.cxx.

References addToScene().

550  {
551  int i, size = theKeyNameVector.size();
552  for( i=0; i< size; i++ )
553  {
554  addToScene( theKeyNameVector[i], append, visualization, control, ifActive, ifShowCtrlPoints );
555  }
556  }

Here is the call graph for this function:

void wxVtkBaseView_SceneManager::configureSelectionROI ( double *  spc)

Definition at line 246 of file wxVtkBaseView_SceneManager.cxx.

References _controlerSelectionROI, _modelSelectionROI, _viewerSelectionROI, and _wxVtk_BaseView.

247  {
248  _controlerSelectionROI = new manualRoiControler();
249  _viewerSelectionROI = new manualViewRoi();
250  _modelSelectionROI = new manualContourModel();
251 
253  _viewerSelectionROI->SetWxVtkBaseView( _wxVtk_BaseView );
254  _viewerSelectionROI->SetRange( 2 );
255  _viewerSelectionROI->SetZ( -900 );
256  _viewerSelectionROI->SetColorNormalContour(0.6, 0.8, 0);
257 
258  _viewerSelectionROI->SetSpacing( spc );
259 
261  ((vtkInteractorStyleBaseView*)_wxVtk_BaseView->GetInteractorStyleBaseView())->AddInteractorStyleMaracas( _controlerSelectionROI );
262  _controlerSelectionROI->SetActive(false);
263  }
void wxVtkBaseView_SceneManager::configureViewControlTo ( std::string  theKeyName,
manualBaseModel *  manContourControl,
double *  spc,
int  typeContour 
)

Definition at line 152 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().

153  {
154  //setControlActiveStateOfALL( false );
155  _creatingROI = true;
156  _waiting = false;
157  if( _lastInteraction!=NULL )
158  {
159  _lastInteraction->getControler()->SetEditable( false );
160  _lastInteraction->getViewer()->Refresh();
161  _lastInteraction->getControler()->SetActive( false );
162  this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
163  }
164 
165 
166  manualContourBaseControler *manContourControl;
167  manualViewBaseContour *manViewerContour;
168 
169  // Creating the view manualViewContour and the manualContourControler
170  // NOTE: The model is created in the KernelManagerContour class, factoryManualContourModel method
171  if (typeContour==1)
172  {
173  manContourControl = new manualContourControler();
174  manViewerContour = new manualViewContour();
175  }
176 
177  if (typeContour==2)
178  {
179  manContourControl = new manualRoiControler();
180  manViewerContour = new manualViewRoi();
181  }
182 
183  if (typeContour==3)
184  {
185  manContourControl = new manualCircleControler();
186  manViewerContour = new manualViewCircle();
187  }
188 
189  if (typeContour==4)
190  {
191  manContourControl = new manualRoiControler();
192  manViewerContour = new manualViewBullEye();
193  }
194 
195  if (typeContour==6)
196  {
197  manContourControl = new manualLineControler();
198  manViewerContour = new manualViewLine();
199  }
200 
201  //Points
202  if (typeContour==7)
203  {
204  manContourControl = new manualContourControler();
205  manViewerContour = new manualViewPoints();
206  }
207 
208  //Polygon
209  if (typeContour==10)
210  {
211  manContourControl = new manualContourControler();
212  manViewerContour = new manualViewContour();
213  }
214 
215 
216 
217  _lastInteraction = insertWrap( theKeyName, manContourControl, manViewerContour );
218  _lastInteractionName = theKeyName;
219 
220  //Configuring the relations between the contour members representation
221  manViewerContour->SetModel( manModelContour );
222  manViewerContour->SetWxVtkBaseView( _wxVtk_BaseView );
223  manViewerContour->SetRange( _widthOfControlPoint );
224  manViewerContour->SetZ( -900 );
225 
226  manViewerContour->SetSpacing(spc);
227 
228  manViewerContour->SetColorNormalContour(0, 0, 1);
229  manViewerContour->SetColorEditContour(0.5, 0.5, 0.5);
230  manViewerContour->SetColorSelectContour(1, 0.8, 0);
231  manViewerContour->SetWidthLine(_widthOfContour);
232 
233  manContourControl->SetModelView( manModelContour , manViewerContour );
234  manContourControl->Configure();
235  int i,sizeLstPoints = manModelContour->GetSizeLstPoints();
236  for ( i=0; i<sizeLstPoints; i++ )
237  {
238  manViewerContour->AddPoint();
239  }
240 
241  manContourControl->CreateNewManualContour();
242  manViewerContour->RefreshContour();
243  addToScene( theKeyName );
244  }

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 375 of file wxVtkBaseView_SceneManager.cxx.

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

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

376  {
377  if ( !append )
378  {
380  _workingGroup->clear();
381  }
382  std::map <std::string, ContourWrap_ViewControl *>::iterator iter;
383 
384 
385  iter = _contours_ViewControl->find( anExistingKName );
386 
387  manualBaseModel *cModule = manualModel;
388  manualViewBaseContour *cViewer = iter->second->getViewer()->Clone();
389  manualContourBaseControler *cControl = iter->second->getControler()->Clone( );
390 
391  cViewer->SetModel(cModule);
392  cControl->SetModelView( cModule , cViewer );
393  cControl->CreateNewManualContour();
394  cControl->SetActive( true );
395  cControl->SetEditable( false );
396 
397  cViewer->RefreshContour();
398  cViewer->Refresh();
399  this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
400  this->_vtkInteractorStyleBaseView->EvaluateToRefresh();
401 
402  _lastInteraction = insertWrap( cloneName, cControl, cViewer );
403  _workingGroup->insert(std::pair <std::string, ContourWrap_ViewControl *> ( cloneName, _lastInteraction ));
404  addToScene( cloneName );
405  }

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 1245 of file wxVtkBaseView_SceneManager.cxx.

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

Referenced by wxContourViewPanel::removeFromScene().

1245  {
1246 
1247 
1249 
1250  manualViewBaseContour * cViewer = ccon->getViewer();
1251  manualContourBaseControler * cControler = ccon->getControler();
1252 
1253  removeFromScene(theKeyName);
1254  removeWrap(theKeyName);
1255 
1256  delete cViewer;
1257  delete cControler;
1258  }

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 277 of file wxVtkBaseView_SceneManager.cxx.

278  {
279 
280  }
void wxVtkBaseView_SceneManager::drawSelectionROI ( )

Definition at line 1049 of file wxVtkBaseView_SceneManager.cxx.

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

1050  {
1051  _drawingSelectionROI = true;
1052  _workingGroup->clear();
1053  _controlerSelectionROI->CreateNewManualContour();
1054  if (_lastInteraction!=NULL)
1055  {
1056  _lastInteraction->getControler()->SetEditable( false );
1057  _lastInteraction->getControler()->SetActive( false );
1058  _lastInteraction->getControler()->SetPosibleToMove( false );
1059  _lastInteraction->getViewer()->Refresh();
1060  }
1061  std::map<std::string, ContourWrap_ViewControl *>::iterator iter = _workingGroup->begin();
1062  int i, workSize = _workingGroup->size();
1063  for( i=0; i< workSize; i++ )
1064  {
1065  manualContourBaseControler * control = iter->second->getControler();
1066  control->SetEditable( false );
1067  control->SetActive( false );
1068  control->SetPosibleToMove( false );
1069  iter->second->getViewer()->Refresh();
1070 
1071  iter++;
1072  }
1073  _lastInteraction = NULL;
1074  _lastInteractionName = "";
1075 
1076  _viewerSelectionROI->AddCompleteContourActor( true );
1077  _controlerSelectionROI->SetActive( true );
1078 
1079  _viewerSelectionROI->RefreshContour();
1080  this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
1081  }

Here is the call graph for this function:

bool wxVtkBaseView_SceneManager::get_creatingMULT_ROI ( )

Definition at line 339 of file wxVtkBaseView_SceneManager.cxx.

References _creatingMULT_ROI.

340  {
341  return _creatingMULT_ROI;
342  }
bool wxVtkBaseView_SceneManager::get_creatingROI ( )

Definition at line 361 of file wxVtkBaseView_SceneManager.cxx.

References _creatingROI.

362  {
363  return _creatingROI;
364  }
bool wxVtkBaseView_SceneManager::get_editingROI ( )

Definition at line 344 of file wxVtkBaseView_SceneManager.cxx.

References _editingROI.

345  {
346  return _editingROI;
347  }
bool wxVtkBaseView_SceneManager::get_toIncludeAtInteractionGroup ( )

Definition at line 349 of file wxVtkBaseView_SceneManager.cxx.

References _toIncludeAtInteractionGroup.

350  {
352  }
bool wxVtkBaseView_SceneManager::get_waiting ( )

Definition at line 355 of file wxVtkBaseView_SceneManager.cxx.

References _waiting.

356  {
357  return _waiting;
358  }
ContourWrap_ViewControl * wxVtkBaseView_SceneManager::getContourWrap_ViewControlOf ( std::string  theName)

Definition at line 294 of file wxVtkBaseView_SceneManager.cxx.

References _contours_ViewControl.

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

295  {
296  std::map<std::string, ContourWrap_ViewControl *> :: iterator iter;
297  iter = _contours_ViewControl->find( theName );
298  return iter->second;
299  //return iter->first;
300  }

Here is the caller graph for this function:

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

Definition at line 302 of file wxVtkBaseView_SceneManager.cxx.

303  {
304  std::map<std::string, ContourWrap_ViewControl *> :: iterator iter;
305  iter = theMap->find( theName );
306  return iter->second;
307  }
manualContourBaseControler * wxVtkBaseView_SceneManager::getControlerOf ( std::string  theName)

Definition at line 309 of file wxVtkBaseView_SceneManager.cxx.

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

Referenced by GetPointsOfActualContour().

310  {
311  return getContourWrap_ViewControlOf ( theName )->getControler();
312  }

Here is the call graph for this function:

Here is the caller graph for this function:

vtkImageData * wxVtkBaseView_SceneManager::GetImageData ( )

Definition at line 1170 of file wxVtkBaseView_SceneManager.cxx.

References _wxVtk_BaseView.

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

1171  {
1172  wxVtk2DBaseView *wxvtk2dbaseview =(wxVtk2DBaseView*)_wxVtk_BaseView;
1173  return wxvtk2dbaseview->GetVtkBaseData()->GetImageData();
1174  }

Here is the caller graph for this function:

void wxVtkBaseView_SceneManager::GetImageDataRange ( double *  range)

Definition at line 1191 of file wxVtkBaseView_SceneManager.cxx.

References GetImageData(), and GetImageDataSizeZ().

Referenced by wxContourViewPanel::GetImageDataRange().

1192  {
1193  int ext[6];
1194  vtkImageData *imagedata = GetImageData();
1195  imagedata->GetExtent(ext);
1196  int sizeX = ext[1]-ext[0]+1;
1197  int sizeY = ext[3]-ext[2]+1;
1198  int sizeZ = GetImageDataSizeZ();
1199  int sizeXYZ = sizeX*sizeY*sizeZ;
1200  long int i;
1201  range[0]=9999999;
1202  range[1]=-9999999;
1203  unsigned short *p = (unsigned short *)imagedata->GetScalarPointer(0,0,0);
1204  for (i=0;i<sizeXYZ;i++)
1205  {
1206  if ( p[i]<range[0] ) range[0]=p[i];
1207  if ( p[i]>range[1] ) range[1]=p[i];
1208  }
1209  }

Here is the call graph for this function:

Here is the caller graph for this function:

int wxVtkBaseView_SceneManager::GetImageDataSizeZ ( )

Definition at line 1177 of file wxVtkBaseView_SceneManager.cxx.

References GetImageData().

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

1178  {
1179  int ext[6];
1180  vtkImageData *imagedata = GetImageData();
1181  imagedata->GetExtent(ext);
1182  int sizeZ = ext[5]-ext[4]+1;
1183 
1184 //EED OJO Machete
1185 // sizeZ = sizeZ-1;
1186 
1187  return sizeZ;
1188  }

Here is the call graph for this function:

Here is the caller graph for this function:

char wxVtkBaseView_SceneManager::getLastKeyCode ( )

Definition at line 688 of file wxVtkBaseView_SceneManager.cxx.

References _lastKeyCode.

Referenced by wxContourViewPanel::onActionButtonPressed().

689  {
690  return _lastKeyCode;
691  }

Here is the caller graph for this function:

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

Definition at line 450 of file wxVtkBaseView_SceneManager.cxx.

References _sceneContours_ViewControl.

Referenced by wxContourMainFrame::onDeleteContoursActSlice().

451  {
452  std::vector<std::string> lstContoursNameActualSlice;
453  std::map <std::string, ContourWrap_ViewControl *>::iterator iter = _sceneContours_ViewControl->begin();
454  int i,size = _sceneContours_ViewControl->size();
455  for ( i = 0; i<size; i++ )
456  {
457  lstContoursNameActualSlice.push_back( iter->first );
458  iter++;
459  }
460  return lstContoursNameActualSlice;
461  }

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 1150 of file wxVtkBaseView_SceneManager.cxx.

References getControlerOf(), and getSelectedObjects().

Referenced by wxContourViewPanel::GetPointsOfActualContour().

1151  {
1152  std::vector<std::string> currentSelection = this->getSelectedObjects();
1153  if (currentSelection.size()>=1){
1154 
1155  manualContourBaseControler *cControler = this->getControlerOf( currentSelection[0] );
1156  manualBaseModel *cModel = cControler->GetManualContourModel();
1157  int i,size = cModel->GetNumberOfPointsSpline();
1158  double x,y,z;
1159  for (i=0; i<size; i++)
1160  {
1161  cModel->GetSpline_i_Point(i, &x, &y, &z);
1162  vecX->push_back(x);
1163  vecY->push_back(y);
1164  vecZ->push_back(z);
1165  }
1166  }
1167  }

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 588 of file wxVtkBaseView_SceneManager.cxx.

References _workingGroup.

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

589  {
590  std::vector< std::string > selectedObjects;
591  std::map <std::string, ContourWrap_ViewControl *>::iterator iter = _workingGroup->begin();
592  int size = _workingGroup->size();
593  for ( int i = 0; i<size; i++ )
594  {
595 //EED??? manualViewBaseContour * viewer = iter->second->getViewer();
596  selectedObjects.push_back( iter->first);
597 
598  iter++;
599  }
600  return selectedObjects;
601  }

Here is the caller graph for this function:

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

Definition at line 314 of file wxVtkBaseView_SceneManager.cxx.

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

315  {
316  return getContourWrap_ViewControlOf ( theName )->getViewer();
317  }

Here is the call graph for this function:

wxVtkBaseView * wxVtkBaseView_SceneManager::getWxVtkViewBase ( )

Definition at line 147 of file wxVtkBaseView_SceneManager.cxx.

References _wxVtk_BaseView.

Referenced by wxContourViewPanel::setImageSlice().

148  {
149  return _wxVtk_BaseView;
150  }

Here is the caller graph for this function:

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

Definition at line 266 of file wxVtkBaseView_SceneManager.cxx.

References _contours_ViewControl.

Referenced by configureViewControlTo(), and createCopyContourOf().

267  {
268  ContourWrap_ViewControl * newContourWrap = new ContourWrap_ViewControl(manContourControl, manViewerContour);
269  if(_contours_ViewControl == NULL)
270  {
271  _contours_ViewControl = new std::map< std::string, ContourWrap_ViewControl * >();
272  }
273  _contours_ViewControl->insert(std::pair <std::string, ContourWrap_ViewControl *> ( theKeyName, newContourWrap ));
274  return newContourWrap;
275  }

Here is the caller graph for this function:

bool wxVtkBaseView_SceneManager::isCtrlPressed ( )

Definition at line 680 of file wxVtkBaseView_SceneManager.cxx.

References _ctrlKey.

Referenced by wxContourViewPanel::onActionButtonPressed().

681  {
682  return _ctrlKey;
683  }

Here is the caller graph for this function:

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

Definition at line 1233 of file wxVtkBaseView_SceneManager.cxx.

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

Referenced by wxContourViewPanel::isEditableCControler().

1233  {
1234 
1236  if(ccon != NULL ){
1237  manualContourBaseControler* cControler = ccon->getControler();
1238  if(cControler != NULL && cControler->IsEditable() == false){
1239  return true;
1240  }
1241  }
1242  return false;
1243  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool wxVtkBaseView_SceneManager::isShiftPressed ( )

Definition at line 684 of file wxVtkBaseView_SceneManager.cxx.

References _shiftKey.

685  {
686  return _shiftKey;
687  }
bool wxVtkBaseView_SceneManager::OnChar ( )
virtual

Definition at line 692 of file wxVtkBaseView_SceneManager.cxx.

References _ctrlKey, _eventHandler, _lastKeyCode, and _shiftKey.

693  {
694 
695  _ctrlKey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey() == 1;
696  _shiftKey = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey() == 1;
697 
698  _lastKeyCode = _vtkInteractorStyleBaseView->GetInteractor()-> GetKeyCode();
699 
700  wxCommandEvent cevent( wxEVT_COMMAND_BUTTON_CLICKED );
701  _eventHandler->ProcessEvent( cevent );
702 
703 
704  /*if( _eventHandler!=NULL )
705  {
706  char * toolCommand = NULL;
707 
708  if ( _lastKeyCode == 3 && ctrlKey ) //'C' || 'c'
709  {
710  toolCommand = &(COPY_TOOL);
711  }
712  else if( _lastKeyCode == 22 && ctrlKey ) //'V' || 'v'
713  {
714  toolCommand = &(PASTE_TOOL);
715  }
716  else if( _lastKeyCode == 8 || (_lastKeyCode==127) ) // Delete
717  {
718  toolCommand = &(DELETE_KEY);
719  }
720  else if( _lastKeyCode == 14 && ctrlKey ) //'N' || 'n'
721  {
722  toolCommand = &(CREATE_CONTOUR_KEY);
723  }
724  else if( _lastKeyCode == 15 && ctrlKey ) //'O' || 'o'
725  {
726  toolCommand = &(OPEN_TOOL);
727  }
728  else if( _lastKeyCode == 19 && ctrlKey ) //'S' || 's'
729  {
730  toolCommand = &(SAVE_KEY);
731  }
732 
733  if ( toolCommand!=NULL )
734  {
735  currentkey = toolCommand;
736  wxCommandEvent cevent( wxEVT_COMMAND_BUTTON_CLICKED );
737  cevent.SetClientData( (void *) toolCommand);
738  _eventHandler->ProcessEvent( cevent );
739  }
740  }*/
741 
742 
743  // long int endtime = clock();
744 
745  return true;
746  }
bool wxVtkBaseView_SceneManager::OnLeftButtonDown ( )
virtual

Definition at line 867 of file wxVtkBaseView_SceneManager.cxx.

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

868  {
869 
870 
871 
872 //EED??? char aa = _vtkInteractorStyleBaseView->GetInteractor()->GetKeyCode();
873  bool condition = false;
874  //vtkCommand * theComand = _wxVtk_BaseView ->GetInteractorStyleBaseView()->GetCommand(
875 //EED??? vtkRenderWindowInteractor * vtkRWInteractor1 = _wxVtk_BaseView ->GetWxVTKRenderWindowInteractor();
876 //EED??? wxVTKRenderWindowInteractor * vtkRWInteractor2 = _wxVtk_BaseView ->GetWxVTKRenderWindowInteractor();//GetInteractorStyleBaseView()->GetInteractor();
877 //EED?? wxVTKRenderWindowInteractorPlus * vtkRWInteractor3 = (wxVTKRenderWindowInteractorPlus*)_wxVtk_BaseView ->GetWxVTKRenderWindowInteractor();//GetInteractorStyleBaseView()->GetInteractor();
878  vtkRenderWindowInteractor * vtkRWInteractor = _vtkInteractorStyleBaseView->GetInteractor();
879 
880  bool ctrlKey = vtkRWInteractor->GetControlKey() == 1;
881  bool shftKey = vtkRWInteractor->GetShiftKey() == 1;
883  if ( ctrlKey || shftKey )
884  {
886  }
887  else
888  {
890  {
891  if( _lastInteraction->getControler()->GetIfCompleteCreation() && !_lastInteraction->getControler()->IsEditable()&& !_lastInteraction->getViewer()->GetPosibleSelected() )
892  {
893  _lastInteraction->getControler()->SetEditable( false );
894  _lastInteraction->getControler()->SetActive( false );
895  _lastInteraction->getControler()->SetPosibleToMove( false );
896  _lastInteraction->getViewer()->Refresh();
897  _lastInteraction=NULL;
898  }
899  }
900  }
901 
902 
903 
905  {
906  _workingGroup->clear();
907  }
908 
909  if( _lastInteraction!=NULL )
910  {
913  _workingGroup->insert(std::pair <std::string, ContourWrap_ViewControl *> ( _lastInteractionName, _lastInteraction ));
914  }
915  if( _creatingMULT_ROI && !_creatingROI && !ctrlKey && !shftKey )
916  {
917  _creatingROI = true;
918  //setControlActiveStateOf( _contours_ViewControl, false );
919  sendEnvent( wxEVT_START_CREATE_ROI, "");
920  }
921  condition = true;
922 
923 // FILE *ff = fopen("c:/temp/wxVtkBaseView_SceneManagerStadistics.txt","a+");
924 // fprintf(ff,"EED wxVtkBaseView_SceneManager::OnLeftButtonDown() contours=%d sceneContour=%d workingContours=%d\n",
925 // _contours_ViewControl->size(), _sceneContours_ViewControl->size(), _workingGroup->size() );
926 // fclose(ff);
927 
928 
929  return condition;
930  }

Here is the call graph for this function:

bool wxVtkBaseView_SceneManager::OnLeftButtonUp ( )
virtual

Definition at line 933 of file wxVtkBaseView_SceneManager.cxx.

References _drawingSelectionROI, and setSelection2DROIInternalOutlines().

934  {
935  bool condition = false;
936  condition = true;
937 
939  {
941  }
942  return condition;
943  }

Here is the call graph for this function:

bool wxVtkBaseView_SceneManager::OnLeftDClick ( )
virtual

Definition at line 1006 of file wxVtkBaseView_SceneManager.cxx.

1007  {
1008  bool condition = false;
1009  condition = true;
1010 
1011  return condition;
1012  }
bool wxVtkBaseView_SceneManager::OnMiddleButtonDown ( )
virtual

Definition at line 945 of file wxVtkBaseView_SceneManager.cxx.

946  {
947  bool condition = false;
948  condition = true;
949 
950  return condition;
951  }
bool wxVtkBaseView_SceneManager::OnMiddleButtonUp ( )
virtual

Definition at line 953 of file wxVtkBaseView_SceneManager.cxx.

954  {
955  bool condition = false;
956  condition = true;
957 
958  return condition;
959  }
bool wxVtkBaseView_SceneManager::OnMiddleDClick ( )
virtual

Definition at line 1033 of file wxVtkBaseView_SceneManager.cxx.

1034  {
1035  bool condition = false;
1036  condition = true;
1037 
1038  return condition;
1039  }
bool wxVtkBaseView_SceneManager::OnMouseMove ( )
virtual

Definition at line 749 of file wxVtkBaseView_SceneManager.cxx.

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

750  {
751 
752  bool condition = true;
753  int X,Y;
754  wxVTKRenderWindowInteractor *_wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
755  _wxVTKiren->GetEventPosition( X , Y );
756 
757  bool ctrlKey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey() == 1;
758 //??? bool shiftKey = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey() == 1;
759 
760  if( _waiting && !ctrlKey )
761  {
762  sendEnvent( wxEVT_CHANGED_DEEP, "Update");
763  //toca ver como decirle al viewer que no se mueva mientras no se este esperando que se pueda mover
764  }
765 
766  if ( !_creatingROI && !_creatingMULT_ROI )
767  {
768 
769  /*if( ctrlKey || shiftKey )
770  {
771 
772  }
773  else
774  {
775  _toIncludeAtInteractionGroup = false;
776  }*/
777 
778  bool preserveState = _lastInteraction!=NULL? _lastInteraction->getViewer()->GetSelected() : false;
779  std::string preservingName = preserveState ? _lastInteractionName : "";
780 
781  std::map<std::string, ContourWrap_ViewControl *>::iterator iter = _sceneContours_ViewControl->begin();
782  int i, size = _sceneContours_ViewControl->size();
783  bool foundOne = false;
784 
785  manualContourBaseControler * control = _lastInteraction != NULL ? _lastInteraction->getControler() : NULL;
786  manualViewBaseContour * viewer = NULL;
787 
788 
789  bool singleMoving = true;
790  int selectionSize = _workingGroup->size();
791  if( selectionSize > 1 )
792  {
793  //Multiple moving
794 
795 //EED??? bool ckecking = false;
796  for( i =0; i<size ; i++ )
797  {
798  control = iter->second->getControler();
799  viewer = iter->second->getViewer();
800  /*ckecking = */control->SetActive( true );
801  }
802  if (_lastInteraction != NULL)
803  {
804  singleMoving = !_lastInteraction->getViewer()->GetSelected();
805 
806  }
807  if( !singleMoving )
808  {
809  size = selectionSize;
810  iter = _workingGroup->begin();
811  }
812  }
813  else
814  {
815 
817  }
818 
819  if( ((_lastInteraction != NULL && !control->IsEditable() && !control->IsMoving() ) || _lastInteraction==NULL ))
820  {
821 
822  _lastInteraction=NULL;
823  for( i =0; i<size ; i++ )
824  {
825  control = iter->second->getControler();
826  viewer = iter->second->getViewer();
827 // _wxVtk_BaseView->GetInteractorStyleBaseView()->AddInteractorStyleMaracas( control );
828  control->SetActive( true );
829 
830  foundOne = control->OnMouseMove();
831  foundOne &= viewer->GetPosibleSelected();
832 
833  if ( !foundOne && singleMoving )
834  {
835  control->SetActive( false );
836 // _wxVtk_BaseView->GetInteractorStyleBaseView()->RemoveInteractorStyleMaracas( control );
837  control->SetPosibleToMove( false );
838  }
839  else
840  {
841  if( _toIncludeAtInteractionGroup && preserveState && _lastInteractionName.compare( preservingName)==0 )
842  {
843  _lastInteraction->getControler()->SetActive( true );
844  }
845 
846  _lastInteraction = iter->second;
847  _lastInteractionName = iter->first;
848 
849  viewer->UpdateColorActor();
850  control->SetPosibleToMove( true );
851  // viewer->AddCompleteContourActor();
852  }
853  iter++;
854  }
855  control = NULL;
856  viewer = NULL;
857  }
858  }
859  return condition;
860  }

Here is the call graph for this function:

bool wxVtkBaseView_SceneManager::OnMouseWheel ( )
virtual

Definition at line 1041 of file wxVtkBaseView_SceneManager.cxx.

1042  {
1043  bool condition = false;
1044  condition = true;
1045  return condition;
1046  }
bool wxVtkBaseView_SceneManager::OnRightButtonDown ( )
virtual

Definition at line 961 of file wxVtkBaseView_SceneManager.cxx.

References _waiting.

962  {
963  bool condition = false;
964 //EED??? vtkRenderWindowInteractor * vtkRWInteractor = _vtkInteractorStyleBaseView->GetInteractor();
965 //EED??? bool ctrlKey = vtkRWInteractor->GetControlKey() == 1;
966  _waiting = true;
967 
968  condition = true;
969 
970  return condition;
971  }
bool wxVtkBaseView_SceneManager::OnRightButtonUp ( )
virtual

Definition at line 973 of file wxVtkBaseView_SceneManager.cxx.

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

974  {
975  bool condition = false;
976  condition = true;
977  //setControlActiveStateOfALL( false );//************************************************
978  if ( _creatingMULT_ROI )
979  {
980  //setControlActiveStateOfALL( false );
981  }
982  if( _creatingROI )
983  {
984  sendEnvent( wxEVT_STOP_CREATE_ROI, "Activate");
985  _creatingROI = false;
986  }
987  else
988  {
990  {
991  manualContourBaseControler * control = _lastInteraction->getControler();
992  //_lastInteraction->getControler()->SetPosibleToMove( false );
993  control->SetActive( false );
994  control->SetEditable( false );
995  control->SetPosibleToMove( false );
996 // _wxVtk_BaseView->GetInteractorStyleBaseView()->RemoveInteractorStyleMaracas( control );
997  _lastInteraction->getViewer()->Refresh();
998  this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
999  }
1000  }
1001  _waiting = false;
1002  return condition;
1003  }

Here is the call graph for this function:

bool wxVtkBaseView_SceneManager::OnRightDClick ( )
virtual

Definition at line 1014 of file wxVtkBaseView_SceneManager.cxx.

1015  {
1016  bool condition = false; condition = true;
1017 //EED??? vtkRenderWindowInteractor * vtkRWInteractor = _vtkInteractorStyleBaseView->GetInteractor();
1018  /*vtkRenderWindowInteractor * vtkRWInteractor1 =*/ _vtkInteractorStyleBaseView->OnChar();
1019 //EED??? wxVTKRenderWindowInteractor * wxVtkRWInterator = _wxVtk_BaseView ->GetWxVTKRenderWindowInteractor();
1020 
1021  /*if( _waiting )
1022  {
1023  sendEnvent( wxEVT_START_CREATE_MULT_ROI, "Multiple");
1024  set_creatingMULT_ROI( !_creatingMULT_ROI );
1025  _waiting = false;
1026  }
1027  else
1028  _waiting = true;*/
1029 
1030  return condition;
1031  }
void wxVtkBaseView_SceneManager::removeAllOutlines ( )

Definition at line 481 of file wxVtkBaseView_SceneManager.cxx.

References _contours_ViewControl, and removeWrap().

Referenced by wxContourMainFrame::deleteAllContours().

482  {
483  manualViewBaseContour * cViewer;
484  manualContourBaseControler * cControler;
485 
486  std::map <std::string, ContourWrap_ViewControl *>::iterator iter;
487  int i,size=_contours_ViewControl->size();
488  for (i=0;i<size;i++)
489  {
490  iter = _contours_ViewControl->begin();
491  cControler = iter->second->getControler();
492  cViewer = iter->second->getViewer();
493  removeWrap( iter->first );
494  delete cViewer;
495  delete cControler;
496  }// for
497 
498  }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 409 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().

410  {
411  if( contourWRP == _lastInteraction )
412  {
413  _lastInteraction = NULL;
415  }
416 
417 
418  ((vtkInteractorStyleBaseView*)_wxVtk_BaseView->GetInteractorStyleBaseView())->RemoveInteractorStyleMaracas( contourWRP->getControler() );
419 
420  contourWRP->getControler()->SetActive( control );
421  contourWRP->getControler()->SetEditable( false );
422 
423  if ( !visualization && control )
424  {
425  contourWRP->getViewer()->RemoveControlPoints( );
426  contourWRP->getViewer()->RemoveTextActor( );
427  }
428  if ( visualization )
429  {
430  contourWRP->getViewer()->RemoveCompleteContourActor();
431  }
432 
433  }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 435 of file wxVtkBaseView_SceneManager.cxx.

References _sceneContours_ViewControl, and removeFromScene().

436  {
437 
438  std::map<std::string, ContourWrap_ViewControl *> :: iterator iter;
439  iter = _sceneContours_ViewControl->find( theKeyName );
440  if (iter != _sceneContours_ViewControl->end())
441  {
442  ContourWrap_ViewControl * contourWRP = iter->second;
443  removeFromScene( contourWRP );
444  _sceneContours_ViewControl->erase(iter);
445  }
446  }

Here is the call graph for this function:

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

Definition at line 539 of file wxVtkBaseView_SceneManager.cxx.

References removeFromScene().

540  {
541  int i, size = theKeyNameVector.size();
542  for( i=0; i< size; i++ )
543  {
544  removeFromScene( theKeyNameVector[i], visualization, control );
545  }
546  }

Here is the call graph for this function:

void wxVtkBaseView_SceneManager::removeSceneContours ( )

Definition at line 464 of file wxVtkBaseView_SceneManager.cxx.

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

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

465  {
466  std::map <std::string, ContourWrap_ViewControl *>::iterator iter = _sceneContours_ViewControl->begin();
467  int size = _sceneContours_ViewControl->size();
468  for ( int i = 0; i<size; i++ )
469  {
470  removeFromScene( iter->second );
471  iter++;
472  }
474 
475 
476  //Removing the selection rectangle to avoid showing when it's innecesary
477  _controlerSelectionROI->SetActive( false );
478  _viewerSelectionROI->RemoveCompleteContourActor();
479  }

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 282 of file wxVtkBaseView_SceneManager.cxx.

References _contours_ViewControl, _lastInteraction, _lastInteractionName, and _workingGroup.

Referenced by deleteCViewerCControler(), and removeAllOutlines().

283  {
284  std::map<std::string, ContourWrap_ViewControl *> :: iterator iter;
285  iter = _contours_ViewControl->find( theKeyName );
286  _contours_ViewControl->erase( iter );
287  _lastInteraction=NULL;
289  _workingGroup->clear();
290  this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
291  this->_vtkInteractorStyleBaseView->EvaluateToRefresh();
292  }

Here is the caller graph for this function:

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

Definition at line 1131 of file wxVtkBaseView_SceneManager.cxx.

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

Referenced by wxContourMainFrame::saveFileWithContours().

1132  {
1133  std::map <std::string, ContourWrap_ViewControl *>::iterator iter = _contours_ViewControl->find(nameThing);
1134  manualViewBaseContour * cViewer;
1135  manualContourBaseControler * cControler;
1136  ContourWrap_ViewControl *conwraviwcont=iter->second;
1137 
1138  cViewer = conwraviwcont->getViewer();
1139  cViewer->Save(ff);
1140 
1141  cControler = conwraviwcont->getControler();
1142 // cControler->Save(ff);
1143 
1144 // cModel = cControler->GetManualContourModel();
1145 // cModel->Save(ff);
1146  }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 603 of file wxVtkBaseView_SceneManager.cxx.

References _contours_ViewControl.

604  {
605  std::map <std::string, ContourWrap_ViewControl *>::iterator iter = _contours_ViewControl->begin();
606 //EED??? int size = _contours_ViewControl->size();
607 //EED??? bool selected;
608  /*for ( int i = 0; i<size; i++ )
609  {
610  selected = false;
611  manualViewBaseContour * viewer = iter->second->getViewer();
612  std::vector <std::string >::iterator iterIN;
613  int a = 0;
614  for( a = 0, iterIN = theExistingObjectsToSelect.begin() ; !selected && a < theExistingObjectsToSelect.size() ; a++ )
615  {
616  if( iter->first.compare( theExistingObjectsToSelect[i] ) )
617  {
618  viewer->SelectAllPoints( true );
619  viewer->SelectPosibleContour( true );
620  selected = true;
621  theExistingObjectsToSelect.erase( iterIN );
622  }
623  if( !selected )
624  iterIN++;
625  }
626  } */
627  }
void wxVtkBaseView_SceneManager::selectObjects ( std::map< std::string, ContourWrap_ViewControl * > *  theMap)

Definition at line 630 of file wxVtkBaseView_SceneManager.cxx.

References _contours_ViewControl.

631  {
632  std::map <std::string, ContourWrap_ViewControl *>::iterator iter = theMap->begin();
633  int size = _contours_ViewControl->size();
634  for ( int i = 0; i<size; i++ )
635  {
636  manualViewBaseContour * viewer = iter->second->getViewer();
637 
638  viewer->SetSelected( true );
639  /*viewer->SelectAllPoints( true );
640  viewer->SelectPosibleContour( true );*/
641 
642  iter++;
643  }
644  }
void wxVtkBaseView_SceneManager::sendEnvent ( WXTYPE  theEventType,
std::string  text 
)

Definition at line 122 of file wxVtkBaseView_SceneManager.cxx.

References _eventHandler.

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

123  {
124  if ( _eventHandler != NULL )
125  {
126  wxCommandEvent cevent( theEventType );
127  cevent.SetString( wxString( text.c_str(), wxConvUTF8) );
128  _eventHandler->ProcessEvent( cevent );
129  }
130  }

Here is the caller graph for this function:

void wxVtkBaseView_SceneManager::set_creatingMULT_ROI ( bool  condition)

Definition at line 319 of file wxVtkBaseView_SceneManager.cxx.

References _creatingMULT_ROI.

320  {
321  _creatingMULT_ROI = condition;
322  }
void wxVtkBaseView_SceneManager::set_creatingROI ( bool  theCondition)

Definition at line 366 of file wxVtkBaseView_SceneManager.cxx.

References _creatingROI.

367  {
368  _creatingROI = condition;
369  }
void wxVtkBaseView_SceneManager::set_editingROI ( bool  condition)

Definition at line 324 of file wxVtkBaseView_SceneManager.cxx.

References _editingROI.

325  {
326  _editingROI = condition;
327  }
void wxVtkBaseView_SceneManager::set_toIncludeAtInteractionGroup ( bool  condition)

Definition at line 329 of file wxVtkBaseView_SceneManager.cxx.

References _toIncludeAtInteractionGroup.

330  {
331  _toIncludeAtInteractionGroup = condition;
332  }
void wxVtkBaseView_SceneManager::set_waiting ( bool  condition)

Definition at line 334 of file wxVtkBaseView_SceneManager.cxx.

References _waiting.

335  {
336  _waiting = condition;
337  }
void wxVtkBaseView_SceneManager::setControlActiveStateOf ( std::string  theKeyName,
bool  stateCondition 
)

Definition at line 565 of file wxVtkBaseView_SceneManager.cxx.

References getContourWrap_ViewControlOf().

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

566  {
567  ContourWrap_ViewControl * contourWRP = getContourWrap_ViewControlOf( theKeyName );
568  setControlActiveStateOf( contourWRP, stateCondition );
569  }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 572 of file wxVtkBaseView_SceneManager.cxx.

References ContourWrap_ViewControl::getControler().

573  {
574  contourWRP->getControler()->SetActive( stateCondition );
575  contourWRP->getControler()->SetEditable( false );
576  }

Here is the call graph for this function:

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

Definition at line 647 of file wxVtkBaseView_SceneManager.cxx.

References setControlActiveStateOf().

648  {
649  int i, size = theKeyNameVector.size();
650  for( i=0; i< size; i++ )
651  {
652  setControlActiveStateOf( theKeyNameVector[i], controlCondition );
653  }
654  }

Here is the call graph for this function:

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

Definition at line 657 of file wxVtkBaseView_SceneManager.cxx.

References removeFromScene().

658  {
659  std::map<std::string, ContourWrap_ViewControl *>::iterator iter = theMap->begin();
660  int i, size = theMap->size();
661  for( i=0; i< size; i++ )
662  {
663  removeFromScene( iter->second, false, controlCondition );
664  iter++;
665  }
666  }

Here is the call graph for this function:

void wxVtkBaseView_SceneManager::setControlActiveStateOfALL ( bool  stateCondition)

Definition at line 559 of file wxVtkBaseView_SceneManager.cxx.

References _contours_ViewControl, and setControlActiveStateOf().

560  {
562  }

Here is the call graph for this function:

void wxVtkBaseView_SceneManager::setSelection2DROIInternalOutlines ( )

Definition at line 1083 of file wxVtkBaseView_SceneManager.cxx.

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

Referenced by OnLeftButtonUp().

1084  {
1085  _drawingSelectionROI = false;
1086  _workingGroup->clear();
1087  double minX,minY,maxX,maxY, minX_ROI,minY_ROI,maxX_ROI,maxY_ROI;
1088  double minZ = -1.0;
1089  double maxZ = -1.0;
1090  std::map<std::string, ContourWrap_ViewControl *>::iterator iter = _sceneContours_ViewControl->begin();
1091  int i, size = _sceneContours_ViewControl->size();
1092  _viewerSelectionROI->GetMinMax( minX_ROI, minY_ROI, maxX_ROI, maxY_ROI );
1093  manualViewBaseContour * viewer;
1094  bool insideRoi = false;
1095  for ( i=0; i<size; i++ )
1096  {
1097  viewer = iter->second->getViewer();
1098  viewer->GetMinMax( minX, minY, minZ, maxX, maxY, maxZ );
1099  insideRoi = minX >= minX_ROI && maxX <= maxX_ROI && minY_ROI && maxY <= maxY_ROI;
1100  if ( insideRoi )
1101  {
1102  viewer->SetSelected( true );
1103  viewer->UpdateColorActor();
1104  setControlActiveStateOf( iter->second, true );
1105  _workingGroup->insert(std::pair <std::string, ContourWrap_ViewControl *> ( iter->first, iter->second ));
1106  }
1107  iter++;
1108  }
1109  _viewerSelectionROI->RemoveCompleteContourActor( );
1110  _controlerSelectionROI->SetActive( false );
1111  }

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 579 of file wxVtkBaseView_SceneManager.cxx.

References getContourWrap_ViewControlOf(), and removeFromScene().

580  {
581  ContourWrap_ViewControl * contourWRP = getContourWrap_ViewControlOf( theKeyName );
582 // contourWRP->getViewer()->SetVisible( stateCondition );
583  if ( contourWRP!=NULL )
584  removeFromScene( contourWRP, false, stateCondition );
585  }

Here is the call graph for this function:

void wxVtkBaseView_SceneManager::SetWidthContour ( double  width)

Definition at line 1212 of file wxVtkBaseView_SceneManager.cxx.

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

Referenced by wxContourViewPanel::SetWidthContour().

1213  {
1214  _widthOfContour = width;
1216  manualViewBaseContour *cViewer;
1217  ContourWrap_ViewControl *conwraviwcont;
1218  std::map <std::string, ContourWrap_ViewControl *>::iterator iter;
1219 
1220  if (_contours_ViewControl!=NULL)
1221  {
1222  for (iter=_contours_ViewControl->begin(); iter!=_contours_ViewControl->end(); iter++ )
1223  {
1224  conwraviwcont = iter->second;
1225  cViewer = conwraviwcont->getViewer();
1226  cViewer->SetShowText( false ); // EED 28Mars2011
1227  cViewer->SetWidthLine( _widthOfContour );
1228  cViewer->SetRange( _widthOfControlPoint );
1229  } // for
1230  } // if
1231  }

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 136 of file wxVtkBaseView_SceneManager.cxx.

References _eventHandler.

137  {
138  _eventHandler = theEventHandler;
139  }
void wxVtkBaseView_SceneManager::setWxVtkViewBase ( wxVtkBaseView *  theBaseView)

Definition at line 141 of file wxVtkBaseView_SceneManager.cxx.

References _wxVtk_BaseView.

142  {
143  _wxVtk_BaseView = theBaseView;
144  }
void wxVtkBaseView_SceneManager::writeCoords ( std::string  method)

Definition at line 1113 of file wxVtkBaseView_SceneManager.cxx.

1114  {
1115  FILE *ff = fopen("c:/temp/wxVtkBaseView_SceneManagerStadistics.txt","a+");
1116  long int start = clock();
1117 #if(WIN32)
1118  double sg = (double)(start) / (double)CLK_TCK;
1119 #else
1120  double sg = (double)(start) / CLOCKS_PER_SEC;
1121 #endif
1122  int tmpPx,tmpPy;
1123  wxVTKRenderWindowInteractor *wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
1124  wxVTKiren->GetEventPosition( tmpPx , tmpPy );
1125  fprintf(ff,"::%s (x,y) = (%i, %i) t(sg): %f\n \n",method.c_str(), tmpPx, tmpPy, sg);
1126  fclose(ff);
1127  }

Member Data Documentation

manualRoiControler* wxVtkBaseView_SceneManager::_controlerSelectionROI
private
bool wxVtkBaseView_SceneManager::_creatingMULT_ROI
private
bool wxVtkBaseView_SceneManager::_creatingROI
private
bool wxVtkBaseView_SceneManager::_ctrlKey
private

Definition at line 262 of file wxVtkBaseView_SceneManager.h.

Referenced by isCtrlPressed(), and OnChar().

bool wxVtkBaseView_SceneManager::_drawingSelectionROI
private
bool wxVtkBaseView_SceneManager::_editingROI
private

Definition at line 243 of file wxVtkBaseView_SceneManager.h.

Referenced by get_editingROI(), and set_editingROI().

int wxVtkBaseView_SceneManager::_enventID
private

Definition at line 247 of file wxVtkBaseView_SceneManager.h.

wxEvtHandler* wxVtkBaseView_SceneManager::_eventHandler
private

Definition at line 238 of file wxVtkBaseView_SceneManager.h.

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

std::string wxVtkBaseView_SceneManager::_lastInteractionName
private
char wxVtkBaseView_SceneManager::_lastKeyCode
private

Definition at line 252 of file wxVtkBaseView_SceneManager.h.

Referenced by getLastKeyCode(), and OnChar().

int wxVtkBaseView_SceneManager::_leftClickCount
private

Definition at line 248 of file wxVtkBaseView_SceneManager.h.

manualBaseModel* wxVtkBaseView_SceneManager::_modelSelectionROI
private

Definition at line 258 of file wxVtkBaseView_SceneManager.h.

Referenced by configureSelectionROI().

int wxVtkBaseView_SceneManager::_rigthClickCount
private

Definition at line 249 of file wxVtkBaseView_SceneManager.h.

std::map<std::string, ContourWrap_ViewControl *>* wxVtkBaseView_SceneManager::_sceneContours_ViewControl
private
bool wxVtkBaseView_SceneManager::_shiftKey
private

Definition at line 263 of file wxVtkBaseView_SceneManager.h.

Referenced by isShiftPressed(), and OnChar().

bool wxVtkBaseView_SceneManager::_toIncludeAtInteractionGroup
private
manualViewRoi* wxVtkBaseView_SceneManager::_viewerSelectionROI
private
bool wxVtkBaseView_SceneManager::_waiting
private
double wxVtkBaseView_SceneManager::_widthOfContour
private

Definition at line 259 of file wxVtkBaseView_SceneManager.h.

Referenced by configureViewControlTo(), and SetWidthContour().

double wxVtkBaseView_SceneManager::_widthOfControlPoint
private

Definition at line 260 of file wxVtkBaseView_SceneManager.h.

Referenced by configureViewControlTo(), and SetWidthContour().

wxVtkBaseView* wxVtkBaseView_SceneManager::_wxVtk_BaseView
private
int wxVtkBaseView_SceneManager::clickX
private

Definition at line 250 of file wxVtkBaseView_SceneManager.h.

int wxVtkBaseView_SceneManager::clickY
private

Definition at line 251 of file wxVtkBaseView_SceneManager.h.

long int wxVtkBaseView_SceneManager::onCharCallBackTimeEnd
private

Definition at line 253 of file wxVtkBaseView_SceneManager.h.

long int wxVtkBaseView_SceneManager::onCharNeeded
private

Definition at line 254 of file wxVtkBaseView_SceneManager.h.


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