static void populateMarkerArea() { for (int x = gCurStart.x; x <= gCurEnd.x; ++x) { for (int y = gCurStart.y; y <= gCurEnd.y; ++y) { KdCell::Range& range = sgLevel.kdLevelTree->get(x, y); if (range.end <= range.start) { Block b; b.x = x; b.y = y; b.z = 0; b.dzx = 0; b.dzy = 0; range.start = sgLevel.blocks.insert(b); range.end = range.start + 1; } } } markerChanged(); }
void changeMarkerArea(int incz, int incdzx, int incdzy) { Vector3 min(gCurStart.x + 0.5f, gCurStart.y + 0.5f, 0.0f); Vector3 max(gCurEnd.x + 0.5f, gCurEnd.y + 0.5f, 0.0f); KdRangeTraverse iter(*sgLevel.kdLevelTree, min, max); KdList list(iter); while (list.next()) { Block& b = sgLevel.blocks[*list]; int x = b.x; int y = b.y; int z = b.z; int dzx = b.dzx; int dzy = b.dzy; int incx = -(gCurEnd.x + gCurStart.x - 2 * x) * incdzx; int incy = -(gCurEnd.y + gCurStart.y - 2 * y) * incdzy; z += incz + incx + incy; dzx += incdzx; dzy += incdzy; if (z - (abs(dzx) + abs(dzy)) >= 0 && (z + (abs(dzx) + abs(dzy))) <= MAX_LEVEL_HEIGHT * HEIGHT_STEPS && abs(dzx) <= 5 && abs(dzy) <= 5) { b.z = z; b.dzx = dzx; b.dzy = dzy; } } markerChanged(); }
void LineSpec::setMarker(QString arg) { if (m_marker == arg) return; // TODO: Check that the marker is valid m_marker = arg; emit markerChanged(arg); }
/*! \brief Specify a pen for the label \param p New pen \sa QwtMarker::labelPen() */ void QwtMarker::setLabelPen(const QPen &p) { if ( p != d_tPen ) { d_tPen = p; markerChanged(); } }
/*! \brief Specify a pen for the line. \param p New pen \sa QwtMarker::linePen() */ void QwtMarker::setLinePen(const QPen &p) { if ( p != d_pen ) { d_pen = p; markerChanged(); } }
/*! \brief Set the alignment of the label The alignment determines where the label is drawn relative to the marker's position. \param align Alignment. A combination of AlignTop, AlignBottom, AlignLeft, AlignRight, AlignCenter, AlgnHCenter, AlignVCenter. \sa QwtMarker::labelAlignment() */ void QwtMarker::setLabelAlignment(int align) { if ( align != d_align ) { d_align = align; markerChanged(); } }
/*! \brief Set the label \param txt label text \sa QwtMarker::label() */ void QwtMarker::setLabel(const QString &txt) { if ( txt != d_label ) { d_label = txt; markerChanged(); } }
/*! \brief Set the line style \param st Line style. Can be one of QwtMarker::NoLine, QwtMarker::HLine, QwtMarker::VLine or QwtMarker::Cross \sa QwtMarker::lineStyle() */ void QwtMarker::setLineStyle(QwtMarker::LineStyle st) { if ( st != d_style ) { d_style = st; markerChanged(); } }
/*! \brief Specify the font for the label \param f New font \sa QwtMarker::font() */ void QwtMarker::setFont(const QFont &f) { if ( f != d_font ) { d_font = f; markerChanged(); } }
static void flattenMarkerArea() { Vector3 min(gCurStart.x + 0.5f, gCurStart.y + 0.5f, 0.0f); Vector3 max(gCurEnd.x + 0.5f, gCurEnd.y + 0.5f, 0.0f); KdRangeTraverse iter(*sgLevel.kdLevelTree, min, max); KdList list(iter); while (list.next()) { Block& b = sgLevel.blocks[*list]; b.dzx = 0; b.dzy = 0; } markerChanged(); }
static void deleteMarkerArea() { Vector3 min(gCurStart.x + 0.5f, gCurStart.y + 0.5f, 0.0f); Vector3 max(gCurEnd.x + 0.5f, gCurEnd.y + 0.5f, 0.0f); KdRangeTraverse iter(*sgLevel.kdLevelTree, min, max); while (iter.next()) { KdCell::Range& range = sgLevel.kdLevelTree->cell(iter.index()).range; for (int index = range.start; index < range.end; ++index) { sgLevel.blocks.free(index); } range.start = -1; range.end = -1; } markerChanged(); }
/*! \brief Assign a symbol \param s New symbol \sa QwtSymbol, QwtMarker::symbol() */ void QwtMarker::setSymbol(const QwtSymbol &s) { d_sym = s; markerChanged(); }