Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

mcDecorationHelpers Class Reference

#include <Decoration.h>

Inheritance diagram for mcDecorationHelpers:

Inheritance graph
[legend]
Collaboration diagram for mcDecorationHelpers:

Collaboration graph
[legend]
List of all members.

Detailed Description

A little class containing the DATA, MATH, GUI and IO sections of this element (as instances and not pointers).

This is entirely defined & implemented through macros.

Definition at line 54 of file Decoration.h.

Public Member Functions

const mcElementdata_GetConstChild (int n) const
 mcDecorationHelpers have no children (by default).
 mcDecorationHelpers ()
virtual ~mcDecorationHelpers ()
void data_DeepCopy (const mcElementHelpers *p)
 Deep copies all the info contained in this class.
mcExpSimRes math_Simplify (long flags, mcElement *)
 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 *)
 Expands this element one "step".
bool math_CanBeAddedWith (const mcElement &p) const
 Returns TRUE if this element can be added with the given element.
bool math_CanBeMultWith (const mcElement &p) const
 Works like #math_CanBemath_AddeWith(), just for multiplication.
bool math_CanBeDivBy (const mcElement &p) const
 Works like #math_CanBemath_AddeWith(), just for divisions.
virtual mcBasicOpRes math_Add (const mcElement &, mcElement *p, bool add)
 Sums or subtracts this element with the given e element.
virtual mcBasicOpRes math_Subtract (const mcElement &, mcElement *p)
 math_s two mcElements of the same type and stores the result in this object.
virtual mcBasicOpRes math_MultiplyBy (const mcElement &, mcElement *p)
 Multiplies two mcElements of the same type and stores the result in this object.
virtual mcBasicOpRes math_DivideBy (const mcElement &, mcElement *p)
 Divides two mcElements of the same type and stores the result in this object.
void math_SetExp (const mcPolynomial &p)
 Sets the exponent of this element to match the given polynomial.
mcBasicOpRes math_MakeReciprocal (mcElement *e)
 Calculates the reciprocal of this element; tipically, this function creates a mcFraction whose numerator is 1 and the denominator contains *this.
mcBasicOpRes math_RaiseTo (const mcPolynomial &)
 Raises *this element to the given polynomial.
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_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.
mcRealValue math_Evaluate () const
 Evaluates the numeric value of this element and then returns it.
mcRealValue math_GetLenght () const
 Returns the 'lenght' of this element without taking in count its children.
int math_GetOrderPos () const
 Returns the order position for this element.
mcMonomial math_GetLCM (const mcElement &) const
 Returns the LCM between *this and the given element.
mcMonomial math_GetGCD (const mcElement &) const
bool io_isBeginTag (const wxXml2Node &tag) const
 Returns a positive value if the given MathML content tag marks the begin of this element; FALSE otherwise.
bool io_isBeginChar (const wxString &str) const
 Returns a positive value if the given inlined expression marks the begin of this element; FALSE otherwise.
wxXml2Node io_GetMathML (bool bGetPresentation) const
 Returns the MathML code for this element as presentation markup (http://www.w3.org/TR/MathML2/chapter3.html) or as content markup (http://www.w3.org/TR/MathML2/chapter4.html).
wxString io_GetInlinedExpr () const
 Returns the inlined expression for this element as a wxString.
bool io_ImportPresentationMathML (wxXml2Node tag, wxString &pErr)
 Imports presentation MathML reading the contents of the given XML node (without modifying it).
bool io_ImportInlinedExpr (const wxString &str, int *count, wxString &pErr)
 Imports an inlined expression.
mcElementGUI overloaded functions
Implements the behaviour of a general decoration element.

bool gui_isBeginKey (const mcKey &key) const
 Always returns FALSE: decorations generally are created by the program itself...
bool gui_isEndKey (const mcKey &key) const
 Always returns FALSE: mcEmptyBox::gui_Input function handles all the keypresses returning mcIR_DELETE_this-> Empty boxes infact, should always be replaced by a new class.
mcInputRes gui_Input (const mcKey &key, mcElement *pnew)
 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).
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).
mcInsertRes gui_Insert (const mcElement &, mcElement *)
 Inserts the given element at the right of the cursor position.
