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

mcSymbolHelpers Class Reference

#include <Symbol.h>

Inheritance diagram for mcSymbolHelpers:

Inheritance graph
[legend]
Collaboration diagram for mcSymbolHelpers:

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. The symbol is always registered in at least one of mcSymbol global arrays (mcSymbol::arrUnknowns, mcSymbol::arrParameters, mcSymbol::arrConstants or mcSymbol::arrUnregistered). This class just holds a pointer to the right entry of one of those arrays (a mcSymbolProperties class), thus this class doesn't contain any info about the mathematical meaning of the symbol: in fact, those info are global info which shouldn't be owned by a particular mcSymbolData class).

Definition at line 62 of file Symbol.h.

Public Member Functions

 mcSymbolHelpers ()
virtual ~mcSymbolHelpers ()
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.
bool math_isListedBeforeOf (const mcElement &s) const
 Returns TRUE if this symbol should be put before the given one in an ordered list.
int math_GetOrderPos () const
 Returns the order position for this symbol.
bool io_isBeginTag (const wxXml2Node &tag) const
 Returns a positive value if the given MathML content tag marks the begin of this element; FALSE otherwise.
bool io_isBeginChar (const wxString &str) const
 Returns a positive value if the given inlined expression marks the begin of this element; FALSE otherwise.
wxXml2Node io_GetBaseMathML (bool bGetPresentation) const
 Returns a MathML tree with the presentation math markup language regarding the base.
wxString io_GetBaseInlinedExpr () const
bool io_ImportPresentationMathML (wxXml2Node tag, wxString &pErr)
 Imports presentation MathML reading the contents of the given XML node (without modifying it).
bool io_ImportBaseInlinedExpr (const wxString &str, int *count, wxString &pErr)
LINKING functions
Link/unlink this symbol to a mcSymbolProperties class.

void data_LinkWith (mcSymbolProperties *prop)
 Links this class with the given symbol properties, eventually unlinking it from its previous mcSymbolProperties.
void data_Unlink ()
 Unlinks this class from the current symbol properties.
bool data_isLinked () const
 Returns TRUE if the class is ready to work.
bool data_isLinkedWith (const mcSymbolProperties *p) const
 Returns TRUE if this class is linked with the given mcSymbolProperties.
void data_Update ()
 data_Updates this symbol, trying to link this element with another mcSymbolProperties.
GET functions
Handy getters.

wxString data_GetSubscript () const
 Returns the string associated with the eventually present subscript.
wxString data_GetSymbol () const
 Returns the symbol associated with this class.
wxString data_GetInlinedSymbol () const
 Returns the string used to export this symbol as inlined expression.
wxString data_GetEncodedType () const
 Returns a string containing a single character: U if this is an unknown, C if this is a constant or P if this is a parameter.
mcRealValue data_GetValue () const
 Returns the numeric value of this symbol if it is a constant.
const mcExtRangedata_GetDomain () const
 If this is a parameter/unknown, this function returns the domain of this symbol.
mcExtRangedata_GetDomain ()
 Returns the domain range of this symbol.
const mcSymbolPropertiesdata_GetConstProperties () const
 Returns the properties of this symbol.
mcSymbolPropertiesdata_GetProperties ()
CHECK functions
The "isXXXXX" functions.

bool data_isGreekSymbol () const
 Returns TRUE if this symbol must be drawn with a special font containing greek symbols because, even if its code if a normal ASCII code.
bool data_isRegistered () const
 Returns TRUE if this symbol is registered in the mcMathCore global arrays (mcSymbol::arrUnknowns, mcSymbol::arrParameters, mcSymbol::arrConstants).
bool data_isParameter () const
bool data_isUnknown () const
bool data_isConstant () const
SET functions
The setters of mcSymbolData.

void data_SetSymbol (const wxString &str)
 Sets the symbol associated with this class.
void data_SetValue (double d)
 If this symbol is a constant, this function sets its value.
