+/*# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+# pour la Sant�)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+# Previous Authors : Laurent Guigues, Jean-Pierre Roux
+# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+#
+# This software is governed by the CeCILL-B license under French law and
+# abiding by the rules of distribution of free software. You can use,
+# modify and/ or redistribute the software under the terms of the CeCILL-B
+# license as circulated by CEA, CNRS and INRIA at the following URL
+# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+# or in the file LICENSE.txt.
+#
+# As a counterpart to the access to the source code and rights to copy,
+# modify and redistribute granted by the license, users are provided only
+# with a limited warranty and the software's author, the holder of the
+# economic rights, and the successive licensors have only limited
+# liability.
+#
+# The fact that you are presently reading this means that you have had
+# knowledge of the CeCILL-B license and that you accept its terms.
+# ------------------------------------------------------------------------ */
+
#ifndef __wxVtkBaseView_SceneManager_h_INCLUDED_H__
#define __wxVtkBaseView_SceneManager_h_INCLUDED_H__
#include "manualViewBullEye.h"
#include "manualViewCircle.h"
#include "manualViewLine.h"
+#include "manualViewPoints.h"
#include "manualViewRoi.h"
#include <wx/event.h>
//------------------------------------------------------------------------------------------------------------
// Events declaration
//------------------------------------------------------------------------------------------------------------
+/* EED 2022-09-30
BEGIN_DECLARE_EVENT_TYPES()
DECLARE_EVENT_TYPE( wxEVT_START_CREATE_MULT_ROI, -1 )
DECLARE_EVENT_TYPE( wxEVT_STOP_CREATE_MULT_ROI, -1 )
DECLARE_EVENT_TYPE( wxEVT_UNSELECTED_ROI_POINT, -1 )
DECLARE_EVENT_TYPE( wxEVT_CHANGED_DEEP, -1 )
END_DECLARE_EVENT_TYPES()
+*/
+wxDECLARE_EVENT(wxEVT_START_CREATE_MULT_ROI, wxCommandEvent);
+wxDECLARE_EVENT(wxEVT_STOP_CREATE_MULT_ROI, wxCommandEvent);
+wxDECLARE_EVENT(wxEVT_SELECTED_MULT_ROI, wxCommandEvent);
+wxDECLARE_EVENT(wxEVT_START_CREATE_ROI, wxCommandEvent);
+wxDECLARE_EVENT(wxEVT_STOP_CREATE_ROI, wxCommandEvent);
+wxDECLARE_EVENT(wxEVT_DELETE_ROI, wxCommandEvent);
+wxDECLARE_EVENT(wxEVT_SELECTED_ROI, wxCommandEvent);
+wxDECLARE_EVENT(wxEVT_UNSLECTED_ROI, wxCommandEvent);
+wxDECLARE_EVENT(wxEVT_MANUAL_HIDED_ROI, wxCommandEvent);
+wxDECLARE_EVENT(wxEVT_MANUAL_SHOWED_ROI, wxCommandEvent);
+wxDECLARE_EVENT(wxEVT_EDITING_ROI, wxCommandEvent);
+wxDECLARE_EVENT(wxEVT_MOVING_ROI, wxCommandEvent);
+wxDECLARE_EVENT(wxEVT_MOVING_ROI_POINT, wxCommandEvent);
+wxDECLARE_EVENT(wxEVT_SELECTED_ROI_POINT, wxCommandEvent);
+wxDECLARE_EVENT(wxEVT_UNSELECTED_ROI_POINT, wxCommandEvent);
+wxDECLARE_EVENT(wxEVT_CHANGED_DEEP, wxCommandEvent);
/** file wxVtkBaseView_SceneManager.h */
// Methods for capturing events
//------------------------------------------------------------------------------------------------------------
-
//------------------------------------------------------------------------------------------------------------
// Methods for sending events
//------------------------------------------------------------------------------------------------------------
void setWxVtkViewBase( wxVtkBaseView * theBaseView );
void setWxEventHandler( wxEvtHandler * theEventHandler );
wxVtkBaseView * getWxVtkViewBase();
- void configureViewControlTo( std::string theKeyName, manualContourModel * manContourControl, double * spc ,int typeContour);
+
+ //
+ // Method which creates and associates view and controller to the contour model type pointed in parameter.
+ // The possible contour types are:
+ // 0-spline
+ // 1-spline
+ // 2-rectangle
+ // 3-circle
+ // 4-BullEye
+ // 5-BullEyeSector
+ // 6-Line
+ // 7-Points
+ // NOTE: The model is created in the KernelManagerContour class, factoryManualContourModel method
+ // @param typeContour - int
+ // @param theKeyName - string
+ // @param manContourControl - manualBaseModel
+ // @param spc - double* 3-pos Array
+ void configureViewControlTo( std::string theKeyName, manualBaseModel * manContourControl, double * spc ,int typeContour);
+
void configureSelectionROI( double * spc );
ContourWrap_ViewControl * insertWrap( std::string theKeyName, manualContourBaseControler * manContourControl, manualViewBaseContour * manViewerContour );
void desconfigureViewControlOf( std::string theKeyName );
// Other functional methods
//------------------------------------------------------------------------------------------------------------
- void createCopyContourOf( std::string anExistingKName, std::string cloneName, manualContourModel * manualModel, bool append = false );
+ 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( );
int GetImageDataSizeZ();
void GetImageDataRange( double *range );
- void SetWidthContour(double width);
+ void SetWidthContour(double width);
+ void SetShowTextContour(bool show);
//JCP 21 - 09 - 08
bool isEditableCControler(std::string theKeyName);
bool isCtrlPressed();
bool isShiftPressed();
char getLastKeyCode();
+ void SetLabelNumberOfContours( std::string label );
+
private:
//------------------------------------------------------------------------------------------------------------
// Private methods
//------------------------------------------------------------------------------------------------------------
+ void configureTextNumberOfContour();
//------------------------------------------------------------------------------------------------------------
// Attributtes
//------------------------------------------------------------------------------------------------------------
- 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;
- manualContourModel *_modelSelectionROI;
- double _widthOfContour;
-
- bool _ctrlKey;
- bool _shiftKey;
+ 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;
+ bool _showTextContour;
+ vtkTextActor *_numberOfContoursTextActor;
};
#endif // __wxVtkBaseView_SceneManager_HEADER_FILE__