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

mcMathAndSystemHelpers Class Reference

#include <MathAndSystem.h>

Inheritance diagram for mcMathAndSystemHelpers:

Inheritance graph
[legend]
Collaboration diagram for mcMathAndSystemHelpers:

Collaboration graph
[legend]
List of all members.

Detailed Description

A set of mcMathLines connected with an AND logical operator.

Note:
In the following documentation with the term "main system symbol" I mean the great '{' symbol on the left, which groups all the equations\inequalities of the system.

Definition at line 70 of file MathAndSystem.h.

Public Member Functions

 mcMathAndSystemHelpers ()
virtual ~mcMathAndSystemHelpers ()
void data_SetFilter (const mcFilter *p, int n=-1)
 Sets the filter associated with all the elements of the array.
mcMathLinegui_GetFocusLine ()
const mcMathLinegui_GetFocusLine () const
void gui_DrawSystemSymbols (wxDC &dc, int x, int y, long flags) const
 Draws the connector symbols of this system *without* drawing the elements contained.
void gui_RecalcSymbolSize ()
 Recalculates the size of one of the connectors (they must have all the same size for mcMathSystem algorithms) and puts the result into the mgui_szSymbol variable.
mcElement gui_GetSelection () const
 Returns a pointer to the portion of mathsystem currently selected; NULL if there are no parts selected.
bool gui_isIDChanged () const
 Returns TRUE if the last call to #data_UpdateBmp() set as active element (the element under mouse cursor) an element which is different from the element which was active before that call.
virtual int gui_GetActiveElemID () const
 Returns the ID of the element which was marked as active in the last bitmap update.
void math_Merge (const mcMathAndSystem &arr1, const mcMathAndSystem &arr2)
mcMathSystemType math_GetMathSystemType () const
 Returns the type of this math system as a mcMathOrSystemType enumeration value.
wxString io_GetInlinedExprOfLogicalOperator () const
 Returns as inlined expression all the current system.
bool io_ImportToken (const wxString &str, wxString *perr)
DATA functions
Functions that work on the content but which do not belong to the general GUI, MATH and IO sections.

void data_AddLine (mcMathLine *ptoadd)
 Adds the given line to the array taking ownership of it.
void data_AddEmptyLine ()
 Adds an empty line to the array.
mcMathLinedata_GetLine (int n)
const mcMathLinedata_GetLine (int n) const
mcMathLinedata_GetLastLine ()
const mcMathLinedata_GetLastLine () const

Static Public Attributes

static int sgui_nSpaceLeftRight = 4
 The space left on the left and the right of the math lines.
static int sgui_nSpaceAboveBelow = 4
 The space left above and below the math lines.
static int sgui_nSpaceBetween = 10
 The space between two math lines when sgui_bUseCurlyBracket is TRUE and thus lines are drawn one above the other.
static bool sgui_bHorizOrientation = FALSE
 If TRUE, then the lines of this system will be drawn horizontally, if FALSE, then they will be drawn vertically.
static mcMathAndSystemRenderMode sgui_nRenderMode = mcMASRM_DRAW_AND_SYMBOLS
 If TRUE, then sgui_bHorizOrientation will be ignored (the lines will always ve drawn in vertical order) and a curly bracket on the left side of the system.

Protected Member Functions

int gui_UpdateActiveLine (int n, wxMemoryDC &hDC, int x, int y, long flags, const wxPoint &p)
 Sets the n-th line as the line where the cursor is currently over.
int gui_GetLineContainingPt (int x, int y, const wxPoint &pt)
 Returns the index of the math-line which contains the given point.
void gui_UpdateSystemSym ()
 Updates the font which is used to draw the main system symbol.
void data_Delete (int n)
 Removes the n-th line of the array.
mcAbstractItemdata_GetCopyOf (int n) const
 Returns a copy of the n-th line of the array.