void data_SetAsGreek (bool b=TRUE)
void data_SetSubscript (const wxString &str)
mcExpElement overloaded BASE functions
These functions handle the base of the symbol; the exponent is handled by mcExpElement functions.

bool gui_isBeginKey (const mcKey &ke) const
 Returns zero when the given character is valid but unrecognized symbol, returns a positive value when the character is a valid and recognized symbol and returns FALSE when the character is not a valid symbol.
bool gui_isBaseEndKey (const mcKey &key) const
 A mcSymbol element is always composed by only one character; however, user could still try to delete it, to enter an exponent or a subscript; that's why this function doesn't return always TRUE...
bool gui_DrawAsActiveOverBase () const
 The mcSymbol class is not a container of elements, so it returns TRUE (see the mcExpElement::gui_DrawAsActiveOverBase documentation).
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...
mcInputRes gui_SubInput (const mcKey &ev, mcElement *pnew)
mcInsertRes gui_BaseInsert (const mcElement &, mcElement *)
mcMoveCursorRes gui_BaseMoveCursor (mcMoveCursorFlag flag, long modifiers)
 Handles cursor movements when the cursor is editing the base.
void gui_GetBaseCursorPos (mcCursorPos &) const
 Returns one of the cursor position flags (called only when cursor is inside the base).
int gui_BaseMoveCursorUsingPoint (wxDC &, const wxPoint &)
 Moves the cursor inside the base using the given point and, eventually the given DC for calculations.
int gui_GetBaseRelCursorPos (wxDC &dc, wxPoint *pt) const
 Returns the height of the cursor and it's position (in the given pointer and in coordinates relatives to the top-left point of the base), when the cursor is editing the base.
int gui_DrawBase (wxDC &dc, int x, int y, long flags, const wxPoint &pt) const
 Identical to mcElement::gui_Draw, but just for the base.
void gui_SetBaseCursorPos (const mcCursorPos &code)
 Sets the cursor position of the element.
void gui_EditBase ()
 Called when the cursor is switching from the exp/sub to the base; it should set the cursor inside the base: the correct position will be set using the gui_SetBaseCursorPos.
void gui_DoRecalcBaseSize ()
 Calculates (in the m_szBase variable) the size of the base only.
mcExpElementMath and mcElementMath abstract functions
Implementation of general math abstract functions.

bool math_CompareThisOnly (const mcElement &, long flags) const
 Compares this element and the given one and then stops, unlike math_Compare() that compares children too.
mcExpSimRes math_ExpandBase (long flags, mcElement *newelem)
mcExpSimRes math_SimplifyBase (long flags, mcElement *newelem)
mcExpSimRes math_SimplifyBaseExp (long flags, mcElement *pnew)
virtual mcBasicOpRes math_Add (const mcElement &, mcElement *p, bool add)
 Sums or subtracts this element with the given e element.
virtual mcBasicOpRes math_MultiplyBaseOnlyBy (const mcElement &, mcElement *p)
virtual mcBasicOpRes math_DivideBaseOnlyBy (const mcElement &, mcElement *p)
bool math_CanBeDivBy (const mcElement &p) const
 Symbols can be divided by only other identical symbols:.
bool math_CanBeMultWith (const mcElement &p) const
 Works like #math_CanBemath_AddeWith(), just for multiplication.
bool math_CanBeAddedWith (const mcElement &p) const
 Returns TRUE if this element can be added with the given element.
mcRealValue math_GetBaseLenght () const
mcRealValue math_EvaluateBase () const
mcMathType math_GetBaseMathType () const

Static Public Attributes

static wxColour sgui_clrUndefSymbols = wxColour(255, 0, 0)
 The color used to draw unregistered symbols.
static int smath_nUnknownOrderPos = 3
static int smath_nParameterOrderPos = 2
static int smath_nConstantOrderPos = 1

Protected Member Functions

void gui_Init ()
 Inits this section of the element.

Protected Attributes