int gui_MoveCursorUsingPoint (wxDC &dc, const wxPoint &p)
 Moves the cursor inside this element in the closest available position to the given point.
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.
void gui_SetCursorPos (const mcCursorPos &code)
 Sets the cursor position inside the element using Cursor Position flags.
void gui_GetCursorPos (mcCursorPos &) const
 Returns the cursor position as Cursor Position flag.
mcCursorPos gui_GetCursorPos () const
 Returns the cursor position after creating mcCursorPos.

Protected Member Functions

void gui_Init ()
 Inits this section of the element.

Protected Attributes

int mgui_nCursorPos


Constructor & Destructor Documentation

mcDecorationHelpers::mcDecorationHelpers  )  [inline]
 

Definition at line 80 of file Decoration.h.

virtual mcDecorationHelpers::~mcDecorationHelpers  )  [inline, virtual]
 

Definition at line 81 of file Decoration.h.


Member Function Documentation

void mcDecorationHelpers::data_DeepCopy const mcElementHelpers p  )  [inline, virtual]
 

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 mcOperatorHelpers, mcParenthesisHelpers, and mcTextHelpers.

Definition at line 97 of file Decoration.h.

References mcElementHelpers::data_DeepCopy(), and mgui_nCursorPos.

Referenced by mcParenthesisHelpers::data_DeepCopy(), and mcOperatorHelpers::data_DeepCopy().

const mcElement& mcDecorationHelpers::data_GetConstChild int  n  )  const [inline, virtual]
 

mcDecorationHelpers have no children (by default).

Reimplemented from mcElementHelpers.

Reimplemented in mcTextHelpers.

Definition at line 60 of file Decoration.h.

References mcEmptyElement.

mcCursorPos mcDecorationHelpers::gui_GetCursorPos  )  const [inline, virtual]
 

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 139 of file Decoration.h.

References mcElementHelpers::gui_GetCursorPos().

Referenced by gui_GetRelCursorPos(), and gui_MoveCursor().

void mcDecorationHelpers::gui_GetCursorPos mcCursorPos  )  const [virtual]
 

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.

Reimplemented in mcEmptyBoxHelpers, mcOperatorHelpers, and mcTextHelpers.

Definition at line 136 of file Decoration.cpp.

References mcCursorPos::gui_Push(), mcCP_BEGIN, mcCP_END, mcDECORATION_LEFT, mcDECORATION_RIGHT, and mgui_nCursorPos.

int mcDecorationHelpers::gui_GetRelCursorPos wxDC &  dc,
wxPoint *  pt
const [virtual]
 

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.

Parameters:
dc The device context where the element was drawn last time.
pt The coordinates, relative to the element (assume the element placed at 0;0), indicating the top-left point of the cursor.

Implements mcElementHelpers.

Reimplemented in mcEmptyBoxHelpers, mcOperatorHelpers, and mcTextHelpers.

Definition at line 116 of file Decoration.cpp.

References gui_GetCursorPos(), mcElementHelpers::gui_GetHeight(), mcElementHelpers::gui_GetWidth(), and mcCursorPos::isBegin().

void mcDecorationHelpers::gui_Init  )  [inline, protected, virtual]
 

Inits this section of the element.

