+ //return GetZ();
+ }
+
+
+ bool wxContourViewPanel::isEditableCControler(std::string theKeyName){
+ return _sceneManager->isEditableCControler(theKeyName);
+ }
+
+ void wxContourViewPanel::removeFromScene(std::string theKeyName){
+
+ _sceneManager->deleteCViewerCControler(theKeyName);
+
+
+ }
+
+ void wxContourViewPanel::onChangeInstant(wxCommandEvent& event){
+ ConceptDataWrap * dataConcept = NULL;
+ if ( GetId() == event.GetId() )
+ {
+ dataConcept = (ConceptDataWrap *)event.GetClientData();
+ int value = dataConcept->getActualValue();
+ //_instantPanel->setConceptValue( dataConcept->getName(), value );
+ wxContourMainFrame::getInstance()->setConceptValue( dataConcept->getName(), value );
+ }
+ else
+ {
+ dataConcept = wxContourMainFrame::getInstance()->getLastConceptData();
+ if( dataConcept->getName().compare( getVerticalConceptName() ) == 0)
+ {
+ setActualVertical( dataConcept->getActualValue());
+ //_theViewPanel->setVerticalConcept( dataConcept->getName(), dataConcept->getMinShowedValue()/*dataConcept->getMinValue()*/, /*dataConcept->getMaxValue()*/ dataConcept->getMaxShowedValue(), dataConcept->getMinShowedValue(), dataConcept->getMaxShowedValue(), dataConcept->getActualValue());
+ }
+ else if( dataConcept->getName().compare( getHorizontalConceptName() ) == 0|| wxContourMainFrame::getInstance()->getIfConceptCheckedAt( dataConcept->getName(), 0 ) )
+ {
+ setHorizontalConcept( dataConcept->getName(), dataConcept->getMinShowedValue()/*dataConcept->getMinValue()*/, /*dataConcept->getMaxValue()*/ dataConcept->getMaxShowedValue(), dataConcept->getMinShowedValue(), dataConcept->getMaxShowedValue(), dataConcept->getActualValue());
+ }
+ }
+ wxContourMainFrame::getInstance()->changeInstant();
+ }
+
+ void wxContourViewPanel::onCreateMultipleROI (wxCommandEvent& event){
+ }
+ void wxContourViewPanel::onCreateROI (wxCommandEvent& event){
+ }
+ void wxContourViewPanel::onStopCreateROI (wxCommandEvent& event){
+ }
+ void wxContourViewPanel::onChangedDeep (wxCommandEvent& event){
+ double val = getCurrentDeep();
+ //setActualVertical( (int)val );
+ wxContourMainFrame::getInstance()->onChangeDeep((int)val);
+ //_instantPanel->setConceptValue( "Axe Depth", (int)val );
+
+// changeInstant();
+ }
+ void wxContourViewPanel::changeDeep(){
+ double val = getCurrentDeep();
+ setActualVertical( (int)val );
+ }
+ void wxContourViewPanel::onActionButtonPressed(wxCommandEvent& event){
+
+
+ std::vector<std::string> currentSelection = _sceneManager->getSelectedObjects();
+// int elementsSelected = currentSelection.size();
+ bool ctrlKey = _sceneManager->isCtrlPressed();
+ char toolCommand = _sceneManager->getLastKeyCode();
+
+
+ if ( toolCommand == 3 && ctrlKey ) //'C' || 'c'
+ {
+ wxContourMainFrame::getInstance()->onCopy();
+ }
+ else if( toolCommand == 22 && ctrlKey ) //'V' || 'v'
+ {
+ wxContourMainFrame::getInstance()->onPaste();
+ }
+ else if( toolCommand == 8 || (toolCommand==127) ) // backspace Delete
+ {
+ wxContourMainFrame::getInstance()->onDeleteContour();
+ }
+ else if( toolCommand == 14 && ctrlKey ) //'N' || 'n'
+ {
+ //toolCommand = &(CREATE_CONTOUR_KEY);
+ }
+ else if( toolCommand == 15 && ctrlKey ) //'O' || 'o'
+ {
+ wxContourMainFrame::getInstance()->onLoad();
+ }
+ else if( toolCommand == 19 && ctrlKey ) //'S' || 's'
+ {
+ wxContourMainFrame::getInstance()->saveFileWithContoursAutomatique();
+ }else if( toolCommand == 26 ){
+ wxContourMainFrame::getInstance()->onUndo();
+ }else if( toolCommand == 25 ){
+ wxContourMainFrame::getInstance()->onRedo();
+ }
+ }
+
+ void wxContourViewPanel::removeSceneContours()
+ {
+ _sceneManager->removeSceneContours();
+ }
+
+ void wxContourViewPanel::addNameWrapperToScene()
+ {
+ int size = wxContourMainFrame::getInstance()->getNamesWrappingSize();
+ for(int i = 0; i < size;i++){
+ std::string name = wxContourMainFrame::getInstance()->getNameWrapping(i);
+ _sceneManager->addToScene(name, true, true, true, false, false );
+ }
+ }
+
+ std::vector<std::string> wxContourViewPanel::getSelectedObjects(){
+ return _sceneManager->getSelectedObjects();
+ }
+
+ void wxContourViewPanel::RefreshInterface(){
+ getWxVtkBaseView()->Refresh();
+ }
+
+ vtkImageData* wxContourViewPanel::getImageData(){
+ return _sceneManager->GetImageData();
+ }
+
+ void wxContourViewPanel::configureViewControlTo(std::string theName,manualBaseModel* manModelContour,double* spc,int typeofcontour)
+ {
+ _sceneManager->configureViewControlTo(theName, manModelContour, spc, typeofcontour);
+ }
+
+ int wxContourViewPanel::GetImageDataSizeZ()
+ {
+ return _sceneManager->GetImageDataSizeZ();
+ }
+
+ void wxContourViewPanel::GetImageDataRange(double *range)
+ {
+ _sceneManager->GetImageDataRange(range);
+ }
+
+ void wxContourViewPanel::SetWidthContour(double width )
+ {
+ _sceneManager->SetWidthContour( width );
+ }
+
+ int wxContourViewPanel::getColorWindow()
+ {
+ wxVtk2DBaseView *wxvtk2dbaseview = (wxVtk2DBaseView*)getWxVtkBaseView();
+ vtkImageViewer2 *imageviewer = wxvtk2dbaseview->_imageViewer2XYZ->GetVtkImageViewer2();
+ int colorwindow = (int)imageviewer->GetWindowLevel()->GetLevel();
+ return colorwindow;
+ }
+
+ int wxContourViewPanel::getWindowLevel()
+ {
+ wxVtk2DBaseView *wxvtk2dbaseview = (wxVtk2DBaseView*)getWxVtkBaseView();
+ vtkImageViewer2 *imageviewer = wxvtk2dbaseview->_imageViewer2XYZ->GetVtkImageViewer2();
+ int windowlevel = (int)imageviewer->GetWindowLevel()->GetWindow();
+ return windowlevel;
+ }
+
+ void wxContourViewPanel::onBrigthnessColorWindowLevel(int colorwindow,int windowlevel)
+ {
+ wxVtk2DBaseView *wxvtk2dbaseview = (wxVtk2DBaseView*)getWxVtkBaseView();
+ wxvtk2dbaseview->SetColorWindow( colorwindow );
+ wxvtk2dbaseview->SetColorLevel( windowlevel );
+ }
+
+ void wxContourViewPanel::onInterpolation(bool interpolate)
+ {
+ wxVtk2DBaseView *wxvtk2dbaseview = (wxVtk2DBaseView*)getWxVtkBaseView();
+ wxvtk2dbaseview->SetInterpolate( interpolate );
+ }
+
+ void wxContourViewPanel::GetPointsOfActualContour( std::vector<double> *vecX, std::vector<double> *vecY, std::vector<double> *vecZ )
+ {
+ _sceneManager->GetPointsOfActualContour(vecX, vecY, vecZ);
+ }
+
+ void wxContourViewPanel::setImageSlice(int z){
+ vtkInteractorStyleBaseView* stylebaseview = (vtkInteractorStyleBaseView*) _sceneManager->getWxVtkViewBase()->GetInteractorStyleBaseView();
+ wxVtk2DBaseView* baseview = (wxVtk2DBaseView*)stylebaseview->GetWxVtk2DBaseView();
+ baseview->SetActualSlice(z);
+ RefreshInterface();