mcSymbolPropertiesmdata_pEntry
 Points to a mcSymbolProperties class, containing the properties of this mcSymbol.
int mgui_nCursorPos

Private Member Functions

 mcDEFINE_REFERENCE_DATA (mcSymbol, mcET_SYMBOL)


Constructor & Destructor Documentation

mcSymbolHelpers::mcSymbolHelpers  )  [inline]
 

Definition at line 110 of file Symbol.h.

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

Definition at line 118 of file Symbol.h.


Member Function Documentation

void mcSymbolHelpers::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 144 of file Symbol.h.

References mcExpElementHelpers::data_DeepCopy().

const mcSymbolProperties* mcSymbolHelpers::data_GetConstProperties  )  const [inline]
 

Returns the properties of this symbol.

Definition at line 243 of file Symbol.h.

Referenced by math_CompareThisOnly(), and math_EvaluateBase().

mcExtRange* mcSymbolHelpers::data_GetDomain  )  [inline]
 

Returns the domain range of this symbol.

Definition at line 238 of file Symbol.h.

References mcSymbolProperties::m_pDomain.

const mcExtRange* mcSymbolHelpers::data_GetDomain  )  const [inline]
 

If this is a parameter/unknown, this function returns the domain of this symbol.

Definition at line 233 of file Symbol.h.

References mcSymbolProperties::m_pDomain.

wxString mcSymbolHelpers::data_GetEncodedType  )  const [inline]
 

Returns a string containing a single character: U if this is an unknown, C if this is a constant or P if this is a parameter.

Definition at line 220 of file Symbol.h.

wxString mcSymbolHelpers::data_GetInlinedSymbol  )  const [inline]
 

Returns the string used to export this symbol as inlined expression.

Definition at line 213 of file Symbol.h.

References mcSymbolProperties::io_GetInlinedSym(), and mcASSERT.

Referenced by io_GetBaseInlinedExpr().

mcSymbolProperties* mcSymbolHelpers::data_GetProperties  )  [inline]
 

Definition at line 247 of file Symbol.h.

Referenced by data_SetSubscript(), data_Update(), and gui_SubInput().

wxString mcSymbolHelpers::data_GetSubscript  )  const [inline]
 

Returns the string associated with the eventually present subscript.

Definition at line 201 of file Symbol.h.

References mcSymbolProperties::m_strSubscript, and mcASSERT.

wxString mcSymbolHelpers::data_GetSymbol  )  const [inline]
 

Returns the symbol associated with this class.

Definition at line 207 of file Symbol.h.

References mcSymbolProperties::m_strSymbol, and mcASSERT.

Referenced by gui_DoRecalcBaseSize(), gui_DrawBase(), io_GetBaseInlinedExpr(), io_GetBaseMathML(), io_ImportPresentationMathML(), mcSymbolProperties::math_FindDuplicate(), and math_isListedBeforeOf().

mcRealValue mcSymbolHelpers::data_GetValue  )  const [inline]
 

Returns the numeric value of this symbol if it is a constant.

Definition at line 228 of file Symbol.h.

References mcSymbolProperties::m_fValue.

Referenced by math_EvaluateBase().

bool mcSymbolHelpers::data_isConstant  )  const [inline]
 

Definition at line 285 of file Symbol.h.

References mcSymbolProperties::data_isConstant(), and mcASSERT.

Referenced by math_EvaluateBase().

bool mcSymbolHelpers::data_isGreekSymbol  )  const [inline]
 

Returns TRUE if this symbol must be drawn with a special font containing greek symbols because, even if its code if a normal ASCII code.

Definition at line 261 of file Symbol.h.

References mcSymbolProperties::m_fEncoding, and mcASSERT.

bool mcSymbolHelpers::data_isLinked  )  const [inline]
 

Returns TRUE if the class is ready to work.

Definition at line 181 of file Symbol.h.

Referenced by gui_DoRecalcBaseSize().

bool mcSymbolHelpers::data_isLinkedWith const mcSymbolProperties p  )  const [inline]
 

