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

mcExpContainerHelpers Class Reference

#include <ExpContainer.h>

Inheritance diagram for mcExpContainerHelpers:

Inheritance graph
[legend]
Collaboration diagram for mcExpContainerHelpers:

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 ExpContainer.h.

Public Member Functions

 mcExpContainerHelpers ()
virtual ~mcExpContainerHelpers ()
int data_GetChildrenCount () const
 Returns the number of children attached to this tree node.
const mcElementdata_GetConstChild (int n) const
 Returns the n-th tree node attached to this element.
void data_SetChild (int n, const mcElement &newchild)
 math_Replaces the idx-th child of this element with a copy of the given one.
void data_DeepCopy (const mcElementHelpers *p)
 Deep copies the given mcExpElementHelpers, removing the exponent from this if it is not present in p or deep-copying it otherwise.
bool data_isSameAs (const mcElementHelpers *p) const
 Performs a deep comparison of the data hold by this class and the data hold by the given mcElementHelpers object.
wxString data_GetDebugName () const
virtual void data_SetContent (const mcPolynomial &p)
 math_Replaces the current contents copying all the elements contained in the given polynomial.
mcPolynomialdata_GetContent ()
 Returns a pointer to contained polynomial.
const mcPolynomialdata_GetContent () const
virtual void data_AddElements (mcElement *p, int num, int pos=-1, bool bOverwrite=FALSE)
 Works exactly as mcElementArray::data_math_AddElements.
virtual mcElement data_AddNewElement (mcElementType t, bool bOverwrite=FALSE, int pos=-1)
 Works exactly as mcElementArray::data_math_AddNewElement.
virtual int gui_GetSpaceAboveBelow () const
 The additional space added above and below the parentheses.
virtual int gui_GetSpaceLeftRight () const
virtual mcInputRes gui_HandleContentInput (mcInputRes, mcElement *)
 Handles the input result flag returned by the contained element.
virtual mcExpSimRes math_SimplifyContents (long flags, mcElement *newelem)=0
virtual mcExpSimRes math_ExpandContents (long flags, mcElement *newelem)=0
virtual mcPolynomial math_GetRaisedContents () const
virtual mcMonomial math_GetFactors () const
 Factores-out everything which can be factored out from this element.
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.
wxXml2Node io_GetBaseMathML (bool bGetPresentation) const
 Returns a MathML tree with the presentation math markup language regarding the base.
bool io_ImportPresentationMathML (wxXml2Node tag, wxString &pErr)
 Imports presentation MathML reading the contents of the given XML node (without modifying it).
mcExpContainer abstract function
Some simple functions used by mcExpContainerGUI to adjust the behaviour of the mcElement implemented functions.

virtual int gui_GetContentOffsetX () const =0
virtual int gui_GetContentOffsetY () const =0
virtual bool gui_isLeftPosEnabled () const =0
virtual bool gui_isRightPosEnabled () const =0
virtual void gui_DrawContainer (wxDC &dc, int x, int y, long flags, const wxPoint &p) const =0
mcExpElement overloaded functions
Functions which implements some of the mcExpElement abstract methods: the functions which are common to all container with exponents.

void gui_UpdateExpDepth ()
 ExpContainers need to change the exponent depth of the content.
virtual bool gui_DrawAsActiveOverBase () const
 mcExpContainers are containers by definition; thus, the containers must find the contained element which is active and draw it.
virtual mcElement gui_GetBaseSelection () const
 When the selection is inside the contents, this function can be called.
virtual bool gui_isBaseEndKey (const mcKey &ev) const
 This function should work as mcElement::isEndChar function, but it should care only for the base; this means that the element should not handle the mcEXPELEM_**** cursor positions, but it will probably still need to check for exp/sub presence to choose if the given keyevent is the end key.
virtual int gui_BaseMoveCursorUsingPoint (wxDC &, const wxPoint &)
 Moves the cursor inside the base using the given point and, eventually the given DC for calculations.
virtual int gui_GetBaseRelCursorPos (wxDC &, wxPoint *) const
 Returns the height of the cursor and it's position (in the given pointer and in coordinates relatives to the top-left point of the base), when the cursor is editing the base.
