当前位置: 首页>>代码示例>>C++>>正文


C++ MathCell类代码示例

本文整理汇总了C++中MathCell的典型用法代码示例。如果您正苦于以下问题:C++ MathCell类的具体用法?C++ MathCell怎么用?C++ MathCell使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了MathCell类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: wxCHECK_VERSION

MathCell* MathParser::ParseSupTag(wxXmlNode* node)
{
  ExptCell *expt = new ExptCell;
#if wxCHECK_VERSION(2,9,0)
  if (node->GetAttributes() != NULL)
#else
  if (node->GetProperties() != NULL)
#endif
    expt->IsMatrix(true);
  wxXmlNode* child = node->GetChildren();
  if (child)
  {
    expt->SetBase(ParseTag(child, false));
    child = child->GetNext();
    if (child)
    {
      MathCell* power = ParseTag(child, false);
      power->SetExponentFlag();
      expt->SetPower(power);
      expt->SetType(m_ParserStyle);
      expt->SetStyle(TS_VARIABLE);
      return expt;
    }
  }
  delete expt;
  return NULL;
}
开发者ID:DevJohan,项目名称:wxmaxima,代码行数:27,代码来源:MathParser.cpp

示例2: wxT

wxString IntCell::ToString(bool all)
{
  wxString s = wxT("integrate(");

  s += m_base->ToString(true);

  MathCell* tmp = m_var;
  wxString var;
  tmp = tmp->m_next;
  if (tmp != NULL)
  {
    var = tmp->ToString(true);
  }

  wxString to = m_over->ToString(true);
  wxString from = m_under->ToString(true);

  s += wxT(",") + var;
  if (m_intStyle == INT_DEF)
    s += wxT(",") + from + wxT(",") + to;

  s += wxT(")");
  s += MathCell::ToString(all);
  return s;
}
开发者ID:Ionic,项目名称:wxmaxima,代码行数:25,代码来源:IntCell.cpp

示例3: GetMaxPoint

void Bitmap::GetMaxPoint(int* width, int* height)
{
  MathCell* tmp = m_tree;
  int currentHeight = 0;
  int currentWidth = 0;
  *width = 0;
  *height = 0;
  bool bigSkip = false;
  bool firstCell = true;
  while (tmp != NULL)
  {
    if (!tmp->m_isBroken)
    {
      if (tmp->BreakLineHere() || firstCell)
      {
        firstCell = false;
        currentHeight += tmp->GetMaxHeight();
        if (bigSkip)
          currentHeight += MC_LINE_SKIP;
        *height = currentHeight;
        currentWidth = tmp->GetWidth();
        *width = MAX(currentWidth, *width);
      }
      else
      {
        currentWidth += (tmp->GetWidth() + MC_CELL_SKIP);
        *width = MAX(currentWidth - MC_CELL_SKIP, *width);
      }
      bigSkip = tmp->m_bigSkip;
    }
    tmp = tmp->m_nextToDraw;
  }
}
开发者ID:DevJohan,项目名称:wxmaxima,代码行数:33,代码来源:Bitmap.cpp

示例4: ParseTag

MathCell* MathParser::ParseSubSupTag(wxXmlNode* node)
{
  SubSupCell *subsup = new SubSupCell;
  wxXmlNode* child = node->GetChildren();
  if (child)
  {
    subsup->SetBase(ParseTag(child, false));
    child = child->GetNext();
    if (child)
    {
      MathCell* index = ParseTag(child, false);
      index->SetExponentFlag();
      subsup->SetIndex(index);
      child = child->GetNext();
      if (child)
      {
        MathCell* power = ParseTag(child, false);
        power->SetExponentFlag();
        subsup->SetExponent(power);
        subsup->SetType(m_ParserStyle);
        subsup->SetStyle(TS_VARIABLE);
        return subsup;
      }
    }
  }
  delete subsup;
  return NULL;
}
开发者ID:DevJohan,项目名称:wxmaxima,代码行数:28,代码来源:MathParser.cpp

示例5: while

void GroupCell::AppendOutput(MathCell *cell)
{
  if (m_output == NULL) {
    m_output = cell;

    if (m_groupType == GC_TYPE_CODE && m_input->m_next != NULL)
      ((EditorCell *)(m_input->m_next))->ContainsChanges(false);

    m_lastInOutput = m_output;

    while (m_lastInOutput->m_next != NULL)
      m_lastInOutput = m_lastInOutput->m_next;
  }

  else {
    MathCell *tmp = m_lastInOutput;
    if (tmp == NULL)
      tmp = m_output;

    while (tmp->m_next != NULL)
      tmp = tmp->m_next;

    tmp->AppendCell(cell);

    while (m_lastInOutput->m_next != NULL)
      m_lastInOutput = m_lastInOutput->m_next;
  }

  if (m_appendedCells == NULL)
    m_appendedCells = cell;
}
开发者ID:BigMcLargeHuge,项目名称:wxmaxima,代码行数:31,代码来源:GroupCell.cpp

示例6: ToString

