本文整理汇总了C++中Marker类的典型用法代码示例。如果您正苦于以下问题:C++ Marker类的具体用法?C++ Marker怎么用?C++ Marker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Marker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: collect
void MemoryManager::collect() {
if (!RuntimeOption::EvalEnableGC || empty()) return;
Marker mkr;
mkr.init();
mkr.trace();
mkr.sweep();
}
示例2: while
// Sync method.
void qtractorTimeScale::sync ( const qtractorTimeScale& ts )
{
// Copy master parameters...
m_iSampleRate = ts.m_iSampleRate;
m_iTicksPerBeat = ts.m_iTicksPerBeat;
m_iPixelsPerBeat = ts.m_iPixelsPerBeat;
// Copy location markers...
m_markers.clear();
Marker *pMarker = ts.m_markers.first();
while (pMarker) {
m_markers.append(new Marker(*pMarker));
pMarker = pMarker->next();
}
m_markerCursor.reset();
// Copy tempo-map nodes...
m_nodes.clear();
Node *pNode = ts.nodes().first();
while (pNode) {
m_nodes.append(new Node(this, pNode->frame,
pNode->tempo, pNode->beatType,
pNode->beatsPerBar, pNode->beatDivisor));
pNode = pNode->next();
}
m_cursor.reset();
updateScale();
}
示例3: RepeatMeasure
Palette* MuseScore::newRepeatsPalette()
{
Palette* sp = new Palette;
sp->setName(QT_TRANSLATE_NOOP("Palette", "Repeats && Jumps"));
sp->setMag(0.65);
sp->setGrid(84, 28);
sp->setDrawGrid(true);
RepeatMeasure* rm = new RepeatMeasure(gscore);
sp->append(rm, tr("Repeat measure sign"));
for (int i = 0; i < markerTypeTableSize(); i++) {
if(markerTypeTable[i].type == Marker::Type::CODETTA) //not in smufl
continue;
Marker* mk = new Marker(gscore);
mk->setMarkerType(markerTypeTable[i].type);
sp->append(mk, qApp->translate("markerType", markerTypeTable[i].name.toUtf8().constData()));
}
for (int i = 0; i < jumpTypeTableSize(); i++) {
Jump* jp = new Jump(gscore);
jp->setJumpType(jumpTypeTable[i].type);
sp->append(jp, qApp->translate("jumpType", jumpTypeTable[i].userText.toUtf8().constData()));
}
return sp;
}
示例4: pit
void
PlotWidget::saveMarkers (DataBase &db)
{
// save plot markers
QHashIterator<QString, Plot *> pit(_plots);
while (pit.hasNext())
{
pit.next();
Plot *p = pit.value();
QHash<QString, Marker *> markers = p->markers();
QHashIterator<QString, Marker *> mit(markers);
while (mit.hasNext())
{
mit.next();
Marker *m = mit.value();
if (m->readOnly())
continue;
if (! m->modified())
continue;
Entity *e = m->settings();
e->setName(mit.key());
db.transaction();
db.set(e);
db.commit();
m->setModified(FALSE);
}
}
}
示例5: QString
int
MarkerSell::info (PluginData *pd)
{
if (! pd->data)
return 0;
Marker *sell = (Marker *) pd->data;
Entity *e = sell->settings();
QVariant *price = e->get(QString("price"));
if (! price)
return 0;
QVariant *date = e->get(QString("date"));
if (! date)
return 0;
QDateTime dt = date->toDateTime();
pd->info << "D=" + dt.toString("yyyy-MM-dd");
pd->info << "T=" + dt.toString("HH:mm:ss");
Strip strip;
QString ts;
strip.strip(price->toDouble(), 4, ts);
pd->info << QString("Sell=") + ts;
return 1;
}
示例6: it
void Plot::mouseClick (int button, QPoint p)
{
if (! g_symbol)
return;
if (_plotSettings.selected)
{
_plotSettings.selected->click(_plotSettings.status, button, p);
return;
}
QHashIterator<QString, Marker *> it(_plotSettings.markers);
while (it.hasNext())
{
it.next();
Marker *co = it.value();
if (co->readOnly())
continue;
if (! co->isSelected(p))
continue;
_plotSettings.selected = co;
_plotSettings.selected->click(_plotSettings.status, button, p);
return;
}
}
示例7:
int
MarkerTLine::highLow (PluginData *pd)
{
if (! pd->data)
return 0;
Marker *tline = (Marker *) pd->data;
Entity *e = tline->settings();
PlotDateScaleDraw *dsd = (PlotDateScaleDraw *) tline->plot()->axisScaleDraw(QwtPlot::xBottom);
if (! dsd)
return 1;
QVariant *date = e->get(QString("date"));
if (! date)
return 0;
QVariant *date2 = e->get(QString("date2"));
if (! date2)
return 0;
QVariant *price = e->get(QString("price"));
if (! price)
return 0;
QVariant *price2 = e->get(QString("price2"));
if (! price2)
return 0;
int x = dsd->dateToX(date->toDateTime());
if (x >= pd->start && x <= pd->end)
{
pd->high = price->toDouble();
double t = price2->toDouble();
if (t > pd->high)
pd->high = t;
pd->low = price->toDouble();
if (t < pd->low)
pd->low = t;
return 1;
}
int x2 = dsd->dateToX(date2->toDateTime());
if (x2 >= pd->start && x2 <= pd->end)
{
pd->high = price->toDouble();
double t = price2->toDouble();
if (t > pd->high)
pd->high = t;
pd->low = price->toDouble();
if (t < pd->low)
pd->low = t;
return 1;
}
return 1;
}
示例8: tr
void EditMarkerGroupDialog::sl_onTypeChanged(int newTypeIndex) {
if (newTypeIndex == currentTypeIndex) {
return;
}
MarkerDataType oldType = MarkerTypes::getDataTypeById(marker->getType());
MarkerDataType newType = MarkerTypes::getDataTypeById(typeIds.at(newTypeIndex));
bool changeMarker = false;
if (1 == marker->getValues().size()) { // contains only "rest"
changeMarker = true;
} else {
if (oldType == newType) {
changeMarker = true;
} else {
changeMarker = (QMessageBox::Ok == QMessageBox::question(this, tr("Warning"), tr("Are you really want to change marker's type? Some data can be lost!"), QMessageBox::Ok | QMessageBox::Cancel));
}
}
if (changeMarker) {
Marker *oldMarker = marker;
marker = MarkerFactory::createInstanse(typeIds.at(newTypeIndex), addParamEdit->text());
{
marker->setName(oldMarker->getName());
MarkerDataType oldType = MarkerTypes::getDataTypeById(oldMarker->getType());
MarkerDataType newType = MarkerTypes::getDataTypeById(marker->getType());
if (oldType == newType) {
foreach (const QString &key, oldMarker->getValues().keys()) {
marker->addValue(key, oldMarker->getValues().value(key));
}
} else {
marker->addValue(MarkerUtils::REST_OPERATION, oldMarker->getValues().value(MarkerUtils::REST_OPERATION));
}
}
示例9: assert
bool IdentificatorTemplMatch::readMarkerCode(const cv::Mat &area, Marker &marker) {
assert(area.rows == area.cols && area.rows == reqMarkerSize && area.type() == CV_8UC1); // must be quadratic and grayscale
// check the border as "cells" first
bool borderOk = checkBorder(area, 0, 0) // top row
&& checkBorder(area, 0, 7) // bottom row
&& checkBorder(area, 1, 0) // left column
&& checkBorder(area, 1, 7); // right column
if (!borderOk) return false;
// printf("ocv_ar::IdentificatorTemplMatch - border checks ok\n");
// get only the "content" of <area>, i.e. the marker without borders
int areaContentSize = area.cols - 2 * borderSize;
cv::Rect roi(borderSize, borderSize, areaContentSize, areaContentSize);
cv::Mat areaContent(area, roi);
// do the template matching for all templates we have
for (TemplateMap::iterator it = templates.begin();
it != templates.end();
++it)
{
int validRot;
if (checkTemplateRotations(areaContent, it->second, &validRot)) { // found a matching template!
marker.setId(it->first);
marker.rotatePoints(validRot);
return true;
}
}
return false;
}
示例10: extents
ClientData Graph::pickEntry(int xx, int yy, ClassId* classIdPtr)
{
if (flags & (LAYOUT | MAP_MARKERS)) {
*classIdPtr = CID_NONE;
return NULL;
}
// Sample coordinate is in one of the graph margins. Can only pick an axis.
Region2d exts;
extents(&exts);
if (xx>=exts.right || xx<exts.left || yy>=exts.bottom || yy<exts.top) {
Axis* axisPtr = nearestAxis(xx, yy);
if (axisPtr) {
*classIdPtr = axisPtr->classId();
return axisPtr;
}
}
// From top-to-bottom check:
// 1. markers drawn on top (-under false).
// 2. elements using its display list back to front.
// 3. markers drawn under element (-under true).
Marker* markerPtr = nearestMarker(xx, yy, 0);
if (markerPtr) {
*classIdPtr = markerPtr->classId();
return markerPtr;
}
GraphOptions* ops = (GraphOptions*)ops_;
ClosestSearch* searchPtr = &ops->search;
searchPtr->index = -1;
searchPtr->x = xx;
searchPtr->y = yy;
searchPtr->dist = (double)(searchPtr->halo + 1);
for (ChainLink* link = Chain_LastLink(elements_.displayList); link;
link = Chain_PrevLink(link)) {
Element* elemPtr = (Element*)Chain_GetValue(link);
ElementOptions* eops = (ElementOptions*)elemPtr->ops();
if (eops->hide)
continue;
elemPtr->closest();
}
// Found an element within the minimum halo distance.
if (searchPtr->dist <= (double)searchPtr->halo) {
*classIdPtr = searchPtr->elemPtr->classId();
return searchPtr->elemPtr;
}
markerPtr = nearestMarker(xx, yy, 1);
if (markerPtr) {
*classIdPtr = markerPtr->classId();
return markerPtr;
}
*classIdPtr = CID_NONE;
return NULL;
}
示例11: traceHeap
void MemoryManager::traceHeap() {
if (!RuntimeOption::EvalTraceHeap) return;
if (empty()) return;
Marker mkr;
mkr.init();
mkr.trace();
mkr.sweep();
}
示例12:
Marker::Marker(const Marker &m)
:m_id(m.getID())
{
for(int i=0; i<16; i++)
{
m_position[i]=m.getTransformation()[i];
}
}
示例13: Chain_NextLink
void Graph::configureMarkers()
{
for (ChainLink* link = Chain_FirstLink(markers_.displayList); link;
link = Chain_NextLink(link)) {
Marker* markerPtr = (Marker*)Chain_GetValue(link);
markerPtr->configure();
}
}
示例14: setBody
// Markers
void OpenSimContext::setBody(Marker& currentMarker, Body& newBody, bool b) {
if( b ) {
currentMarker.changeFramePreserveLocation( *_configState, newBody );
} else {
currentMarker.changeFrame( newBody );
}
return;
}
示例15: getStyle
void SeriesList::drawInFrame(Frame& innerFrame, double minX, double maxX, double minY, double maxY)
{
double multX = innerFrame.getWidth()/(maxX-minX);
double multY = innerFrame.getHeight()/(maxY-minY);
// Draw lines
for(int i=0;i<getNumSeries();i++)
{
innerFrame.push_state();
StrokeStyle s = getStyle(i);
Marker m = getMarker(i);
if(m.getColor().isClear() && s.getColor().isClear())
{
innerFrame << Comment("Plot contained data with clear stroke and marker. Skipping.");
continue;
}
vector< pair<double,double> >& vec = getPointList(i);
Path curve(vec,innerFrame.lx(), innerFrame.ly());
// What I'd give for a line of haskell...
// map (\(x,y) -> (multX*(x-minX), multY*(y-minY))) vector
map_object map_instance(multX,minX,multY,minY);
innerFrame.setMarker(m);
innerFrame.setLineStyle(s);
if(s.getColor().isClear())
{
// crop
auto_ptr< Path > cropX = Splitter::cropToBox(minX,maxX,minY,maxY,curve);
// Fit it to the box.
std::for_each(cropX->begin(), cropX->end(), map_instance);
// Draw the line
innerFrame.line(*cropX);
}
else
{
// interpolate
auto_ptr< std::list<Path> > interpX = Splitter::interpToBox(minX,maxX,minY,maxY,curve);
for(std::list<Path>::iterator i=interpX->begin();i!=interpX->end();i++)
{
// Fit it to the box
std::for_each(i->begin(), i->end(), map_instance);
// Draw the line
innerFrame.line(*i);
}
}
innerFrame.pop_state();
}
}