Returns TRUE if this class is linked with the given mcSymbolProperties.

Definition at line 185 of file Symbol.h.

bool mcSymbolHelpers::data_isParameter  )  const [inline]
 

Definition at line 275 of file Symbol.h.

References mcSymbolProperties::data_isParameter(), and mcASSERT.

Referenced by math_GetBaseMathType().

bool mcSymbolHelpers::data_isRegistered  )  const [inline]
 

Returns TRUE if this symbol is registered in the mcMathCore global arrays (mcSymbol::arrUnknowns, mcSymbol::arrParameters, mcSymbol::arrConstants).

Call data_Update() to be sure to get updated info.

Definition at line 270 of file Symbol.h.

References mcSymbolProperties::data_isRegistered(), and mcASSERT.

Referenced by data_Update(), gui_DrawBase(), and math_GetBaseMathType().

bool mcSymbolHelpers::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 151 of file Symbol.h.

Referenced by math_CompareThisOnly().

bool mcSymbolHelpers::data_isUnknown  )  const [inline]
 

Definition at line 280 of file Symbol.h.

References mcSymbolProperties::data_isUnknown(), and mcASSERT.

Referenced by math_GetBaseMathType().

void mcSymbolHelpers::data_LinkWith mcSymbolProperties prop  )  [inline]
 

Links this class with the given symbol properties, eventually unlinking it from its previous mcSymbolProperties.

Definition at line 165 of file Symbol.h.

References mcSymbolProperties::data_Link().

Referenced by mcSymbolArray::data_AddSymbol(), data_SetSymbol(), data_Update(), io_ImportBaseInlinedExpr(), and mcSymbolProperties::mcSymbolProperties().

void mcSymbolHelpers::data_SetAsGreek bool  b = TRUE  )  [inline]
 

Definition at line 306 of file Symbol.h.

References mcSymbolProperties::m_fEncoding.

Referenced by gui_BaseInput().

void mcSymbolHelpers::data_SetSubscript const wxString &  str  ) 
 

Definition at line 333 of file Symbol.cpp.

References mcExpElementHelpers::data_CreateExpSub(), mcExpElementHelpers::data_DestroyExpSub(), data_GetProperties(), mcExpElementHelpers::data_GetSub(), mcText::data_SetText(), mcSymbolProperties::m_strSubscript, and mcEmptyElement.

void mcSymbolHelpers::data_SetSymbol const wxString &  str  ) 
 

Sets the symbol associated with this class.

This function checks if the symbol belongs to the mcSymbol global arrays; if it does not, then it register to mcSymbol::arrUnregistered, eventually creating a new entry in that array.

Definition at line 311 of file Symbol.cpp.

References mcSymbolArray::data_GetSymbol(), data_LinkWith(), mcSymbol::math_FindSymbol(), and mcSYMFIND_MATCH_NAME.

Referenced by gui_BaseInput(), and io_ImportBaseInlinedExpr().

void mcSymbolHelpers::data_SetValue double  d  )  [inline]
 

If this symbol is a constant, this function sets its value.

Definition at line 305 of file Symbol.h.

References mcSymbolProperties::m_fValue.

void mcSymbolHelpers::data_Unlink  )  [inline]
 

Unlinks this class from the current symbol properties.

VERY IMPORTANT: after the execution of this function, this class must not be used, because it cannot work unlinked.

Definition at line 175 of file Symbol.h.

References mcSymbolProperties::data_Unlink().

Referenced by mcSymbolArray::data_AddSymbol(), and mcSymbolProperties::~mcSymbolProperties().

void mcSymbolHelpers::data_Update  )  [virtual]
 

data_Updates this symbol, trying to link this element with another mcSymbolProperties.

Reimplemented from mcElementHelpers.

Definition at line 351 of file Symbol.cpp.