virtual bool gui_DrawHorizontally () const
 Returns TRUE if the elements of the array should be oriented horizontally.
virtual bool gui_DrawVertically () const
virtual int gui_GetSpaceAboveBelow () const
virtual int gui_GetSpaceLeftRight () const
virtual int gui_GetSpaceBetween () const

Private Member Functions

 mcDEFINE_REFERENCE_DATA (mcMathAndSystem, mcET_MATHANDSYSTEM)


Constructor & Destructor Documentation

mcMathAndSystemHelpers::mcMathAndSystemHelpers  )  [inline]
 

Definition at line 109 of file MathAndSystem.h.

References mcElementHelpers::data_Init().

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

Definition at line 110 of file MathAndSystem.h.

References mcAbstractArray::data_Clear().


Member Function Documentation

void mcMathAndSystemHelpers::data_AddEmptyLine  )  [inline]
 

Adds an empty line to the array.

Definition at line 133 of file MathAndSystem.h.

Referenced by io_ImportToken().

void mcMathAndSystemHelpers::data_AddLine mcMathLine ptoadd  )  [inline]
 

Adds the given line to the array taking ownership of it.

Definition at line 129 of file MathAndSystem.h.

References mcAbstractArray::data_Add().

void mcMathAndSystemHelpers::data_Delete int  n  )  [inline, protected, virtual]
 

Removes the n-th line of the array.

Implements mcAbstractArray.

Definition at line 99 of file MathAndSystem.h.

References mcAbstractArray::data_GetItem().

mcAbstractItem* mcMathAndSystemHelpers::data_GetCopyOf int  n  )  const [inline, protected, virtual]
 

Returns a copy of the n-th line of the array.

Reimplemented from mcAbstractArray.

Definition at line 103 of file MathAndSystem.h.

References mcAbstractItem.

const mcMathLine& mcMathAndSystemHelpers::data_GetLastLine  )  const [inline]
 

Definition at line 142 of file MathAndSystem.h.

References mcMathSystemHelpers::data_GetLast().

mcMathLine& mcMathAndSystemHelpers::data_GetLastLine  )  [inline]
 

Definition at line 140 of file MathAndSystem.h.

References mcMathSystemHelpers::data_GetLast().

Referenced by io_ImportToken().

const mcMathLine& mcMathAndSystemHelpers::data_GetLine int  n  )  const [inline]
 

Definition at line 138 of file MathAndSystem.h.

References mcMathSystemHelpers::data_GetConstChild().

mcMathLine& mcMathAndSystemHelpers::data_GetLine int  n  )  [inline]
 

Definition at line 136 of file MathAndSystem.h.

References mcElementHelpers::data_GetChild().

Referenced by data_SetFilter(), gui_GetActiveElemID(), gui_isIDChanged(), and math_GetMathSystemType().

void mcMathAndSystemHelpers::data_SetFilter const mcFilter p,
int  n = -1
 

Sets the filter associated with all the elements of the array.

See mcFilter and mcPolynomial for more info.

Parameters:
p The new mcFilter to set (can be NULL)
n The line to set the filter for or -1 to set it for all the lines of this array

Definition at line 90 of file MathAndSystem.cpp.

References mcMathSystemHelpers::data_GetCount(), data_GetLine(), and mcMathMng::data_SetFilter().

virtual bool mcMathAndSystemHelpers::gui_DrawHorizontally  )  const [inline, protected, virtual]
 

Returns TRUE if the elements of the array should be oriented horizontally.

Implements mcMathSystemHelpers.

Definition at line 183 of file MathAndSystem.h.

void mcMathAndSystemHelpers::gui_DrawSystemSymbols wxDC &  dc,
int  x,
int  y,
long  flags
const [virtual]
 

Draws the connector symbols of this system *without* drawing the elements contained.

Implements mcMathSystemHelpers.

Definition at line 130 of file MathAndSystem.cpp.