virtual mcMoveCursorRes gui_BaseMoveCursor (mcMoveCursorFlag flag, long modifiers)
 Handles cursor movements when the cursor is editing the base.
virtual mcInputRes gui_BaseInput (const mcKey &ke, mcElement *pnew)
 Handles the input when the cursor is editing the base; an useful function, to avoid repetitions inside gui_BaseInput(), could be the gui_HandleSubExpEditKeys() function...
virtual mcInsertRes gui_BaseInsert (const mcElement &, mcElement *)
virtual void gui_GetBaseCursorPos (mcCursorPos &) const
 Returns one of the cursor position flags (called only when cursor is inside the base).
virtual int gui_DrawBase (wxDC &cd, int x, int y, long flags, const wxPoint &p) const
 Identical to mcElement::gui_Draw, but just for the base.
virtual int gui_GetYAnchor () const
 Returns the y amount of this mcElement to subtract from the center line to draw this element.
virtual void gui_OnBaseSelect (wxDC &dc, wxRect &rc)
 Handles selections for the base only.
virtual void gui_SetBaseCursorPos (const mcCursorPos &)
 Sets the cursor position of the element.
virtual void gui_EditBase ()
 Called when the cursor is switching from the exp/sub to the base; it should set the cursor inside the base: the correct position will be set using the gui_SetBaseCursorPos.
mcExpElementMath and mcElementMath abstract functions
Implementation of some functions dropping math requests to the contained polynomial (quite easy !).

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.
bool math_CanBeDivBy (const mcElement &) const
 Works like #math_CanBemath_AddeWith(), just for divisions.
bool math_CanBeMultWith (const mcElement &) const
 Works like #math_CanBemath_AddeWith(), just for multiplication.
bool math_CanBeAddedWith (const mcElement &) const
 Returns TRUE if this element can be added with the given element.
mcBasicOpRes math_Add (const mcElement &, mcElement *p, bool add)
 Sums or subtracts this element with the given e element.
mcBasicOpRes math_DivideBaseOnlyBy (const mcElement &, mcElement *p)
mcBasicOpRes math_MultiplyBaseOnlyBy (const mcElement &, mcElement *p)
mcRealValue math_GetBaseLenght () const
mcRealValue math_EvaluateBase () const
mcMathType math_GetBaseMathType () const
mcExpSimRes math_SimplifyBase (long flags, mcElement *newelem)
mcExpSimRes math_ExpandBase (long flags, mcElement *newelem)
mcExpSimRes math_SimplifyBaseExp (long flags, mcElement *pnew)

Protected Member Functions

void gui_Init ()
 Inits this section of the element.
virtual wxString io_GetMathMLPresentationTag () const
 Returns the name of the container TAG for this element.

Protected Attributes

mcPolynomial m_eContent
 The contained expression.
int mgui_nCursorPos
 The cursor position.


Constructor & Destructor Documentation

mcExpContainerHelpers::mcExpContainerHelpers  )  [inline]
 

Definition at line 88 of file ExpContainer.h.

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

Definition at line 93 of file ExpContainer.h.


Member Function Documentation

virtual void mcExpContainerHelpers::data_AddElements mcElement p,
int  num,
int  pos = -1,
bool  bOverwrite = FALSE
[inline, virtual]
 

Works exactly as mcElementArray::data_math_AddElements.

Definition at line 169 of file ExpContainer.h.

References mcElementArray::data_AddElements().

virtual mcElement mcExpContainerHelpers::data_AddNewElement mcElementType  t,
bool  bOverwrite = FALSE,
int  pos = -1
[inline, virtual]
 

Works exactly as mcElementArray::data_math_AddNewElement.

Definition at line 176 of file ExpContainer.h.

References mcElementArray::data_AddNewElement().

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

Deep copies the given mcExpElementHelpers, removing the exponent from this if it is not present in p or deep-copying it otherwise.

The same checks are performed on the subscript.

Reimplemented from mcExpElementHelpers.

Definition at line 131 of file ExpContainer.h.

References mcExpElementHelpers::data_DeepCopy(), mcElement::data_DeepCopy(), and data_GetContent().

int mcExpContainerHelpers::data_GetChildrenCount  )  const [inline, virtual]
 

Returns the number of children attached to this tree node.