Acts like a constructor (it's called by mcElementHelpers).

Reimplemented from mcElementHelpers.

Reimplemented in mcTextHelpers.

Definition at line 86 of file Decoration.h.

References mcElementHelpers::gui_Init(), and mcDECORATION_RIGHT.

Referenced by mcTextHelpers::gui_Init().

mcInputRes mcDecorationHelpers::gui_Input const mcKey key,
mcElement pnew
[virtual]
 

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.

Parameters:
ev The wxWidgets key event for the keypress. It contains the untraslated code for the input key; see wxWidgets KeyCodes for more info.
newelem If the function returns mcIR_REPLACE_THIS, the caller will use this pointer as a substitute for this element (which will be deleted).

Implements mcElementHelpers.

Reimplemented in mcEmptyBoxHelpers, mcOperatorHelpers, mcParenthesisHelpers, and mcTextHelpers.

Definition at line 69 of file Decoration.cpp.

References mcElementHelpers::data_AddProperty(), mcElementHelpers::data_hasProperty(), mcMathCore::Get(), mcElementHelpers::gui_RecalcSize(), mcMathCore::m_pCancelKey, mcKey::MatchKey(), mcEP_INITIALIZED, mcIR_DELETE_THIS, and mcIR_OKAY.

Referenced by mcParenthesisHelpers::gui_Input().

mcInsertRes mcDecorationHelpers::gui_Insert const mcElement ,
mcElement
[inline, virtual]
 

Inserts the given element at the right of the cursor position.

Implements mcElementHelpers.

Reimplemented in mcEmptyBoxHelpers.

Definition at line 133 of file Decoration.h.

References mcINSR_OKAY.

bool mcDecorationHelpers::gui_isBeginKey const mcKey key  )  const [inline, virtual]
 

Always returns FALSE: decorations generally are created by the program itself...

Implements mcElementHelpers.

Reimplemented in mcEmptyBoxHelpers, mcMultDivOpHelpers, mcOperatorHelpers, mcParenthesisHelpers, and mcTextHelpers.

Definition at line 122 of file Decoration.h.

bool mcDecorationHelpers::gui_isEndKey const mcKey key  )  const [virtual]
 

Always returns FALSE: mcEmptyBox::gui_Input function handles all the keypresses returning mcIR_DELETE_this-> Empty boxes infact, should always be replaced by a new class.

Implements mcElementHelpers.

Reimplemented in mcEmptyBoxHelpers, mcOperatorHelpers, and mcTextHelpers.

Definition at line 62 of file Decoration.cpp.

mcMoveCursorRes mcDecorationHelpers::gui_MoveCursor mcMoveCursorFlag  flag,
long  modifiers
[virtual]
 

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.

Parameters:
flag One of the Move Cursor flags (see MathTypes.h)

Implements mcElementHelpers.

Reimplemented in mcEmptyBoxHelpers, mcOperatorHelpers, and mcTextHelpers.

Definition at line 90 of file Decoration.cpp.

References gui_GetCursorPos(), mcDECORATION_LEFT, mcDECORATION_RIGHT, mcMCF_DOWN, mcMCF_LEFT, mcMCF_RIGHT, mcMCF_UP, mcMCR_OKAY, mcMCR_SETFOCUS_ABOVE, mcMCR_SETFOCUS_BELOW, mcMCR_SETFOCUS_NEXT, mcMCR_SETFOCUS_PREVIOUS, and mgui_nCursorPos.

int mcDecorationHelpers::gui_MoveCursorUsingPoint wxDC &  dc,
const wxPoint &  p
[virtual]
 

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).

Parameters:
dc The device context where the element was drawn last time
p a valid pointer to a wxPoint (containing coord. relative to the top-left point of the element) which must be used to find the selected subelement; otherwise this is a NULL value

Implements mcElementHelpers.

Reimplemented in mcEmptyBoxHelpers, mcOperatorHelpers, and mcTextHelpers.

Definition at line 107 of file Decoration.cpp.

References mcDECORATION_LEFT, mcDECORATION_RIGHT, mcMCR_OKAY, and mgui_nCursorPos.

void mcDecorationHelpers::gui_SetCursorPos const mcCursorPos code  )  [virtual]
 

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 mcEmptyBoxHelpers, mcOperatorHelpers, and mcTextHelpers.

Definition at line 128 of file Decoration.cpp.

References mcDECORATION_LEFT, mcDECORATION_RIGHT, and mgui_nCursorPos.

