这篇教程C++ track函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中track函数的典型用法代码示例。如果您正苦于以下问题:C++ track函数的具体用法?C++ track怎么用?C++ track使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了track函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: qDebugvoid Tuplet::layout() { if (_elements.empty()) { qDebug("Tuplet::layout(): tuplet is empty"); return; } // is in a TAB without stems, skip any format: tuplets are not shown if (staff() && staff()->isTabStaff() && staff()->staffType()->slashStyle()) return; qreal _spatium = spatium(); if (_numberType != NumberType::NO_TEXT) { if (_number == 0) { _number = new Text(score()); _number->setTextStyleType(TextStyleType::TUPLET); _number->setTrack(track()); _number->setParent(this); _number->setVisible(visible()); } if (_numberType == NumberType::SHOW_NUMBER) _number->setText(QString("%1").arg(_ratio.numerator())); else _number->setText(QString("%1:%2").arg(_ratio.numerator()).arg(_ratio.denominator())); } else { if (_number) { if (_number->selected()) score()->deselect(_number); delete _number; _number = 0; } } // // find out main direction // if (_direction == MScore::Direction::AUTO) { int up = 1; foreach (const DurationElement* e, _elements) { if (e->type() == Element::Type::CHORD) { const Chord* c = static_cast<const Chord*>(e); if (c->stemDirection() != MScore::Direction::AUTO) up += c->stemDirection() == MScore::Direction::UP ? 1000 : -1000; else up += c->up() ? 1 : -1; } else if (e->type() == Element::Type::TUPLET) { // TODO } } _isUp = up > 0; }
开发者ID:JessicaWhite17,项目名称:MuseScore,代码行数:51,
示例2: getmcmf pair<long long,long long> getmcmf(int sz,int source,int sink,int times){ pair<long long,long long> res; res.first=0;res.second=0;n=sz; if(!times) times=-1; while(times){ spfa(source,sink); if(d[sink][1] == 0) break; res.first += d[sink][1]; res.second += d[sink][0] * d[sink][1]; track(sink,source,(int)d[sink][1]); times--; } return res; }
开发者ID:jihoon-ko,项目名称:AlgorithmStorage,代码行数:14,
示例3: currentTrackint TimelineDock::clipCount(int trackIndex) const{ if (trackIndex < 0) trackIndex = currentTrack(); if (trackIndex >= 0 && trackIndex < m_model.trackList().size()) { int i = m_model.trackList().at(trackIndex).mlt_index; QScopedPointer<Mlt::Producer> track(m_model.tractor()->track(i)); if (track) { Mlt::Playlist playlist(*track); return playlist.count(); } } return 0;}
开发者ID:EdKeith,项目名称:shotcut,代码行数:14,
示例4: switchQVariant Fermata::propertyDefault(Pid propertyId) const { switch (propertyId) { case Pid::PLACEMENT: return int(track() & 1 ? Placement::BELOW : Placement::ABOVE); case Pid::TIME_STRETCH: return 1.0; // articulationList[int(articulationType())].timeStretch; case Pid::PLAY: return true; default: break; } return Element::propertyDefault(propertyId); }
开发者ID:mmuman,项目名称:MuseScore,代码行数:14,
示例5: DurationElementChordRest::ChordRest(const ChordRest& cr, bool link) : DurationElement(cr) { _durationType = cr._durationType; _staffMove = cr._staffMove; _beam = 0; _tabDur = 0; // tab sur. symb. depends upon context: can't be // simply copied from another CR for (Articulation* a : cr._articulations) { // make deep copy Articulation* na = new Articulation(*a); if (link) na->linkTo(a); na->setParent(this); na->setTrack(track()); _articulations.append(na); } _beamMode = cr._beamMode; _up = cr._up; _small = cr._small; _crossMeasure = cr._crossMeasure; _space = cr._space; for (Lyrics* l : cr._lyricsList) { // make deep copy if (l == 0) { _lyricsList.append(0); continue; } Lyrics* nl = new Lyrics(*l); if (link) nl->linkTo(l); nl->setParent(this); nl->setTrack(track()); _lyricsList.append(nl); } }
开发者ID:DannyBehar,项目名称:MuseScore,代码行数:37,
示例6: forceCallback_void Projectile::update(int milliseconds){ lifeTime_ -= milliseconds; if (alive_) { //Turn off penetration if (penetration_ < 0) { body_->GetFixtureList()->SetSensor(false); } if (lastPen_.z != 0) { forceCallback_(b2Vec2(lastPen_.x, lastPen_.y), force_.force, force_.radius, force_.lifeTime, faction_); lastPen_.z = 0; } if (tracking_.radius != 0 && tracking_.speed != 0) { track(); } if (target_.z != 0) { b2Vec2 dir = b2Vec2(body_->GetPosition().x - target_.x, body_->GetPosition().y - target_.y); orient(dir); } b2Vec2 vel = body_->GetLinearVelocity(); body_->SetTransform(body_->GetPosition(), atan2f(-vel.x, vel.y)); //std::cout << vel.Length() << std::endl; if ((bounce_ <= 0 && vel.Length() <= 0) || hp_ <= 0 || lifeTime_ <= 0) { alive_ = false; } } //Do our force once before we deactivate else if (alive_ == false && active_ == true) { forceCallback_(body_->GetPosition(), force_.force, force_.radius, force_.lifeTime, faction_); active_ = false; } else active_ = false;}
开发者ID:shovelware,项目名称:MySides,代码行数:49,
示例7: apply_track void apply_track(int **input,int **tracked,int width, int height, int lowthresh,int highthresh) { int i,j; int **marked; d_w = width; d_h = height; //int [][] tracked = new int[d_w][d_h]; marked= new int* [d_w]; for (i=0;i<d_w;i++) marked[i]=new int [d_h]; std::stack<int> to_track; //Initialise the marked array for( i = 0; i < d_w; i++){ for( j = 0; j < d_h; j++){ marked[i][j] = 0; } } //Now find all the starting points for the tracking for( i = 0; i < d_w; i++){ for( j = 0; j < d_h; j++){ //If the point is unmarked and above high threshold then track if((input[i][j] > highthresh) && (marked[i][j] == 0)){ track(input, marked, to_track, lowthresh, i, j); } } } //Now clear all the pixels in the input which are unmarked for( i = 0; i < d_w; i++){ for( j = 0; j < d_h; j++){ if(marked[i][j] == 0){ tracked[i][j] = 0; } else { tracked[i][j] = input[i][j]; } } } for(i=0;i<d_w;i++) delete(marked[i]); delete(marked); }
开发者ID:AshwinChandlapur,项目名称:perception,代码行数:49,
示例8: calloc/* 0.15 requires we track calloc too */void* calloc(size_t nmemb, size_t sz) { if (!next_calloc) { extern void* __libc_calloc(size_t nmemb, size_t sz); return __libc_calloc(nmemb, sz); /* avoid infinite regress */ } if (test_mode == 2) check(); void* ptr = next_calloc(nmemb, sz); if (test_mode >= 0) track(1, sz, ptr); return ptr;}
开发者ID:Cheukyin,项目名称:CodeSnippet,代码行数:16,
示例9: mallocvoid* malloc(size_t sz) { if (!next_malloc) { next_malloc = dlsym(RTLD_NEXT, "malloc"); next_calloc = dlsym(RTLD_NEXT, "calloc"); } if (test_mode == 2) check(); void* ptr = next_malloc(sz); if (test_mode >= 0) track(1, sz, ptr); return ptr;}
开发者ID:Cheukyin,项目名称:CodeSnippet,代码行数:15,
示例10: salvage/* * salvage -- * A single salvage. */static voidsalvage(void){ WT_CONNECTION *conn; WT_DECL_RET; WT_SESSION *session; conn = g.wts_conn; track("salvage", 0ULL, NULL); testutil_check(conn->open_session(conn, NULL, NULL, &session)); if ((ret = session->salvage(session, g.uri, "force=true")) != 0) testutil_die(ret, "session.salvage: %s", g.uri); testutil_check(session->close(session, NULL));}
开发者ID:AlexOreshkevich,项目名称:mongo,代码行数:19,
示例11: lock_obsrvbool ObjectTrackerRos<Tracker>::run_once(){ if (!obsrv_updated_) return false; Obsrv obsrv; sensor_msgs::Image ros_image; { std::lock_guard<std::mutex> lock_obsrv(obsrv_mutex_); ros_image = current_ros_image_; obsrv_updated_ = false; } track(ros_image); return true;}
开发者ID:abajcsy,项目名称:dbot_ros,代码行数:15,
示例12: track_local // ignores gap range void track_local(int row, int col) const { if (row == -1 || col == -1) { return; } int min_row = row; int min_col = col; find_opt(min_row, min_col); if (at(min_row, min_col) == 0) { return; } // go right to col for (int j = min_col; j <= col; j++) { track(min_row, j) = COL_INC; } // go bottom to row for (int i = min_row; i <= row; i++) { track(i, col) = ROW_INC; } while (at(min_row, min_col) < 0) { go_prev(min_row, min_col); ASSERT_TRUE(in(min_row, min_col)); } track_local(min_row, min_col); }
开发者ID:npge,项目名称:npge,代码行数:25,
示例13: TEST_FTEST_F(testLHCNoiseFB, track1){ auto long_tracker = new RingAndRfSection(); auto lhcnfb = new LHCNoiseFB(1.0, 0.1, 0.9, 1); f_vector_t res; for (uint i = 0; i < 100; ++i) { long_tracker->track(); Context::Slice->track(); lhcnfb->track(); res.push_back(lhcnfb->fX); } auto params = std::string(TEST_FILES) + "/LHCNoiseFB/track/test1/"; f_vector_t v; util::read_vector_from_file(v, params + "x.txt"); // util::dump(lhcnfb->fG, "fG/n"); ASSERT_EQ(v.size(), res.size()); auto epsilon = 1e-8; for (unsigned int i = 0; i < v.size(); ++i) { auto ref = v[i]; auto real = res[i]; ASSERT_NEAR(ref, real, epsilon * std::max(fabs(ref), fabs(real))) << "Testing of fX failed on i " << i << std::endl; } delete lhcnfb; delete long_tracker;}
开发者ID:kiliakis,项目名称:BLonD-minimal-cpp,代码行数:36,
示例14: TEST_FTEST_F(testSlices, n_macroparticles){ auto Slice = Context::Slice; //RingAndRfSection *long_tracker = new RingAndRfSection(); //long_tracker->track(0, Beam->n_macroparticles); Slice->track(); //util::dump(Slice->n_macroparticles, 100, "something/n"); std::vector<ftype> v; util::read_vector_from_file(v, track_params + "n_macroparticles"); for (unsigned int i = 0; i < v.size(); ++i) { ftype ref = v[i]; ftype real = Slice->n_macroparticles[i]; ASSERT_NEAR(ref, real, epsilon * std::max(fabs(ref), fabs(real))); }}
开发者ID:dpiparo,项目名称:BLonD-minimal-cpp,代码行数:15,
示例15: scheduleLoadvoid HTMLTrackElement::parseAttribute(const QualifiedName& name, const AtomicString& value){ if (name == srcAttr) { if (!value.isEmpty()) scheduleLoad(); else if (m_track) m_track->removeAllCues(); // 4.8.10.12.3 Sourcing out-of-band text tracks // As the kind, label, and srclang attributes are set, changed, or removed, the text track must update accordingly... } else if (name == kindAttr) { track()->setKind(value.lower()); } else if (name == labelAttr) { track()->setLabel(value); } else if (name == srclangAttr) { track()->setLanguage(value); } else if (name == idAttr) { track()->setId(value); } else if (name == defaultAttr) { track()->setIsDefault(!value.isNull()); } HTMLElement::parseAttribute(name, value);}
开发者ID:smil-in-javascript,项目名称:blink,代码行数:24,
示例16: mainint main(){#if (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && (defined(VISP_HAVE_DC1394_2) || defined(VISP_HAVE_CMU1394)) vpImage<unsigned char> I;#if defined(VISP_HAVE_DC1394_2) vp1394TwoGrabber g;#elif defined(VISP_HAVE_CMU1394) vp1394CMUGrabber g;#endif g.open(I); // Parameters of our camera vpCameraParameters cam(840, 840, I.getWidth()/2, I.getHeight()/2); // The pose container vpHomogeneousMatrix cMo; std::vector<vpDot2> dot(4); std::vector<vpPoint> point(4); double L = 0.06; point[0].setWorldCoordinates(-L, -L, 0); point[1].setWorldCoordinates( L, -L, 0); point[2].setWorldCoordinates( L, L, 0); point[3].setWorldCoordinates(-L, L, 0); bool init = true;#if defined(VISP_HAVE_X11) vpDisplayX d(I);#elif defined(VISP_HAVE_GDI) vpDisplayGDI d(I);#endif while(1){ // Image Acquisition g.acquire(I); vpDisplay::display(I); track(I, dot, init); computePose(point, dot, cam, init, cMo); vpDisplay::displayFrame(I, cMo, cam, 0.05, vpColor::none, 3); vpDisplay::flush(I); if (init) init = false; // turn off the initialisation specific stuff if (vpDisplay::getClick(I, false)) break; }#endif}
开发者ID:ILoveFree2,项目名称:visp-deb,代码行数:48,
示例17: track //----------------------------------------------------------------------------------- void WireAabb::setToAabb( const Aabb &aabb ) { if( mTrackedObject ) track( (MovableObject*)0 ); if( !mParentNode ) { //We need a node of our own. SceneNode *newNode = mManager->getRootSceneNode()->createChildSceneNode(); newNode->attachObject( this ); } setVisible( true ); mParentNode->setPosition( aabb.mCenter ); mParentNode->setScale( aabb.mHalfSize ); }
开发者ID:devxkh,项目名称:FrankE,代码行数:17,
示例18: updateDisplayTreevoid VTTCue::updateDisplayTree(double movieTime){ // The display tree may contain WebVTT timestamp objects representing // timestamps (processing instructions), along with displayable nodes. if (!track()->isRendered()) return; // Clear the contents of the set. m_cueBackgroundBox->removeChildren(); // Update the two sets containing past and future WebVTT objects. RefPtrWillBeRawPtr<DocumentFragment> referenceTree = createCueRenderingTree(); markFutureAndPastNodes(referenceTree.get(), startTime(), movieTime); m_cueBackgroundBox->appendChild(referenceTree, ASSERT_NO_EXCEPTION);}
开发者ID:kjthegod,项目名称:WebKit,代码行数:16,
示例19: dropElement* Bracket::drop(const DropData& data) { Element* e = data.element; if (e->type() == BRACKET) { Bracket* b = static_cast<Bracket*>(e); b->setParent(parent()); b->setTrack(track()); b->setSpan(span()); b->setLevel(level()); score()->undoRemoveElement(this); score()->undoAddElement(b); return b; } delete e; return 0; }
开发者ID:coliveira,项目名称:MuseScore,代码行数:16,
示例20: registerClient void registerClient(boost::shared_ptr<Client> &client) { typedef boost::signals2::signal<void (const Item&)> signal_type; typedef signal_type::slot_type slot_type; // create a slot. bind is not needed. slot constructor wiht more than one // argument passes automatically its parametrs to boost::bind. auto slot = slot_type(&Client::consume, client.get(), _1); slot.track(client); // slot will disconnect automatically when the tracked // object expires. slot::track() can be only used for // boost::shared_ptr objects, not for std::shared_ptr // objects. signalDeliverItem.connect(slot); // tracking has to be set before connecting }
开发者ID:MarkoFilipovic,项目名称:Playground,代码行数:16,
示例21: textLineBasevoid TextLineBaseSegment::draw(QPainter* painter) const { TextLineBase* tl = textLineBase(); qreal _spatium = spatium(); // color for line (text color comes from the text properties) QColor color; if (selected() && !(score() && score()->printing())) color = (track() > -1) ? MScore::selectColor[voice()] : MScore::selectColor[0]; else if (!tl->visible() || !tl->lineVisible()) color = Qt::gray; else color = tl->lineColor(); if (!_text->empty()) { painter->translate(_text->pos()); _text->setVisible(tl->visible()); _text->draw(painter); painter->translate(-_text->pos()); } if (!_endText->empty()) { painter->translate(_endText->pos()); _endText->setVisible(tl->visible()); _endText->draw(painter); painter->translate(-_endText->pos()); } if (npoints == 0) return; qreal textlineLineWidth = tl->lineWidth().val() * _spatium; QPen pen(color, textlineLineWidth, tl->lineStyle()); if (tl->lineStyle() == Qt::CustomDashLine) { QVector<qreal> dashes { tl->dashLineLen(), tl->dashGapLen() }; pen.setDashPattern(dashes); } painter->setPen(pen); if (twoLines) { // hairpins painter->drawLines(&points[0], 1); painter->drawLines(&points[2], 1); } else { for (int i = 0; i < npoints; ++i) painter->drawLines(&points[i], 1); } }
开发者ID:trig-ger,项目名称:MuseScore,代码行数:47,
示例22: qDebug// Audio clip special process cycle executive.void qtractorMidiClip::process ( unsigned long iFrameStart, unsigned long iFrameEnd ){#ifdef CONFIG_DEBUG_0 qDebug("qtractorMidiClip[%p]::process(%lu, %lu)/n", this, iFrameStart, iFrameEnd);#endif qtractorTrack *pTrack = track(); if (pTrack == NULL) return; qtractorSession *pSession = pTrack->session(); if (pSession == NULL) return; qtractorMidiEngine *pMidiEngine = pSession->midiEngine(); if (pMidiEngine == NULL) return; qtractorMidiSequence *pSeq = sequence(); if (pSeq == NULL) return; // Track mute state... const bool bMute = (pTrack->isMute() || (pSession->soloTracks() && !pTrack->isSolo())); const unsigned long t0 = pSession->tickFromFrame(clipStart()); const unsigned long iTimeStart = pSession->tickFromFrame(iFrameStart); const unsigned long iTimeEnd = pSession->tickFromFrame(iFrameEnd); // Enqueue the requested events... qtractorMidiEvent *pEvent = m_playCursor.seek(pSeq, iTimeStart > t0 ? iTimeStart - t0 : 0); while (pEvent) { const unsigned long t1 = t0 + pEvent->time(); if (t1 >= iTimeEnd) break; if (t1 >= iTimeStart && (!bMute || pEvent->type() != qtractorMidiEvent::NOTEON)) pMidiEngine->enqueue(pTrack, pEvent, t1, gain(pSession->frameFromTick(t1) - clipStart())); pEvent = pEvent->next(); }}
开发者ID:ventosus,项目名称:qtractor,代码行数:48,
示例23: track void FooPlaylistManager::addFilesToCurrentPlaylist(QStringList files) { QList<FooTrack> tracks; for (int i = 0; i < files.size(); i++) { QString file = files.at(i); FooTrack track(file); engine->metaData(track); tracks.append(track); } currentViewingtPlaylist->addTracks(tracks); }
开发者ID:matthewpl,项目名称:fooaudio-dev,代码行数:17,
示例24: capturestatic void capture(uiArea *a, BOOL capturing){ // do nothing if there's no change if (a->capturing && capturing) return; if (!a->capturing && !capturing) return; // change flag first as ReleaseCapture() sends WM_CAPTURECHANGED a->capturing = capturing; if (a->capturing) { track(a, FALSE); SetCapture(a->hwnd); } else if (ReleaseCapture() == 0) logLastError("error releasing capture on drag in capture()");}
开发者ID:ifzz,项目名称:libui,代码行数:17,
示例25: ss_is_pointerinline voidbasic_iarchive_impl::load_object( basic_iarchive & ar, void * t, const basic_iserializer & bis){ m_moveable_objects.is_pointer = false; serialization::state_saver<bool> ss_is_pointer(m_moveable_objects.is_pointer); // if its been serialized through a pointer and the preamble's been done if(t == m_pending.object && & bis == m_pending.bis){ // read data (bis.load_object_data)(ar, t, m_pending.version); return; } const class_id_type cid = register_type(bis); const int i = cid; cobject_id & co = cobject_id_vector[i]; load_preamble(ar, co); // save the current move stack position in case we want to truncate it boost::serialization::state_saver<object_id_type> ss_start(m_moveable_objects.start); // note: extra line used to evade borland issue const bool tracking = co.tracking_level; object_id_type this_id; m_moveable_objects.start = this_id = object_id_type(object_id_vector.size()); // if we tracked this object when the archive was saved if(tracking){ // if it was already read if(!track(ar, t)) // we're done return; // add a new enty into the tracking list object_id_vector.push_back(aobject(t, cid)); // and add an entry for this object m_moveable_objects.end = object_id_type(object_id_vector.size()); } // read data (bis.load_object_data)(ar, t, co.file_version); m_moveable_objects.recent = this_id;}
开发者ID:HIT-SCIR,项目名称:pyltp,代码行数:46,
示例26: chordQPointF Arpeggio::gripAnchor(int n) const { Chord* c = chord(); if (c == 0) return QPointF(); if (n == 0) return c->upNote()->pagePos(); else if (n == 1) { Note* dnote = c->downNote(); int btrack = track() + (_span - 1) * VOICES; ChordRest* bchord = static_cast<ChordRest*>(c->segment()->element(btrack)); if (bchord && bchord->type() == CHORD) dnote = static_cast<Chord*>(bchord)->downNote(); return dnote->pagePos(); } return QPointF(); }
开发者ID:parinporecha,项目名称:MuseScore,代码行数:17,
注:本文中的track函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ trackRect函数代码示例 C++ tracing_stop函数代码示例 |