//------------------------------------------------------------------------------
// displayHelper
// helper to display function
void BSTree::displayHelper(Node* target) const{
	if(target == NULL) {
		return;
	}
	displayHelper(target->left);
	cout << *target->data << endl;
	displayHelper(target->right);
}
Example #2
0
void displayCons(Value *list) {
    Value *cur = list;
    while (cur->type == CONS_TYPE) {
        displayHelper(car(cur));
        cur = cdr(cur);
    }
}
Example #3
0
/*
 * Display the contents of the linked list to the screen
 * in some kind of readable format.
 */
void display(Value *list){
    // Print ' at beginning if top level is null, cons, or symbol
    if (list->type == CONS_TYPE ||
        list->type == NULL_TYPE ||
        list->type == SYMBOL_TYPE ) {
        printf("'");
        if(list->type == NULL_TYPE){
            printf("()");
        }
    }
    displayHelper(list);
}
Example #4
0
void ZCircle::display(ZPainter &painter, int n,
                      ZStackObject::EDisplayStyle style) const
{
  if (!isVisible()) {
    return;
  }

  UNUSED_PARAMETER(style);
#if _QT_GUI_USED_
  painter.save();

  QPen pen(m_color, getPenWidth());
  pen.setCosmetic(m_usingCosmeticPen);

  if (hasVisualEffect(VE_DASH_PATTERN)) {
    pen.setStyle(Qt::DotLine);
  }

  painter.setPen(pen);

  //qDebug() << "Internal color: " << m_color;
//  const QBrush &oldBrush = painter.getBrush();
  if (hasVisualEffect(VE_GRADIENT_FILL)) {
    QRadialGradient gradient(50, 50, 50, 50, 50);
    gradient.setColorAt(0, QColor::fromRgbF(0, 1, 0, 1));
    gradient.setColorAt(1, QColor::fromRgbF(0, 0, 0, 0));

    /*
    QBrush brush(gradient);
    brush.setColor(m_color);
    brush.setStyle(Qt::RadialGradientPattern);
    painter.setBrush(brush);
    */
    //painter.setBrush(m_color);
    //painter.setBrush(QBrush(m_color, Qt::RadialGradientPattern));
  } else {
    if (hasVisualEffect(VE_NO_FILL)) {
      painter.setBrush(Qt::NoBrush);
    }
  }
  displayHelper(&painter, n, style);
//  painter.setBrush(oldBrush);

  painter.restore();
#endif
}
//------------------------------------------------------------------------------
// display
// displays the entire tree
void BSTree::display() const {
	displayHelper(root);
}