#include <Function.h>
Inheritance diagram for mcFunctionHelpers:
This is entirely defined & implemented through macros.
Definition at line 79 of file Function.h.
Public Member Functions | |
virtual int | gui_GetSpaceAboveBelow () const |
virtual int | gui_GetSpaceLeftRight () const |
mcFunctionHelpers () | |
virtual | ~mcFunctionHelpers () |
int | data_GetChildrenCount () const |
Returns the number of children attached to this tree node. | |
const mcElement & | data_GetConstChild (int n) const |
Returns the n-th tree node attached to this element. | |
void | data_SetChild (int n, const mcElement &newchild) |
math_Replaces the idx-th child of this element with a copy of the given one. | |
void | data_DeepCopy (const mcElementHelpers *p) |
Deep copies the given mcExpElementHelpers, removing the exponent from this if it is not present in p or deep-copying it otherwise. | |
bool | data_isSameAs (const mcElementHelpers *p) const |
Performs a deep comparison of the data hold by this class and the data hold by the given mcElementHelpers object. | |
void | data_CreateSub () |
mcFunctionData doesn't use the default subscript: mcText. | |
wxString | data_GetName () const |
Returns the name of this function. | |
void | data_CheckName () |
Checks if the function name matches with the name of this type of fnc. | |
void | data_SetName (const wxString &str) |
Sets the name of this function. | |
mcText & | data_GetNameObj () |
Returns a pointer to the mcText containing the name of this function. | |
const mcText & | data_GetNameObj () const |
mcTextHelpers * | data_GetNameObjHlp () |
const mcTextHelpers * | data_GetNameObjHlp () const |
mcBracket & | data_GetArgObj () |
Returns a pointer to the mcBracket containing the argument of this function. | |
const mcBracket & | data_GetArgObj () const |
mcBracketHelpers * | data_GetArgObjHlp () |
const mcBracketHelpers * | data_GetArgObjHlp () const |
void | data_SetNameObj (const mcText &p) |
void | data_SetArgObj (const mcBracket &p) |
bool | data_isRegistered () const |
Returns TRUE if this function is registered in the mcFunction array. | |
void | data_SetFncType (int n) |
int | data_GetFncType () const |
wxScriptFunction * | data_GetScript () const |
Returns the script associated with this function, if any. | |
bool | math_CanBeAddedWith (const mcElement &p) const |
Returns TRUE if this element can be added with the given element. | |
bool | math_CanBeMultWith (const mcElement &p) const |
Works like #math_CanBemath_AddeWith(), just for multiplication. | |
bool | math_CanBeDivBy (const mcElement &p) const |
Works like #math_CanBemath_AddeWith(), just for divisions. | |
virtual mcBasicOpRes | math_Add (const mcElement &, mcElement *p, bool add) |
Sums or subtracts this element with the given e element. | |
virtual mcBasicOpRes | math_Subtract (const mcElement &, mcElement *p) |
math_s two mcElements of the same type and stores the result in this object. | |
virtual mcBasicOpRes | math_MultiplyBaseOnlyBy (const mcElement &, mcElement *p) |
virtual mcBasicOpRes | math_DivideBaseOnlyBy (const mcElement &, mcElement *p) |
mcMathType | math_GetBaseMathType () const |
bool | math_CompareThisOnly (const mcElement &p) const |
mcRealValue | math_EvaluateBase () const |
mcRealValue | math_GetLenght () const |
The raise-to-power operation has a little degree of complexity. | |
int | math_GetOrderPos () const |
Returns the order position for this element. | |
mcExpSimRes | math_SimplifyBase (long flags, mcElement *newelem) |
mcExpSimRes | math_ExpandBase (long flags, mcElement *newelem) |
bool | io_isBeginTag (const wxXml2Node &tag) const |
Returns a positive value if the given MathML content tag marks the begin of this element; FALSE otherwise. | |
bool | io_isBeginChar (const wxString &str) const |
Returns a positive value if the given inlined expression marks the begin of this element; FALSE otherwise. | |
wxXml2Node | io_GetBaseMathML (bool bGetPresentation) const |
Returns a MathML tree with the presentation math markup language regarding the base. | |
wxXml2Node | io_GetMathML (bool bGetPresentation) const |
Returns the MathML tree which describes this element and, eventually, its exponent and its subscript. | |
wxString | io_GetBaseInlinedExpr () const |
bool | io_ImportPresentationMathML (wxXml2Node tag, wxString &pErr) |
Imports presentation MathML reading the contents of the given XML node (without modifying it). | |
bool | io_ImportInlinedExpr (const wxString &str, int *count, wxString &pErr) |
Imports an inlined expression. | |
bool | io_ImportBaseInlinedExpr (const wxString &, int *, wxString &) |
This function is not used by mcFunction::io_ImportInlinedExpr. | |
virtual void | io_GetExpSubInlinedToken (wxString &subexp) |
Overloading mcExpElementHelpers function is required since. | |
Utility functions | |
Utility functions used to get the size, offsets, etc of the contained objects. | |
int | gui_GetArgOffsetx () const |
int | gui_GetArgOffsety () const |
int | gui_GetNameOffsetx () const |
int | gui_GetNameOffsety () const |
void | gui_Setup (int functiontype) |
wxSize | gui_GetSizeOfArg () const |
wxSize | gui_GetSizeOfName () const |
mcExpElement overloaded BASE functions | |
bool | gui_isBeginKey (const mcKey &key) const |
Returns a positive value if the given character marks the begin of this element; FALSE otherwise. | |
bool | gui_isBaseEndKey (const mcKey &ev) const |
This function should work as mcElement::isEndChar function, but it should care only for the base; this means that the element should not handle the mcEXPELEM_**** cursor positions, but it will probably still need to check for exp/sub presence to choose if the given keyevent is the end key. | |
bool | gui_DrawAsActiveOverBase () const |
Returns TRUE if the mcExpElement functions must draw as active the entire element when the cursor is over the base of the element. | |
int | gui_DrawBase (wxDC &dc, int x, int y, long flags, const wxPoint &pt) const |
Identical to mcElement::gui_Draw, but just for the base. | |
int | gui_BaseMoveCursorUsingPoint (wxDC &dc, const wxPoint &) |
Moves the cursor inside the base using the given point and, eventually the given DC for calculations. | |
int | gui_GetBaseRelCursorPos (wxDC &dc, wxPoint *pt) const |
Returns the height of the cursor and it's position (in the given pointer and in coordinates relatives to the top-left point of the base), when the cursor is editing the base. | |
mcMoveCursorRes | gui_BaseMoveCursor (mcMoveCursorFlag, long modifiers) |
Handles cursor movements when the cursor is editing the base. | |
mcMoveCursorRes | gui_MoveCursor (mcMoveCursorFlag, long modifiers) |
This function is called to move the cursor which is inside the element, one 'step' left, right, up or down (when flag=mcMCF_LEFT/mcMCF_RIGHT/mcMCF_UP/mcMCF_DOWN). | |
mcInputRes | gui_BaseInput (const mcKey &key, mcElement *pnew) |
Handles the input when the cursor is editing the base; an useful function, to avoid repetitions inside gui_BaseInput(), could be the gui_HandleSubExpEditKeys() function... | |
mcInsertRes | gui_BaseInsert (const mcElement &, mcElement *) |
void | gui_GetBaseCursorPos (mcCursorPos &) const |
Returns one of the cursor position flags (called only when cursor is inside the base). | |
int | gui_GetExpOffsetx () const |
int | gui_GetExpOffsety () const |
int | gui_GetSubOffsetx () const |
int | gui_GetSubOffsety () const |
void | gui_SetCursorPos (const mcCursorPos &code) |
Sets the cursor position inside the element using Cursor Position flags. | |
void | gui_SetBaseCursorPos (const mcCursorPos &) |
Sets the cursor position of the element. | |
void | gui_DoRecalcBaseSize () |
Calculates (in the m_szBase variable) the size of the base only. | |
void | gui_EditBase () |
Called when the cursor is switching from the exp/sub to the base; it should set the cursor inside the base: the correct position will be set using the gui_SetBaseCursorPos. | |
void | gui_EditBaseAndSetPos (const mcCursorPos &cp) |
Works as gui_EditBase() but this function also sets the cursor position inside the base with the given flag. | |
bool | gui_hasBaseSthOnRightSide () const |
mcFunction doesn't have the exponent placed on the right: it is in the middle, so we need to return always FALSE from this function... | |
mcMoveCursorRes | gui_ExpMoveCursor (mcMoveCursorFlag, long) |
This function is overloaded by mcExpElementGUI to remove the EXPELEM_EXPEND cursor position which is otherwise automatically enabled for elements with the exponent placed on the right. | |
mcMoveCursorRes | gui_SubMoveCursor (mcMoveCursorFlag, long) |
void | gui_CheckSub () |
We do not use the standard mcText object as subscript, so we need to overload this function. | |
Static Public Member Functions | |
static wxArrayString | io_ImportArgument (const wxString &str, int *count, wxString &pErr) |
static bool | io_isFunctionBeginChar (const wxString &str) |
Static Public Attributes | |
static int | sgui_nSpaceAboveBelow = 0 |
static int | sgui_nSpaceLeftRight = 0 |
static mcKey * | sgui_pNewFunction = NULL |
The key to use to create this element. | |
Protected Member Functions | |
void | gui_Init () |
Inits this section of the element. | |
Protected Attributes | |
mcBracket | mdata_eArg |
The argument of this function. | |
mcText | mdata_eName |
The name of this function. | |
int | mdata_nFncType |
The type of this function. | |
int | mgui_nCursorPos |
Private Member Functions | |
mcDEFINE_REFERENCE_DATA (mcFunction, mcET_FUNCTION) |
|
Definition at line 132 of file Function.h. References mcElementHelpers::data_Init(), mcText::data_SetFilter(), data_SetFncType(), mcFUNCTION_TYPE_NOTSET, and mdata_eName. |
|
Definition at line 142 of file Function.h. |
|
Checks if the function name matches with the name of this type of fnc.
Definition at line 215 of file Function.cpp. References data_GetName(), mcASSERT, and mdata_nFncType. |
|
mcFunctionData doesn't use the default subscript: mcText. In fact, the subscript of the function, if allowed, is usually the base of the function (think to log and ln): another mcPolynomial is required... Definition at line 179 of file Function.cpp. References mcExpElementHelpers::data_DestroyExpSub(), and mcElement::gui_SetAsExpOf(). |
|
Deep copies the given mcExpElementHelpers, removing the exponent from this if it is not present in The same checks are performed on the subscript. Reimplemented from mcExpElementHelpers. Definition at line 185 of file Function.h. References mcExpElementHelpers::data_DeepCopy(), mcElement::data_DeepCopy(), mdata_eArg, mdata_eName, and mdata_nFncType. |
|
Definition at line 230 of file Function.h. References mdata_eArg. |
|
Returns a pointer to the mcBracket containing the argument of this function.
Definition at line 229 of file Function.h. References mdata_eArg. Referenced by data_GetConstChild(), gui_BaseInput(), gui_BaseMoveCursor(), gui_DoRecalcBaseSize(), gui_DrawBase(), gui_GetBaseCursorPos(), gui_GetBaseRelCursorPos(), gui_GetSizeOfArg(), gui_SetCursorPos(), gui_Setup(), io_GetBaseInlinedExpr(), io_GetMathML(), io_ImportInlinedExpr(), math_EvaluateBase(), math_ExpandBase(), math_GetBaseMathType(), and math_SimplifyBase(). |
|
Definition at line 232 of file Function.h. References mdata_eArg. |
|
Definition at line 231 of file Function.h. References mdata_eArg. |
|
Returns the number of children attached to this tree node. This function can be used on *any* mcElement node because this is a virtual function which is overridden by container classes which thus return the correct number of children. This function is used by various mcElement functions like data_Check() const data_GetElemFromID(), ... which must call some standard mcElement functions on all nodes attached to this element. Reimplemented from mcExpElementHelpers. Definition at line 162 of file Function.h. References mcExpElementHelpers::data_GetChildrenCount(). |
|
Returns the n-th tree node attached to this element. You can use this function to traverse the entire tree:
mcElement rootnode = [...]; MyWalkerFnc(rootnode); void MyWalkerFnc(mcElement p) { // do what you want on the "p" node... for (int i=0; i < p.data_GetChildrenCount(); i++) MyWalkerFnc(p.data_GetChild(i)); }
Reimplemented from mcExpElementHelpers. Definition at line 168 of file Function.h. References data_GetArgObj(), data_GetNameObj(), mcEmptyElement, and mcRETURN_ELEMENT_CHILD. |
|
Definition at line 249 of file Function.h. References mdata_nFncType. Referenced by data_GetScript(), and io_ImportInlinedExpr(). |
|
Returns the name of this function.
Definition at line 208 of file Function.cpp. References data_GetNameObj(), and mcText::data_GetText(). Referenced by data_CheckName(), gui_BaseInput(), and io_ImportInlinedExpr(). |
|
Definition at line 223 of file Function.h. References mdata_eName. |
|
Returns a pointer to the mcText containing the name of this function.
Definition at line 222 of file Function.h. References mdata_eName. Referenced by data_GetConstChild(), data_GetName(), gui_BaseInput(), gui_BaseMoveCursor(), gui_DoRecalcBaseSize(), gui_DrawBase(), gui_EditBaseAndSetPos(), gui_GetBaseCursorPos(), gui_GetBaseRelCursorPos(), gui_GetSizeOfName(), gui_SetCursorPos(), io_GetBaseInlinedExpr(), and io_GetBaseMathML(). |
|
Definition at line 225 of file Function.h. References mdata_eName. |
|
Definition at line 224 of file Function.h. References mdata_eName. |
|
Returns the script associated with this function, if any.
Definition at line 225 of file Function.cpp. References data_GetFncType(). Referenced by math_EvaluateBase(). |
|
Returns TRUE if this function is registered in the mcFunction array.
Definition at line 239 of file Function.h. References mcFUNCTION_TYPE_NOTSET, and mdata_nFncType. Referenced by gui_DrawBase(). |
|
Performs a deep comparison of the data hold by this class and the data hold by the given mcElementHelpers object.
Reimplemented from mcElementHelpers. Definition at line 194 of file Function.h. References mdata_eArg, and mdata_eName. |
|
Definition at line 235 of file Function.h. References mcElement::data_DeepCopy(), and mdata_eArg. Referenced by data_SetChild(). |
|
math_Replaces the idx-th child of this element with a copy of the given one.
Reimplemented from mcExpElementHelpers. Definition at line 175 of file Function.h. References data_SetArgObj(), data_SetNameObj(), mcASSERT, mcET_BRACKET, mcET_TEXT, and mcSET_ELEMENT_CHILD. |
|
Definition at line 188 of file Function.cpp. References data_SetName(), mcFUNCTION_TYPE_NOTSET, and mdata_nFncType. Referenced by gui_BaseInput(), gui_Setup(), io_ImportInlinedExpr(), and mcFunctionHelpers(). |
|
Sets the name of this function.
Definition at line 217 of file Function.h. References mcText::data_SetText(), and mdata_eName. Referenced by data_SetFncType(). |
|
Definition at line 234 of file Function.h. References mcElement::data_DeepCopy(), and mdata_eName. Referenced by data_SetChild(). |
|
Handles the input when the cursor is editing the base; an useful function, to avoid repetitions inside gui_BaseInput(), could be the gui_HandleSubExpEditKeys() function...
Implements mcExpElementHelpers. Definition at line 257 of file Function.cpp. References data_GetArgObj(), mcFunction::data_GetFunctionType(), data_GetName(), data_GetNameObj(), mcElementHelpers::data_hasProperty(), data_SetFncType(), mcMathCore::Get(), mcExpElementHelpers::gui_HandleSubExpEditKeys(), mcElement::gui_Input(), gui_isBeginKey(), mcElementHelpers::gui_RecalcSize(), mcElementHelpers::Init(), mcASSERT, mcEP_INITIALIZED, mcFUNCTION_INSIDEARG, mcFUNCTION_INSIDENAME, mcFUNCTION_TYPE_NOTFOUND, mcIR_DELETE_NEXT, mcIR_DELETE_PREVIOUS, mcIR_DELETE_THIS, mcIR_DIRECT_DELETE, mcIR_DISTRIBUTE, mcIR_OKAY, mcIR_REPLACE_THIS, mdata_nFncType, mgui_nCursorPos, and mcMathCore::SyntaxError(). |
|
Implements mcExpElementHelpers. Definition at line 379 of file Function.cpp. References mcINSR_OKAY. |
|
Handles cursor movements when the cursor is editing the base. This function should work ABSOLUTELY without care about the exponent or subscript presence or absence: if the cursor is placed on the rightmost point of the base, and the function is called with the mcMCF_RIGHT flag, then the function should return mcMCR_SETFOCUS_NEXT without any check: the mcExpElement::gui_MoveCursor function will check the return value of this function and will corerctly handle it !!! Implements mcExpElementHelpers. Definition at line 384 of file Function.cpp. References data_GetArgObj(), data_GetNameObj(), mcElementHelpers::data_hasProperty(), mcExpElementHelpers::gui_EditExpSub(), mcElementHelpers::gui_GetCursorPos(), mcElement::gui_MoveCursor(), mcElement::gui_SetCursorPos(), mcASSERT, mcCP_BEGIN, mcCP_END, mcEP_HASEXPONENT, mcEP_HASSUBSCRIPT, mcFUNCTION_INSIDEARG, mcFUNCTION_INSIDENAME, mcMCF_RIGHT, mcMCR_OKAY, mcMCR_SETFOCUS_ABOVE, mcMCR_SETFOCUS_BELOW, mcMCR_SETFOCUS_NEXT, mcMCR_SETFOCUS_PREVIOUS, and mgui_nCursorPos. Referenced by gui_MoveCursor(). |
|
Moves the cursor inside the base using the given point and, eventually the given DC for calculations.
Implements mcExpElementHelpers. Definition at line 519 of file Function.cpp. References mcMCR_CANNOT_SETFOCUS. |
|
We do not use the standard mcText object as subscript, so we need to overload this function. See mcFunction::data_CreateSub for more info. Definition at line 731 of file Function.cpp. References mcExpElementHelpers::data_GetSub(), mcElementArray::data_isArrayEmpty(), and mcPolynomial::gui_AddNewEmptyMonomial(). |
|
Calculates (in the m_szBase variable) the size of the base only. It's very important not to modify the m_sz variable: m_sz is handled by mcExpElement functions: the base must modify ONLY *m_szBase*. Implements mcExpElementHelpers. Definition at line 242 of file Function.cpp. References data_GetArgObj(), data_GetNameObj(), gui_GetArgOffsetx(), gui_GetArgOffsety(), gui_GetNameOffsetx(), gui_GetNameOffsety(), gui_GetSizeOfArg(), gui_GetSizeOfName(), mcElement::gui_RecalcSize(), and mcMAX. |
|
Returns TRUE if the mcExpElement functions must draw as active the entire element when the cursor is over the base of the element. If this function returns FALSE, then the exponent is not drawn as active when cursor is inside the base. This function should always return TRUE if the base is *not* a container of other elements (e.g. mcSymbol and mcNumber always return TRUE); in this way when the cursor is inside the base, the mcExpElement::gui_DrawActivationRect() will always be called and the gui_DrawBase() function will never be called with a pt != mcDRW_NONACTIVE. On the other hand, if the base contains other elements (e.g. mcBracket), this function should return FALSE, so that the gui_DrawBase() function is called with a valid pointer to the cursor position, if the mouse is inside the base. In this way, the container element can send the mouse cursor position to the contained elements, highligthing them only. Implements mcExpElementHelpers. Definition at line 310 of file Function.h. |
|
Identical to mcElement::gui_Draw, but just for the base. You have to draw it at the given point (x,y) without take care of the exp/sub, just do everything as they wouldn't exist. The given pointer to a wxPoint class can be mcDRW_NONACTIVE or a valid pointer value (in this case, the cursor is always inside the base). You can be sure that it will never be mcDRW_ALLACTIVE: this flag is completely handled by mcExpElement. If all the base must be drawn as active, the subscript should be too... you can use the #GetBaseAndSubSize function to make the task easier.
Implements mcExpElementHelpers. Definition at line 334 of file Function.cpp. References data_GetArgObj(), mcElementHelpers::data_GetID(), data_GetNameObj(), data_isRegistered(), mcElement::gui_Draw(), mcText::gui_Draw(), gui_GetArgOffsetx(), gui_GetArgOffsety(), gui_GetNameOffsetx(), gui_GetNameOffsety(), gui_GetSizeOfArg(), gui_GetSizeOfName(), mcDRW_NONACTIVE, and mcDRW_USEPOINT. |
|
Called when the cursor is switching from the exp/sub to the base; it should set the cursor inside the base: the correct position will be set using the gui_SetBaseCursorPos.
Implements mcExpElementHelpers. Definition at line 588 of file Function.cpp. References mcECL_INSIDEBASE, mcFUNCTION_INSIDENAME, and mgui_nCursorPos. Referenced by gui_EditBaseAndSetPos(). |
|
Works as gui_EditBase() but this function also sets the cursor position inside the base with the given flag.
Reimplemented from mcExpElementHelpers. Definition at line 595 of file Function.cpp. References data_GetNameObj(), gui_EditBase(), and mcElement::gui_SetCursorPos(). |
|
This function is overloaded by mcExpElementGUI to remove the EXPELEM_EXPEND cursor position which is otherwise automatically enabled for elements with the exponent placed on the right.
Definition at line 710 of file Function.cpp. References mcExpElementHelpers::data_GetExp(), mcElement::gui_MoveCursor(), HANDLE_EXPSUB, mcASSERT, mcECL_INSIDEEXPONENT, mcMCR_OKAY, and mgui_nCursorPos. |
|
Definition at line 649 of file Function.cpp. References mcExpElementHelpers::gui_GetExpSubOffsetx(), mcExpElementHelpers::gui_GetExpSubSize(), and mcMAX. Referenced by gui_DoRecalcBaseSize(), gui_DrawBase(), and gui_GetBaseRelCursorPos(). |
|
Definition at line 653 of file Function.cpp. Referenced by gui_DoRecalcBaseSize(), gui_DrawBase(), and gui_GetBaseRelCursorPos(). |
|
Returns one of the cursor position flags (called only when cursor is inside the base).
Implements mcExpElementHelpers. Definition at line 570 of file Function.cpp. References data_GetArgObj(), data_GetNameObj(), mcElementHelpers::gui_GetCursorPos(), mcCursorPos::gui_Push(), mcCP_BEGIN, mcCP_END, mcFUNCTION_INSIDEARG, mcFUNCTION_INSIDENAME, and mgui_nCursorPos. |
|
Returns the height of the cursor and it's position (in the given pointer and in coordinates relatives to the top-left point of the base), when the cursor is editing the base.
Implements mcExpElementHelpers. Definition at line 546 of file Function.cpp. References data_GetArgObj(), data_GetNameObj(), gui_GetArgOffsetx(), gui_GetArgOffsety(), gui_GetNameOffsetx(), gui_GetNameOffsety(), mcElement::gui_GetRelCursorPos(), mcASSERT, mcFUNCTION_INSIDEARG, mcFUNCTION_INSIDENAME, and mgui_nCursorPos. |
|
Definition at line 671 of file Function.cpp. References gui_GetSizeOfName(). Referenced by gui_GetSubOffsetx(). |
|
Definition at line 674 of file Function.cpp. References gui_GetNameOffsety(). |
|
Definition at line 661 of file Function.cpp. Referenced by gui_DoRecalcBaseSize(), gui_DrawBase(), and gui_GetBaseRelCursorPos(). |
|
Definition at line 664 of file Function.cpp. References mcExpElementHelpers::gui_GetBaseSize(), and gui_GetSizeOfName(). Referenced by gui_DoRecalcBaseSize(), gui_DrawBase(), gui_GetBaseRelCursorPos(), gui_GetExpOffsety(), and gui_GetSubOffsety(). |
|
Definition at line 638 of file Function.cpp. References data_GetArgObj(), and mcElement::gui_GetSize(). Referenced by gui_DoRecalcBaseSize(), and gui_DrawBase(). |
|
Definition at line 641 of file Function.cpp. References data_GetNameObj(), and mcElement::gui_GetSize(). Referenced by gui_DoRecalcBaseSize(), gui_DrawBase(), gui_GetExpOffsetx(), gui_GetNameOffsety(), and gui_GetSubOffsety(). |
|
Definition at line 105 of file Function.h. References sgui_nSpaceAboveBelow. |
|
Definition at line 106 of file Function.h. References sgui_nSpaceLeftRight. |
|
Definition at line 682 of file Function.cpp. References gui_GetExpOffsetx(). |
|
Definition at line 685 of file Function.cpp. References gui_GetNameOffsety(), and gui_GetSizeOfName(). |
|
mcFunction doesn't have the exponent placed on the right: it is in the middle, so we need to return always FALSE from this function...
Reimplemented from mcExpElementHelpers. Definition at line 336 of file Function.h. |
|
Inits this section of the element. Acts like a constructor (it's called by mcElementHelpers). Reimplemented from mcExpElementHelpers. Definition at line 146 of file Function.h. References mcExpElementHelpers::gui_Init(), mcFUNCTION_INSIDEARG, mdata_eName, and mgui_nCursorPos. |
|
This function should work as mcElement::isEndChar function, but it should care only for the base; this means that the element should not handle the mcEXPELEM_**** cursor positions, but it will probably still need to check for exp/sub presence to choose if the given keyevent is the end key. When the cursor is inside the exp/sub, this function is never called. Derived classes must also implement the mcElementHelpers::gui_isBeginChar function. Implements mcExpElementHelpers. Definition at line 292 of file Function.h. References mcText::data_isToReject(), mcElement::gui_GetCursorPos(), mcElement::gui_isEndKey(), mcFUNCTION_INSIDEARG, mcFUNCTION_INSIDENAME, mdata_eArg, mdata_eName, and mgui_nCursorPos. |
|
Returns a positive value if the given character marks the begin of this element; FALSE otherwise. The begin character cannot be dependent from any variable; it must be always the same. The character is given both as ASCII code and as virtual key code.
Implements mcElementHelpers. Definition at line 285 of file Function.h. References sgui_pNewFunction. Referenced by gui_BaseInput(). |
|
This function is called to move the cursor which is inside the element, one 'step' left, right, up or down (when flag=mcMCF_LEFT/mcMCF_RIGHT/mcMCF_UP/mcMCF_DOWN). Elements which cannot move the cursor in the given direction, should call mcMathCore::Get()->SyntaxError() function. If the cursor must 'exit' the element (because its at the end, for example) the function must return mcMCR_SETFOCUS_PREVIOUS or mcMCR_SETFOCUS_NEXT. This function must always return the code mcMCR_SETFOCUS_* or mcMCR_OKAY. When this function is called, cursor is always inside the element.
Reimplemented from mcExpElementHelpers. Definition at line 470 of file Function.cpp. References mcElementHelpers::data_hasProperty(), gui_BaseMoveCursor(), mcExpElementHelpers::gui_EditExpSub(), mcExpElementHelpers::gui_ExpSubMoveCursor(), mcExpElementHelpers::gui_isCursorInBase(), mcExpElementHelpers::gui_isCursorInExpSub(), mcASSERT, mcEP_HASEXPONENT, mcEP_HASSUBSCRIPT, mcMCR_CANNOT_SETFOCUS, mcMCR_OKAY, mcMCR_SETFOCUS_ABOVE, mcMCR_SETFOCUS_BELOW, mcMCR_SETFOCUS_NEXT, and mcMCR_SETFOCUS_PREVIOUS. |
|
Sets the cursor position of the element. When this function is called with the mcCP_BEGIN flag, it must set the cursor at the leftmost point of the base; when this function is called with mcCP_END flag, the function must set the cursor at the rightmost point of the base. It should never check exponent/subscript presence: everything is handled by mcExpElement. Implements mcExpElementHelpers. Definition at line 328 of file Function.h. |
|
Sets the cursor position inside the element using Cursor Position flags. When it's called to set the cursor at the end of the base, code==mcCP_END and data_hasProperty(mcEP_HASEXPONENT) == FALSE, when it's called to set the cursor at the beginning of the base, code==mcCP_BEGIN. The function doesnt need to care for the third Cursor Position flag: mcCP_INSIDE, actually this function will never be called with this code. Reimplemented from mcExpElementHelpers. Definition at line 601 of file Function.cpp. References data_GetArgObj(), data_GetNameObj(), mcElement::gui_SetCursorPos(), mcCP_BEGIN, mcCP_END, mcFUNCTION_INSIDEARG, mcFUNCTION_INSIDENAME, and mgui_nCursorPos. |
|
Definition at line 619 of file Function.cpp. References mcElementHelpers::data_AddProperty(), data_GetArgObj(), mcExpContainer::data_GetContent(), data_SetFncType(), mcPolynomial::gui_AddNewEmptyMonomial(), mcElementHelpers::gui_RecalcSize(), mcASSERT, and mcEP_INITIALIZED. |
|
Definition at line 738 of file Function.cpp. References mcExpElementHelpers::data_GetSub(), mcElement::gui_MoveCursor(), HANDLE_EXPSUB, mcASSERT, mcECL_INSIDESUBSCRIPT, mcMCR_OKAY, and mgui_nCursorPos. |
|
Implements mcExpElementHelpers. Definition at line 845 of file Function.cpp. References data_GetArgObj(), data_GetNameObj(), mcExpElementHelpers::data_GetSub(), mcElementHelpers::data_hasProperty(), mcElement::io_GetInlinedExpr(), mcEP_HASEXPONENT, and mcEP_HASSUBSCRIPT. |
|
Returns a MathML tree with the presentation math markup language regarding the base. This function should work exactly as the hononymous mcElement function.
Implements mcExpElementHelpers. Definition at line 794 of file Function.cpp. References data_GetNameObj(), and mcElement::io_GetMathML(). |
|
Overloading mcExpElementHelpers function is required since.
Reimplemented from mcExpElementHelpers. Definition at line 881 of file Function.cpp. Referenced by io_ImportInlinedExpr(). |
|
Returns the MathML tree which describes this element and, eventually, its exponent and its subscript.
Reimplemented from mcExpElementHelpers. Definition at line 805 of file Function.cpp. References data_GetArgObj(). |
|
Definition at line 895 of file Function.cpp. Referenced by mcRadicalHelpers::io_ImportBaseInlinedExpr(), and io_ImportInlinedExpr(). |
|
This function is not used by mcFunction::io_ImportInlinedExpr. However, it must still be present. Implements mcExpElementHelpers. Definition at line 413 of file Function.h. |
|
Imports an inlined expression.
"Inlined expression" means a string containing an encoded representation of math data: 234^2*ax+6y/2=0 is an inlined expression. This is the form which is used to input and output math data by a lot of math programs. Compability with these programs is crucial. However, because of the nature of this representation, the algorithm which recognizes (through io_isBeginChar functions) the elements to create, needs to know the lenght of the token which encodes this element; this is accomplished with the
Reimplemented from mcExpElementHelpers. Definition at line 930 of file Function.cpp. References mcExpElementHelpers::data_CreateExpSub(), data_GetArgObj(), mcExpElementHelpers::data_GetExp(), data_GetFncType(), data_GetName(), mcExpElementHelpers::data_GetSub(), data_SetFncType(), io_GetExpSubInlinedToken(), io_ImportArgument(), mcElementHelpers::io_PostProcessChildren(), mcASSERT, mcIOLOG, and mcTXTTHIS. |
|
Imports presentation MathML reading the contents of the given XML node (without modifying it).
This function is called only if io_isBeginTag function returns a positive value for the name of parent tag of
Implements mcElementHelpers. Definition at line 875 of file Function.cpp. References mcASSERT. |
|
Returns a positive value if the given inlined expression marks the begin of this element; FALSE otherwise. The begin tag cannot be dependent from any variable; it must be always the same. Implements mcElementHelpers. Definition at line 765 of file Function.cpp. References io_isFunctionBeginChar(). |
|
Returns a positive value if the given MathML content tag marks the begin of this element; FALSE otherwise. The begin tag cannot be dependent from any variable; it must be always the same.
Implements mcElementHelpers. Definition at line 392 of file Function.h. |
|
Definition at line 771 of file Function.cpp. References mcFunction::data_GetFunctionType(). Referenced by mcMonomialHelpers::io_ImportInlinedExpr(), and io_isBeginChar(). |
|
Sums or subtracts this element with the given A unique function for add/subtract operations is used because the algorithms used to handle this two operations are usually almost identic and thus this avoids a lot of repetitions. If the two elements cannot be summed, then an ASSERT should fail since before using this function, the caller should always use the math_CanBeAddedWith() function.
The function returns one of mcBasicOpRes values, eventually using the Implements mcElementHelpers. Definition at line 365 of file Function.h. References mcBOR_REMOVE_OPERAND. |
|
Returns TRUE if this element can be added with the given element. If the function returns TRUE, then the math_Add() function should return one of mcBOR_REMOVE_OPERAND, mcBOR_REPLACE_BOTH or mcBOR_REPLACE_OPERAND. Implements mcElementHelpers. Definition at line 360 of file Function.h. |
|
Works like #math_CanBemath_AddeWith(), just for divisions.
Implements mcElementHelpers. Definition at line 362 of file Function.h. |
|
Works like #math_CanBemath_AddeWith(), just for multiplication.
Implements mcElementHelpers. Definition at line 361 of file Function.h. |
|
Definition at line 372 of file Function.h. |
|
Implements mcExpElementHelpers. Definition at line 368 of file Function.h. References mcBOR_REMOVE_OPERAND. |
|
Implements mcExpElementHelpers. Definition at line 1007 of file Function.cpp. References data_GetArgObj(), data_GetScript(), mcRealValue::GetDouble(), mcValue::isValid(), and mcElement::math_Evaluate(). |
|
Implements mcExpElementHelpers. Definition at line 1052 of file Function.cpp. References data_GetArgObj(), and mcElement::math_Expand(). |
|
Implements mcExpElementHelpers. Definition at line 1059 of file Function.cpp. References data_GetArgObj(), and mcElement::math_GetMathType(). |
|
The raise-to-power operation has a little degree of complexity. In this way we can force our simplify routines to transform an expression like: 9^2 into 81 lenght=2.5 lenght=2 The exponent/subscript of this element will be taken in count by the math_GetTotalLenght() function. Reimplemented from mcExpElementHelpers. Definition at line 377 of file Function.h. |
|
Returns the order position for this element.
Implements mcElementHelpers. Definition at line 379 of file Function.h. |
|
Implements mcExpElementHelpers. Definition at line 367 of file Function.h. References mcBOR_REMOVE_OPERAND. |
|
Implements mcExpElementHelpers. Definition at line 1030 of file Function.cpp. References data_GetArgObj(), mcExpElementHelpers::math_Evaluate(), mcElementHelpers::math_isConstant(), mcElement::math_Simplify(), mcESR_DONE, and mcESR_REPLACE_THIS. |
|
math_s two mcElements of the same type and stores the result in this object.
Reimplemented from mcElementHelpers. Definition at line 366 of file Function.h. References mcBOR_REMOVE_OPERAND. |
|
|
|
The argument of this function.
Definition at line 87 of file Function.h. Referenced by data_DeepCopy(), data_GetArgObj(), data_GetArgObjHlp(), data_isSameAs(), data_SetArgObj(), and gui_isBaseEndKey(). |
|
The name of this function.
Definition at line 90 of file Function.h. Referenced by data_DeepCopy(), data_GetNameObj(), data_GetNameObjHlp(), data_isSameAs(), data_SetName(), data_SetNameObj(), gui_Init(), gui_isBaseEndKey(), and mcFunctionHelpers(). |
|
The type of this function.
Definition at line 93 of file Function.h. Referenced by data_CheckName(), data_DeepCopy(), data_GetFncType(), data_isRegistered(), data_SetFncType(), and gui_BaseInput(). |
|
Definition at line 119 of file Function.h. Referenced by gui_BaseInput(), gui_BaseMoveCursor(), gui_EditBase(), gui_ExpMoveCursor(), gui_GetBaseCursorPos(), gui_GetBaseRelCursorPos(), gui_Init(), gui_isBaseEndKey(), gui_SetCursorPos(), and gui_SubMoveCursor(). |
|
Definition at line 63 of file Function.cpp. Referenced by gui_GetSpaceAboveBelow(). |
|
Definition at line 62 of file Function.cpp. Referenced by gui_GetSpaceLeftRight(). |
|
The key to use to create this element.
Definition at line 77 of file Function.cpp. Referenced by gui_isBeginKey(). |
[ Top ] |