This function can be used on *any* mcElement node because this is a virtual function which is overridden by container classes which thus return the correct number of children.

This function is used by various mcElement functions like data_Check() const data_GetElemFromID(), ... which must call some standard mcElement functions on all nodes attached to this element.

Reimplemented from mcExpElementHelpers.

Definition at line 110 of file ExpContainer.h.

References mcExpElementHelpers::data_GetChildrenCount(), and mcEmptyPolynomial.

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

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));
     }

Parameters:
n The n-th child of this object.

Reimplemented from mcExpElementHelpers.

Definition at line 115 of file ExpContainer.h.

References mcEmptyElement, and mcRETURN_ELEMENT_CHILD.

const mcPolynomial& mcExpContainerHelpers::data_GetContent  )  const [inline]
 

Definition at line 162 of file ExpContainer.h.

mcPolynomial& mcExpContainerHelpers::data_GetContent  )  [inline]
 

Returns a pointer to contained polynomial.

Definition at line 161 of file ExpContainer.h.

Referenced by mcBracketHelpers::data_ChooseBracketType(), data_DeepCopy(), gui_BaseInput(), gui_BaseInsert(), gui_BaseMoveCursor(), gui_BaseMoveCursorUsingPoint(), mcRadicalHelpers::gui_DoRecalcBaseSize(), mcBracketHelpers::gui_DoRecalcBaseSize(), gui_DrawBase(), mcBracketHelpers::gui_DrawContainer(), gui_GetBaseRelCursorPos(), mcRadicalHelpers::gui_GetContentOffsetY(), mcBracketHelpers::gui_GetContentOffsetY(), gui_GetYAnchor(), gui_OnBaseSelect(), gui_SetBaseCursorPos(), mcBracketHelpers::io_GetBaseInlinedExpr(), io_GetBaseMathML(), mcRadicalHelpers::io_GetInlinedExpr(), mcRadicalHelpers::io_GetMathML(), mcRadicalHelpers::io_ImportBaseInlinedExpr(), mcBracketHelpers::io_ImportBaseInlinedExpr(), io_ImportPresentationMathML(), math_Add(), math_CanBeAddedWith(), math_CanBeDivBy(), math_CanBeMultWith(), math_CompareThisOnly(), math_DivideBaseOnlyBy(), math_ExpandBase(), math_GetFactors(), math_GetRaisedContents(), mcBracketHelpers::math_MakeReciprocal(), math_MultiplyBaseOnlyBy(), mcBracketHelpers::math_RemoveExp(), math_SimplifyBase(), math_SimplifyBaseExp(), mcRadicalHelpers::math_SimplifyContents(), and mcBracketHelpers::math_SimplifyContents().

wxString mcExpContainerHelpers::data_GetDebugName  )  const [inline]
 

Reimplemented from mcElementHelpers.

Definition at line 148 of file ExpContainer.h.

bool mcExpContainerHelpers::data_isSameAs const mcElementHelpers p  )  const [inline, virtual]
 

Performs a deep comparison of the data hold by this class and the data hold by the given mcElementHelpers object.

Reimplemented from mcElementHelpers.

Definition at line 139 of file ExpContainer.h.

References m_eContent.

void mcExpContainerHelpers::data_SetChild int  n,
const mcElement newchild
[inline, virtual]
 

math_Replaces the idx-th child of this element with a copy of the given one.

Reimplemented from mcExpElementHelpers.

Definition at line 122 of file ExpContainer.h.

References mcASSERT, mcET_POLYNOMIAL, and mcSET_ELEMENT_CHILD.

virtual void mcExpContainerHelpers::data_SetContent const mcPolynomial p  )  [inline, virtual]
 

math_Replaces the current contents copying all the elements contained in the given polynomial.

Definition at line 154 of file ExpContainer.h.

mcInputRes mcExpContainerHelpers::gui_BaseInput const mcKey ke,
mcElement pnew
[virtual]
 

Handles the input when the cursor is editing the base; an useful function, to avoid repetitions inside gui_BaseInput(), could be the gui_HandleSubExpEditKeys() function...

Implements mcExpElementHelpers.

Reimplemented in mcBracketHelpers.

Definition at line 155 of file ExpContainer.cpp.

