#include <MathCore.h>
Collaboration diagram for mcMathCore:
This class has the following roles:
Definition at line 82 of file MathCore.h.
GENERAL SECTION | |
Defines functions and values for general purposes. | |
void | SyntaxError (wxString str) |
Call this function with a description of the error to notify the user about a syntax error; this function will return immediately and the caller should continue data processing as if nothing happened. | |
bool | isGUIEnabled () const |
Returns TRUE if mcElementGUI are being allocated when new elements are created: that is, GUI classes of MathCore are being used. | |
bool | isMathEnabled () const |
Like isGUIEnabled() but for math section. | |
bool | isIOEnabled () const |
Like isGUIEnabled() but for input/output section. | |
static void | Setup (bool bIO=TRUE, bool bMath=TRUE, bool bGUI=TRUE) |
Builds all the objects with a constructor (here declared as pointers) using the default values; initializes the specified subsystems; prepares everything to work. | |
static void | Cleanup () |
Deallocates MathCore stuff. | |
MATH SECTION | |
Holds the array of solvers. | |
mcRealValue | GetStepThreshold () const |
Returns the step threshold. | |
void | SetStepThreshold (const mcRealValue &n) |
Changes the step threshold. | |
static void | LoadDefaultSolvers () |
Loads the default mcSolvers in the array. | |
static mcSolverArray | arrSolvers |
The main mcSolver array. | |
KEYS SECTION | |
The virtual keycodes customizable and non-customizable used for editing. | |
bool | MatchEditKeys (const mcKey &ke) |
Returns TRUE if the given keypress matches one of the following combinations: m_pgui_EditExpKey, m_pgui_EditSubscriptKey, m_pDeleteKey, m_pCancelKey->. | |
mcKey * | m_pEditExpKey |
Edits/inserts the exponent. | |
mcKey * | m_pEditSubscriptKey |
Edits/inserts the subscript. | |
mcKey * | m_pDeleteKey |
Deletes the char at the left of the cursor. | |
mcKey * | m_pCancelKey |
Deletes the char at the right of the cursor. | |
mcKey * | m_pNewLineKey |
Creates a new line (see mcText). | |
DEBUG SECTION | |
General debug variables and functions used by MathCore. | |
int | m_nMaxSharing |
The maximum number of elements which shared the same data in the current session (works as COW performance meter). | |
int | m_nIndentationStep |
Indentation step for debug output only. | |
static void(* | OnError )(const wxString &) = NULL |
The function called by mcMathCore::Get()->SyntaxError() with the description of the error. | |
Public Member Functions | |
mcMathCore () | |
Main constructor: inits all the variables contained in this class. | |
virtual | ~mcMathCore () |
The Destructor: frees all the memory allocated by this object. | |
Static Public Member Functions | |
static mcMathCore * | Get () |
Returns the global instance of mcMathCore. | |
static void | Set (mcMathCore *) |
math_Replaces the current instance of mcMathCore class with the given one. | |
static bool | isOk () |
Returns TRUE if the mcMathCore global instance is ready to work. | |
Protected Member Functions | |
void | Init (bool bIO=TRUE, bool bMath=TRUE, bool bGUI=TRUE) |
void | SetupGUI (void(*OnError)(const wxString &)=NULL) |
void | SetupIO () |
void | SetupMath () |
void | CleanupGUI () |
void | CleanupIO () |
void | CleanupMath () |
Protected Attributes | |
bool | m_bGUIEnabled |
TRUE if the GUI section of the library is enabled. | |
bool | m_bIOEnabled |
TRUE if the IO section of the library is enabled. | |
bool | m_bMathEnabled |
TRUE if the MATH section of the library is enabled. | |
mcRealValue | m_fStepThreshold |
The current step threshold. | |
Static Protected Attributes | |
static mcMathCore * | g_pTheInstance = NULL |
The global instance of the class shared everywhere in programs which use this library. |
|
Main constructor: inits all the variables contained in this class.
Definition at line 84 of file MathCore.cpp. References m_bGUIEnabled, m_bIOEnabled, m_bMathEnabled, m_nIndentationStep, and m_nMaxSharing. Referenced by Setup(). |
|
The Destructor: frees all the memory allocated by this object.
Definition at line 93 of file MathCore.cpp. References CleanupGUI(), CleanupIO(), CleanupMath(), isGUIEnabled(), isIOEnabled(), isMathEnabled(), and mcSAFE_DELETE. |
|
Deallocates MathCore stuff.
Definition at line 146 of file MathCore.cpp. References g_pTheInstance, and mcSAFE_DELETE. |
|
Definition at line 311 of file MathCore.cpp. References mcElementHelpers::gui_DeleteDefaultStyles(), mcMathMngHelpers::gui_DeleteStyles(), m_bGUIEnabled, m_pCancelKey, m_pDeleteKey, m_pEditExpKey, m_pEditSubscriptKey, m_pNewLineKey, and mcSAFE_DELETE. Referenced by ~mcMathCore(). |
|
Definition at line 166 of file MathCore.cpp. References m_bIOEnabled. Referenced by ~mcMathCore(). |
|
Definition at line 235 of file MathCore.cpp. References arrSolvers, mcElementHelpers::Cleanup(), mcValue::Cleanup(), mcSymbol::CleanupSymbols(), mcAbstractArray::data_Clear(), m_bMathEnabled, and mcSAFE_DELETE. Referenced by ~mcMathCore(). |
|
|
Returns the step threshold.
Definition at line 207 of file MathCore.h. References m_fStepThreshold. |
|
Definition at line 132 of file MathCore.cpp. References mcElementHelpers::Init(), SetupGUI(), SetupIO(), and SetupMath(). Referenced by Setup(). |
|
Returns TRUE if mcElementGUI are being allocated when new elements are created: that is, GUI classes of MathCore are being used.
Definition at line 354 of file MathCore.cpp. References m_bGUIEnabled. Referenced by ~mcMathCore(). |
|
Like isGUIEnabled() but for input/output section.
Definition at line 360 of file MathCore.cpp. References m_bIOEnabled. Referenced by ~mcMathCore(). |
|
Like isGUIEnabled() but for math section.
Definition at line 357 of file MathCore.cpp. References m_bMathEnabled. Referenced by ~mcMathCore(). |
|
Returns TRUE if the mcMathCore global instance is ready to work.
Definition at line 144 of file MathCore.h. References g_pTheInstance. |
|
Loads the default mcSolvers in the array.
Definition at line 392 of file MathCore.cpp. References mcSAFE_ADD. |
|
Returns TRUE if the given keypress matches one of the following combinations: m_pgui_EditExpKey, m_pgui_EditSubscriptKey, m_pDeleteKey, m_pCancelKey->.
Definition at line 363 of file MathCore.cpp. References m_pCancelKey, m_pDeleteKey, m_pEditExpKey, m_pEditSubscriptKey, and mcKey::MatchKey(). Referenced by mcNumberHelpers::gui_isBaseEndKey(). |
|
math_Replaces the current instance of mcMathCore class with the given one. This function should be used only in the case that, for some special reasons, the user wants to create a class derived from mcMathCore and he wants to use it instead of the base class. Definition at line 113 of file MathCore.cpp. References g_pTheInstance. |
|
Changes the step threshold.
Definition at line 210 of file MathCore.h. References m_fStepThreshold. |
|
Builds all the objects with a constructor (here declared as pointers) using the default values; initializes the specified subsystems; prepares everything to work.
Definition at line 120 of file MathCore.cpp. References g_pTheInstance, Init(), and mcMathCore(). |
|
Definition at line 271 of file MathCore.cpp. References mcElementHelpers::gui_InitDefaultStyles(), mcMathMngHelpers::gui_InitStyles(), m_bGUIEnabled, m_pCancelKey, m_pDeleteKey, m_pEditExpKey, m_pEditSubscriptKey, m_pNewLineKey, mcASSERT, and OnError. Referenced by Init(). |
|
Definition at line 158 of file MathCore.cpp. References m_bIOEnabled. Referenced by Init(). |
|
Definition at line 174 of file MathCore.cpp. References mcElement::data_Check(), mcValue::Init(), mcSymbol::InitSymbols(), m_bMathEnabled, m_fStepThreshold, mcElementArray::math_WrapNumber(), mcElementArray::math_WrapSimple(), and mcDEFAULT_STEP_THRESHOLD. Referenced by Init(). |
|
Call this function with a description of the error to notify the user about a syntax error; this function will return immediately and the caller should continue data processing as if nothing happened.
Definition at line 371 of file MathCore.cpp. References OnError. Referenced by mcPolynomialHelpers::gui_BackInput(), mcMonomialHelpers::gui_BackInput(), mcSymbolHelpers::gui_BaseInput(), mcNumberHelpers::gui_BaseInput(), mcFunctionHelpers::gui_BaseInput(), mcExpContainerHelpers::gui_BaseInput(), mcExpElementHelpers::gui_EditExpSub(), mcTextHelpers::gui_Input(), mcMathMngHelpers::gui_Input(), mcEmptyBoxHelpers::gui_Input(), mcElementArrayHelpers::gui_Input(), and mcMonomialHelpers::gui_Replace(). |
|
The main mcSolver array.
Definition at line 69 of file MathCore.cpp. Referenced by CleanupMath(). |
|
The global instance of the class shared everywhere in programs which use this library.
Definition at line 67 of file MathCore.cpp. |
|
TRUE if the GUI section of the library is enabled.
Definition at line 90 of file MathCore.h. Referenced by CleanupGUI(), isGUIEnabled(), mcMathCore(), and SetupGUI(). |
|
TRUE if the IO section of the library is enabled.
Definition at line 91 of file MathCore.h. Referenced by CleanupIO(), isIOEnabled(), mcMathCore(), and SetupIO(). |
|
TRUE if the MATH section of the library is enabled.
Definition at line 92 of file MathCore.h. Referenced by CleanupMath(), isMathEnabled(), mcMathCore(), and SetupMath(). |
|
The current step threshold. This important value determines how many operations should be performed between two simplification/expansion/resolution (through the mcSolvers) steps. If this number is very high, then you'll see complex data solved in very few steps (the steps could then be quite difficult to check by hand...); if this number is very low, then you'll see a lot of steps even for simple data (all those steps could be quite boring...). Definition at line 103 of file MathCore.h. Referenced by GetStepThreshold(), SetStepThreshold(), and SetupMath(). |
|
Indentation step for debug output only.
Definition at line 263 of file MathCore.h. Referenced by mcMathCore(). |
|
The maximum number of elements which shared the same data in the current session (works as COW performance meter).
Definition at line 260 of file MathCore.h. Referenced by mcMathCore(), and mcElement::~mcElement(). |
|
Deletes the char at the right of the cursor.
Definition at line 234 of file MathCore.h. Referenced by CleanupGUI(), mcMonomialHelpers::gui_BackInput(), mcEmptyBoxHelpers::gui_Input(), mcDecorationHelpers::gui_Input(), mcFractionHelpers::gui_isEndKey(), MatchEditKeys(), and SetupGUI(). |
|
Deletes the char at the left of the cursor.
Definition at line 233 of file MathCore.h. Referenced by CleanupGUI(), mcMonomialHelpers::gui_BackInput(), MatchEditKeys(), and SetupGUI(). |
|
Edits/inserts the exponent. Pressing this key, if the current element allows it, an exponent is created and the cursor is moved there. The user should be able to insert any mathdata as exponent. Definition at line 226 of file MathCore.h. Referenced by CleanupGUI(), MatchEditKeys(), and SetupGUI(). |
|
Edits/inserts the subscript. The same as mcMathCore::m_pgui_EditExpKey, but this key creates a subscript and allows the user to edit it. Currently, only mcSymbols allow subscripts. Definition at line 231 of file MathCore.h. Referenced by CleanupGUI(), MatchEditKeys(), and SetupGUI(). |
|
Creates a new line (see mcText).
Definition at line 235 of file MathCore.h. Referenced by CleanupGUI(), and SetupGUI(). |
|
The function called by mcMathCore::Get()->SyntaxError() with the description of the error.
Definition at line 68 of file MathCore.cpp. Referenced by SetupGUI(), and SyntaxError(). |
[ Top ] |