#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