References mcMathSystemHelpers::data_GetCount(), mcMathSystemHelpers::gui_GetXOfSymbol(), mcMathSystemHelpers::gui_GetYOfSymbol(), mcElementHelpers::gui_SelectStyle(), mcMASRM_DRAW_AND_SYMBOLS, mcMASRM_DRAW_AND_TEXT, mcMASRM_DRAW_CURLY_BRACKET, and sgui_nRenderMode.

virtual bool mcMathAndSystemHelpers::gui_DrawVertically  )  const [inline, protected, virtual]
 

Implements mcMathSystemHelpers.

Definition at line 184 of file MathAndSystem.h.

int mcMathAndSystemHelpers::gui_GetActiveElemID  )  const [virtual]
 

Returns the ID of the element which was marked as active in the last bitmap update.

Note:
This function can be much faster than calling gui_GetActiveElem(...).data_GetID() because mcMathLine holds a variable containing directly the ID, while gui_GetActiveElem() requires a search into the math & gui tree.

Definition at line 175 of file MathAndSystem.cpp.

References data_GetLine(), mcMathLine::gui_GetActiveElemID(), and mcDRW_NOACTIVEELEM.

const mcMathLine& mcMathAndSystemHelpers::gui_GetFocusLine  )  const [inline]
 

Definition at line 194 of file MathAndSystem.h.

References mcMathSystemHelpers::gui_GetFocus().

mcMathLine& mcMathAndSystemHelpers::gui_GetFocusLine  )  [inline]
 

Definition at line 192 of file MathAndSystem.h.

References mcMathSystemHelpers::gui_GetFocus().

int mcMathAndSystemHelpers::gui_GetLineContainingPt int  x,
int  y,
const wxPoint &  pt
[protected]
 

Returns the index of the math-line which contains the given point.

mcElement mcMathAndSystemHelpers::gui_GetSelection  )  const [virtual]
 

Returns a pointer to the portion of mathsystem currently selected; NULL if there are no parts selected.

Reimplemented from mcElementHelpers.

Definition at line 183 of file MathAndSystem.cpp.

References mcMathSystemHelpers::data_Get(), mcMathSystemHelpers::data_GetCount(), mcElementHelpers::gui_isSelected(), and mcEmptySystem.

virtual int mcMathAndSystemHelpers::gui_GetSpaceAboveBelow  )  const [inline, protected, virtual]
 

Implements mcMathSystemHelpers.

Definition at line 186 of file MathAndSystem.h.

virtual int mcMathAndSystemHelpers::gui_GetSpaceBetween  )  const [inline, protected, virtual]
 

Implements mcMathSystemHelpers.

Definition at line 188 of file MathAndSystem.h.

virtual int mcMathAndSystemHelpers::gui_GetSpaceLeftRight  )  const [inline, protected, virtual]
 

Implements mcMathSystemHelpers.

Definition at line 187 of file MathAndSystem.h.

bool mcMathAndSystemHelpers::gui_isIDChanged  )  const
 

Returns TRUE if the last call to #data_UpdateBmp() set as active element (the element under mouse cursor) an element which is different from the element which was active before that call.

Definition at line 161 of file MathAndSystem.cpp.

References data_GetLine(), and mcMathLine::gui_isIDChanged().

void mcMathAndSystemHelpers::gui_RecalcSymbolSize  )  [virtual]
 

Recalculates the size of one of the connectors (they must have all the same size for mcMathSystem algorithms) and puts the result into the mgui_szSymbol variable.

Implements mcMathSystemHelpers.

Definition at line 111 of file MathAndSystem.cpp.

References mcElementHelpers::gui_GetSizeOf(), mcElementHelpers::gui_SelectStyle(), mcMASRM_DRAW_AND_SYMBOLS, mcMASRM_DRAW_AND_TEXT, mcMASRM_DRAW_CURLY_BRACKET, and sgui_nRenderMode.

