#include <ElementArray.h>
Inheritance diagram for mcElementArrayHelpers:
This is entirely defined & implemented through macros.
Definition at line 216 of file ElementArray.h.
INLINE CHECK functions | |
Fast and safe (in debug build) check functions. | |
bool | data_isOp (int entry) const |
Returns TRUE if the specified entry is an operator. | |
bool | data_isEmptyBox (int entry) const |
Returns TRUE if the specified entry is an empty box; an empty box can be placed anywhere in the array before the end. | |
bool | data_isEmptyEntry (int entry) const |
Returns TRUE if the specified entry is an empty entry; empty entries can be placed only at the end of the array. | |
bool | data_isAddSubOp (int entry) const |
Returns TRUE if the specified entry is an operator. | |
bool | data_isMultDivOp (int entry) const |
Returns TRUE if the specified entry is an operator. | |
bool | data_isArrayEmpty () const |
Returns TRUE if the array is empty or non allocated. | |
bool | data_isValidElem (int entry) const |
Returns TRUE if the specified entry is valid. | |
static bool | data_isValidElem (const mcElement &p) |
Checks if the given pointer is valid (it's not an empty box or an empty entry). | |
Public Member Functions | |
virtual int | gui_GetSpaceBetweenRatio () const |
Returns the costant which is divided by the exponent depth of this element to get the number of pixels to leave among the elements. | |
mcElementArrayHelpers () | |
virtual | ~mcElementArrayHelpers () |
bool | io_isBeginTag (const wxXml2Node &tag) const |
Checks the given tag and, if it is an MROW, returns a null value (the ID of the first mcElementArray-derived class). | |
bool | io_isBeginChar (const wxString &str) const |
Element arrays do not have a special begin/end character in inlined expressions... | |
wxString | io_GetInlinedExpr () const |
Returns the inlined expression for this element as a wxString. | |
MISCELLANEOUS | |
Some miscellaneous functions. | |
void | data_DeepCopy (const mcElementHelpers *p) |
Deep copies all the info contained in this class. | |
void | data_AddProperty (int p, void *val1=NULL, void *val2=NULL) |
mcElementArray overloads this function to handle the mcElementArray-specific mcEP_ELEMENTARRAY_FILTER property. | |
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_CheckArrayLimit () |
Checks if the array is full; makes room if it is (the space added to the array is mcELEMENTARRAY_DEFAULT_ROOM. | |
void | data_ChangeFilter (const mcFilter *p) |
Changes the filter associated with this array. See mcFilter. | |
void | data_UpdateFilterFor (mcElement &p, const mcFilter *f) |
Updates the filter of the given element setting it to f . | |
bool | data_isElementAllowed (mcElementType type) const |
Returns TRUE if the given type of element can be created. | |
bool | data_isSameAs (const mcElementHelpers *p) const |
Checks all the children. | |
ARRAY HANDLER functions | |
Fast and safe (in debug build) array handlers functions. | |
virtual bool | data_ScanArray (bool(*func)(const mcElement &), bool odd) const |
Checks that in this array, all the even (or odd) elements are okay. | |
virtual int | data_AddElements (const mcElement *p, int num, int pos=-1, bool bOverwrite=FALSE, bool bForceCopy=FALSE) |
math_Adds one or more elements to the array. | |
virtual mcElement & | data_AddNewElement (mcElementType t, bool bOverwrite=FALSE, int pos=-1) |
math_Adds a new element to the array and returns a pointer to it. | |
virtual mcElement & | data_AddNewWrappedElement (mcElementType t, bool bOverwrite=FALSE, int pos=-1) |
Works like the #math_AddNewElement function but the new element is first wrapped in the appropriate structure: a mcPolynomial will wrap the new element in a mcMonomial while a mcMonomial will just call the #math_AddNewElement function. | |
void | data_Merge (const mcElementArray &p, int n=0, bool bAddToEnd=TRUE) |
Merges the given array with this one, deep-copying the content and adding the new elements at the end of this array. | |
virtual void | data_AddNewOp (mcElementType type, int pos=-1) |
math_Adds a new operator in the array. | |
virtual void | data_AddNewEmptyBox (int pos=-1) |
math_Adds a new mcEmptyBox in the array, at the given position. | |
virtual void | data_UpdateNeighbor (int n) |
Checks if the neighbors of the element n have the mcEP_NOTIFY_NEIGHBOR_CHANGE property set; if they have this function calls the mcElement::data_OnNeighborChange function of the neighbors of the element n. | |
virtual void | data_Delete (int entry) |
Mark the requested entry as empty, that is, not containing a valid pointer value to an allocated element. | |
virtual bool | data_Delete (const mcElement &elem) |
math_Finds the given element among the elements contained directly (that is, without any wrapper: this function is not recursive) and then deletes it from the array. | |
virtual void | data_DeleteLast (int num) |
Deletes the last num elements decrementing also the element counter. | |
virtual void | data_DeleteFirst (int num) |
Deletes the first num elements decrementing also the element counter. | |
virtual void | data_DeleteAllElemType (mcElementType) |
Deletes all the occurrences of the elements of the given type, shifting the array each time... | |
mcElement | data_Detach (int n) |
Detaches (that is, removes from array but doesn't delete) the n-th entry of the array and returns it. | |
mcElement | data_DetachLastElem (int num) |
Detaches the last num elements decrementing the mdata_nElements counter. | |
mcElement | data_DetachAll () |
Detaches all the elements of the array. | |
void | data_DeleteAll () |
Deletes all the element in the array and marks all entries as empty; the array of pointers mdata_pElemArray is not deallocated. | |
void | data_MoveElemRight (int start) |
Shifts elements in the array one position on the right (mdata_pElemArray[start] will be shifted right with all the following elements) and adds one unit from the elements counter (array grows). | |
void | data_MoveElemLeft (int start) |
Shifts elements in the array one position on the left (mdata_pElemArray[start] will be replaced by the element on his right and so on) and subtracts one unit to the elements counter (array is shrinked). | |
void | data_Move (int n, int k) |
Moves the n-th element of the array (and its preceding operator) to the position k. | |
int | data_MoveAllElemType (mcElementType t, mcElementArray &m) |
Moves all the elements of type t from *this to the given array m (which must be of compatible with elements of type t !!). | |
void | data_Swap (int index1, int index2) |
Swaps the element placed in index1 with the element placed in index2. | |
int | data_QueueElemType (mcElementType t, int firstpos) |
Places the elements of the given type and subtype in the firstpos entry and following (swapping the element previously placed in the entries where the sequence of the t elements is created). | |
virtual void | data_Repair () |
Repairs the array, solving those problems which derive *not* from logic programming errors but from some assumptions taken in the algorithms. | |
virtual bool | data_isWrappingOnly (mcElementType t) const |
Returns TRUE if this array is containing only an element of the given type. | |
virtual const mcElement & | data_GetWrapped (mcElementType t) const |
Returns the element of type t wrapped by this element, if it does exist and it is the only element wrapped by this array; returns NULL otherwise. | |
GET functions | |
Fast and safe (in debug build) get functions. | |
void | data_CheckIndex (int entry) const |
Use this as quick array and index check function; it stops the program if the given index is not a valid index for the current array (which must have been already created). | |
const mcElement & | data_GetConst (int entry) const |
Returns a pointer to the element placed at the entry-th position in the array; it's better to use this function rather than accessing directly the array because this function (in debug mode), ensure some data checks. | |
const mcElement & | data_Get (int entry) const |
mcElement & | data_Get (int entry) |
int | data_GetIndexOf (const mcElement &p) const |
Returns the index of the entry in the array which points to the given element. | |
const mcElement & | data_GetLast () const |
Returns a pointer to the last element of the array. | |
mcElement & | data_GetLast () |
mcElement * | data_GetArray (int n=0) const |
Returns a pointer to the memory address where the pointer to the n-th element is stored. | |
int | data_GetIndex (int id) const |
Returns the index of the element with the given ID; -1 if no elements with the given ID are stored in this expression. | |
int | data_GetCount () const |
Returns the number of the elements stored in the mcPolynomial (takes in count also empty boxes). | |
int | data_GetAvailableEntryCount () const |
Returns the number of the entries in the array (the array automatically grows if needed). | |
int | data_GetNumOfElemType (mcElementType t) const |
Returns the number of the elements of type == t. | |
int | data_GetOpCount () const |
Returns the number of the operators stored in the mcPolynomial. | |
mcElement & | data_GetElemOfType (int n, mcElementType t) const |
Returns a pointer to the n-th occurrence of the element of type == t. | |
int | data_GetElemIndexOfType (int n, mcElementType t) const |
Returns the index of the n-th occurrence of the element of type == t. | |
mcElement & | data_GetNonOpElem (int n) const |
Returns a pointer to the n-th occurrence of a non mcOperator-derived class. | |
int | data_GetNonOpElemIndex (int n) const |
Returns the index of the n-th occurrence of a non mcOperator-derived class. | |
mcOperator & | data_GetOp (int n) const |
Returns a pointer to the n-th operator in the array. | |
int | data_GetOpIndex (int n) const |
Returns the index of the n-th operator in the array. | |
mcElementType | data_GetOpTypeBetween (int n1, int n2) const |
Returns the element type of the operator between... | |
mcElementType | data_GetOpTypePreceding (int n) const |
Returns the operator type preceding the n-th element. | |
mcOperator & | data_GetOpPreceding (int n) const |
const mcElement & | data_GetElemAtLeftOf (const mcElement &p) const |
Returns the element preceding the given pointer; this pointer must be a pointer to one element of the array of this class. | |
const mcElement & | data_GetElemAtRightOf (const mcElement &p) const |
Returns a the element following the given pointer; this pointer must be a pointer to one element of the array of this class. | |
INLINE SET functions | |
Fast and safe (in debug build) set functions. | |
void | data_Set (int i, const mcElement &value) |
Sets the i-th entry with the given value. | |
void | data_SetAsEmptyEntry (int entry) |
Marks the given entry as empty but this function doesn't delete the eventually pre-existent element. | |
Filter functions | |
void | data_SetFilter (const mcFilter *p) |
(Re)sets the filter attached to this object. | |
mcFilter * | data_GetFilter () |
Returns the filter attached to this array; NULL if there are no filters set for this object. | |
const mcFilter * | data_GetFilter () const |
The CONST version of the data_GetFilter. | |
bool | data_isUsingFilter () const |
Returns TRUE if this class is using a filter. | |
Array handlers | |
virtual int | gui_AddNewElement (mcElementType type, const mcKey &key, int pos=-1) |
Creates a new element of the type & subtype, sends it the given start key and adds it to the array in the specified position. | |
void | gui_AddNewEmptyBox (int pos=-1) |
Just to make easier the empty box creation. | |
void | gui_AddNewOp (mcElementType nOpType, int pos=-1) |
math_Adds a new operator of the specified type at the specified position. | |
void | gui_SetCursorOnElemBegin (int n) |
Sets the cursor at the beginning of the n-th element. | |
void | gui_SetCursorOnElemEnd (int n) |
Sets the cursor at the end of the n-th element. | |
bool | gui_isCursorOn (const mcElement &p) const |
Returns TRUE if the given element is contained in this monomial and it has the focus (that is, the cursor is placed on that element). | |
int | gui_GetSelElemCount () const |
Returns the number of the selected elements in the expression. | |
int | gui_GetSelElemCountOfType (mcElementType t) const |
Returns the number of the selected elements in the array of the given type and subtype. | |
int | gui_GetSelElemIndex (int n) const |
Returns the index of the n-th selected element found inside the expression. | |
int | gui_GetSelElemIndexOfType (int n, mcElementType t) const |
Returns the index of the n-th selected element found inside the expression, which match the given type and subtype. | |
const mcElement & | gui_GetSelElem (int n) const |
Returns a pointer to the n-th selected element found inside the expression. | |
const mcElement & | gui_GetSelElemOfType (int n, mcElementType t) const |
int | gui_GetSelStart () const |
Returns the index of the first selected element contained in the expression, or -1 if there is no selected element. | |
int | gui_GetSelEnd () const |
Returns the index of the last selected element contained in the expression, or -1 if there is no selected element. | |
void | gui_DeleteSelection () |
Deletes all the selected elements of the array. | |
mcElement & | gui_ExGetActiveElem (int x, int y, const wxPoint &pt, int cl) |
Returns the currently active element of the array or NULL if there is no active element under the mouse cursor. | |
void | gui_DeleteNextOp () |
Deletes the operator which follows the currently focused element. | |
void | gui_DeletePreviousOp () |
Deletes the operator which precedes the currently focused element. | |
void | gui_MoveCursorRight () |
Moves cursor from the current position one step right, skipping elements which return FALSE to the gui_LetInCursor() function. | |
void | gui_MoveCursorLeft () |
void | gui_UpdateExpDepth () |
Sets the exponent depth of all the elements contained to be the same of the exponent depth of *this. | |
bool | gui_Insert (const mcElement &toinsert) |
mcElement functions | |
Functions which implements some (the remaining abstract methods must be implemented by derived classes) abstract functions of mcElement. | |
virtual bool | gui_isEndKey (const mcKey &ev) const |
Returns TRUE if the given character marks the end of this element; this function is always called before calling ::gui_Input function. | |
virtual void | gui_SetCursorPos (const mcCursorPos &code) |
Sets the cursor position inside the element using Cursor Position flags. | |
virtual mcInputRes | gui_Input (const mcKey &ev, mcElement *newelem) |
This function is called when the cursor is inside the element and the user presses a key (which is not the element's end tag). | |
virtual mcMoveCursorRes | gui_MoveCursor (mcMoveCursorFlag flag, 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). | |
virtual mcElement | gui_GetSelection () const |
Returns the selected portion of this element. | |
virtual void | gui_DoRecalcSize () |
This function is called by mcElement and non-mcElement functions when the internal size variable must be updated due to a change in the structure of the element. | |
virtual void | gui_GetCursorPos (mcCursorPos &) const |
Returns the cursor position as Cursor Position flag. | |
virtual mcCursorPos | gui_GetCursorPos () const |
Returns the cursor position after creating mcCursorPos. | |
virtual int | gui_GetYAnchor () const |
Returns the y amount of this mcElement to subtract from the center line to draw this element. | |
void | gui_OnSelect (wxDC &dc, wxRect &rc) |
This function is called when the bounding box of this element intersects with the selection rectangle created by the user with the mouse cursor. | |
int | gui_Draw (wxDC &dc, int x, int y, long flags, const wxPoint &pt) const |
element must be drawn with mcElementHelpers::sgui_m_pActivationBrush background brush; if this pointer is equal to mcDRW_NONACTIVE, the function must simply draw everything with default transparent mode; if the pointer is not one of the previous values, the function must use the pointer to find the subelement where it lies. | |
int | gui_GetRelCursorPos (wxDC &dc, wxPoint *pt) const |
Returns the height of the cursor and the (x;y) position of the cursor (in the given pointer) relative to the top-left point of this element. | |
int | gui_MoveCursorUsingPoint (wxDC &dc, const wxPoint &pt) |
Moves the cursor inside this element in the closest available position to the given point. | |
mcElement & | gui_GetActiveElem (int x, int y, const wxPoint &pt) |
Abstract mcElementArray functions | |
Pure virtual functions which must be implemented in mcElementArray derived classes to personalize array's behaviour. | |
virtual mcInputRes | gui_BackInput (const mcKey &key, mcElement *pnewelem, int n)=0 |
Replies to the return flag of the gui_Input() function of the subelement called by the mcElementArray::gui_Input() function. | |
virtual bool | gui_isArrEndKey (const mcKey &ev) const =0 |
Returns TRUE if the given key cannot be handled by the array. | |
virtual void | gui_CheckCursorPos () const =0 |
Checks that the cursor is in the right position; this function is called in critical points of the most complex mcElementArrayGUI routines to be sure that wrong cursor positions are immediately catched. | |
virtual void | gui_DoSplit (mcElementType type, const mcKey &ev)=0 |
gui_Splits the currently focused elements in two parts, inserting a new element of the given type and subtype between those two parts | |
Helper functions | |
Handy functions related to the graphical output; these functions are defined as virtual, so derived classes can override them. | |
virtual int | gui_GetSpaceBetween () const |
Returns the number of pixels to leave among the elements of the array. | |
virtual int | gui_GetCenterLine () const |
Returns the y value which is the half of the height of the tallest element in the array. | |
virtual int | gui_ExDraw (wxDC &dc, int x, int y, long flags, const wxPoint &pt, int cl=-1, int begin=0, int end=-1, bool bgui_DrawSelected=FALSE) const |
gui_Draws all the elements contained in the array behaving exactly as mcElement::gui_Draw but requires some additional parameters. | |
virtual int | gui_DrawSelectedElements (wxDC &dc, int x, int y, long flags, const wxPoint &pt, int cl=-1) const |
gui_Draws only the selected elements contained in the array. | |
virtual int | gui_DrawSelection (wxDC &hDC, int x, int y, long flags, const wxPoint &pt, int cl=-1) const |
rectangle, mcDRW_NOACTIVEELEM otherwise: please note that this function could return mcDRW_NOACTIVEELEM even if an active element is present (but not inside the selection rectangle). | |
virtual void | gui_ExOnSelect (wxDC &dc, wxRect &rc, int cl=-1) |
Behaves as mcElement::gui_OnSelect() function; the only difference is that this function allows the caller to specify a space to leave (in computations: this function doesn't draw anything) among the various elements. | |
virtual wxSize | gui_CalcSizeOfFirst (int n, int cl=-1) const |
Returns the size of the first n elements in the array. | |
virtual wxSize | gui_CalcSizeOfRange (int begin, int end, int cl=-1) const |
Returns the size of the bouding box of the given range of elements. | |
virtual wxRect | gui_GetSelectionRect (wxDC &dc, int x, int y, int cl=-1) const |
Returns the selection rectangle in screen coordinates. | |
virtual wxPoint | gui_GetOriginOfElem (int n, int cl=-1) const |
Returns the position of the upper-left coord. | |
virtual int | gui_GetBB (int n, wxRect *rc, int yCenter=0, int w=0) const |
Returns the width of n-th element and its bounding box (in the pointer) in coord. | |
virtual int | gui_ExGetRelCursorPos (wxDC &hDC, wxPoint *pt, int cl=-1) const |
Asks the currently focused element of the array for the cursor position; then, offsets it to the right position and return it in the given point pointer. | |
virtual int | gui_ExMoveCursorUsingPoint (wxDC &hDC, const wxPoint &pt, int cl=-1) |
This function is typically used in response to a gui_MoveCursorUsingPoint() calls. | |
virtual int | gui_GetActiveElemIndex (int x, int y, const wxPoint &pt, int cl=-1) |
Returns the index of the currently active element, or the index of the element which contains the current active element (this function cannot recursively search the index of the active element and it must stop to the first element, even if it's a container one). | |
mcElementMath abstract functions implementation | |
mcElementArrayMath implements various mcElementMath functions. | |
mcExpSimRes | math_Simplify (long flags, mcElement *newelem) |
Simplifies this element one "step"; that is, after one call to this function the element must be slightly changed. | |
mcExpSimRes | math_Expand (long flags, mcElement *newelem) |
Expands this element one "step". | |
mcExpSimRes | math_Simplify (long flags) |
A mcElementArray will never use the argument of the standard mcElement::math_Simplify(long flags) function, because it will never return mcESR_REPLACE_THIS flag... | |
mcExpSimRes | math_Expand (long flags) |
mcMathType | math_GetMathType () const |
A powerful recognizer function which automatically classifies the type of the math data contained in this class and returns the respective identifier. | |
bool | math_CanBeAddedWith (const mcElement &p) const |
Returns TRUE if this element can be added with the given element. | |
bool | math_CanBeDivBy (const mcElement &p) const |
Works like #math_CanBemath_AddeWith(), just for divisions. | |
bool | math_CanBeMultWith (const mcElement &p) const |
Works like #math_CanBemath_AddeWith(), just for multiplication. | |
mcBasicOpRes | math_MakeReciprocal (mcElement *) |
Calculates the reciprocal of this element; tipically, this function creates a mcFraction whose numerator is 1 and the denominator contains *this. | |
virtual mcRealValue | math_Evaluate () const |
Evaluates the numeric value of this element and then returns it. | |
virtual mcRealValue | math_GetLenght () const |
An empty array must not be evaluated zero: in this way, the simp/exp algorithms know that an array, even if empty, adds a little bit of complexity... | |
Array access functions | |
Functions which work on the array in a similar way to mcElementArrayData. | |
const mcElement & | math_Get (int n) const |
This should not be virtual because mcPolynomial will use its own Get() function with a different return type. | |
mcElement & | math_Get (int n) |
virtual int | math_GetCount () const |
int | math_GetIndexOf (int occ, const mcElement &tofind) const |
Even if this function could seem similar to mcElementArray::data_GetIndexOf, it's not: while data_GetIndexOf works using for comparisons XX, math_GetIndexOf uses the mcElement math_NonRecursiveFindInChildren function which uses math_Compare and math_CompareThisOnly for comparisons. | |
mcElementType | math_GetOpTypeBetween (int n1, int n2) const |
mcElementType | math_GetOpTypePreceding (int n) const |
mcOperator & | math_GetOpBetween (int n1, int n2) const |
mcOperator & | math_GetOpPreceding (int n) const |
mcElementArrayMath-specific math functions | |
Functions implemented on the top of the abstract ones. | |
bool | math_Remove (int n, bool bAddZero=TRUE) |
Remove the n-th element from the array, creating a mcNumber init with zero (if bmath_AddToZero == TRUE) or with one (if bmath_AddToZero == FALSE), if the expression would remain empty after the removal of the n-th element. | |
bool | math_RemoveFactor (const mcArrayEntry &toremove) |
virtual bool | math_Delete (int n, const mcElement &elem, bool bAddZero=TRUE) |
math_Finds the given element among the elements contained directly (that is, without any wrapper: this function is not recursive) and then deletes it from the array. | |
void | math_ApplyOp (mcElementType optype, mcElement res, const mcElement &factor, mcElement *) |
Creates a temporary operator of the given type and then applies it to the given two elements. | |
void | math_ApplyOpSimple (mcElementType optype, mcElement res, const mcElement &factor) |
Works like #ApplyOp but uses the mcOperator::ApplySimple instead of the mcOperator::Apply function. | |
virtual bool | math_CompareThisOnly (const mcElement &p, long flags) const |
Compares this element and the given one and then stops, unlike math_Compare() that compares children too. | |
virtual bool | math_Compare (const mcElement &p, long flags) const |
Compares *this element with the given one and then compare the children of *this and the children of the given element, too. | |
virtual bool | math_isWrappingOnly (mcElementType t) const |
Returns TRUE if this array is containing only an element of the given type. | |
virtual const mcElement & | math_GetWrapped (mcElementType t) const |
Returns the element of type t wrapped by this element, if it does exist and it is the only element wrapped by this array; returns NULL otherwise. | |
virtual mcArrayEntry | math_WrapMonomial (const mcMonomial &)=0 |
virtual mcArrayEntry | math_WrapSimple (const mcElement &)=0 |
virtual mcArrayEntry | math_WrapSymbol (const mcSymbolProperties *sym) |
virtual mcArrayEntry | math_WrapNumber (const mcRealValue &val) |
bool | math_isWrappingNumOnly () const |
Returns TRUE if this array is containing only a mcNumber. | |
bool | math_isWrappingSymOnly () const |
Returns TRUE if this array is containing only a mcSymbol. | |
mcRealValue | math_GetWrappedNumber () const |
Returns the number which is wrapped by this array or NAN if this array does not contain a single mcNumber. | |
const mcSymbolProperties * | math_GetWrappedSymbol () const |
Returns the symbol which is wrapped by this array or NULL if this array does not contain a single mcSymbol. | |
bool | math_isWrappingOnly (const mcSymbolProperties *sym) const |
bool | math_isWrappingOnly (const mcRealValue &val) const |
virtual void | math_ResetToOne () |
virtual void | math_ResetToZero () |
virtual void | math_SimpleAdd (const mcElement &p, bool add=TRUE) |
Adds the given element to this element using the math_Add() function and then checking that the return value is mcBOR_REMOVE_OPERAND: that is, the operation was completed successfully and *this now contains the result of the operation. | |
virtual void | math_SimpleMultiplyBy (const mcElement &p) |
virtual void | math_SimpleDivideBy (const mcElement &p) |
mcArrayEntry | math_EmbedInFraction (bool bAsDenominator=FALSE) |
mcArrayEntry | math_EmbedInBracket () |
mcArrayEntry | math_EmbedInRadical () |
mcElementArrayMath abstract functions | |
Functions which must be implemented by derived classes. | |
virtual int | math_DataToMathIdx (int dataindex) const =0 |
Converts from data to math index. | |
virtual int | math_MathToDataIdx (int mathindex) const =0 |
Converts from math to data index. | |
virtual void | math_PrepareForComparison (mcElementArray &p) const |
virtual void | math_PrepareForMathOperations (mcElementArray &p) const |
virtual mcElementType | math_GetNeutralOpType () const =0 |
virtual double | math_GetNeutralValue () const =0 |
virtual mcPolynomial | math_GetPolynomialWrapper () const =0 |
Returns a new mcPolynomial containing *this array. | |
virtual mcElementArray | math_CreateWrapperFor (const mcElement &p) const |
Returns a new mcElementArray element which wraps the given element. | |
virtual mcMonomial | math_GetFactors () const |
Factores-out everything which can be factored out from this element. | |
void | math_EmbedInBracketAndRaiseTo (const mcRealValue &n) |
Factores-out of the contained elements everything is possible. | |
void | math_EmbedInBracketAndRaiseTo (const mcPolynomial &p) |
void | math_EmbedInRadicalAndRaiseTo (const mcPolynomial &p) |
Static Public Attributes | |
static wxPen * | sgui_pSelectionPen = NULL |
The pen used to draw the selection rectangle. | |
static bool | sgui_bDrawSelectionInverting = TRUE |
If TRUE, then the selection will be drawn inverting the colours of the selected elements (this is the standard behaviour in all editing systems). | |
Protected Member Functions | |
void | gui_Init () |
Inits the GUI section of this element. | |
virtual int | data_GetIdxFromEntry (const mcArrayEntry *p) const =0 |
virtual mcElement & | data_GetRefFromEntry (const mcArrayEntry *p)=0 |
virtual mcExpSimRes | math_HandleExpSimFlag (mcExpSimRes r, mcElement *newelem, int i) |
Handles the given simplification flag returned by the i-th element of this array. | |
virtual void | math_HandleBasicOpRes (mcBasicOpRes res, mcElement r, int ridx) |
Handles the mcBasicOpRes flag returned by one of mcElementMath basic operations (+,-,*,/). | |
virtual int | math_ReorderElements (mcElement *arr, int sz, int start=0, int toskip=1) |
Reorders the given array of the given size using the mcElement::math_isListedBeforeOf to perform comparisons. | |
virtual mcExpSimRes | math_ExpandAll (long flags, mcElement *pp) |
Expands all the elements of the array. | |
virtual mcExpSimRes | math_SimplifyAll (long flags, mcElement *pp) |
Simplifies all the elements of the array. | |
virtual mcExpSimRes | math_SimplifyExp (long flags, mcElement *pp) |
Expands those elements which contain symbols in common. | |
virtual mcExpSimRes | math_SimplifyRemoveNeutrals (long flags) |
Removes all the neutral elements from the array, using the #GetNeutralValue and the #GetNeutralOpType functions. | |
virtual mcExpSimRes | math_SimplifySolveOp (long flags) |
Applies all the operators which can be applied on the elements of the array. | |
virtual mcExpSimRes | math_Reorder ()=0 |
Reorders the array. | |
virtual bool | math_SimplifyNeedExp (long flags, int n) const |
Returns TRUE if the n-th element must be expanded in order to simplify this array. | |
virtual mcExpSimRes | math_BeginSimSteps () |
virtual mcExpSimRes | math_FinalSimSteps () |
virtual void | math_EndSimSteps () |
This routine is called when we're exiting from the math_Simplify(long flags) function (it's called even if we're exiting with a code different from mcESR_DONE). | |
virtual void | math_EndExpSteps () |
Like #EndSimSteps() just for expansion. | |
Protected Attributes | |
int | mdata_nElements |
Number of mcElements currently inserted in the mdata_pElemArray array. | |
mcFilter * | mdata_pFilter |
The filter which is attached to this array. | |
int | mgui_nCursorPos |
Index of the element which contains the cursor (mgui_nCursorPos cannot index an operator of the array, it must always index a non-operator element). | |
Private Attributes | |
mcElement * | mdata_pElemArray |
Pointer to the array of mcElements; double deference is required for special operations like array enlargment. | |
int | mdata_nUpperBound |
Used to remember the upper bound of the m_pElem array and thus to avoid the use of non-allocated memory. | |
Friends | |
class | mcArrayEntry |
|
Definition at line 289 of file ElementArray.h. |
|
Definition at line 298 of file ElementArray.h. References mcSAFE_DELETE, and mcSAFE_DELETE_ARRAY. |
|
|
math_Adds a new element to the array and returns a pointer to it. The new element is initialized with the given string (for more details, see mcElement::Init() function); it is built as a child of this element and it is placed in the n-th entry of this array, eventually overriding the previously present element. Definition at line 435 of file ElementArray.cpp. References data_AddElements(), data_Get(), and mcElementHelpers::data_NewElem(). Referenced by mcPolynomialHelpers::gui_Input(), and mcPolynomialHelpers::io_ImportInlinedExpr(). |
|
math_Adds a new mcEmptyBox in the array, at the given position.
Reimplemented in mcPolynomialHelpers. Definition at line 226 of file ElementArray.cpp. References data_AddElements(), mcElement::data_AddProperty(), and mcEP_INITIALIZED. Referenced by mcMonomialHelpers::gui_BackInput(), and mcMonomialHelpers::gui_Replace(). |
|
math_Adds a new operator in the array. This function is very different from mcElementArray::gui_math_AddNewOp: this function doesn't follow input rules, that is, if you try to add a mcAddOp in a mcMonomialData (this wouldn't be allowed by mcMonomial::gui_math_AddNewOp), no mcASSERTs will fail. Another example is that if you add a new operator at the end of the array, this function won't add any mcEmptyBox (which is the typical behaviour of mcElementGUI functions). Definition at line 774 of file ElementArray.cpp. References data_AddElements(), and mcElementHelpers::data_NewElem(). Referenced by mcPolynomialHelpers::data_CreateFirstOp(), mcMonomialHelpers::data_Repair(), mcPolynomialHelpers::gui_DoSplit(), mcPolynomialHelpers::math_Add(), mcPolynomialHelpers::math_SetSign(), and mcMonomialHelpers::math_TransformDivOp(). |
|
Works like the #math_AddNewElement function but the new element is first wrapped in the appropriate structure: a mcPolynomial will wrap the new element in a mcMonomial while a mcMonomial will just call the #math_AddNewElement function.
Reimplemented in mcPolynomialHelpers. Definition at line 423 of file ElementArray.h. |
|
mcElementArray overloads this function to handle the mcElementArray-specific mcEP_ELEMENTARRAY_FILTER property.
Reimplemented from mcElementHelpers. Definition at line 343 of file ElementArray.h. References mcEP_ELEMENTARRAY_FILTER. |
|
Changes the filter associated with this array. See mcFilter.
Definition at line 694 of file ElementArray.cpp. References mcFilter::DeepCopy(), mcSAFE_DELETE, and mdata_pFilter. Referenced by data_SetFilter(). |
|
Checks if the array is full; makes room if it is (the space added to the array is mcELEMENTARRAY_DEFAULT_ROOM.
Definition at line 318 of file ElementArray.cpp. References data_GetCount(), mcELEMENTARRAY_DEFAULT_ROOM, mcEXTEND_ARRAY, mdata_nUpperBound, and mdata_pElemArray. Referenced by data_AddElements(), and data_MoveElemRight(). |
|
Use this as quick array and index check function; it stops the program if the given index is not a valid index for the current array (which must have been already created).
Definition at line 569 of file ElementArray.h. References mcASSERT. Referenced by data_AddElements(), data_Delete(), data_Detach(), data_GetOpTypeBetween(), data_isOp(), data_Set(), data_Swap(), mcPolynomialHelpers::math_DataToMathIdx(), mcMonomialHelpers::math_DataToMathIdx(), and math_HandleExpSimFlag(). |
|
Deep copies all the info contained in this class. The mcElement implementation should be enough because all the element's data should be contained inside the associated mcElementData derived class. In fact, mcElementData does not provide a standard implementation of the DeepCopy() function. mcElement-derived classes, instead, should not contain any other variable, so this function should be enough.... Reimplemented from mcElementHelpers. Reimplemented in mcPolynomialHelpers. Definition at line 665 of file ElementArray.cpp. References data_AddElements(), mcElementHelpers::data_DeepCopy(), data_DeleteAll(), data_GetArray(), data_GetCount(), mdata_pElemArray, and mdata_pFilter. Referenced by mcPolynomialHelpers::data_DeepCopy(), and mcMonomialHelpers::math_WrapMonomial(). |
|
math_Finds the given element among the elements contained directly (that is, without any wrapper: this function is not recursive) and then deletes it from the array. This function also shifts the array, thus decrementing the element counter. Returns TRUE if everything is okay; FALSE if the given pointer is not an element contained in this array. Definition at line 242 of file ElementArray.cpp. References data_Delete(), data_GetIndexOf(), and data_MoveElemLeft(). |
|
Mark the requested entry as empty, that is, not containing a valid pointer value to an allocated element. This function frees the memory used by an eventually pre-existent element in the specified position. Definition at line 233 of file ElementArray.cpp. References data_CheckIndex(), and data_SetAsEmptyEntry(). Referenced by data_AddElements(), data_Delete(), data_DeleteAll(), data_DeleteAllElemType(), data_DeleteFirst(), data_DeleteLast(), mcMonomialHelpers::data_Repair(), mcPolynomialHelpers::data_ReplaceParentheses(), mcMonomialHelpers::data_TransformDivOp(), mcPolynomialHelpers::gui_BackInput(), mcMonomialHelpers::gui_BackInput(), gui_DeleteNextOp(), gui_DeletePreviousOp(), gui_DeleteSelection(), mcMonomialHelpers::gui_ReplaceSymbolsWithFunction(), mcMonomialHelpers::gui_Split(), mcPolynomialHelpers::math_DeleteFirstOp(), mcMonomialHelpers::math_DetachNonCommonFactors(), math_HandleBasicOpRes(), math_HandleExpSimFlag(), math_Remove(), and mcMonomialHelpers::math_RemoveAllOp(). |
|
Deletes all the element in the array and marks all entries as empty; the array of pointers mdata_pElemArray is not deallocated.
Definition at line 337 of file ElementArray.cpp. References data_Delete(), mdata_nElements, mdata_nUpperBound, and mdata_pElemArray. Referenced by data_DeepCopy(), mcMonomialHelpers::gui_AddNewElement(), mcPolynomialHelpers::io_ImportInlinedExpr(), mcMonomialHelpers::io_ImportInlinedExpr(), mcPolynomialHelpers::io_ImportPresentationMathML(), mcMonomialHelpers::io_ImportPresentationMathML(), math_EmbedInBracket(), math_EmbedInFraction(), math_EmbedInRadical(), mcMonomialHelpers::math_MultiplyBy(), math_ResetToOne(), math_ResetToZero(), and mcPolynomialHelpers::math_WrapMonomial(). |
|
Deletes all the occurrences of the elements of the given type, shifting the array each time...
Definition at line 268 of file ElementArray.cpp. References data_Delete(), data_GetElemIndexOfType(), data_GetNumOfElemType(), and data_MoveElemLeft(). |
|
Deletes the first num elements decrementing also the element counter. This function differs from Delete() because it also modifies the mdata_nElements counter. Definition at line 260 of file ElementArray.cpp. References data_Delete(), and data_MoveElemLeft(). Referenced by mcPolynomialHelpers::data_DeleteFirstOp(). |
|
Deletes the last num elements decrementing also the element counter. This function differs from Delete() because it also modifies the mdata_nElements counter. Definition at line 252 of file ElementArray.cpp. References data_Delete(), data_GetCount(), and mdata_nElements. Referenced by mcMonomialHelpers::data_Repair(). |
|
Detaches (that is, removes from array but doesn't delete) the n-th entry of the array and returns it. Doesn't modify the mdata_nElements counter, so this function makes an "hole" in the array: BE CAREFUL not to forget to replace it. Definition at line 280 of file ElementArray.cpp. References data_CheckIndex(), data_Get(), and data_SetAsEmptyEntry(). Referenced by data_DetachAll(), mcPolynomialHelpers::data_DetachAndShiftMonomial(), data_DetachLastElem(), data_Move(), data_MoveAllElemType(), and mcPolynomialHelpers::math_DistributeBracket(). |
|
Detaches all the elements of the array. VERY IMPORTANT: this could cause a very big memory leak if the detached elements are not deleted by something/someone. Definition at line 351 of file ElementArray.cpp. References data_Detach(), mcEmptyElement, mdata_nElements, mdata_nUpperBound, and mdata_pElemArray. |
|
Detaches the last num elements decrementing the mdata_nElements counter.
Definition at line 295 of file ElementArray.cpp. References data_Detach(), data_GetCount(), mcEmptyElement, and mdata_nElements. Referenced by mcMonomialHelpers::gui_Split(). |
|
Definition at line 590 of file ElementArray.h. |
|
Definition at line 587 of file ElementArray.h. Referenced by data_AddNewElement(), mcPolynomialHelpers::data_AddNewWrappedElement(), data_Detach(), mcPolynomialHelpers::data_DetachAndShiftMonomial(), mcPolynomialHelpers::data_FindMonomialContaining(), data_GetElemIndexOfType(), data_GetIndexOf(), data_GetNumOfElemType(), data_GetOpTypeBetween(), data_GetOpTypePreceding(), mcPolynomialHelpers::data_GetWrapped(), data_GetWrapped(), data_isOp(), mcPolynomialHelpers::data_isWrappingOnly(), data_isWrappingOnly(), data_QueueElemType(), mcMonomialHelpers::data_Repair(), mcPolynomialHelpers::data_ReplaceParentheses(), data_ScanArray(), data_Swap(), mcMonomialHelpers::data_TransformDivOp(), data_UpdateNeighbor(), mcPolynomialHelpers::gui_BackInput(), mcMonomialHelpers::gui_BackInput(), gui_CalcSizeOfRange(), mcPolynomialHelpers::gui_CheckCursorPos(), gui_DeleteSelection(), mcPolynomialHelpers::gui_DoSplit(), mcMonomialHelpers::gui_DoSplit(), gui_ExDraw(), gui_ExGetRelCursorPos(), gui_ExMoveCursorUsingPoint(), mcPolynomialHelpers::gui_ExOnSelect(), gui_ExOnSelect(), gui_GetActiveElemIndex(), gui_GetBB(), gui_GetCenterLine(), gui_GetCursorPos(), gui_GetOriginOfElem(), gui_GetSelectionRect(), gui_Input(), mcPolynomialHelpers::gui_Insert(), mcMonomialHelpers::gui_Insert(), gui_isEndKey(), gui_MoveCursor(), gui_MoveCursorLeft(), gui_MoveCursorRight(), mcPolynomialHelpers::gui_ReplaceBracket(), mcMonomialHelpers::gui_ScanArrayForFunctions(), gui_SetCursorPos(), mcMonomialHelpers::gui_Split(), gui_UpdateExpDepth(), mcPolynomialHelpers::io_GetInlinedExpr(), io_GetInlinedExpr(), mcPolynomialHelpers::io_GetMathML(), mcMonomialHelpers::io_GetMathML(), mcMonomialHelpers::io_ImportPresentationMathML(), mcMonomialHelpers::math_CanBeAddedWith(), mcPolynomialHelpers::math_DeleteFirstOp(), mcMonomialHelpers::math_DetachNonCommonFactors(), mcPolynomialHelpers::math_DistributeBracket(), math_Evaluate(), mcMonomialHelpers::math_GetCoeff(), math_GetMathType(), mcPolynomialHelpers::math_GetSign(), mcPolynomialHelpers::math_HandleExpSimFlag(), math_isWrappingOnly(), mcMonomialHelpers::math_MultiplyBy(), math_Remove(), mcMonomialHelpers::math_RemoveCoeff(), mcMonomialHelpers::math_SetCoeff(), mcMonomialHelpers::math_SimplifyCoeff(), math_SimplifyRemoveNeutrals(), and mcMonomialHelpers::math_TransformDivOp(). |
|
Returns a pointer to the memory address where the pointer to the n-th element is stored. Use with care. Definition at line 608 of file ElementArray.h. Referenced by data_DeepCopy(), mcPolynomialHelpers::data_ReplaceParentheses(), mcMonomialHelpers::data_TransformDivOp(), mcMonomialHelpers::gui_ScanArrayForFunctions(), mcMonomialHelpers::gui_Split(), mcMonomialHelpers::math_DetachNonCommonFactors(), mcPolynomialHelpers::math_Reorder(), and mcMonomialHelpers::math_Reorder(). |
|
Returns the number of the entries in the array (the array automatically grows if needed).
Definition at line 634 of file ElementArray.h. |
|
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 mcElementHelpers. Definition at line 348 of file ElementArray.h. References mcElementHelpers::data_GetChildrenCount(). |
|
Returns a pointer to the element placed at the entry-th position in the array; it's better to use this function rather than accessing directly the array because this function (in debug mode), ensure some data checks. If n is too high, an mcASSERT will fail; use #GetCount() to avoid it.
Definition at line 582 of file ElementArray.h. Referenced by mcPolynomialHelpers::gui_ReplaceBracket(). |
|
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 mcElementHelpers. Definition at line 352 of file ElementArray.h. References mcRETURN_ELEMENT_CHILD. |
|
Returns the number of the elements stored in the mcPolynomial (takes in count also empty boxes).
Definition at line 628 of file ElementArray.h. Referenced by data_AddElements(), mcPolynomialHelpers::data_AddNewEmptyMonomial(), data_CheckArrayLimit(), data_DeepCopy(), data_DeleteLast(), data_DetachLastElem(), mcPolynomialHelpers::data_FindMonomialContaining(), data_GetIndexOf(), mcPolynomialHelpers::data_isWrappingOnly(), data_isWrappingOnly(), data_MoveElemLeft(), data_QueueElemType(), mcMonomialHelpers::data_Repair(), mcPolynomialHelpers::data_ReplaceParentheses(), data_ScanArray(), mcMonomialHelpers::data_TransformDivOp(), data_UpdateNeighbor(), mcPolynomialHelpers::gui_AddNewElement(), mcMonomialHelpers::gui_AddNewElement(), gui_AddNewElement(), mcPolynomialHelpers::gui_AddNewEmptyMonomial(), mcPolynomialHelpers::gui_BackInput(), mcMonomialHelpers::gui_BackInput(), mcPolynomialHelpers::gui_CheckCursorPos(), mcMonomialHelpers::gui_CheckCursorPos(), gui_DeleteNextOp(), gui_DoRecalcSize(), gui_DrawSelection(), gui_ExDraw(), gui_ExGetRelCursorPos(), gui_ExMoveCursorUsingPoint(), gui_ExOnSelect(), gui_GetActiveElemIndex(), gui_GetCenterLine(), gui_GetCursorPos(), mcPolynomialHelpers::gui_Input(), gui_Input(), mcPolynomialHelpers::gui_isArrayEmpty(), gui_isEndKey(), gui_MoveCursor(), gui_MoveCursorRight(), mcPolynomialHelpers::gui_ReplaceBracket(), mcMonomialHelpers::gui_ScanArrayForFunctions(), gui_SetCursorPos(), mcMonomialHelpers::gui_Split(), gui_UpdateExpDepth(), mcPolynomialHelpers::io_GetInlinedExpr(), io_GetInlinedExpr(), mcPolynomialHelpers::io_GetMathML(), mcMonomialHelpers::io_GetMathML(), mcMonomialHelpers::io_ImportPresentationMathML(), mcMonomialHelpers::math_DetachNonCommonFactors(), mcPolynomialHelpers::math_EmbedInBracket(), mcPolynomialHelpers::math_FactoreOut(), mcMonomialHelpers::math_GetCoeff(), mcMonomialHelpers::math_GetMaxDegreeForSymbolArray(), mcMonomialHelpers::math_RemoveAllOp(), mcPolynomialHelpers::math_Reorder(), mcMonomialHelpers::math_Reorder(), mcMonomialHelpers::math_SetCoeff(), math_SimplifyRemoveNeutrals(), and mcMonomialHelpers::math_TransformDivOp(). |
|
Returns the element preceding the given pointer; this pointer must be a pointer to one element of the array of this class. If the given pointer is not valid, not a child of this class, or the previous element doesn't exist, returns NULL. Definition at line 691 of file ElementArray.h. References mcEmptyElement. |
|
Returns a the element following the given pointer; this pointer must be a pointer to one element of the array of this class. If the given pointer is not valid, not a child of this class, or the following element doesn't exist, returns NULL. Definition at line 700 of file ElementArray.h. References mcEmptyElement. |
|
Returns the index of the n-th occurrence of the element of type == t.
Definition at line 587 of file ElementArray.cpp. References data_Get(), mcElementHelpers::data_GetType(), and SCAN_ARRAY_SEARCHING. Referenced by data_DeleteAllElemType(), data_GetElemOfType(), data_MoveAllElemType(), and mcMonomialHelpers::math_SimplifyCoeff(). |
|
Returns a pointer to the n-th occurrence of the element of type == t.
Definition at line 613 of file ElementArray.cpp. References data_GetElemIndexOfType(), and RETURN_ELEM_FROM_INDEX. Referenced by mcPolynomialHelpers::data_GetWrapped(), and mcPolynomialHelpers::io_ImportInlinedExpr(). |
|
The CONST version of the data_GetFilter.
Definition at line 805 of file ElementArray.h. |
|
Returns the filter attached to this array; NULL if there are no filters set for this object.
Definition at line 802 of file ElementArray.h. |
|
Implemented in mcMonomialHelpers, and mcPolynomialHelpers. Referenced by mcArrayEntry::data_GetIdx(). |
|
Returns the index of the element with the given ID; -1 if no elements with the given ID are stored in this expression.
Definition at line 619 of file ElementArray.h. |
|
Returns the index of the entry in the array which points to the given element. Returns -1 if the given pointer does not points to an element in the array. Definition at line 395 of file ElementArray.cpp. References data_Get(), and data_GetCount(). Referenced by data_Delete(), and mcPolynomialHelpers::data_FindMonomialContaining(). |
|
Definition at line 603 of file ElementArray.h. |
|
Returns a pointer to the last element of the array.
Definition at line 600 of file ElementArray.h. Referenced by mcMonomialHelpers::gui_MergeWith(). |
|
Returns a pointer to the n-th occurrence of a non mcOperator-derived class.
Definition at line 618 of file ElementArray.cpp. References data_GetNonOpElemIndex(), and RETURN_ELEM_FROM_INDEX. |
|
Returns the index of the n-th occurrence of a non mcOperator-derived class.
Definition at line 592 of file ElementArray.cpp. References data_isOp(), and SCAN_ARRAY_SEARCHING. Referenced by data_GetNonOpElem(), and mcMonomialHelpers::math_MathToDataIdx(). |
|
Returns the number of the elements of type == t.
Definition at line 555 of file ElementArray.cpp. References data_Get(), mcElementHelpers::data_GetType(), and SCAN_ARRAY_COUNTING. Referenced by data_DeleteAllElemType(), data_isElementAllowed(), data_MoveAllElemType(), mcPolynomialHelpers::io_ImportInlinedExpr(), mcMonomialHelpers::math_GetCoeff(), mcMonomialHelpers::math_Reorder(), and mcMonomialHelpers::math_SimplifyCoeff(). |
|
Returns a pointer to the n-th operator in the array. See the note of #GetOpIndex for more info. If n is too high, an mcASSERT will fail; use #GetOpCount() to avoid it. Definition at line 623 of file ElementArray.cpp. References data_GetOpIndex(), and RETURN_ELEM_FROM_INDEX. |
|
Returns the number of the operators stored in the mcPolynomial.
Definition at line 560 of file ElementArray.cpp. References data_isOp(), and SCAN_ARRAY_COUNTING. |
|
Returns the index of the n-th operator in the array.
Definition at line 597 of file ElementArray.cpp. References data_isOp(), and SCAN_ARRAY_SEARCHING. Referenced by data_GetOp(). |
|
Definition at line 684 of file ElementArray.h. |
|
Returns the element type of the operator between...
Definition at line 726 of file ElementArray.cpp. References data_CheckIndex(), data_Get(), mcElement::data_GetType(), math_GetNeutralOpType(), mcASSERT, and mcSWAP. |
|
Returns the operator type preceding the n-th element.
Definition at line 755 of file ElementArray.cpp. References data_Get(), mcElement::data_GetType(), data_isOp(), math_GetNeutralOpType(), and mcASSERT. |
|
Implemented in mcMonomialHelpers, and mcPolynomialHelpers. |
|
Returns the element of type
Reimplemented in mcPolynomialHelpers. Definition at line 219 of file ElementArray.cpp. References data_Get(), data_isWrappingOnly(), and mcEmptyElement. Referenced by mcMonomialHelpers::math_MultiplyBy(). |
|
Returns TRUE if the specified entry is an operator.
Definition at line 733 of file ElementArray.h. References mcET_ADDOP, and mcET_SUBOP. Referenced by mcPolynomialHelpers::math_DistributeBracket(), and mcPolynomialHelpers::math_GetSign(). |
|
Returns TRUE if the array is empty or non allocated.
Definition at line 747 of file ElementArray.h. Referenced by mcPolynomialHelpers::data_CreateFirstOp(), mcPolynomialHelpers::data_DeleteFirstOp(), mcMonomialHelpers::data_Repair(), mcPolynomialHelpers::gui_BackInput(), mcPolynomialHelpers::gui_CheckCursorPos(), mcPolynomialHelpers::gui_isArrayEmpty(), gui_SetCursorPos(), mcPolynomialHelpers::io_ImportInlinedExpr(), mcPolynomialHelpers::math_DeleteFirstOp(), mcPolynomialHelpers::math_DivideBy(), math_Evaluate(), math_GetMathType(), mcPolynomialHelpers::math_MultiplyBy(), and math_Remove(). |
|
Returns TRUE if the given type of element can be created. Consults the current filter to give the result. Definition at line 711 of file ElementArray.cpp. References data_GetNumOfElemType(), mcFilter::isElementTypeAllowed(), and mdata_pFilter. Referenced by gui_Input(), and mcMonomialHelpers::gui_Replace(). |
|
Returns TRUE if the specified entry is an empty box; an empty box can be placed anywhere in the array before the end.
Definition at line 720 of file ElementArray.h. References mcET_EMPTYBOX. |
|
Returns TRUE if the specified entry is an empty entry; empty entries can be placed only at the end of the array.
Definition at line 727 of file ElementArray.h. References mcEmptyElement. Referenced by mcPolynomialHelpers::gui_CheckCursorPos(). |
|
Returns TRUE if the specified entry is an operator.
Definition at line 740 of file ElementArray.h. References mcET_DIVOP, and mcET_MULTOP. |
|
Returns TRUE if the specified entry is an operator.
Definition at line 768 of file ElementArray.cpp. References data_CheckIndex(), data_Get(), mcElementHelpers::data_GetType(), and mcOperatorHelpers::data_isOp(). Referenced by mcPolynomialHelpers::data_CreateFirstOp(), mcPolynomialHelpers::data_DeleteFirstOp(), mcPolynomialHelpers::data_DetachAndShiftMonomial(), data_GetNonOpElemIndex(), data_GetOpCount(), data_GetOpIndex(), data_GetOpTypePreceding(), data_Move(), data_MoveAllElemType(), mcMonomialHelpers::data_Repair(), mcMonomialHelpers::data_TransformDivOp(), mcPolynomialHelpers::gui_AddNewElement(), mcMonomialHelpers::gui_AddNewElement(), mcPolynomialHelpers::gui_BackInput(), mcMonomialHelpers::gui_BackInput(), mcPolynomialHelpers::gui_CheckCursorPos(), mcMonomialHelpers::gui_CheckCursorPos(), gui_DeleteNextOp(), gui_DeletePreviousOp(), gui_ExMoveCursorUsingPoint(), mcPolynomialHelpers::gui_ExOnSelect(), gui_ExOnSelect(), gui_GetCursorPos(), mcPolynomialHelpers::gui_Input(), mcPolynomialHelpers::gui_isArrayEmpty(), gui_MoveCursor(), gui_SetCursorPos(), mcMonomialHelpers::io_GetMathML(), mcPolynomialHelpers::math_DataToMathIdx(), mcMonomialHelpers::math_DataToMathIdx(), mcPolynomialHelpers::math_DeleteFirstOp(), math_Evaluate(), math_HandleBasicOpRes(), mcPolynomialHelpers::math_MathToDataIdx(), math_Remove(), mcMonomialHelpers::math_RemoveAllOp(), mcPolynomialHelpers::math_SetSign(), and mcMonomialHelpers::math_SimplifyCoeff(). |
|
Checks all the children.
Reimplemented from mcElementHelpers. Definition at line 191 of file ElementArray.cpp. References mdata_nElements. |
|
Returns TRUE if this class is using a filter.
Definition at line 808 of file ElementArray.h. |
|
Returns TRUE if the specified entry is valid.
Definition at line 760 of file ElementArray.h. |
|
Checks if the given pointer is valid (it's not an empty box or an empty entry). This function can be used without allocating any mcElementArray: it's a static function. Definition at line 755 of file ElementArray.h. References mcEmptyElement. Referenced by data_AddElements(), data_UpdateNeighbor(), mcPolynomialHelpers::gui_CheckCursorPos(), and mcMonomialHelpers::gui_Replace(). |
|
Returns TRUE if this array is containing only an element of the given type.
Reimplemented in mcPolynomialHelpers. Definition at line 208 of file ElementArray.cpp. References data_Get(), data_GetCount(), and mcElementHelpers::data_GetType(). Referenced by data_GetWrapped(). |
|
Merges the given array with this one, deep-copying the content and adding the new elements at the end of this array.
Definition at line 426 of file ElementArray.cpp. References data_AddElements(). Referenced by mcMonomialHelpers::gui_MergeWith(), mcPolynomialHelpers::gui_ReplaceBracket(), mcPolynomialHelpers::math_Add(), and mcMonomialHelpers::math_MultiplyBy(). |
|
Moves the n-th element of the array (and its preceding operator) to the position k. VERY IMPORTANT: with mcMonomial you can use this function only when all mcDivOp have been removed. Definition at line 780 of file ElementArray.cpp. References data_Detach(), data_isOp(), data_MoveElemLeft(), data_MoveElemRight(), data_Set(), and mcASSERT. |
|
Moves all the elements of type
Definition at line 811 of file ElementArray.cpp. References data_Detach(), data_GetElemIndexOfType(), data_GetNumOfElemType(), data_isOp(), and data_MoveElemLeft(). |
|
Shifts elements in the array one position on the left (mdata_pElemArray[start] will be replaced by the element on his right and so on) and subtracts one unit to the elements counter (array is shrinked).
Definition at line 382 of file ElementArray.cpp. References data_GetCount(), data_SetAsEmptyEntry(), mdata_nElements, and mdata_pElemArray. Referenced by data_Delete(), data_DeleteAllElemType(), data_DeleteFirst(), mcPolynomialHelpers::data_DetachAndShiftMonomial(), data_Move(), data_MoveAllElemType(), mcMonomialHelpers::data_Repair(), mcPolynomialHelpers::data_ReplaceParentheses(), mcMonomialHelpers::data_TransformDivOp(), mcPolynomialHelpers::gui_BackInput(), mcMonomialHelpers::gui_BackInput(), gui_DeleteNextOp(), gui_DeletePreviousOp(), gui_DeleteSelection(), mcMonomialHelpers::gui_ReplaceSymbolsWithFunction(), mcMonomialHelpers::gui_Split(), mcPolynomialHelpers::math_DeleteFirstOp(), mcMonomialHelpers::math_DetachNonCommonFactors(), mcPolynomialHelpers::math_DistributeBracket(), math_HandleExpSimFlag(), math_Remove(), and mcMonomialHelpers::math_RemoveAllOp(). |
|
Shifts elements in the array one position on the right (mdata_pElemArray[start] will be shifted right with all the following elements) and adds one unit from the elements counter (array grows).
Definition at line 368 of file ElementArray.cpp. References data_CheckArrayLimit(), data_SetAsEmptyEntry(), mdata_nElements, and mdata_pElemArray. Referenced by data_AddElements(), mcPolynomialHelpers::data_CreateFirstOp(), data_Move(), mcMonomialHelpers::data_Repair(), mcPolynomialHelpers::gui_AddNewElement(), mcMonomialHelpers::gui_AddNewElement(), mcPolynomialHelpers::gui_BackInput(), mcPolynomialHelpers::gui_DoSplit(), mcMonomialHelpers::gui_DoSplit(), gui_Input(), mcPolynomialHelpers::math_DistributeBracket(), math_HandleBasicOpRes(), math_Remove(), and mcPolynomialHelpers::math_SetSign(). |
|
Places the elements of the given type and subtype in the firstpos entry and following (swapping the element previously placed in the entries where the sequence of the t elements is created).
Definition at line 629 of file ElementArray.cpp. References data_Get(), data_GetCount(), mcElementHelpers::data_GetType(), and data_Swap(). |
|
Repairs the array, solving those problems which derive *not* from logic programming errors but from some assumptions taken in the algorithms. The default implementation does nothing. Reimplemented in mcMonomialHelpers. Definition at line 547 of file ElementArray.h. Referenced by math_Simplify(). |
|
Checks that in this array, all the even (or odd) elements are okay.
Definition at line 309 of file ElementArray.cpp. References data_Get(), and data_GetCount(). |
|
Sets the i-th entry with the given value. Be careful: this function does not free any memory used by the i-th element (eventually) present before the call to this function. Definition at line 445 of file ElementArray.cpp. References data_CheckIndex(), mcEP_NOTIFY_NEIGHBOR_CHANGE, and mdata_pElemArray. Referenced by data_AddElements(), data_Move(), mcPolynomialHelpers::gui_DoSplit(), mcMonomialHelpers::gui_DoSplit(), mcPolynomialHelpers::math_DistributeBracket(), and math_Remove(). |
|
Marks the given entry as empty but this function doesn't delete the eventually pre-existent element. If you specify an entry containing a valid pointer, the memory address of that element will be lost and the element will never be allocated: be careful !!!! If you want to set as empty an entry where an allocated element is currently placed, use DeleteElement() function. Definition at line 784 of file ElementArray.h. References mcEmptyElement. Referenced by data_Delete(), data_Detach(), data_MoveElemLeft(), and data_MoveElemRight(). |
|
math_Replaces the idx-th child of this element with a copy of the given one.
Reimplemented from mcElementHelpers. Definition at line 357 of file ElementArray.h. References mcSET_ELEMENT_CHILD. |
|
(Re)sets the filter attached to this object.
If Definition at line 685 of file ElementArray.cpp. References data_ChangeFilter(), and data_UpdateFilterFor(). |
|
Swaps the element placed in index1 with the element placed in index2.
Definition at line 406 of file ElementArray.cpp. References data_CheckIndex(), data_Get(), and mdata_pElemArray. Referenced by data_QueueElemType(). |
|
Updates the filter of the given element setting it to
Definition at line 704 of file ElementArray.cpp. References mcEP_ELEMENTARRAY_FILTER, mcET_MONOMIAL, and mcET_POLYNOMIAL. Referenced by data_SetFilter(). |
|
Checks if the neighbors of the element n have the mcEP_NOTIFY_NEIGHBOR_CHANGE property set; if they have this function calls the mcElement::data_OnNeighborChange function of the neighbors of the element n.
Definition at line 417 of file ElementArray.cpp. References data_Get(), data_GetCount(), mcElementHelpers::data_hasProperty(), data_isValidElem(), and mcEP_NOTIFY_NEIGHBOR_CHANGE. |
|
Creates a new element of the type & subtype, sends it the given start key and adds it to the array in the specified position.
Reimplemented in mcMonomialHelpers, and mcPolynomialHelpers. Definition at line 883 of file ElementArray.cpp. References data_AddElements(), data_GetCount(), mcElementHelpers::data_NewElem(), and mcElement::gui_Input(). Referenced by mcPolynomialHelpers::gui_AddNewElement(), mcMonomialHelpers::gui_AddNewElement(), gui_AddNewEmptyBox(), gui_AddNewOp(), and gui_Input(). |
|
Just to make easier the empty box creation. The eventually pre-existent element at the given position is deleted. This function just calls math_AddNewElement with some fixed arguments. Definition at line 904 of file ElementArray.cpp. References gui_AddNewElement(), and mcET_EMPTYBOX. Referenced by mcMonomialHelpers::gui_AddNewElement(). |
|
math_Adds a new operator of the specified type at the specified position.
Definition at line 1847 of file ElementArray.cpp. References gui_AddNewElement(). |
|
Replies to the return flag of the gui_Input() function of the subelement called by the mcElementArray::gui_Input() function.
Implemented in mcMonomialHelpers, and mcPolynomialHelpers. Referenced by gui_Input(). |
|
Returns the size of the first n elements in the array. Use gui_GetSize to get the size of the entire monomial.
Definition at line 970 of file ElementArray.cpp. References gui_CalcSizeOfRange(), and gui_GetCenterLine(). Referenced by gui_DoRecalcSize(), gui_ExDraw(), gui_ExGetRelCursorPos(), gui_GetOriginOfElem(), and gui_GetSelectionRect(). |
|
Returns the size of the bouding box of the given range of elements. When begin = 0 and end = GetCount(), this function returns the size of the entire element.
Definition at line 945 of file ElementArray.cpp. References data_Get(), gui_GetCenterLine(), mcElement::gui_GetHeight(), gui_GetSpaceBetween(), mcElement::gui_GetWidth(), mcElement::gui_GetYAnchor(), and mcMAX. Referenced by gui_CalcSizeOfFirst(), and gui_GetSelectionRect(). |
|
Checks that the cursor is in the right position; this function is called in critical points of the most complex mcElementArrayGUI routines to be sure that wrong cursor positions are immediately catched. If one of the checks fails, this function should stop program execution. Implemented in mcMonomialHelpers, and mcPolynomialHelpers. Referenced by gui_ExGetRelCursorPos(), gui_ExMoveCursorUsingPoint(), gui_Input(), and gui_MoveCursor(). |
|
Deletes the operator which follows the currently focused element.
Definition at line 910 of file ElementArray.cpp. References data_Delete(), data_GetCount(), data_isOp(), data_MoveElemLeft(), and mgui_nCursorPos. Referenced by mcMonomialHelpers::gui_BackInput(). |
|
Deletes the operator which precedes the currently focused element.
Definition at line 920 of file ElementArray.cpp. References data_Delete(), data_isOp(), data_MoveElemLeft(), and mgui_nCursorPos. Referenced by mcMonomialHelpers::gui_BackInput(). |
|
Deletes all the selected elements of the array.
Reimplemented from mcElementHelpers. Definition at line 1188 of file ElementArray.cpp. References data_Delete(), data_Get(), data_MoveElemLeft(), mcElement::gui_DeleteSelection(), gui_GetSelElem(), gui_GetSelEnd(), gui_GetSelStart(), mcElementHelpers::gui_isAllSelected(), mcElement::gui_isAllSelected(), mcElementHelpers::gui_RecalcSize(), and mcASSERT. Referenced by mcMathMngHelpers::gui_MoveSel(), and mcPolynomialHelpers::math_DeleteSelection(). |
|
This function is called by mcElement and non-mcElement functions when the internal size variable must be updated due to a change in the structure of the element. This function should be as fast and accurate as possible and it must store the new size in the mgui_sz variable.
Implements mcElementHelpers. Definition at line 1233 of file ElementArray.cpp. References data_GetCount(), and gui_CalcSizeOfFirst(). |
|
gui_Splits the currently focused elements in two parts, inserting a new element of the given type and subtype between those two parts
Implemented in mcMonomialHelpers, and mcPolynomialHelpers. Referenced by gui_Input(). |
|
element must be drawn with mcElementHelpers::sgui_m_pActivationBrush background brush; if this pointer is equal to mcDRW_NONACTIVE, the function must simply draw everything with default transparent mode; if the pointer is not one of the previous values, the function must use the pointer to find the subelement where it lies. Then, only the subelement's gui_Draw() function must be called with the initial pointer. The subelements must be called with mcDRW_ALLACTIVE flag only for special reasons.
Implements mcElementHelpers. Reimplemented in mcMonomialHelpers, and mcPolynomialHelpers. Definition at line 1037 of file ElementArray.h. |
|
gui_Draws only the selected elements contained in the array. You should call this function with the same coordinates you gave to the gui_Draw() function (e.g.: if the first two elements of the array are not selected (while the third and fourth are), then, this function will draw the third and fourth elements beginning at x+CalcSizeOfRange(0, 3)). This function doesn't draw anything except selected elements; if you want to draw also the selection rectangle, use gui_DrawSelection().
Definition at line 1009 of file ElementArray.cpp. References gui_ExDraw(), gui_GetSelEnd(), and gui_GetSelStart(). Referenced by gui_DrawSelection(). |
|
rectangle, mcDRW_NOACTIVEELEM otherwise: please note that this function could return mcDRW_NOACTIVEELEM even if an active element is present (but not inside the selection rectangle).
Definition at line 1020 of file ElementArray.cpp. References data_GetCount(), mcMathCore::Get(), gui_DrawSelectedElements(), gui_GetCenterLine(), gui_GetSelectionRect(), gui_GetSelElem(), gui_GetSelElemCount(), mcElement::gui_isAllSelected(), mcElementHelpers::gui_isAllSelected(), mcDRW_ALLACTIVE, mcDRW_ALLOW_TOTAL_SELECTION, mcDRW_NOACTIVEELEM, mcDRW_ONSELECTION, mcDRW_USEPOINT, mcGUILOG, mcTXTTHIS, sgui_bDrawSelectionInverting, and sgui_pSelectionPen. Referenced by mcMonomialHelpers::gui_Draw(), and mcPolynomialHelpers::gui_ExDraw(). |
|
gui_Draws all the elements contained in the array behaving exactly as mcElement::gui_Draw but requires some additional parameters.
Definition at line 1252 of file ElementArray.cpp. References data_Get(), data_GetCount(), gui_CalcSizeOfFirst(), mcElement::gui_Draw(), gui_GetBB(), gui_GetCenterLine(), mcElementHelpers::gui_GetWidth(), mcElementHelpers::gui_isSelected(), mcDRW_ALLACTIVE, mcDRW_ALLOW_TOTAL_SELECTION, mcDRW_NOACTIVEELEM, mcDRW_NONACTIVE, mcDRW_USEPOINT, mcGUILOG, mcTXT, and mcTXTTHIS. Referenced by mcMonomialHelpers::gui_Draw(), gui_DrawSelectedElements(), and mcPolynomialHelpers::gui_ExDraw(). |
|
Returns the currently active element of the array or NULL if there is no active element under the mouse cursor.
Definition at line 982 of file ElementArray.h. References mcElement::gui_GetActiveElem(), mcDRW_NOACTIVEELEM, mcDRW_ONSELECTION, and mcEmptyElement. |
|
Asks the currently focused element of the array for the cursor position; then, offsets it to the right position and return it in the given point pointer. This function works as mcElement::gui_GetRelCursorPos function should work, but it can accept a center line and the space to leave among the elements, given by caller. Definition at line 1330 of file ElementArray.cpp. References data_Get(), data_GetCount(), gui_CalcSizeOfFirst(), gui_CheckCursorPos(), gui_GetCenterLine(), mcElement::gui_GetRelCursorPos(), mcElement::gui_GetYAnchor(), and mgui_nCursorPos. |
|
This function is typically used in response to a gui_MoveCursorUsingPoint() calls.
Definition at line 1650 of file ElementArray.cpp. References data_Get(), data_GetCount(), data_isOp(), gui_CheckCursorPos(), gui_GetBB(), gui_GetCenterLine(), gui_GetSpaceBetween(), mcElement::gui_LetInCursor(), mcElement::gui_MoveCursorUsingPoint(), mcCP_END, mcMCR_CANNOT_SETFOCUS, mcMCR_OKAY, and mgui_nCursorPos. |
|
Behaves as mcElement::gui_OnSelect() function; the only difference is that this function allows the caller to specify a space to leave (in computations: this function doesn't draw anything) among the various elements.
Reimplemented in mcPolynomialHelpers. Definition at line 1354 of file ElementArray.cpp. References data_Get(), data_GetCount(), data_isOp(), mcElement::gui_DeSelect(), mcElementHelpers::gui_DeSelect(), gui_GetBB(), gui_GetCenterLine(), gui_GetSelElemCount(), gui_GetSelEnd(), gui_GetSelStart(), mcElement::gui_OnSelect(), mcElementHelpers::gui_Select(), mcElement::gui_SelectAll(), mcMAX, and mcMIN. Referenced by mcPolynomialHelpers::gui_ExOnSelect(). |
|
Definition at line 1052 of file ElementArray.h. |
|
Returns the index of the currently active element, or the index of the element which contains the current active element (this function cannot recursively search the index of the active element and it must stop to the first element, even if it's a container one).
Definition at line 1818 of file ElementArray.cpp. References data_Get(), data_GetCount(), gui_GetBB(), gui_GetCenterLine(), mcElementHelpers::gui_isSelected(), mcDRW_NOACTIVEELEM, and mcDRW_ONSELECTION. |
|
Returns the width of n-th element and its bounding box (in the pointer) in coord. relative to the top-left point of the entire monomial. If you want to use a special center line, use a non-zero value for yCenter; otherwise let it to zero, the function will compute it using #GetCenterLine. If you want to specify the width of all the elements preceding the n-th element, use w with a non-zero value, otherwise the function will calculate it.
Definition at line 1161 of file ElementArray.cpp. References data_Get(), gui_GetCenterLine(), mcElement::gui_GetHeight(), gui_GetOriginOfElem(), gui_GetSpaceBetween(), mcElement::gui_GetWidth(), and mcUNUSED. Referenced by gui_ExDraw(), gui_ExMoveCursorUsingPoint(), gui_ExOnSelect(), and gui_GetActiveElemIndex(). |
|
Returns the y value which is the half of the height of the tallest element in the array. This function scans all the array and do a lot of comparisons: use it as less as possible. Definition at line 1178 of file ElementArray.cpp. References data_Get(), data_GetCount(), gui_GetYAnchor(), and mcMAX. Referenced by gui_CalcSizeOfFirst(), gui_CalcSizeOfRange(), gui_DrawSelection(), gui_ExDraw(), gui_ExGetRelCursorPos(), gui_ExMoveCursorUsingPoint(), gui_ExOnSelect(), gui_GetActiveElemIndex(), gui_GetBB(), gui_GetOriginOfElem(), and gui_GetSelectionRect(). |
|
Returns the cursor position after creating mcCursorPos. This function uses the gui_GetCursorPos but it is a little slower since it allocates a mcCursorPos oject while the other overload uses an already existing object given by the caller. Reimplemented from mcElementHelpers. Definition at line 1025 of file ElementArray.h. References mcElementHelpers::gui_GetCursorPos(). Referenced by mcPolynomialHelpers::gui_CheckCursorPos(), gui_GetCursorPos(), mcPolynomialHelpers::gui_Input(), mcPolynomialHelpers::gui_Insert(), mcMonomialHelpers::gui_Insert(), and gui_MoveCursor(). |
|
Returns the cursor position as Cursor Position flag. It must return mcCP_BEGIN if cursor is at the leftmost point of the element, mcCP_END if the cursor is at the rightmost point of the element, mcCP_INSIDE otherwise. When this function is called the cursor is always inside the element. Implements mcElementHelpers. Definition at line 1701 of file ElementArray.cpp. References data_Get(), data_GetCount(), data_isOp(), mcElement::gui_GetCursorPos(), gui_GetCursorPos(), mcCursorPos::gui_Push(), mcCursorPos::isBegin(), mcCursorPos::isBeginEnd(), mcCursorPos::isEnd(), mcCP_BEGIN, mcCP_BEGINEND, mcCP_END, and mgui_nCursorPos. |
|
Returns the position of the upper-left coord. of the n-th element.
Definition at line 930 of file ElementArray.cpp. References data_Get(), gui_CalcSizeOfFirst(), gui_GetCenterLine(), and mcElement::gui_GetYAnchor(). Referenced by gui_GetBB(). |
|
Returns the height of the cursor and the (x;y) position of the cursor (in the given pointer) relative to the top-left point of this element. The function must fill the wxPoint pointer using coordinates relative to the top-left point of its bounding rectangle. When this function is called, the cursor is always inside the element.
Implements mcElementHelpers. Definition at line 1042 of file ElementArray.h. |
|
Returns the selected portion of this element. If this element is entirely selected (this is the default for non-container elements), the entire element should be returned (this is what the default implementation does). Container elements should override this function returning only the selected elements (in mcMonomials, mcBrackets, mcPolynomials...) or the entire element itself if it is entirely selected. This functions returns an object and not a reference to an object (as for example does gui_GetActiveElem) because the selection cannot be modified through this function. Reimplemented from mcElementHelpers. Definition at line 1775 of file ElementArray.cpp. References mcElementArray::data_AddElements(), mcElementHelpers::data_GetType(), mcElement::data_GetType(), mcElement::data_MakePrivateCopy(), gui_GetSelElem(), gui_GetSelElemCount(), mcASSERT, mcEmptyElement, and mcET_POLYNOMIAL. Referenced by mcMathMngHelpers::gui_AddSubSel(), and mcMathMngHelpers::gui_MoveSel(). |
|
Returns the selection rectangle in screen coordinates.
Definition at line 981 of file ElementArray.cpp. References data_Get(), gui_CalcSizeOfFirst(), gui_CalcSizeOfRange(), gui_GetCenterLine(), gui_GetSelEnd(), gui_GetSelStart(), gui_GetSpaceBetween(), gui_GetYAnchor(), and mcMIN. Referenced by gui_DrawSelection(). |
|
Returns a pointer to the n-th selected element found inside the expression.
Definition at line 939 of file ElementArray.h. References mcEmptyElement. Referenced by gui_DeleteSelection(), gui_DrawSelection(), and gui_GetSelection(). |
|
Returns the number of the selected elements in the expression.
Definition at line 873 of file ElementArray.h. Referenced by gui_DrawSelection(), mcPolynomialHelpers::gui_ExDraw(), gui_ExOnSelect(), and gui_GetSelection(). |
|
Returns the number of the selected elements in the array of the given type and subtype.
Definition at line 879 of file ElementArray.h. |
|
Returns the index of the n-th selected element found inside the expression.
Definition at line 895 of file ElementArray.h. |
|
Returns the index of the n-th selected element found inside the expression, which match the given type and subtype.
Definition at line 919 of file ElementArray.h. |
|
Definition at line 949 of file ElementArray.h. References mcEmptyElement. |
|
Returns the index of the last selected element contained in the expression, or -1 if there is no selected element.
Definition at line 970 of file ElementArray.h. Referenced by gui_DeleteSelection(), gui_DrawSelectedElements(), mcPolynomialHelpers::gui_ExOnSelect(), gui_ExOnSelect(), and gui_GetSelectionRect(). |
|
Returns the index of the first selected element contained in the expression, or -1 if there is no selected element.
Definition at line 961 of file ElementArray.h. Referenced by gui_DeleteSelection(), gui_DrawSelectedElements(), mcPolynomialHelpers::gui_ExOnSelect(), gui_ExOnSelect(), and gui_GetSelectionRect(). |
|
Returns the number of pixels to leave among the elements of the array. This functions takes by default the mcElementArray::gui_nSpaceBetween variables and divides it by the exponent depth of the array. Definition at line 857 of file ElementArray.cpp. References mcElementHelpers::gui_GetExpDepth(), and gui_GetSpaceBetweenRatio(). Referenced by gui_CalcSizeOfRange(), gui_ExMoveCursorUsingPoint(), gui_GetBB(), and gui_GetSelectionRect(). |
|
Returns the costant which is divided by the exponent depth of this element to get the number of pixels to leave among the elements. Derived classes should override this function to allow personalized values of the 'space between' customizable variable. In fact, if we would have defined here a STATIC INT nSpaceBetween variable, we would have forced the instance of all mcElementArrayGUI-derived classes to have the same 'space between' value. Reimplemented in mcMonomialHelpers, and mcPolynomialHelpers. Definition at line 274 of file ElementArray.h. Referenced by gui_GetSpaceBetween(). |
|
Returns the y amount of this mcElement to subtract from the center line to draw this element.
Reimplemented from mcElementHelpers. Definition at line 1028 of file ElementArray.h. Referenced by gui_GetCenterLine(), and gui_GetSelectionRect(). |
|
Inits the GUI section of this element.
Reimplemented from mcElementHelpers. Reimplemented in mcPolynomialHelpers. Definition at line 308 of file ElementArray.h. References mcElementHelpers::gui_Init(). Referenced by mcPolynomialHelpers::gui_Init(). |
|
This function is called when the cursor is inside the element and the user presses a key (which is not the element's end tag). The way the element should process the given character is dependent to the element type: a mcNumber will insert vk next to the cursor position if vk is a digit. If vk is not acceptable, the function should call the MathCore error-handler function, mcMathCore::Get()->SyntaxError. This function should return one of the values defined for mcInputRes: mcIR_OKAY, mcIR_DELETE_THIS, mcIR_DIRECT_DELETE, mcIR_DELETE_NEXT.
Implements mcElementHelpers. Reimplemented in mcMonomialHelpers, and mcPolynomialHelpers. Definition at line 1435 of file ElementArray.cpp. References mcElementHelpers::data_Check(), data_Get(), data_GetCount(), data_isElementAllowed(), data_MoveElemRight(), mcMathCore::Get(), gui_AddNewElement(), gui_BackInput(), gui_CheckCursorPos(), gui_DoSplit(), mcElement::gui_GetCursorPos(), mcElement::gui_Input(), gui_isEndKey(), mcElementHelpers::gui_isKeyBeginKey(), mcElementHelpers::gui_RecalcSize(), gui_UpdateExpDepth(), mcCursorPos::isBegin(), mcCursorPos::isEnd(), mcCursorPos::isInside(), mcASSERT, mcCP_BEGIN, mcET_INVALID, mcGUILOG, mcIR_OKAY, mcTXTTHIS, mgui_nCursorPos, and mcMathCore::SyntaxError(). Referenced by mcPolynomialHelpers::gui_Input(), and mcMonomialHelpers::gui_Input(). |
|
|
|
Returns TRUE if the given key cannot be handled by the array. This function is called by mcElementArray::gui_isEndChar() function only if the currently focused element in the array cannot handle it. Implemented in mcMonomialHelpers, and mcPolynomialHelpers. Referenced by gui_isEndKey(). |
|
Returns TRUE if the given element is contained in this monomial and it has the focus (that is, the cursor is placed on that element).
Definition at line 865 of file ElementArray.h. |
|
Returns TRUE if the given character marks the end of this element; this function is always called before calling ::gui_Input function. isEndChar can return values dependent from the cursor position. The character is given both as ASCII code and as virtual key code
Implements mcElementHelpers. Definition at line 865 of file ElementArray.cpp. References data_Get(), data_GetCount(), gui_isArrEndKey(), and mgui_nCursorPos. Referenced by gui_Input(). |
|
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.
Implements mcElementHelpers. Definition at line 1549 of file ElementArray.cpp. References data_Get(), data_GetCount(), data_isOp(), gui_CheckCursorPos(), gui_GetCursorPos(), mcElementHelpers::gui_isSelected(), mcElement::gui_MoveCursor(), gui_MoveCursorLeft(), gui_MoveCursorRight(), mcElementHelpers::gui_Select(), mcMCF_LEFT, mcMCF_RIGHT, mcMCR_OKAY, mcMCR_SETFOCUS_ABOVE, mcMCR_SETFOCUS_BELOW, mcMCR_SETFOCUS_NEXT, mcMCR_SETFOCUS_PREVIOUS, and mgui_nCursorPos. |
|
Definition at line 1529 of file ElementArray.cpp. References data_Get(), mcElementHelpers::gui_LetInCursor(), mcCP_END, and mgui_nCursorPos. Referenced by mcMonomialHelpers::gui_BackInput(), and gui_MoveCursor(). |
|
Moves cursor from the current position one step right, skipping elements which return FALSE to the gui_LetInCursor() function.
Definition at line 1539 of file ElementArray.cpp. References data_Get(), data_GetCount(), mcElementHelpers::gui_LetInCursor(), mcCP_BEGIN, and mgui_nCursorPos. Referenced by mcMonomialHelpers::gui_BackInput(), and gui_MoveCursor(). |
|
Moves the cursor inside this element in the closest available position to the given point. The function must use the given point to set its internal cursor-position variables (when this function is called, the given point is always inside the bounding rectangle of the element, but maybe the cursor is not).
Implements mcElementHelpers. Definition at line 1047 of file ElementArray.h. |
|
This function is called when the bounding box of this element intersects with the selection rectangle created by the user with the mouse cursor. The standard implementation just selects this element. If you are implementing a container element, you must override this function and check contained elements' bounding boxes and then call the gui_OnSelect() function of the contained elements whose bounding boxes intersect the given selection rectangle. Reimplemented from mcElementHelpers. Reimplemented in mcPolynomialHelpers. Definition at line 1032 of file ElementArray.h. |
|
Sets the cursor at the beginning of the n-th element.
Definition at line 849 of file ElementArray.h. References mcCP_BEGIN. |
|
Sets the cursor at the end of the n-th element.
Definition at line 856 of file ElementArray.h. References mcCP_END. |
|
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. Implements mcElementHelpers. Reimplemented in mcPolynomialHelpers. Definition at line 1745 of file ElementArray.cpp. References data_Get(), data_GetCount(), data_isArrayEmpty(), data_isOp(), mcElement::gui_SetCursorPos(), mcASSERT, mcCP_BEGIN, mcCP_END, and mgui_nCursorPos. Referenced by mcMonomialHelpers::gui_BackInput(). |
|
Sets the exponent depth of all the elements contained to be the same of the exponent depth of *this.
Reimplemented from mcElementHelpers. Definition at line 1240 of file ElementArray.cpp. References data_Get(), data_GetCount(), mcElement::gui_SetAtSameLevelOf(), and mcElementHelpers::gui_UpdateExpDepth(). Referenced by gui_Input(). |
|
Returns the inlined expression for this element as a wxString. "Inlined expression" means a math representation of the data in a single line: to allow such a restriction (everything must be on one text line), some standard conventions (and many brackets !!!) are used:
Implements mcElementHelpers. Reimplemented in mcPolynomialHelpers. Definition at line 1884 of file ElementArray.cpp. References data_Get(), data_GetCount(), and mcElement::io_GetInlinedExpr(). |
|
Element arrays do not have a special begin/end character in inlined expressions... they are allocated using special rules and thus do not follow the standard mcElement rules. This is why this function always returns FALSE. Implements mcElementHelpers. Definition at line 1571 of file ElementArray.h. |
|
Checks the given tag and, if it is an MROW, returns a null value (the ID of the first mcElementArray-derived class).
Implements mcElementHelpers. Definition at line 1561 of file ElementArray.h. |
|
Creates a temporary operator of the given type and then applies it to the given two elements.
Definition at line 2709 of file ElementArray.cpp. References mcElementHelpers::data_NewElem(), mcOperator::math_Apply(), mcLOG, and mcTXT. |
|
Works like #ApplyOp but uses the mcOperator::ApplySimple instead of the mcOperator::Apply function.
Definition at line 2700 of file ElementArray.cpp. References mcElementHelpers::data_NewElem(), mcOperator::math_ApplySimple(), mcLOG, and mcTXT. Referenced by mcMonomialHelpers::math_SimplifyCoeff(). |
|
Reimplemented in mcMonomialHelpers. Definition at line 1329 of file ElementArray.h. References mcESR_DONE. Referenced by math_Simplify(). |
|
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. Reimplemented in mcMonomialHelpers. Definition at line 2560 of file ElementArray.cpp. References mcElementHelpers::data_GetType(). Referenced by math_CanBeDivBy(), and math_CanBeMultWith(). |
|
Works like #math_CanBemath_AddeWith(), just for divisions.
Implements mcElementHelpers. Definition at line 2570 of file ElementArray.cpp. References math_CanBeAddedWith(). |
|
Works like #math_CanBemath_AddeWith(), just for multiplication.
Implements mcElementHelpers. Definition at line 2573 of file ElementArray.cpp. References math_CanBeAddedWith(). |
|
Compares *this element with the given one and then compare the children of *this and the children of the given element, too. If they are the same, then the function returns TRUE; FALSE otherwise. This function is different from #math_hasSameContentOf() because it doesn't work on MaxSimply()ed copies. This function tipically uses the math_CompareThisOnly() function. Implements mcElementHelpers. Definition at line 2783 of file ElementArray.cpp. References mcElementArray::data_Get(), mcElementArray::data_GetCount(), mcElementArray::data_GetElemIndexOfType(), mcElementArray::data_GetNumOfElemType(), mcElementArray::data_GetOpTypePreceding(), mcElement::data_GetType(), mcElementHelpers::data_GetType(), mcElementArray::data_isOp(), mcElement::math_Compare(), math_PrepareForComparison(), mcFIND_STRICT, mcMATHLOG, mcSWAP, mcTXT, and mcTXTTHIS. Referenced by mcMonomialHelpers::math_DetachNonCommonFactors(), and mcPolynomialHelpers::math_GetIndexOf(). |
|
Compares this element and the given one and then stops, unlike math_Compare() that compares children too.
Reimplemented from mcElementHelpers. Definition at line 2896 of file ElementArray.cpp. |
|
Returns a new mcElementArray element which wraps the given element.
Reimplemented in mcPolynomialHelpers. Definition at line 2576 of file ElementArray.cpp. References mcElementArray::data_AddElements(), mcElementHelpers::data_GetType(), and mcElementHelpers::data_NewElem(). Referenced by mcPolynomialHelpers::math_CreateWrapperFor(), math_SimpleAdd(), math_SimpleDivideBy(), and math_SimpleMultiplyBy(). |
|
Converts from data to math index. See #mcElementArrayMath general description for more info. Implemented in mcMonomialHelpers, and mcPolynomialHelpers. Referenced by mcArrayEntry::math_GetIdx(), math_GetIndexOf(), and math_SimplifyRemoveNeutrals(). |
|
math_Finds the given element among the elements contained directly (that is, without any wrapper: this function is not recursive) and then deletes it from the array. Unlike mcElementArray::data_Delete that matches only the elements with the same identity (the same ID or, it's the same, with the same pointer values), this function uses the #math_CompareWith() function to find the n-th element to delete. This function also shifts the array, thus decrementing the element counter. Returns TRUE if everything is okay; FALSE if the given pointer is not an element contained in this array. Definition at line 2689 of file ElementArray.cpp. References mcElementHelpers::math_NonRecursiveFindInChildren(), and math_Remove(). |
|
Definition at line 1971 of file ElementArray.cpp. References data_DeleteAll(), mcArrayEntry::data_GetRef(), mcElement::data_GetType(), mcExpContainer::data_SetContent(), math_GetPolynomialWrapper(), math_WrapSimple(), mcASSERT, and mcET_BRACKET. Referenced by mcPolynomialHelpers::math_EmbedInBracket(), math_EmbedInBracketAndRaiseTo(), mcPolynomialHelpers::math_FactoreOut(), mcPolynomialHelpers::math_GetLCM(), and mcPolynomialHelpers::math_MultiplyBy(). |
|
Definition at line 1906 of file ElementArray.cpp. References mcArrayEntry::data_GetBracket(), math_EmbedInBracket(), and mcElement::math_RaiseTo(). |
|
Factores-out of the contained elements everything is possible. For mcPolynomials, this means that the GCD among all the factors of the monomials (get through math_GetFactors) will be picked up. For mcMonomials, this means that all the children will be divided by the factors they returned with the math_GetFactors function. Definition at line 1903 of file ElementArray.cpp. References mcArrayEntry::data_GetBracket(), math_EmbedInBracket(), and mcElement::math_RaiseTo(). Referenced by mcPolynomialHelpers::math_RaiseTo(). |
|
Definition at line 2005 of file ElementArray.cpp. References mcElementHelpers::data_Check(), data_DeleteAll(), mcArrayEntry::data_GetRef(), mcElement::data_GetType(), mcFraction::data_SetDen(), mcFraction::data_SetNum(), math_GetPolynomialWrapper(), math_WrapSimple(), mcASSERT, mcET_FRACTION, mcMATHLOG, and mcTXT. Referenced by mcPolynomialHelpers::math_DivideBy(), mcMonomialHelpers::math_DivideBy(), and math_MakeReciprocal(). |
|
Definition at line 1988 of file ElementArray.cpp. References data_DeleteAll(), mcArrayEntry::data_GetRef(), mcElement::data_GetType(), mcExpContainer::data_SetContent(), math_GetPolynomialWrapper(), math_WrapSimple(), mcASSERT, and mcET_RADICAL. Referenced by math_EmbedInRadicalAndRaiseTo(). |
|
Definition at line 1909 of file ElementArray.cpp. References mcArrayEntry::data_GetBracket(), math_EmbedInRadical(), and mcElement::math_RaiseTo(). |
|
Like #EndSimSteps() just for expansion.
Reimplemented in mcPolynomialHelpers. Definition at line 1337 of file ElementArray.h. |
|
This routine is called when we're exiting from the math_Simplify(long flags) function (it's called even if we're exiting with a code different from mcESR_DONE).
Reimplemented in mcMonomialHelpers, and mcPolynomialHelpers. Definition at line 1334 of file ElementArray.h. |
|
Evaluates the numeric value of this element and then returns it. The evaluation can proceed *only* if this element does _not_ contain any parameter or unknown; in case it contains one of these, then the returned value is *mcRealValue::pNAN. Implements mcElementHelpers. Definition at line 2038 of file ElementArray.cpp. References data_Get(), data_isArrayEmpty(), data_isOp(), mcValue::isNAN(), mcValue::isValid(), mcOperator::math_Evaluate(), mcElement::math_Evaluate(), math_Get(), math_GetCount(), math_GetNeutralValue(), math_GetOpBetween(), mcMATHLOG, and mcTXTTHIS. |
|
Definition at line 1353 of file ElementArray.h. References math_Expand. |
|
Expands this element one "step". expanding means that the aim of this function is exactly the opposite of math_Simplify: instead making the function body shorter, it tries to make it as long as possible: (x - 2)^3 . first call to math_Expand x^3 - 6x^2 + 12x -8 Implements mcElementHelpers. |
|
Expands all the elements of the array.
|
|
Definition at line 1330 of file ElementArray.h. References mcESR_DONE. Referenced by math_Simplify(). |
|
Reimplemented in mcPolynomialHelpers. Definition at line 1384 of file ElementArray.h. |
|
This should not be virtual because mcPolynomial will use its own Get() function with a different return type.
Reimplemented in mcPolynomialHelpers. Definition at line 1382 of file ElementArray.h. Referenced by mcMonomialHelpers::math_Add(), math_Evaluate(), math_GetFactors(), mcMonomialHelpers::math_GetGCD(), mcMonomialHelpers::math_GetLCM(), math_GetWrapped(), mcMonomialHelpers::math_RaiseTo(), mcMonomialHelpers::math_RemoveCoeff(), and math_SimplifySolveOp(). |
|
Reimplemented in mcPolynomialHelpers. Definition at line 1387 of file ElementArray.h. Referenced by mcMonomialHelpers::math_Add(), mcMonomialHelpers::math_CanBeAddedWith(), math_Evaluate(), math_GetFactors(), mcMonomialHelpers::math_GetGCD(), mcMonomialHelpers::math_GetLCM(), math_GetMathType(), math_isWrappingOnly(), mcMonomialHelpers::math_MathToDataIdx(), mcMonomialHelpers::math_RaiseTo(), mcMonomialHelpers::math_RemoveCoeff(), and math_SimplifySolveOp(). |
|
Factores-out everything which can be factored out from this element. Returns a mcPolynomial containing a copy of those elements factored-out. This function is CONST since many times not all the factores which can be taken out will be used and thus is caller's duty the modification of this element, eventually calling the math_DivideBy function. Reimplemented from mcElementHelpers. Definition at line 2951 of file ElementArray.cpp. References math_Get(), math_GetCount(), mcElement::math_GetFactors(), mcElement::math_GetGCD(), mcElementArray::math_ResetToOne(), mcMATHLOG, and mcTXT. |
|
Even if this function could seem similar to mcElementArray::data_GetIndexOf, it's not: while data_GetIndexOf works using for comparisons XX, math_GetIndexOf uses the mcElement math_NonRecursiveFindInChildren function which uses math_Compare and math_CompareThisOnly for comparisons. Last difference: math_GetIndex returns a math index instead of a data index. Definition at line 1912 of file ElementArray.cpp. References math_DataToMathIdx(), and mcElementHelpers::math_NonRecursiveFindInChildren(). |
|
An empty array must not be evaluated zero: in this way, the simp/exp algorithms know that an array, even if empty, adds a little bit of complexity...
Implements mcElementHelpers. Definition at line 1369 of file ElementArray.h. |
|
A powerful recognizer function which automatically classifies the type of the math data contained in this class and returns the respective identifier.
Implements mcElementHelpers. Definition at line 2718 of file ElementArray.cpp. References data_Get(), data_isArrayEmpty(), mcMathType::math_ApplyOp(), math_GetCount(), mcElement::math_GetMathType(), math_GetOpTypeBetween(), mcMTL1_POLYNOMIAL, mcMTL2_ALGEBRAIC, and mcMTL3_CONSTANT. |
|
Implemented in mcMonomialHelpers, and mcPolynomialHelpers. Referenced by data_GetOpTypeBetween(), data_GetOpTypePreceding(), and math_Remove(). |
|
Implemented in mcMonomialHelpers, and mcPolynomialHelpers. Referenced by math_Evaluate(), and math_SimplifyRemoveNeutrals(). |
|
Definition at line 2739 of file ElementArray.cpp. References mcElementHelpers::data_GetInstanceOf(), mcElement::data_GetType(), math_GetOpTypeBetween(), and mcASSERT. Referenced by math_Evaluate(). |
|
Definition at line 2747 of file ElementArray.cpp. References mcElementHelpers::data_GetInstanceOf(), mcElement::data_GetType(), math_GetOpTypePreceding(), and mcASSERT. Referenced by mcPolynomialHelpers::math_SimplifySolveOp(), and math_SimplifySolveOp(). |
|
Definition at line 1398 of file ElementArray.h. Referenced by math_GetMathType(), and math_GetOpBetween(). |
|
Definition at line 1401 of file ElementArray.h. Referenced by math_GetOpPreceding(). |
|
Returns a new mcPolynomial containing *this array. mcPolynomial returns a copy of themselves, mcMonomial returns a mcPolynomial containing itself. Implemented in mcMonomialHelpers, and mcPolynomialHelpers. Referenced by math_EmbedInBracket(), math_EmbedInFraction(), and math_EmbedInRadical(). |
|
Returns the element of type
Reimplemented in mcPolynomialHelpers. Definition at line 2172 of file ElementArray.cpp. References math_Get(), math_isWrappingOnly(), and mcEmptyElement. Referenced by math_GetWrappedNumber(), and math_GetWrappedSymbol(). |
|
Returns the number which is wrapped by this array or NAN if this array does not contain a single mcNumber.
Definition at line 1943 of file ElementArray.cpp. References mcNumber::data_Get(), math_GetWrapped(), mcEmptyElement, and mcET_NUMBER. |
|
Returns the symbol which is wrapped by this array or NULL if this array does not contain a single mcSymbol.
Definition at line 1935 of file ElementArray.cpp. References mcSymbol::data_GetProperties(), math_GetWrapped(), mcEmptyElement, and mcET_SYMBOL. |
|
Handles the mcBasicOpRes flag returned by one of mcElementMath basic operations (+,-,*,/).
Definition at line 2364 of file ElementArray.cpp. References data_AddElements(), mcElementHelpers::data_Check(), data_Delete(), data_isOp(), data_MoveElemRight(), mcElementHelpers::data_NewElem(), math_MathToDataIdx(), math_Remove(), mcASSERT, mcBOR_INVALID, mcBOR_REMOVE_OPERAND, mcBOR_REPLACE_OPERAND, mcBOR_REPLACE_OPERAND_AND_SET_ADDOP, mcBOR_REPLACE_OPERAND_AND_SET_DIVOP, mcBOR_REPLACE_OPERAND_AND_SET_MULTOP, mcBOR_REPLACE_OPERAND_AND_SET_SUBOP, mcEmptyElement, mcET_ADDOP, mcET_DIVOP, mcET_INVALID, mcET_MULTOP, mcET_SUBOP, mcMATHLOG, and mcTXTTHIS. Referenced by mcPolynomialHelpers::math_SimplifySolveOp(), and math_SimplifySolveOp(). |
|
Handles the given simplification flag returned by the i-th element of this array.
Reimplemented in mcMonomialHelpers, and mcPolynomialHelpers. Definition at line 2187 of file ElementArray.cpp. References data_AddElements(), data_CheckIndex(), data_Delete(), mcElementArray::data_DetachAll(), mcElementArray::data_GetArray(), mcElementArray::data_GetCount(), mcElementHelpers::data_GetType(), data_MoveElemLeft(), mcASSERT, mcESR_DELETE_THIS, mcESR_DISTRIBUTE, mcESR_DONE, mcESR_INVALID_DATA, mcESR_NOTFINISHED, and mcESR_REPLACE_THIS. Referenced by mcPolynomialHelpers::math_HandleExpSimFlag(), and mcMonomialHelpers::math_HandleExpSimFlag(). |
|
Returns TRUE if this array is containing only a mcNumber.
Definition at line 1475 of file ElementArray.h. References mcET_NUMBER. |
|
Definition at line 1490 of file ElementArray.h. |
|
Definition at line 1488 of file ElementArray.h. |
|
Returns TRUE if this array is containing only an element of the given type.
Reimplemented in mcPolynomialHelpers. Definition at line 2160 of file ElementArray.cpp. References data_Get(), mcElementHelpers::data_GetType(), and math_GetCount(). Referenced by mcMonomialHelpers::math_GetGCD(), and math_GetWrapped(). |
|
Returns TRUE if this array is containing only a mcSymbol.
Definition at line 1478 of file ElementArray.h. References mcET_SYMBOL. |
|
Calculates the reciprocal of this element; tipically, this function creates a mcFraction whose numerator is 1 and the denominator contains *this. This should be the default behaviour. A simple multiplication of the current exponent by -1 should be avoided when possible.
Reimplemented from mcElementHelpers. Definition at line 2080 of file ElementArray.cpp. References math_EmbedInFraction(), and mcBOR_REMOVE_OPERAND. |
|
Converts from math to data index. See #mcElementArrayMath general description for more info. Implemented in mcMonomialHelpers, and mcPolynomialHelpers. Referenced by math_HandleBasicOpRes(), and math_Remove(). |
|
Reimplemented in mcMonomialHelpers. Definition at line 2771 of file ElementArray.cpp. Referenced by math_Compare(). |
|
Definition at line 2755 of file ElementArray.cpp. |
|
Remove the n-th element from the array, creating a mcNumber init with zero (if This function also removes the (eventually present) operator which follows the element. This function is designed to be used by math engine functions; if you want a function which simply removes an element, see #DeleteElement. This function, in fact, not only removes the n-th element; it shifts array left one position, too.
Definition at line 2619 of file ElementArray.cpp. References data_Delete(), data_Get(), mcElementHelpers::data_GetType(), data_isArrayEmpty(), data_isOp(), data_MoveElemLeft(), data_MoveElemRight(), data_Set(), math_GetNeutralOpType(), math_MathToDataIdx(), math_WrapSimple(), mcASSERT, mcET_DIVOP, and mcET_MONOMIAL. Referenced by math_Delete(), mcPolynomialHelpers::math_EmbedInBracket(), math_HandleBasicOpRes(), mcMathMngHelpers::math_Move(), mcMonomialHelpers::math_RemoveCoeff(), and math_SimplifyRemoveNeutrals(). |
|
|
|
Reorders the array. Tipically this operation requires one step only anth thus this function should return always mcESR_DONE, even if this is not required. Implemented in mcMonomialHelpers, and mcPolynomialHelpers. Referenced by math_Simplify(). |
|
Reorders the given array of the given size using the mcElement::math_isListedBeforeOf to perform comparisons.
Definition at line 2088 of file ElementArray.cpp. References mcElement::data_GetType(), mcElementHelpers::data_GetType(), mcElement::math_isListedBeforeOf(), mcASSERT, and mcEmptyElement. Referenced by mcPolynomialHelpers::math_Reorder(), and mcMonomialHelpers::math_Reorder(). |
|
Definition at line 1951 of file ElementArray.cpp. References data_DeleteAll(), math_WrapSimple(), and mcASSERT. |
|
Definition at line 1961 of file ElementArray.cpp. References data_DeleteAll(), math_WrapSimple(), and mcASSERT. |
|
Adds the given element to this element using the math_Add() function and then checking that the return value is mcBOR_REMOVE_OPERAND: that is, the operation was completed successfully and *this now contains the result of the operation. If the math_Add() function does not return mcBOR_REMOVE_OPERAND then an ASSERT fails: use math_SimpleXXXX functions only when you are sure that the operation can be performed without special operations. Reimplemented from mcElementHelpers. Definition at line 2603 of file ElementArray.cpp. References math_CreateWrapperFor(), and mcElementHelpers::math_SimpleAdd(). Referenced by mcMathMngHelpers::gui_AddSubSel(), mcPolynomialHelpers::math_Add(), mcPolynomialHelpers::math_EmbedInBracket(), and mcMathMngHelpers::math_Move(). |
|
Reimplemented from mcElementHelpers. Definition at line 2597 of file ElementArray.cpp. References math_CreateWrapperFor(), and mcElementHelpers::math_SimpleDivideBy(). |
|
Reimplemented from mcElementHelpers. Definition at line 2591 of file ElementArray.cpp. References math_CreateWrapperFor(), and mcElementHelpers::math_SimpleMultiplyBy(). |
|
A mcElementArray will never use the argument of the standard mcElement::math_Simplify(long flags) function, because it will never return mcESR_REPLACE_THIS flag... this little function helps to write readable code. Reimplemented in mcPolynomialHelpers. Definition at line 1352 of file ElementArray.h. |
|
Simplifies this element one "step"; that is, after one call to this function the element must be slightly changed. For example, this monomial requires three calls to math_Simplify to be completely reduced in a basic form: 12ax*3 + 4a/(x^-1) . first call to math_Simplify 36ax + 4a/(1/x) . second call 36ax + 4ax . third call 40ax
Implements mcElementHelpers. Reimplemented in mcPolynomialHelpers. Definition at line 2473 of file ElementArray.cpp. References mcElementHelpers::data_Check(), data_Repair(), math_BeginSimSteps(), math_FinalSimSteps(), math_Reorder(), math_SimplifyAll(), math_SimplifyExp(), math_SimplifyRemoveNeutrals(), math_SimplifySolveOp(), mcESR_DONE, mcMATHLOG, mcTXTTHIS, and SIMCHECK_EXIT. Referenced by mcPolynomialHelpers::math_Simplify(). |
|
Simplifies all the elements of the array.
Referenced by math_Simplify(). |
|
Expands those elements which contain symbols in common.
Referenced by math_Simplify(). |
|
Returns TRUE if the n-th element must be expanded in order to simplify this array. This function works in data coord. |
|
Removes all the neutral elements from the array, using the #GetNeutralValue and the #GetNeutralOpType functions.
Definition at line 2330 of file ElementArray.cpp. References data_Get(), data_GetCount(), math_DataToMathIdx(), mcElementHelpers::math_EvaluatesTo(), math_GetNeutralValue(), math_Remove(), mcESR_DONE, mcESR_NOTFINISHED, mcLOG, and mcMATHLOG. Referenced by math_Simplify(). |
|
Applies all the operators which can be applied on the elements of the array.
Reimplemented in mcPolynomialHelpers. Definition at line 2427 of file ElementArray.cpp. References mcOperator::math_Apply(), math_Get(), math_GetCount(), math_GetOpPreceding(), math_HandleBasicOpRes(), mcBOR_INVALID, mcEmptyElement, mcESR_DONE, mcESR_NOTFINISHED, mcMATHLOG, mcTXT, and mcTXTTHIS. Referenced by math_Simplify(). |
|
Implemented in mcMonomialHelpers, and mcPolynomialHelpers. |
|
Definition at line 1929 of file ElementArray.cpp. References math_WrapSimple(). |
|
Implemented in mcMonomialHelpers, and mcPolynomialHelpers. Referenced by math_EmbedInBracket(), math_EmbedInFraction(), math_EmbedInRadical(), math_Remove(), math_ResetToOne(), math_ResetToZero(), math_WrapNumber(), and math_WrapSymbol(). |
|
Definition at line 1922 of file ElementArray.cpp. References math_WrapSimple(), and mcASSERT. |
|
Definition at line 218 of file ElementArray.h. Referenced by mcPolynomialHelpers::math_GetIndexOf(), mcPolynomialHelpers::math_WrapMonomial(), mcMonomialHelpers::math_WrapMonomial(), and mcMonomialHelpers::math_WrapSimple(). |
|
Number of mcElements currently inserted in the mdata_pElemArray array.
Definition at line 234 of file ElementArray.h. Referenced by data_AddElements(), data_DeleteAll(), data_DeleteLast(), data_DetachAll(), data_DetachLastElem(), data_isSameAs(), data_MoveElemLeft(), and data_MoveElemRight(). |
|
Used to remember the upper bound of the m_pElem array and thus to avoid the use of non-allocated memory.
Definition at line 229 of file ElementArray.h. Referenced by data_CheckArrayLimit(), data_DeleteAll(), and data_DetachAll(). |
|
Pointer to the array of mcElements; double deference is required for special operations like array enlargment.
Definition at line 225 of file ElementArray.h. Referenced by data_CheckArrayLimit(), data_DeepCopy(), data_DeleteAll(), data_DetachAll(), data_MoveElemLeft(), data_MoveElemRight(), data_Set(), and data_Swap(). |
|
The filter which is attached to this array. If NULL, filtering is disabled. Definition at line 238 of file ElementArray.h. Referenced by data_ChangeFilter(), data_DeepCopy(), and data_isElementAllowed(). |
|
Index of the element which contains the cursor (mgui_nCursorPos cannot index an operator of the array, it must always index a non-operator element).
Definition at line 251 of file ElementArray.h. Referenced by gui_DeleteNextOp(), gui_DeletePreviousOp(), gui_ExGetRelCursorPos(), gui_ExMoveCursorUsingPoint(), gui_GetCursorPos(), gui_Input(), gui_isEndKey(), gui_MoveCursor(), gui_MoveCursorLeft(), gui_MoveCursorRight(), and gui_SetCursorPos(). |
|
If TRUE, then the selection will be drawn inverting the colours of the selected elements (this is the standard behaviour in all editing systems). If FALSE, then the sgui_pSelectionPen and the mcElementHelpers::sgui_pSelectionBrush will be used to draw the border and the interior of the selection rectangle. Definition at line 78 of file ElementArray.cpp. Referenced by gui_DrawSelection(). |
|
The pen used to draw the selection rectangle. By default, mcElementArrayGUI constructor builds a black pen. Definition at line 77 of file ElementArray.cpp. Referenced by gui_DrawSelection(). |
[ Top ] |