wxString mcDecorationHelpers::io_GetInlinedExpr  )  const [virtual]
 

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:

  • "^" introduces an exponent
  • "_" introduces a subscript Some examples of inlined expressions are: "4x^2+5a*sin(x/4)", "cos^2(PI/2)+ (123ax+b)/c >= 0", ....

Implements mcElementHelpers.

Reimplemented in mcEmptyBoxHelpers, mcOperatorHelpers, and mcTextHelpers.

Definition at line 161 of file Decoration.cpp.

wxXml2Node mcDecorationHelpers::io_GetMathML bool  bGetPresentation  )  const [virtual]
 

Returns the MathML code for this element as presentation markup (http://www.w3.org/TR/MathML2/chapter3.html) or as content markup (http://www.w3.org/TR/MathML2/chapter4.html).

Parameters:
bGetPresentation TRUE if you want to get the presentation markup, FALSE if you want the content MathML.
Returns:
The XML tree containing the MathML code for this element.

Implements mcElementHelpers.

Reimplemented in mcEmptyBoxHelpers, mcMultDivOpHelpers, mcOperatorHelpers, and mcTextHelpers.

Definition at line 152 of file Decoration.cpp.

References mcUNUSED.

bool mcDecorationHelpers::io_ImportInlinedExpr const wxString &  str,
int *  count,
wxString &  pErr
[virtual]
 

Imports an inlined expression.

"Inlined expression" means a string containing an encoded representation of math data: 234^2*ax+6y/2=0 is an inlined expression. This is the form which is used to input and output math data by a lot of math programs. Compability with these programs is crucial. However, because of the nature of this representation, the algorithm which recognizes (through io_isBeginChar functions) the elements to create, needs to know the lenght of the token which encodes this element; this is accomplished with the count parameter which must *absolutely* be set by this function.

Parameters:
str The string containing the inlined expression to import.
count A pointer where is stored the number of characters of str imported by this function.
pErr The string where the error description is placed, if the function returns FALSE.
Returns:
TRUE on success: the first (and eventually the following) characters of the given string represent an encoded inline expression of this element and they were successfully recognized and imported.

Implements mcElementHelpers.

Reimplemented in mcOperatorHelpers, mcParenthesisHelpers, and mcTextHelpers.

Definition at line 180 of file Decoration.cpp.

bool mcDecorationHelpers::io_ImportPresentationMathML wxXml2Node  tag,
wxString &  pErr
[virtual]
 

Imports presentation MathML reading the contents of the given XML node (without modifying it).

This function is called only if io_isBeginTag function returns a positive value for the name of parent tag of pTag.

Parameters:
pTag The wxXML_***_NODE class to parse.
pErr The string where the error description is placed, if the function returns FALSE.
Returns:
TRUE on success (no mismatched or invalid tags).

Implements mcElementHelpers.

Reimplemented in mcEmptyBoxHelpers, mcMultDivOpHelpers, mcOperatorHelpers, mcParenthesisHelpers, and mcTextHelpers.

Definition at line 167 of file Decoration.cpp.

References mcASSERT.

bool mcDecorationHelpers::io_isBeginChar const wxString &  str  )  const [inline, virtual]
 

Returns a positive value if the given inlined expression marks the begin of this element; FALSE otherwise.

The begin tag cannot be dependent from any variable; it must be always the same.

Implements mcElementHelpers.

Reimplemented in mcOperatorHelpers, mcParenthesisHelpers, and mcTextHelpers.

Definition at line 196 of file Decoration.h.

bool mcDecorationHelpers::io_isBeginTag const wxXml2Node &  tag  )  const [inline, virtual]
 

Returns a positive value if the given MathML content tag marks the begin of this element; FALSE otherwise.

The begin tag cannot be dependent from any variable; it must be always the same.

Parameters:
tag The string containing the TAG to test.
Returns:
A value identifying the subclass of this element that matched the given character; if the element has no subclasses it should return a null value when the given character is the begin character of the element. See MathCore::NewElem for more info

Implements mcElementHelpers.

Reimplemented in mcEmptyBoxHelpers, mcOperatorHelpers, mcParenthesisHelpers, and mcTextHelpers.