References mcSymbolArray::data_GetArrayId(), data_GetProperties(), mcSymbolArray::data_GetSymbol(), data_isRegistered(), data_LinkWith(), mcAbstractArray::data_Remove(), mcSymbolProperties::data_Unlink(), mcSymbolProperties::m_nSymbolType, mcSymbol::math_FindSymbol(), mcASSERT, and mcSYMFIND_MATCH_ALL.

mcInputRes mcSymbolHelpers::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.

Definition at line 481 of file Symbol.cpp.

References mcElementHelpers::data_AddProperty(), mcElementHelpers::data_hasProperty(), data_SetAsGreek(), data_SetSymbol(), mcMathCore::Get(), mcExpElementHelpers::gui_HandleSubExpEditKeys(), mcElementHelpers::gui_RecalcSize(), mcEP_INITIALIZED, mcIR_DELETE_NEXT, mcIR_DELETE_PREVIOUS, mcIR_DELETE_THIS, mcIR_OKAY, mcSYMBOL_LEFTMOST, mcSYMBOL_RIGHTMOST, mgui_nCursorPos, and mcMathCore::SyntaxError().

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

Implements mcExpElementHelpers.

Definition at line 544 of file Symbol.cpp.

References mcElementHelpers::mcElement, and mcINSR_REPLACE_THIS.

mcMoveCursorRes mcSymbolHelpers::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 568 of file Symbol.cpp.

References mcElementHelpers::gui_Select(), mcMCF_DOWN, mcMCF_EXTEND_SELECTION, mcMCF_LEFT, mcMCF_RIGHT, mcMCF_UP, mcMCR_OKAY, mcMCR_SETFOCUS_ABOVE, mcMCR_SETFOCUS_BELOW, mcMCR_SETFOCUS_NEXT, mcMCR_SETFOCUS_PREVIOUS, mcSYMBOL_LEFTMOST, mcSYMBOL_RIGHTMOST, and mgui_nCursorPos.

int mcSymbolHelpers::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 605 of file Symbol.cpp.

References mcMCR_OKAY, mcSYMBOL_LEFTMOST, mcSYMBOL_RIGHTMOST, and mgui_nCursorPos.

void mcSymbolHelpers::gui_DoRecalcBaseSize  )  [virtual]
 

Calculates (in the m_szBase variable) the size of the base only.

It's very important not to modify the m_sz variable: m_sz is handled by mcExpElement functions: the base must modify ONLY *m_szBase*.

Implements mcExpElementHelpers.

Definition at line 427 of file Symbol.cpp.

References data_GetSymbol(), data_isLinked(), mcElementHelpers::gui_GetSizeOf(), and mcElementHelpers::gui_SelectStyle().

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

The mcSymbol class is not a container of elements, so it returns TRUE (see the mcExpElement::gui_DrawAsActiveOverBase documentation).

Implements mcExpElementHelpers.

Definition at line 336 of file Symbol.h.

int mcSymbolHelpers::gui_DrawBase wxDC &  dc,
int  x,
int  y,
long  flags,
const wxPoint &  pt
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 439 of file Symbol.cpp.

References mcElementHelpers::data_GetID(), data_GetSymbol(), data_isRegistered(), mcExpElementHelpers::gui_GetBaseAndSubSize(), mcElementHelpers::gui_SelectStyle(), mcDRW_NONACTIVE, mcGUILOG, mcTXTTHIS, and sgui_clrUndefSymbols.

void mcSymbolHelpers::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 474 of file Symbol.cpp.

References mcECL_INSIDEBASE, mcSYMBOL_RIGHTMOST, and mgui_nCursorPos.

void mcSymbolHelpers::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 558 of file Symbol.cpp.

References mcCursorPos::gui_Push(), mcCP_BEGIN, mcCP_END, mcSYMBOL_LEFTMOST, mcSYMBOL_RIGHTMOST, and mgui_nCursorPos.

int mcSymbolHelpers::gui_GetBaseRelCursorPos wxDC &  dc,
wxPoint *  pt
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 616 of file Symbol.cpp.