int mcMathAndSystemHelpers::gui_UpdateActiveLine int  n,
wxMemoryDC &  hDC,
int  x,
int  y,
long  flags,
const wxPoint &  p
[protected]
 

Sets the n-th line as the line where the cursor is currently over.

This requires some manipulation of mgui_nLastActiveLine and mgui_nCurrentActiveLine to optimize redrawing with the #isIDChanged() function. This function is protected because its use should be allowed only to mcMathOrSystem functions. The users of this class should call the #data_UpdateSystemBmp() function (which calls this function with the right parameters).

void mcMathAndSystemHelpers::gui_UpdateSystemSym  )  [protected]
 

Updates the font which is used to draw the main system symbol.

wxString mcMathAndSystemHelpers::io_GetInlinedExprOfLogicalOperator  )  const [inline, virtual]
 

Returns as inlined expression all the current system.

Implements mcMathSystemHelpers.

Definition at line 241 of file MathAndSystem.h.

bool mcMathAndSystemHelpers::io_ImportToken const wxString &  str,
wxString *  perr
[virtual]
 

Implements mcMathSystemHelpers.

Definition at line 205 of file MathAndSystem.cpp.

References data_AddEmptyLine(), data_GetLastLine(), and mcMathSystemHelpers::io_ImportInlinedExpr().

mcMathSystemType mcMathAndSystemHelpers::math_GetMathSystemType  )  const [virtual]
 

Returns the type of this math system as a mcMathOrSystemType enumeration value.

Implements mcMathSystemHelpers.

Definition at line 222 of file MathAndSystem.cpp.

References mcMathSystemHelpers::data_GetCount(), data_GetLine(), mcMathMng::math_GetMathMngType(), mcMMT_EQUATION, mcMMT_EXPRESSION, mcMSTL1_EQUATIONS, mcMSTL1_EXPRESSION, mcMSTL1_INEQUALITIES, and mcMSTL1_MIXED.

void mcMathAndSystemHelpers::math_Merge const mcMathAndSystem arr1,
const mcMathAndSystem arr2
 

Definition at line 246 of file MathAndSystem.cpp.

References mcAbstractArray::data_Add(), mcAbstractArray::data_Clear(), mcMathSystemHelpers::data_DeepCopy(), mcMATHLOG, mcTXT, and mcTXTTHIS.

mcMathAndSystemHelpers::mcDEFINE_REFERENCE_DATA mcMathAndSystem  ,
mcET_MATHANDSYSTEM 
[private]
 


Member Data Documentation

bool mcMathAndSystemHelpers::sgui_bHorizOrientation = FALSE [static]
 

If TRUE, then the lines of this system will be drawn horizontally, if FALSE, then they will be drawn vertically.

Definition at line 58 of file MathAndSystem.cpp.

mcMathAndSystemRenderMode mcMathAndSystemHelpers::sgui_nRenderMode = mcMASRM_DRAW_AND_SYMBOLS [static]
 

If TRUE, then sgui_bHorizOrientation will be ignored (the lines will always ve drawn in vertical order) and a curly bracket on the left side of the system.

Definition at line 59 of file MathAndSystem.cpp.

Referenced by gui_DrawSystemSymbols(), and gui_RecalcSymbolSize().

int mcMathAndSystemHelpers::sgui_nSpaceAboveBelow = 4 [static]
 

The space left above and below the math lines.

Definition at line 55 of file MathAndSystem.cpp.

int mcMathAndSystemHelpers::sgui_nSpaceBetween = 10 [static]
 

The space between two math lines when sgui_bUseCurlyBracket is TRUE and thus lines are drawn one above the other.

Definition at line 57 of file MathAndSystem.cpp.

int mcMathAndSystemHelpers::sgui_nSpaceLeftRight = 4 [static]
 

The space left on the left and the right of the math lines.

Definition at line 56 of file MathAndSystem.cpp.


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

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

[ Top ]