References mcElementHelpers::data_AddProperty(), data_GetContent(), mcElementHelpers::data_hasProperty(), mcMathCore::Get(), mcPolynomial::gui_AddNewEmptyMonomial(), gui_HandleContentInput(), mcExpElementHelpers::gui_HandleSubExpEditKeys(), mcElement::gui_Input(), mcElementHelpers::gui_isBeginKey(), mcElementHelpers::gui_RecalcSize(), mcEP_INITIALIZED, mcEXPCONTAINER_INSIDEEXPR, mcEXPCONTAINER_LEFTMOST, mcEXPCONTAINER_RIGHTMOST, mcIR_DELETE_NEXT, mcIR_DELETE_PREVIOUS, mcIR_DELETE_THIS, mcIR_OKAY, mgui_nCursorPos, and mcMathCore::SyntaxError().

Referenced by mcBracketHelpers::gui_BaseInput().

mcInsertRes mcExpContainerHelpers::gui_BaseInsert const mcElement ,
mcElement
[virtual]
 

Implements mcExpElementHelpers.

Definition at line 223 of file ExpContainer.cpp.

References data_GetContent(), mcElement::gui_Insert(), mcASSERT, mcEXPCONTAINER_LEFTMOST, mcEXPCONTAINER_RIGHTMOST, and mgui_nCursorPos.

mcMoveCursorRes mcExpContainerHelpers::gui_BaseMoveCursor mcMoveCursorFlag  flag,
long  modifiers
[virtual]
 

Handles cursor movements when the cursor is editing the base.

This function should work ABSOLUTELY without care about the exponent or subscript presence or absence: if the cursor is placed on the rightmost point of the base, and the function is called with the mcMCF_RIGHT flag, then the function should return mcMCR_SETFOCUS_NEXT without any check: the mcExpElement::gui_MoveCursor function will check the return value of this function and will corerctly handle it !!!

Implements mcExpElementHelpers.

Definition at line 252 of file ExpContainer.cpp.

References data_GetContent(), gui_isLeftPosEnabled(), gui_isRightPosEnabled(), mcElement::gui_MoveCursor(), mcElement::gui_SetCursorPos(), mcASSERT, mcCP_BEGIN, mcCP_END, mcEXPCONTAINER_INSIDEEXPR, mcEXPCONTAINER_LEFTMOST, mcEXPCONTAINER_RIGHTMOST, 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 mcExpContainerHelpers::gui_BaseMoveCursorUsingPoint wxDC &  ,
const wxPoint & 
[virtual]
 

Moves the cursor inside the base using the given point and, eventually the given DC for calculations.

Implements mcExpElementHelpers.

Definition at line 341 of file ExpContainer.cpp.

References data_GetContent(), gui_GetContentOffsetX(), gui_GetContentOffsetY(), mcElementHelpers::gui_GetSize(), gui_isLeftPosEnabled(), gui_isRightPosEnabled(), mcElement::gui_MoveCursorUsingPoint(), mcEXPCONTAINER_INSIDEEXPR, mcEXPCONTAINER_LEFTMOST, mcEXPCONTAINER_RIGHTMOST, mcMCR_CANNOT_SETFOCUS, mcMCR_OKAY, and mgui_nCursorPos.

virtual bool mcExpContainerHelpers::gui_DrawAsActiveOverBase  )  const [inline, virtual]
 

mcExpContainers are containers by definition; thus, the containers must find the contained element which is active and draw it.

Implements mcExpElementHelpers.

Definition at line 240 of file ExpContainer.h.

int mcExpContainerHelpers::gui_DrawBase wxDC &  cd,
int  x,
int  y,
long  flags,
const wxPoint &  p
const [virtual]
 

Identical to mcElement::gui_Draw, but just for the base.

You have to draw it at the given point (x,y) without take care of the exp/sub, just do everything as they wouldn't exist. The given pointer to a wxPoint class can be mcDRW_NONACTIVE or a valid pointer value (in this case, the cursor is always inside the base). You can be sure that it will never be mcDRW_ALLACTIVE: this flag is completely handled by mcExpElement. If all the base must be drawn as active, the subscript should be too... you can use the #GetBaseAndSubSize function to make the task easier.

