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


C++ Marker类代码示例

本文整理汇总了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();
}
开发者ID:barnardm,项目名称:hhvm,代码行数:7,代码来源:heap-collect.cpp

示例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();
}
开发者ID:davidpucheta,项目名称:qtractor,代码行数:30,代码来源:qtractorTimeScale.cpp

示例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;
      }
开发者ID:silongzhou,项目名称:MuseScore,代码行数:28,代码来源:menus.cpp

示例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);
    }
  }
}
开发者ID:abhikalitra,项目名称:qtstalker,代码行数:34,代码来源:PlotWidget.cpp

示例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;
}
开发者ID:abhikalitra,项目名称:qttrader,代码行数:28,代码来源:MarkerSell.cpp

示例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;
  }
}
开发者ID:abhikalitra,项目名称:qttrader,代码行数:28,代码来源:Plot.cpp

示例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;
}
开发者ID:abhikalitra,项目名称:qtstalker,代码行数:60,代码来源:MarkerTLine.cpp

示例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));
            }
        }
开发者ID:neuroidss,项目名称:ugene,代码行数:34,代码来源:EditMarkerGroupDialog.cpp

示例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;
}
开发者ID:JenniferWang,项目名称:iOS-AR,代码行数:34,代码来源:ident_templ.cpp

示例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;
}
开发者ID:SAOImageDS9,项目名称:tkblt,代码行数:59,代码来源:tkbltGraph.C

示例11: traceHeap

void MemoryManager::traceHeap() {
  if (!RuntimeOption::EvalTraceHeap) return;
  if (empty()) return;
  Marker mkr;
  mkr.init();
  mkr.trace();
  mkr.sweep();
}
开发者ID:AmritanshuRanjan,项目名称:hhvm,代码行数:8,代码来源:heap-trace.cpp

示例12:

Marker::Marker(const Marker &m)
	:m_id(m.getID())
{
	for(int i=0; i<16; i++)
	{
		m_position[i]=m.getTransformation()[i];
	}
}
开发者ID:M-Mueller,项目名称:TonARt,代码行数:8,代码来源:Marker.cpp

示例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();
  }
}
开发者ID:SAOImageDS9,项目名称:tkblt,代码行数:8,代码来源:tkbltGraph.C

示例14: setBody

// Markers
void OpenSimContext::setBody(Marker& currentMarker, Body&  newBody, bool b) {
    if( b ) {
         currentMarker.changeFramePreserveLocation( *_configState, newBody );
    } else {
         currentMarker.changeFrame( newBody );
    }
    return;
}
开发者ID:mjhmilla,项目名称:opensim-core,代码行数:9,代码来源:OpenSimContext.cpp

示例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();
    }
  }
开发者ID:Milfhunter,项目名称:gpstk,代码行数:57,代码来源:SeriesList.cpp


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