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

mcMultDivOpHelpers Class Reference

#include <MultDivOp.h>

Inheritance diagram for mcMultDivOpHelpers:

Inheritance graph
[legend]
Collaboration diagram for mcMultDivOpHelpers:

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 52 of file MultDivOp.h.

Public Member Functions

 mcMultDivOpHelpers ()
virtual ~mcMultDivOpHelpers ()
bool data_isMultOp () const
bool data_isDivOp () const
bool gui_isBeginKey (const mcKey &) const
 Always returns FALSE: decorations generally are created by the program itself...
int gui_Draw (wxDC &hDC, int Offsetx, int Offsety, long flags, const wxPoint &) 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.
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.
bool math_CanBeApplied (const mcElement &, const mcElement &) const
 Returns TRUE if this operator can be applied on the two given elements.
mcRealValue math_Evaluate (mcRealValue v1, mcRealValue v2) const
 Applies the operator on the two given values and then returns it.
mcBasicOpRes math_ApplySimple (mcElement &m1, const mcElement &m2) const
 Works like #Apply but uses the mcElement::math_SimpleAdd/Mult/Div functions and thus does not take the pointer-to-pointer argument.
mcBasicOpRes math_Apply (mcElement &, const mcElement &, mcElement *) const
 Applies this operator on the left and right monomials.
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).
bool io_ImportPresentationMathML (wxXml2Node tag, wxString &pErr)
 Imports presentation MathML reading the contents of the given XML node (without modifying it).

Static Public Attributes

static bool sgui_bUseColon = TRUE
 If TRUE, a colon (wxT(";")) is used instead of "/" when rendering mcDivOps.

Private Member Functions

 mcDEFINE_REFERENCE_DATA (mcMultDivOp, mdata_nType)


Constructor & Destructor Documentation

mcMultDivOpHelpers::mcMultDivOpHelpers  )  [inline]
 

Definition at line 67 of file MultDivOp.h.

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

Definition at line 68 of file MultDivOp.h.


Member Function Documentation

bool mcMultDivOpHelpers::data_isDivOp  )  const [inline]
 

Definition at line 75 of file MultDivOp.h.

References mcElement::data_GetType(), and mcET_DIVOP.

Referenced by gui_Draw().

bool mcMultDivOpHelpers::data_isMultOp  )  const [inline]
 

Definition at line 74 of file MultDivOp.h.

References mcElement::data_GetType(), and mcET_MULTOP.

Referenced by gui_isBeginKey(), math_Apply(), math_ApplySimple(), and math_CanBeApplied().

void mcMultDivOpHelpers::gui_DoRecalcSize  )  [virtual]
 

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.

Note:
It's very important, to maintain the size member updated, to call, in the other mcElement functions, gui_RecalcSize() every time size could have changed (for example, in gui_Input(), mcElementData setters...).

Reimplemented from mcOperatorHelpers.

Definition at line 99 of file MultDivOp.cpp.

References mcOperatorHelpers::gui_DoRecalcSize().

int mcMultDivOpHelpers::gui_Draw wxDC &  hDC,
int  Offsetx,
int  Offsety,
long  flags,
const wxPoint & 
const [virtual]
 

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.

Returns:
The ID of the element marked as active (the element which is drawn with mcElementHelpers::sgui_m_pActivationBrush as background), or mcDRW_NOACTIVEELEM flag if this element does not contain the mouse cursor.

Reimplemented from mcOperatorHelpers.

Definition at line 113 of file MultDivOp.cpp.

References mcElementHelpers::data_GetID(), mcOperatorHelpers::data_GetOpSymbol(), data_isDivOp(), mcOperatorHelpers::gui_GetRealSize(), mcElementHelpers::gui_SelectStyle(), mcDRW_NONACTIVE, mcMIN, and sgui_bUseColon.

bool mcMultDivOpHelpers::gui_isBeginKey const mcKey key  )  const [virtual]
 

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

Reimplemented from mcOperatorHelpers.

Definition at line 86 of file MultDivOp.cpp.

References mcOperatorHelpers::data_GetOpSymbol(), data_isMultOp(), mcOperatorHelpers::gui_isBeginKey(), and SHIFT_KEY.

wxXml2Node mcMultDivOpHelpers::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.

Reimplemented from mcOperatorHelpers.

Definition at line 155 of file MultDivOp.cpp.

bool mcMultDivOpHelpers::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).

Reimplemented from mcOperatorHelpers.

Definition at line 170 of file MultDivOp.cpp.

References mcASSERT.

mcBasicOpRes mcMultDivOpHelpers::math_Apply mcElement ,
const mcElement ,
mcElement
const [virtual]
 

Applies this operator on the left and right monomials.

Returns:
TRUE if the right monomial can be deleted.

Implements mcOperatorHelpers.

Definition at line 214 of file MultDivOp.cpp.

References data_isMultOp(), math_CanBeApplied(), and mcBOR_INVALID.

mcBasicOpRes mcMultDivOpHelpers::math_ApplySimple mcElement m1,
const mcElement m2
const [virtual]
 

Works like #Apply but uses the mcElement::math_SimpleAdd/Mult/Div functions and thus does not take the pointer-to-pointer argument.

Implements mcOperatorHelpers.

Definition at line 201 of file MultDivOp.cpp.

References data_isMultOp(), math_CanBeApplied(), mcBOR_INVALID, and mcBOR_REMOVE_OPERAND.

bool mcMultDivOpHelpers::math_CanBeApplied const mcElement ,
const mcElement
const [virtual]
 

Returns TRUE if this operator can be applied on the two given elements.

For non-commutative operators, the order is important: the first given pointer is the left operand while the second is the right one.

Implements mcOperatorHelpers.

Definition at line 194 of file MultDivOp.cpp.

References data_isMultOp().

Referenced by math_Apply(), and math_ApplySimple().

mcRealValue mcMultDivOpHelpers::math_Evaluate mcRealValue  v1,
mcRealValue  v2
const [inline, virtual]
 

Applies the operator on the two given values and then returns it.

Implements mcOperatorHelpers.

Definition at line 101 of file MultDivOp.h.

mcMultDivOpHelpers::mcDEFINE_REFERENCE_DATA mcMultDivOp  ,
mdata_nType 
[private]
 


Member Data Documentation

bool mcMultDivOpHelpers::sgui_bUseColon = TRUE [static]
 

If TRUE, a colon (wxT(";")) is used instead of "/" when rendering mcDivOps.

Definition at line 55 of file MultDivOp.cpp.

Referenced by gui_Draw().


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

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

[ Top ]