Parameters:
dc The DC where the base must be drawn
x,y The position on the DC where the base must be drawn
pt mcDRW_NONACTIVE or a valid pointer to the mouse position;
Returns:
The ID of the element which is placed under the given cursor position (this is typically hlp()->data_GetID(), but in some cases, like for mcBracket, it can be different) or mcDRW_NOACTIVELEM, if the mouse cursor is placed over empty space.

Implements mcExpElementHelpers.

Definition at line 115 of file ExpContainer.cpp.

References data_GetContent(), mcElementHelpers::data_GetID(), mcElement::gui_Draw(), gui_DrawContainer(), gui_GetContentOffsetX(), gui_GetContentOffsetY(), mcElementHelpers::gui_GetSize(), mcElementHelpers::gui_isAllSelected(), mcDRW_ALLOW_TOTAL_SELECTION, and mcDRW_USEPOINT.

virtual void mcExpContainerHelpers::gui_DrawContainer wxDC &  dc,
int  x,
int  y,
long  flags,
const wxPoint &  p
const [pure virtual]
 

Implemented in mcBracketHelpers, and mcRadicalHelpers.

Referenced by gui_DrawBase().

void mcExpContainerHelpers::gui_EditBase  )  [virtual]
 

Called when the cursor is switching from the exp/sub to the base; it should set the cursor inside the base: the correct position will be set using the gui_SetBaseCursorPos.

Implements mcExpElementHelpers.

Definition at line 76 of file ExpContainer.cpp.

References mcECL_INSIDEBASE, mcEXPCONTAINER_INSIDEEXPR, and mgui_nCursorPos.

void mcExpContainerHelpers::gui_GetBaseCursorPos mcCursorPos  )  const [virtual]
 

Returns one of the cursor position flags (called only when cursor is inside the base).

Implements mcExpElementHelpers.

Definition at line 411 of file ExpContainer.cpp.

References mcCursorPos::gui_Push(), mcCP_BEGIN, mcCP_END, mcEXPCONTAINER_LEFTMOST, mcEXPCONTAINER_RIGHTMOST, and mgui_nCursorPos.

int mcExpContainerHelpers::gui_GetBaseRelCursorPos wxDC &  ,
wxPoint * 
const [virtual]
 

Returns the height of the cursor and it's position (in the given pointer and in coordinates relatives to the top-left point of the base), when the cursor is editing the base.

Implements mcExpElementHelpers.

Definition at line 375 of file ExpContainer.cpp.

References data_GetContent(), mcExpElementHelpers::gui_GetBaseSize(), gui_GetContentOffsetX(), gui_GetContentOffsetY(), mcElement::gui_GetRelCursorPos(), mcASSERT, mcEXPCONTAINER_INSIDEEXPR, mcEXPCONTAINER_LEFTMOST, mcEXPCONTAINER_RIGHTMOST, and mgui_nCursorPos.

virtual mcElement mcExpContainerHelpers::gui_GetBaseSelection  )  const [inline, virtual]
 

When the selection is inside the contents, this function can be called.

Reimplemented from mcExpElementHelpers.

Definition at line 245 of file ExpContainer.h.

References mcElement::gui_GetSelection().

virtual int mcExpContainerHelpers::gui_GetContentOffsetX  )  const [pure virtual]
 

Implemented in mcBracketHelpers, and mcRadicalHelpers.

Referenced by gui_BaseMoveCursorUsingPoint(), gui_DrawBase(), gui_GetBaseRelCursorPos(), and gui_OnBaseSelect().

virtual int mcExpContainerHelpers::gui_GetContentOffsetY  )  const [pure virtual]
 

Implemented in mcBracketHelpers, and mcRadicalHelpers.

Referenced by gui_BaseMoveCursorUsingPoint(), gui_DrawBase(), gui_GetBaseRelCursorPos(), gui_GetYAnchor(), and gui_OnBaseSelect().

virtual int mcExpContainerHelpers::gui_GetSpaceAboveBelow  )  const [inline, virtual]
 

The additional space added above and below the parentheses.

Reimplemented in mcBracketHelpers, and mcRadicalHelpers.

Definition at line 192 of file ExpContainer.h.

virtual int mcExpContainerHelpers::gui_GetSpaceLeftRight  )  const [inline, virtual]
 

Reimplemented in mcBracketHelpers, and mcRadicalHelpers.

