/*# --------------------------------------------------------------------- # # 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 __pPlotterWindow_h__ #define __pPlotterWindow_h__ // ---------------------------------------------------------------------------- // WX headers inclusion. // For compilers that support precompilation, includes . // ---------------------------------------------------------------------------- #include #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include #endif //---------------------------------------------------------------------------- // Includes //---------------------------------------------------------------------------- #include "pPlotterLayer.h" #include "pGraphicalFunction.h" #include "mathplot.h" #include "marTypes.h" /** Command IDs used by pPlotterWindow */ enum { pwID_ADDPOINT = 2010, //!< add a point to the function pwID_DELPOINT, //!< delete a point of the function pwID_SHOWPOINTS, //! *vectorX, std::vector *vectorY ); /* Set the scales according to the size of the window and the maximum given by the user */ void setActualScales(); //erase void setmLog(wxTextCtrl *m_log1) { m_log=m_log1; } /* * Actualizes the view range of the plotter and the actual function * @param newMinX Is the min-value to be shown in the x-scale * @param newMaxX Is the max-value to be shown in the x-scale */ void actualizeViewRange(int newMinX, int newMaxX); /* * Sets the condition for drawing or not the guide lines * @param ifDrawing The new condition to assing */ void setLineGuidesCondition(bool ifDrawing) { drawGuides = ifDrawing; } /* * Gets the condition for drawing or not the guide lines * @retval drawGuides The assigned condition */ bool drawGuideLines() { return drawGuides; } /* * Guide lines menu handler method that reacts to the mpID_LINE_GUIDES cimmand event * event The corresponding event to handle */ void OnGuideLines (wxCommandEvent &event); /* writes in t information */ void writeInText(wxString &t) { t=text; } /* Get a function in the plotter given the index */ pGraphicalFunction* getFunction(int index); /* move the functions that the user wants to move and that were setted in functionsToMove @param porcentageMinX:the porcentage that the minShowed of the funcntions have to be move @param porcentageMaxX:the porcentage that the maxShowed of the funcntions have to be move */ void moveFunctions(float porcentageMinX,float porcentageMaxX); /** * Add a function to the plotter * when the function doesnt come from window */ int addFunctionToMove(pGraphicalFunction * function); private: /** * Actual Function */ pGraphicalFunction* actual; /** * layers */ wxList functions; /** * If is drawing the function */ bool drawing; /** * Index of the movig point, if the user is moving * a poit */ int movingPointIndex; /** * the way we scale DEFAULT_SCALE 1 MAX_SCALE 2 USER_SCALE 3 */ int scaleWay; /* Use to Show Information */ wxTextCtrl *m_log; wxString text; /* Functions to be move at the same time */ wxList functionsToMove; /* the user is moving the function */ bool movingFunction; /* */ int initialMovingCLick; /* saving the initial function */ std::vector backUpActualVector; /* wants to move the points of the function */ bool movingPoints; DECLARE_CLASS (pPlotterWindow) //---------------------------------------------------------------------------- // wxWidget macro use declaration for handdling events //---------------------------------------------------------------------------- DECLARE_EVENT_TABLE() }; #endif