References mcExpElementHelpers::gui_GetBaseOffsety(), mcExpElementHelpers::gui_GetBaseSize(), mcElementHelpers::gui_GetHeight(), mcSYMBOL_RIGHTMOST, and mgui_nCursorPos.

void mcSymbolHelpers::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 122 of file Symbol.h.

References mcExpElementHelpers::gui_Init(), and mcSYMBOL_RIGHTMOST.

bool mcSymbolHelpers::gui_isBaseEndKey const mcKey key  )  const [virtual]
 

A mcSymbol element is always composed by only one character; however, user could still try to delete it, to enter an exponent or a subscript; that's why this function doesn't return always TRUE...

Implements mcExpElementHelpers.

Definition at line 416 of file Symbol.cpp.

bool mcSymbolHelpers::gui_isBeginKey const mcKey ke  )  const [virtual]
 

Returns zero when the given character is valid but unrecognized symbol, returns a positive value when the character is a valid and recognized symbol and returns FALSE when the character is not a valid symbol.

Implements mcElementHelpers.

Definition at line 386 of file Symbol.cpp.

void mcSymbolHelpers::gui_SetBaseCursorPos const mcCursorPos code  )  [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 550 of file Symbol.cpp.

References mcSYMBOL_LEFTMOST, mcSYMBOL_RIGHTMOST, and mgui_nCursorPos.

mcInputRes mcSymbolHelpers::gui_SubInput const mcKey ev,
mcElement pnew
 

Definition at line 532 of file Symbol.cpp.

References data_GetProperties(), mcExpElementHelpers::data_GetSub(), mcExpElementHelpers::gui_ExpSubInput(), mcSymbolProperties::m_strSubscript, and mcEmptyElement.

wxString mcSymbolHelpers::io_GetBaseInlinedExpr  )  const [virtual]
 

Implements mcExpElementHelpers.

Definition at line 662 of file Symbol.cpp.

References data_GetInlinedSymbol(), and data_GetSymbol().

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

Definition at line 649 of file Symbol.cpp.

References data_GetSymbol().

bool mcSymbolHelpers::io_ImportBaseInlinedExpr const wxString &  str,
int *  count,
wxString &  pErr
[virtual]
 

Implements mcExpElementHelpers.

Definition at line 695 of file Symbol.cpp.

References mcElementHelpers::data_AddProperty(), mcSymbolArray::data_GetSymbol(), data_LinkWith(), data_SetSymbol(), mcSymbol::math_FindSymbol(), mcASSERT, mcEP_INITIALIZED, and mcSYMFIND_MATCH_INLINED.

bool mcSymbolHelpers::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.

Definition at line 670 of file Symbol.cpp.

References mcElementHelpers::data_AddProperty(), data_GetSymbol(), mcASSERT, and mcEP_INITIALIZED.

bool mcSymbolHelpers::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.

Definition at line 426 of file Symbol.h.

bool mcSymbolHelpers::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.

Definition at line 420 of file Symbol.h.

virtual mcBasicOpRes mcSymbolHelpers::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 390 of file Symbol.h.

References mcBOR_REMOVE_OPERAND.

bool mcSymbolHelpers::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 404 of file Symbol.h.

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

Symbols can be divided by only other identical symbols:.

a/b cannot produce a unique simple element like a mcSymbol or mcNumber... a/a produces a unique mcNumber set to one a^3/a^2 produces a unique mcSymbol (that is, a^1)

This is why in the math_CanBeXXXX() functions we just have to compare the bases of the symbols.

Implements mcElementHelpers.

Definition at line 402 of file Symbol.h.

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

Works like #math_CanBemath_AddeWith(), just for multiplication.

Implements mcElementHelpers.

Definition at line 403 of file Symbol.h.

bool mcSymbolHelpers::math_CompareThisOnly const mcElement ,
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 785 of file Symbol.cpp.

References mcSymbol::data_GetConstProperties(), data_GetConstProperties(), and data_isSameAs().