Definition at line 196 of file ExpContainer.h.

int mcExpContainerHelpers::gui_GetYAnchor  )  const [virtual]
 

Returns the y amount of this mcElement to subtract from the center line to draw this element.

Reimplemented from mcExpElementHelpers.

Definition at line 442 of file ExpContainer.cpp.

References data_GetContent(), mcExpElementHelpers::gui_GetBaseOffsety(), gui_GetContentOffsetY(), and mcElement::gui_GetYAnchor().

mcInputRes mcExpContainerHelpers::gui_HandleContentInput mcInputRes  ,
mcElement
[virtual]
 

Handles the input result flag returned by the contained element.

The value which is returned by this function is also the value of the gui_BaseInput() function.

Reimplemented in mcBracketHelpers.

Definition at line 232 of file ExpContainer.cpp.

References mcElementHelpers::gui_RecalcSize(), mcASSERT, mcIR_DELETE_NEXT, mcIR_DELETE_PREVIOUS, mcIR_DELETE_THIS, and mcIR_OKAY.

Referenced by gui_BaseInput(), and mcBracketHelpers::gui_HandleContentInput().

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

Inits this section of the element.

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

Reimplemented from mcExpElementHelpers.

Definition at line 98 of file ExpContainer.h.

References mcExpElementHelpers::gui_Init(), and mcEXPCONTAINER_INSIDEEXPR.

bool mcExpContainerHelpers::gui_isBaseEndKey const mcKey ev  )  const [virtual]
 

This function should work as mcElement::isEndChar function, but it should care only for the base; this means that the element should not handle the mcEXPELEM_**** cursor positions, but it will probably still need to check for exp/sub presence to choose if the given keyevent is the end key.

When the cursor is inside the exp/sub, this function is never called. Derived classes must also implement the mcElementHelpers::gui_isBeginChar function.

Implements mcExpElementHelpers.

Definition at line 60 of file ExpContainer.cpp.

References mcASSERT, mcEXPCONTAINER_INSIDEEXPR, mcEXPCONTAINER_LEFTMOST, mcEXPCONTAINER_RIGHTMOST, and mgui_nCursorPos.

virtual bool mcExpContainerHelpers::gui_isLeftPosEnabled  )  const [pure virtual]
 

Implemented in mcBracketHelpers, and mcRadicalHelpers.

Referenced by gui_BaseMoveCursor(), gui_BaseMoveCursorUsingPoint(), and gui_SetBaseCursorPos().

virtual bool mcExpContainerHelpers::gui_isRightPosEnabled  )  const [pure virtual]
 

Implemented in mcBracketHelpers, and mcRadicalHelpers.

Referenced by gui_BaseMoveCursor(), gui_BaseMoveCursorUsingPoint(), and gui_SetBaseCursorPos().

void mcExpContainerHelpers::gui_OnBaseSelect wxDC &  dc,
wxRect &  rc
[virtual]
 

Handles selections for the base only.

Called when the base (or the empty space) bounding box only intersects the selection rectangle, this function should call the mcElement::gui_Select() function or, for container classes, call the appropriate gui_OnSelect function of the children elements. The standard implementation if or basic classes and just calls the mcElement::gui_Select() function. Override only if you need.

Reimplemented from mcExpElementHelpers.

Definition at line 83 of file ExpContainer.cpp.

References data_GetContent(), gui_GetContentOffsetX(), gui_GetContentOffsetY(), mcElementHelpers::gui_GetSize(), mcElementHelpers::gui_isSelected(), mcElement::gui_OnSelect(), and mcElementHelpers::gui_Select().

void mcExpContainerHelpers::gui_SetBaseCursorPos const mcCursorPos  )  [virtual]
 

Sets the cursor position of the element.

When this function is called with the mcCP_BEGIN flag, it must set the cursor at the leftmost point of the base; when this function is called with mcCP_END flag, the function must set the cursor at the rightmost point of the base. It should never check exponent/subscript presence: everything is handled by mcExpElement.

Implements mcExpElementHelpers.

Definition at line 421 of file ExpContainer.cpp.