Definition at line 190 of file Decoration.h.

virtual mcBasicOpRes mcDecorationHelpers::math_Add const mcElement ,
mcElement p,
bool  add
[inline, virtual]
 

Sums or subtracts this element with the given e element.

A unique function for add/subtract operations is used because the algorithms used to handle this two operations are usually almost identic and thus this avoids a lot of repetitions.

If the two elements cannot be summed, then an ASSERT should fail since before using this function, the caller should always use the math_CanBeAddedWith() function.

The function returns one of mcBasicOpRes values, eventually using the pp pointer to store the replacement element which will be used by the caller in case this function returns mcBOR_REPLACE_OPERAND or mcBOR_REPLACE_BOTH.

Implements mcElementHelpers.

Definition at line 158 of file Decoration.h.

References mcBOR_REMOVE_OPERAND.

bool mcDecorationHelpers::math_CanBeAddedWith const mcElement p  )  const [inline, virtual]
 

Returns TRUE if this element can be added with the given element.

If the function returns TRUE, then the math_Add() function should return one of mcBOR_REMOVE_OPERAND, mcBOR_REPLACE_BOTH or mcBOR_REPLACE_OPERAND.

Implements mcElementHelpers.

Definition at line 154 of file Decoration.h.

bool mcDecorationHelpers::math_CanBeDivBy const mcElement p  )  const [inline, virtual]
 

Works like #math_CanBemath_AddeWith(), just for divisions.

Implements mcElementHelpers.

Definition at line 156 of file Decoration.h.

bool mcDecorationHelpers::math_CanBeMultWith const mcElement p  )  const [inline, virtual]
 

Works like #math_CanBemath_AddeWith(), just for multiplication.

Implements mcElementHelpers.

Definition at line 155 of file Decoration.h.

bool mcDecorationHelpers::math_Compare const mcElement p,
long  flags
const [inline, virtual]
 

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.

Reimplemented in mcOperatorHelpers.

Definition at line 170 of file Decoration.h.

virtual mcBasicOpRes mcDecorationHelpers::math_DivideBy const mcElement ,
mcElement p
[inline, virtual]
 

Divides two mcElements of the same type and stores the result in this object.

Parameters:
p A pointer to a mcElement of the same type of this mcElement, which will be used to divide this mcElement.

Implements mcElementHelpers.

Definition at line 161 of file Decoration.h.

References mcBOR_REMOVE_OPERAND.

mcRealValue mcDecorationHelpers::math_Evaluate  )  const [inline, virtual]
 

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 173 of file Decoration.h.

mcExpSimRes mcDecorationHelpers::math_Expand long  flags,
mcElement
[inline, virtual]
 

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.

Definition at line 151 of file Decoration.h.

References mcESR_DONE.

mcMonomial mcDecorationHelpers::math_GetGCD const mcElement  )  const [virtual]
 

Implements mcElementHelpers.

Definition at line 195 of file Decoration.cpp.

References mcEmptyElement.

mcMonomial mcDecorationHelpers::math_GetLCM const mcElement  )  const [virtual]
 

Returns the LCM between *this and the given element.

Implements mcElementHelpers.

Definition at line 198 of file Decoration.cpp.

References mcEmptyElement.

mcRealValue mcDecorationHelpers::math_GetLenght  )  const [inline, virtual]
 

Returns the 'lenght' of this element without taking in count its children.

The wxT('lenght') of this element is the 'complexity' represented by the data placed in the mcElementData of this element. This is a key function for the simplify and expand routines of MathCore because through the use of this value, the system is able to decide if an operation determines a simplification or a complication. The simple example below shows how this can be done:

          mcPolynomial mypol(NULL);
          mypol.Init("2^16");
          mcRealValue n1 = mypol.math_GetTotalLenght(); */

(The math_GetTotalLenght() function works using this function !) The default implementation returns zero. This is a valid behaviour only for container elements, that is, for those elements where only the children carry information. For simple elements and for those containers which stand for an operation (like mcFraction which implies a division), the default implementation must be overridden.