wxString DiffCell::ToString()
{
  MathCell* tmp = m_baseCell->m_next;
  wxString s = wxT("'diff(");
  if (tmp != NULL)
    s += tmp->ListToString();
  s += m_diffCell->ListToString();
  s += wxT(")");
  return s;
}
开发者ID:belkacem77,项目名称:wxmaxima,代码行数:10,代码来源:DiffCell.cpp

示例7: ClearCacheList

void MathCell::ClearCacheList()
{
  MathCell *tmp = this;
  
  while(tmp != NULL)
  {
    tmp->ClearCache();
    tmp = tmp->m_next;
  }
}
开发者ID:belkacem77,项目名称:wxmaxima,代码行数:10,代码来源:MathCell.cpp

示例8: UnBreakUpCells

void GroupCell::UnBreakUpCells()
{
  MathCell *tmp = m_output;
  while (tmp != NULL) {
    if (tmp->m_isBroken) {
      tmp->Unbreak();
    }
    tmp = tmp->m_next;
  }
}
开发者ID:BigMcLargeHuge,项目名称:wxmaxima,代码行数:10,代码来源:GroupCell.cpp

示例9: SetParent

void GroupCell::SetParent(MathCell *parent, bool all)
{
  if (m_input != NULL)
    m_input->SetParent(parent, true);

  MathCell *tmp = m_output;
  while (tmp != NULL) {
    tmp->SetParent(parent, false);
    tmp = tmp->m_next;
  }
}
开发者ID:BlackEdder,项目名称:wxmaxima,代码行数:11,代码来源:GroupCell.cpp

示例10: ToString

wxString DiffCell::ToString()
{
  if (m_isBroken)
    return wxEmptyString;
  MathCell* tmp = m_baseCell->m_next;
  wxString s = wxT("'diff(");
  if (tmp != NULL)
    s += tmp->ListToString();
  s += m_diffCell->ListToString();
  s += wxT(")");
  return s;
}
开发者ID:minoki,项目名称:wxmaxima,代码行数:12,代码来源:DiffCell.cpp

示例11: SetParent

/*! Set the parent of this group cell

 \todo: Is the while loop a simple m_output->SetParentList(parent)?
*/
void GroupCell::SetParent(MathCell *parent)
{
  //m_group = parent;
  if (m_input != NULL)
    m_input->SetParentList(parent);

  MathCell *tmp = m_output;
  while (tmp != NULL) {
    tmp->SetParent(parent);
    tmp = tmp->m_next;
  }
}
开发者ID:BigMcLargeHuge,项目名称:wxmaxima,代码行数:16,代码来源:GroupCell.cpp

示例12: BreakLines

void Bitmap::BreakLines()
{
  int fullWidth = BM_FULL_WIDTH;
  int currentWidth = 0;

  MathCell* tmp = m_tree;

  while (tmp != NULL)
  {
    if (!tmp->m_isBroken)
    {
      tmp->BreakLine(false);
      tmp->ResetData();
      if (tmp->BreakLineHere() ||
              (currentWidth + tmp->GetWidth() >= fullWidth))
      {
        currentWidth = tmp->GetWidth();
        tmp->BreakLine(true);
      }
      else
        currentWidth += (tmp->GetWidth() + MC_CELL_SKIP);
    }
    tmp = tmp->m_nextToDraw;
  }
}
开发者ID:DevJohan,项目名称:wxmaxima,代码行数:25,代码来源:Bitmap.cpp

示例13: Copy

MathCell *MathCell::CopyList()
{
  MathCell *dest = Copy();
  MathCell *src = this->m_next;
  MathCell *ret = dest;
  
  while(src != NULL)
  {
    dest->AppendCell(src->Copy());
    src = src->m_next;
    dest = dest->m_next;
  }

  return ret;
}
开发者ID:BigMcLargeHuge,项目名称:wxmaxima,代码行数:15,代码来源:MathCell.cpp

示例14: ToString

wxString GroupCell::ToString()
{
  wxString str;
  if (GetEditable()) {
    str = m_input->ListToString();
    if (m_output != NULL && !m_hide) {
      MathCell *tmp = m_output;
      while (tmp != NULL) {
        if (tmp->ForceBreakLineHere() && str.Length()>0)
          str += wxT("\n");
        str += tmp->ToString();
        tmp = tmp->m_nextToDraw;
      }
    }
  }
  return str;
}
开发者ID:BigMcLargeHuge,项目名称:wxmaxima,代码行数:17,代码来源:GroupCell.cpp

示例15: ListToString

wxString MathCell::ListToString()
{
  wxString retval;
  MathCell *tmp = this;
  bool firstline = true;
  
  while(tmp!=NULL)
    {
      retval+=tmp->ToString();
      if((!firstline)&&(tmp->m_forceBreakLine))
        retval+=wxT("\n");

      firstline = false;
      tmp=tmp->m_next;
    }
  
  return retval;
}
开发者ID:BigMcLargeHuge,项目名称:wxmaxima,代码行数:18,代码来源:MathCell.cpp


注:本文中的MathCell类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。