References data_GetContent(), gui_isLeftPosEnabled(), gui_isRightPosEnabled(), mcElement::gui_SetCursorPos(), mcCP_BEGIN, mcCP_END, mcEXPCONTAINER_INSIDEEXPR, mcEXPCONTAINER_LEFTMOST, mcEXPCONTAINER_RIGHTMOST, and mgui_nCursorPos.

void mcExpContainerHelpers::gui_UpdateExpDepth  )  [inline, virtual]
 

ExpContainers need to change the exponent depth of the content.

Reimplemented from mcExpElementHelpers.

Definition at line 229 of file ExpContainer.h.

References mcElement::gui_SetAtSameLevelOf(), and mcExpElementHelpers::gui_UpdateExpDepth().

wxXml2Node mcExpContainerHelpers::io_GetBaseMathML bool  bGetPresentation  )  const [virtual]
 

Returns a MathML tree with the presentation math markup language regarding the base.

This function should work exactly as the hononymous mcElement function.

Parameters:
bGetPresentation If TRUE, this function returns the presentation MathML, otherwise it returns the content markup.

Implements mcExpElementHelpers.

Reimplemented in mcRadicalHelpers.

Definition at line 455 of file ExpContainer.cpp.

References data_GetContent(), mcElement::io_GetMathML(), and io_GetMathMLPresentationTag().

virtual wxString mcExpContainerHelpers::io_GetMathMLPresentationTag  )  const [inline, protected, virtual]
 

Returns the name of the container TAG for this element.

Reimplemented in mcBracketHelpers.

Definition at line 324 of file ExpContainer.h.

Referenced by io_GetBaseMathML(), and io_ImportPresentationMathML().

bool mcExpContainerHelpers::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 mcRadicalHelpers.

Definition at line 464 of file ExpContainer.cpp.

References data_GetContent(), io_GetMathMLPresentationTag(), mcElement::io_ImportPresentationMathML(), and mcASSERT.

bool mcExpContainerHelpers::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 mcRadicalHelpers.

Definition at line 327 of file ExpContainer.h.

mcBasicOpRes mcExpContainerHelpers::math_Add const mcElement ,
mcElement p,
bool  add
[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 597 of file ExpContainer.cpp.

References mcExpContainer::data_GetContent(), data_GetContent(), mcElementHelpers::data_GetType(), mcElement::math_Add(), and mcBOR_INVALID.

bool mcExpContainerHelpers::math_CanBeAddedWith const mcElement  )  const [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 503 of file ExpContainer.cpp.

References data_GetContent(), mcExpContainer::data_GetContent(), mcElementHelpers::data_GetType(), and mcElement::math_CanBeAddedWith().

bool mcExpContainerHelpers::math_CanBeDivBy const mcElement  )  const [virtual]
 

Works like #math_CanBemath_AddeWith(), just for divisions.

Implements mcElementHelpers.

Definition at line 514 of file ExpContainer.cpp.

References mcExpContainer::data_GetConstContent(), data_GetContent(), mcElementHelpers::data_GetType(), and mcElement::math_CanBeDivBy().

bool mcExpContainerHelpers::math_CanBeMultWith const mcElement  )  const [virtual]
 

Works like #math_CanBemath_AddeWith(), just for multiplication.

Implements mcElementHelpers.

Definition at line 525 of file ExpContainer.cpp.

References data_GetContent(), mcExpContainer::data_GetContent(), mcElementHelpers::data_GetType(), and mcElement::math_CanBeMultWith().

bool mcExpContainerHelpers::math_CompareThisOnly const mcElement p,
long  flags
const [virtual]
 

Compares this element and the given one and then stops, unlike math_Compare() that compares children too.

Reimplemented from mcElementHelpers.

Definition at line 488 of file ExpContainer.cpp.

References data_GetContent(), mcElementHelpers::data_GetType(), and mcElement::math_Compare().

mcBasicOpRes mcExpContainerHelpers::math_DivideBaseOnlyBy const mcElement ,
mcElement p
[virtual]
 

Implements mcExpElementHelpers.

Definition at line 590 of file ExpContainer.cpp.

References mcExpContainer::data_GetContent(), data_GetContent(), mcElementHelpers::data_GetType(), mcElement::math_DivideBy(), and mcBOR_INVALID.

mcRealValue mcExpContainerHelpers::math_EvaluateBase  )  const [inline, virtual]
 