virtual mcBasicOpRes mcSymbolHelpers::math_DivideBaseOnlyBy const mcElement ,
mcElement p
[inline, virtual]
 

Implements mcExpElementHelpers.

Definition at line 392 of file Symbol.h.

References mcBOR_REMOVE_OPERAND.

mcRealValue mcSymbolHelpers::math_EvaluateBase  )  const [virtual]
 

Implements mcExpElementHelpers.

Definition at line 797 of file Symbol.cpp.

References data_GetConstProperties(), data_GetValue(), and data_isConstant().

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

Implements mcExpElementHelpers.

Definition at line 754 of file Symbol.cpp.

References mcESR_DONE.

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

Reimplemented from mcExpElementHelpers.

Definition at line 406 of file Symbol.h.

mcMathType mcSymbolHelpers::math_GetBaseMathType  )  const [virtual]
 

Implements mcExpElementHelpers.

Definition at line 768 of file Symbol.cpp.

References data_isParameter(), data_isRegistered(), data_isUnknown(), mcMathType::m_tMath3, mcElementHelpers::math_isConstant(), mcASSERT, mcMTL1_POLYNOMIAL, mcMTL2_ALGEBRAIC, mcMTL3_CONSTANT, mcMTL3_PARAMETRIC, and mcMTL3_UNKNOWN.

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

Returns the order position for this symbol.

Implements mcElementHelpers.

Definition at line 370 of file Symbol.h.

Referenced by math_isListedBeforeOf().

bool mcSymbolHelpers::math_isListedBeforeOf const mcElement s  )  const [virtual]
 

Returns TRUE if this symbol should be put before the given one in an ordered list.

This function takes in count 1) the type of symbol (parameter/unknown/constant) 2) the name of the symbol

Reimplemented from mcElementHelpers.

Definition at line 810 of file Symbol.cpp.

References data_GetSymbol(), mcSymbol::data_GetSymbol(), math_GetOrderPos(), mcElement::math_GetOrderPos(), mcElementHelpers::math_isListedBeforeOf(), and mcET_SYMBOL.

virtual mcBasicOpRes mcSymbolHelpers::math_MultiplyBaseOnlyBy const mcElement ,
mcElement p
[inline, virtual]
 

Implements mcExpElementHelpers.

Definition at line 391 of file Symbol.h.

References mcBOR_REMOVE_OPERAND.

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

Implements mcExpElementHelpers.

Definition at line 748 of file Symbol.cpp.

References mcESR_DONE.

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

Reimplemented from mcExpElementHelpers.

Definition at line 760 of file Symbol.cpp.

References mcESR_DONE.

mcSymbolHelpers::mcDEFINE_REFERENCE_DATA mcSymbol  ,
mcET_SYMBOL 
[private]
 


Member Data Documentation

mcSymbolProperties* mcSymbolHelpers::mdata_pEntry [protected]
 

Points to a mcSymbolProperties class, containing the properties of this mcSymbol.

Definition at line 71 of file Symbol.h.

int mcSymbolHelpers::mgui_nCursorPos [protected]
 

Definition at line 85 of file Symbol.h.

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

wxColour mcSymbolHelpers::sgui_clrUndefSymbols = wxColour(255, 0, 0) [static]
 

The color used to draw unregistered symbols.

The parameters, constants and unknowns which are not registered in the appropriate buffers, are drawn with this colour.

Definition at line 56 of file Symbol.cpp.

Referenced by gui_DrawBase().

int mcSymbolHelpers::smath_nConstantOrderPos = 1 [static]
 

Definition at line 64 of file Symbol.cpp.

int mcSymbolHelpers::smath_nParameterOrderPos = 2 [static]
 

Definition at line 65 of file Symbol.cpp.

int mcSymbolHelpers::smath_nUnknownOrderPos = 3 [static]
 

Definition at line 66 of file Symbol.cpp.


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

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

[ Top ]