A lenght/complexity of 1 means that this element would require only a single byte of memory if stored in an ASCII string. An element long 2 units (like mcBracket) would require 2 bytes (one for the left parenthesis and one for the right one)...

Implements mcElementHelpers.

Reimplemented in mcOperatorHelpers.

Definition at line 174 of file Decoration.h.

mcMathType mcDecorationHelpers::math_GetMathType  )  const [inline, virtual]
 

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 167 of file Decoration.h.

References mcMTL1_POLYNOMIAL, mcMTL2_ALGEBRAIC, and mcMTL3_CONSTANT.

int mcDecorationHelpers::math_GetOrderPos  )  const [inline, virtual]
 

Returns the order position for this element.

Implements mcElementHelpers.

Definition at line 177 of file Decoration.h.

mcBasicOpRes mcDecorationHelpers::math_MakeReciprocal mcElement e  )  [inline, virtual]
 

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.

Note:
The math_RaiseTo function could be used instead of this one but this function should be preferred over math_RaiseTo(mcPolynomial(-1)); because this function ?????????? FIXME

Reimplemented from mcElementHelpers.

Definition at line 164 of file Decoration.h.

References mcBOR_REMOVE_OPERAND.

virtual mcBasicOpRes mcDecorationHelpers::math_MultiplyBy const mcElement ,
mcElement p
[inline, virtual]
 

Multiplies two mcElements of the same type and stores the result in this object.

Parameters:
p A pointer to a mcElement of the same type of this mcElement, which will be multiplied with this mcElement.

Implements mcElementHelpers.

Definition at line 160 of file Decoration.h.

References mcBOR_REMOVE_OPERAND.

mcBasicOpRes mcDecorationHelpers::math_RaiseTo const mcPolynomial  )  [inline, virtual]
 

Raises *this element to the given polynomial.

Returns mcBOR_INVALID if the operation could not be performed (this is typically because the base is negative), or mcBOR_REMOVE_OPERAND if the operation was okay.

Note:
All MathCore elements must implement this function, not only mcExpElement-derived classes because this operation *must* be feasible on every element: those elements which do not hold an exponent, must raise their children directly. mcFraction, for example, must implement this operation directly raising the numerator & denominator.

Implements mcElementHelpers.

Definition at line 165 of file Decoration.h.

References mcBOR_REMOVE_OPERAND.

void mcDecorationHelpers::math_SetExp const mcPolynomial p  )  [inline, virtual]
 

Sets the exponent of this element to match the given polynomial.

As for math_RaiseTo, for elements which do not have an exponent by their own, this function should just call the children's math_SetExp functions.

Reimplemented from mcElementHelpers.

Definition at line 163 of file Decoration.h.

mcExpSimRes mcDecorationHelpers::math_Simplify long  flags,
mcElement
[inline, virtual]
 

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

Returns:
Returns TRUE if the element is completely simplied and thus, the following calls to math_Simplify won't have effect.

Implements mcElementHelpers.

Definition at line 150 of file Decoration.h.

References mcESR_DONE.

virtual mcBasicOpRes mcDecorationHelpers::math_Subtract const mcElement ,
mcElement p
[inline, virtual]
 

math_s two mcElements of the same type and stores the result in this object.

Reimplemented from mcElementHelpers.

Definition at line 159 of file Decoration.h.

References mcBOR_REMOVE_OPERAND.


Member Data Documentation

int mcDecorationHelpers::mgui_nCursorPos [protected]
 

Reimplemented in mcTextHelpers.

Definition at line 69 of file Decoration.h.

Referenced by data_DeepCopy(), gui_GetCursorPos(), gui_MoveCursor(), gui_MoveCursorUsingPoint(), and gui_SetCursorPos().


The documentation for this class was generated from the following files:

Documentation generated with Doxygen on Sun Feb 6 17:12:24 2005
Visit MathStudio home page for more info

[ Top ]