Implements mcExpElementHelpers.

Definition at line 292 of file ExpContainer.h.

References mcElement::math_Evaluate().

Referenced by mcRadicalHelpers::math_Evaluate().

mcExpSimRes mcExpContainerHelpers::math_ExpandBase long  flags,
mcElement newelem
[virtual]
 

Implements mcExpElementHelpers.

Definition at line 580 of file ExpContainer.cpp.

References data_GetContent(), mcElementArray::math_Expand(), math_ExpandContents(), and mcESR_DONE.

virtual mcExpSimRes mcExpContainerHelpers::math_ExpandContents long  flags,
mcElement newelem
[pure virtual]
 

Implemented in mcBracketHelpers, and mcRadicalHelpers.

Referenced by math_ExpandBase().

mcRealValue mcExpContainerHelpers::math_GetBaseLenght  )  const [inline, virtual]
 

Reimplemented from mcExpElementHelpers.

Reimplemented in mcBracketHelpers.

Definition at line 290 of file ExpContainer.h.

Referenced by mcBracketHelpers::math_GetBaseLenght().

mcMathType mcExpContainerHelpers::math_GetBaseMathType  )  const [inline, virtual]
 

Implements mcExpElementHelpers.

Reimplemented in mcRadicalHelpers.

Definition at line 294 of file ExpContainer.h.

Referenced by mcRadicalHelpers::math_GetBaseMathType().

mcMonomial mcExpContainerHelpers::math_GetFactors  )  const [virtual]
 

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 618 of file ExpContainer.cpp.

References data_GetContent(), and mcPolynomial::math_GetFactors().

mcPolynomial mcExpContainerHelpers::math_GetRaisedContents  )  const [virtual]
 

Definition at line 536 of file ExpContainer.cpp.

References data_GetContent(), mcExpElementHelpers::math_GetExp(), mcExpElementHelpers::math_hasExp(), and mcElement::math_RaiseTo().

mcBasicOpRes mcExpContainerHelpers::math_MultiplyBaseOnlyBy const mcElement ,
mcElement p
[virtual]
 

Implements mcExpElementHelpers.

Definition at line 611 of file ExpContainer.cpp.

References mcExpContainer::data_GetContent(), data_GetContent(), mcElementHelpers::data_GetType(), mcElement::math_MultiplyBy(), and mcBOR_INVALID.

mcExpSimRes mcExpContainerHelpers::math_SimplifyBase long  flags,
mcElement newelem
[virtual]
 

Implements mcExpElementHelpers.

Definition at line 570 of file ExpContainer.cpp.

References data_GetContent(), mcElementArray::math_Simplify(), math_SimplifyContents(), and mcESR_DONE.

mcExpSimRes mcExpContainerHelpers::math_SimplifyBaseExp long  flags,
mcElement pnew
[virtual]
 

Reimplemented from mcExpElementHelpers.

Definition at line 548 of file ExpContainer.cpp.

References mcExpElementHelpers::data_DestroyExpSub(), data_GetContent(), mcExpElementHelpers::math_GetExp(), mcElement::math_RaiseTo(), mcESR_DONE, mcESR_NOTFINISHED, mcEXPSIM_KEEP_FACTORIZATION, mcMATHLOG, and mcTXTTHIS.

virtual mcExpSimRes mcExpContainerHelpers::math_SimplifyContents long  flags,
mcElement newelem
[pure virtual]
 

Implemented in mcBracketHelpers, and mcRadicalHelpers.

Referenced by math_SimplifyBase().


Member Data Documentation

mcPolynomial mcExpContainerHelpers::m_eContent [protected]
 

The contained expression.

Definition at line 60 of file ExpContainer.h.

Referenced by data_isSameAs().

int mcExpContainerHelpers::mgui_nCursorPos [protected]
 

The cursor position.

Definition at line 69 of file ExpContainer.h.

Referenced by gui_BaseInput(), gui_BaseInsert(), gui_BaseMoveCursor(), gui_BaseMoveCursorUsingPoint(), gui_EditBase(), gui_GetBaseCursorPos(), gui_GetBaseRelCursorPos(), gui_isBaseEndKey(), and gui_SetBaseCursorPos().


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

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

[ Top ]