您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ tc函数代码示例

51自学网 2021-06-03 08:41:35
  C++
这篇教程C++ tc函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中tc函数的典型用法代码示例。如果您正苦于以下问题:C++ tc函数的具体用法?C++ tc怎么用?C++ tc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了tc函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: tc

void HelpIndexView::linksActivated(const QMap<QString,QUrl>& links, const QString& keyword){  HelpTopicChooser tc(m_IndexWidget, keyword, links);  if (tc.exec() == QDialog::Accepted)  {    IWorkbenchPage::Pointer page = this->GetSite()->GetPage();    HelpPluginActivator::linkActivated(page, tc.link());  }}
开发者ID:151706061,项目名称:MITK,代码行数:9,


示例2: tileCover

std::vector<UnwrappedTileID> tileCover(const Geometry<double>& geometry, int32_t z) {    std::vector<UnwrappedTileID> result;    TileCover tc(geometry, z, true);    while (tc.hasNext()) {        result.push_back(*tc.next());    };    return result;}
开发者ID:sanyaade-machine-learning,项目名称:mapbox-gl-native,代码行数:9,


示例3: tc

DistQuery::TransactionContextPtrDistQuery::allocTransaction(TransactionContext::Type t){    TransactionContextPtr tc(new TransactionContext(*this));    tc->m_type = t;    tc->m_tid = m_tid++;    tc->m_stopWatch.start();    return tc;}
开发者ID:Go-LiDth,项目名称:platform,代码行数:9,


示例4: tc

voidQvisLine3DInterface::opacityChanged(int opacity){    ColorAttribute tc(annot->GetColor1());    tc.SetAlpha(opacity);    annot->SetColor1(tc);    SetUpdate(false);    Apply();}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:9,


示例5: tileCount

uint64_t tileCount(const Geometry<double>& geometry, uint8_t z) {    uint64_t tileCount = 0;    TileCover tc(geometry, z, true);    while (tc.next()) {        tileCount++;    };    return tileCount;}
开发者ID:sanyaade-machine-learning,项目名称:mapbox-gl-native,代码行数:9,


示例6: trho

void Foam::combustionModels::PaSR<Type>::correct(){    if (this->active())    {        const scalar t = this->mesh().time().value();        const scalar dt = this->mesh().time().deltaTValue();        if (!useReactionRate_)        {            this->chemistryPtr_->solve(t - dt, dt);        }        else        {            this->chemistryPtr_->calculate();        }        if (turbulentReaction_)        {            tmp<volScalarField> trho(this->rho());            const volScalarField& rho = trho();            tmp<volScalarField> tepsilon(this->turbulence().epsilon());            const volScalarField& epsilon = tepsilon();            tmp<volScalarField> tmuEff(this->turbulence().muEff());            const volScalarField& muEff = tmuEff();            tmp<volScalarField> ttc(tc());            const volScalarField& tc = ttc();            forAll(epsilon, i)            {                if (epsilon[i] > 0)                {                    scalar tk =                        Cmix_*Foam::sqrt(muEff[i]/rho[i]/(epsilon[i] + SMALL));                    // Chalmers PaSR model                    if (!useReactionRate_)                    {                        kappa_[i] = (dt + tc[i])/(dt + tc[i] + tk);                    }                    else                    {                        kappa_[i] = tc[i]/(tc[i] + tk);                    }                }                else                {                    // Return to laminar combustion                    kappa_[i] = 1.0;                }            }        }        else        {            kappa_ = 1.0;        }    }
开发者ID:ADGlassby,项目名称:OpenFOAM-2.2.x,代码行数:57,


示例7: TrackName

bool LabelDialog::TransferDataToWindow(){   int cnt = mData.size();   int i;   // Set the editor parameters.  Do this each time since they may change   // due to NEW tracks and change in NumericTextCtrl format.  Rate won't   // change but might as well leave it here.   mChoiceEditor->SetChoices(mTrackNames);   mTimeEditor->SetFormat(mFormat);   mTimeEditor->SetRate(mRate);   // Disable redrawing until we're done   mGrid->BeginBatch();   // Delete all rows   if (mGrid->GetNumberRows()) {      mGrid->DeleteRows(0, mGrid->GetNumberRows());   }   // Add the exact number that we'll need   mGrid->InsertRows(0, cnt);   // Populate the rows   for (i = 0; i < cnt; i++) {      RowData &rd = mData[i];      // Set the cell contents      mGrid->SetCellValue(i, Col_Track, TrackName(rd.index));      mGrid->SetCellValue(i, Col_Label, rd.title);      mGrid->SetCellValue(i, Col_Stime,         wxString::Format(wxT("%g"), rd.selectedRegion.t0()));      mGrid->SetCellValue(i, Col_Etime,         wxString::Format(wxT("%g"), rd.selectedRegion.t1()));      // PRL: to do: -- populate future additional selection fields      // and write event code to update them from controls   }   // Autosize all the rows   mGrid->AutoSizeRows(true);   // Resize the track name column.  Use a wxChoice to determine the maximum   // width needed.   wxChoice tc(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, mTrackNames);   mGrid->SetColSize(Col_Track, tc.GetSize().x);   mGrid->SetColMinimalWidth(Col_Track, tc.GetSize().x);   // Autosize the time columns and set their minimal widths   mGrid->AutoSizeColumn(Col_Stime);   mGrid->AutoSizeColumn(Col_Etime);   // We're done, so allow the grid to redraw   mGrid->EndBatch();   return true;}
开发者ID:Avi2011class,项目名称:audacity,代码行数:57,


示例8: tc

bool PlayerServer::judgeResult(JudgeType type, std::unique_ptr<Card> &card){	unique_ptr<Card> tc(new Card(*card));	TRIEV(t_JudgeResult, &tc);	bool b = Player::judgeResult(type, tc);	TRIEV(t_JudgeResultEnd, &card);	GAME->addToDeadwood(card);	return b;}
开发者ID:popkc,项目名称:FreeSanGuoSha,代码行数:9,


示例9: tc

void SanitiseTool::parseSpacers(xercesc::DOMElement * parentNode,                                 crispr::xml::writer& xmlParser){    for (xercesc::DOMElement * currentElement = parentNode->getFirstElementChild();          currentElement != NULL;          currentElement = currentElement->getNextElementSibling()) {        if (xercesc::XMLString::equals(currentElement->getTagName(), xmlParser.tag_Spacer())) {            char * c_spid = tc(currentElement->getAttribute(xmlParser.attr_Spid()));            std::string spid = c_spid;            ST_SpacerMap[spid] = getNextSpacerS();            xr(&c_spid);            XMLCh * x_next_spacer_num = tc(getNextSpacerS().c_str());            currentElement->setAttribute(xmlParser.attr_Spid(), x_next_spacer_num);            xr(&x_next_spacer_num);            incrementSpacer();        }    }}
开发者ID:ctSkennerton,项目名称:crisprtools,代码行数:19,


示例10: tc

bool KeywordsCompletionAssistProcessor::isInComment() const{    QTextCursor tc(m_interface->textDocument());    tc.setPosition(m_interface->position());    tc.movePosition(QTextCursor::StartOfLine, QTextCursor::KeepAnchor);    const QString &lineBeginning = tc.selectedText();    if (lineBeginning.contains(startOfCommentChar()))        return true;    return false;}
开发者ID:maui-packages,项目名称:qt-creator,代码行数:10,


示例11: tc

void NameCompiler::visitTemplateArgument(TemplateArgumentAST *node){    TypeCompiler tc(m_session);    tc.run(node->type_id->type_specifier);    if (tc.isIntegral())        m_templateArgs << tc.qualifiedName().join(" ");    else        m_templateArgs << tc.qualifiedName().join("::");//   m_currentIdentifier.appendTemplateIdentifier( typeIdentifierFromTemplateArgument(m_session, node) );}
开发者ID:cran,项目名称:qtbase,代码行数:10,


示例12: tc

vguard<set<Ontology::TermIndex> > Ontology::transitiveClosure() const {  vguard<set<TermIndex> > tc (terms());  auto L = toposortTermIndex();  for (TermIndex n : L) {    tc[n].insert (n);    for (TermIndex p : parents[n])      tc[n].insert (tc[p].begin(), tc[p].end());  }  return tc;}
开发者ID:ihh,项目名称:wtfgenes,代码行数:10,


示例13: switch

bool IndexWindow::eventFilter(QObject *obj, QEvent *e){    if (obj == m_searchLineEdit && e->type() == QEvent::KeyPress) {        QKeyEvent *ke = static_cast<QKeyEvent*>(e);        QModelIndex idx = m_indexWidget->currentIndex();        switch (ke->key()) {        case Qt::Key_Up:            idx = m_indexWidget->model()->index(idx.row()-1,                idx.column(), idx.parent());            if (idx.isValid())                m_indexWidget->setCurrentIndex(idx);            break;        case Qt::Key_Down:            idx = m_indexWidget->model()->index(idx.row()+1,                idx.column(), idx.parent());            if (idx.isValid())                m_indexWidget->setCurrentIndex(idx);            break;        case Qt::Key_Escape:            MainWindow::activateCurrentCentralWidgetTab();            break;        default:            ;        }    } else if (obj == m_indexWidget && e->type() == QEvent::ContextMenu) {        QContextMenuEvent *ctxtEvent = static_cast<QContextMenuEvent*>(e);        QModelIndex idx = m_indexWidget->indexAt(ctxtEvent->pos());        if (idx.isValid()) {            QMenu menu;            QAction *curTab = menu.addAction(tr("Open Link"));            QAction *newTab = menu.addAction(tr("Open Link in New Tab"));            menu.move(m_indexWidget->mapToGlobal(ctxtEvent->pos()));            QAction *action = menu.exec();            if (curTab == action)                m_indexWidget->activateCurrentItem();            else if (newTab == action) {                QHelpIndexModel *model = qobject_cast<QHelpIndexModel*>(m_indexWidget->model());                QString keyword = model->data(idx, Qt::DisplayRole).toString();                if (model) {                    QMap<QString, QUrl> links = model->linksForKeyword(keyword);                    if (links.count() == 1) {                        CentralWidget::instance()->setSourceInNewTab(links.constBegin().value());                    } else {                        TopicChooser tc(this, keyword, links);                        if (tc.exec() == QDialog::Accepted) {                            CentralWidget::instance()->setSourceInNewTab(tc.link());                        }                    }                }            }        }    }    return QWidget::eventFilter(obj, e);}
开发者ID:pk-codebox-evo,项目名称:remixos-usb-tool,代码行数:55,


示例14: MOZ_ASSERT

TabIdContentProcessManager::AllocateTabId(const TabId& aOpenerTabId,                                     const IPCTabContext& aContext,                                     const ContentParentId& aChildCpId){  MOZ_ASSERT(NS_IsMainThread());  auto iter = mContentParentMap.find(aChildCpId);  if (NS_WARN_IF(iter == mContentParentMap.end())) {    ASSERT_UNLESS_FUZZING();    return TabId(0);  }  struct RemoteFrameInfo info;  const IPCTabContextUnion& contextUnion = aContext.contextUnion();  // If it's a PopupIPCTabContext, it's the case that a TabChild want to  // open a new tab. aOpenerTabId has to be it's parent frame's opener id.  if (contextUnion.type() == IPCTabContextUnion::TPopupIPCTabContext) {    auto remoteFrameIter = iter->second.mRemoteFrames.find(aOpenerTabId);    if (remoteFrameIter == iter->second.mRemoteFrames.end()) {      ASSERT_UNLESS_FUZZING("Failed to find parent frame's opener id.");      return TabId(0);    }    info.mOpenerTabId = remoteFrameIter->second.mOpenerTabId;    const PopupIPCTabContext &ipcContext = contextUnion.get_PopupIPCTabContext();    MOZ_ASSERT(ipcContext.opener().type() == PBrowserOrId::TTabId);    remoteFrameIter = iter->second.mRemoteFrames.find(ipcContext.opener().get_TabId());    if (remoteFrameIter == iter->second.mRemoteFrames.end()) {      ASSERT_UNLESS_FUZZING("Failed to find tab id.");      return TabId(0);    }    info.mContext = remoteFrameIter->second.mContext;  }  else {    MaybeInvalidTabContext tc(aContext);    if (!tc.IsValid()) {      NS_ERROR(nsPrintfCString("Received an invalid TabContext from "                               "the child process. (%s)",                               tc.GetInvalidReason()).get());      return TabId(0);    }    info.mOpenerTabId = aOpenerTabId;    info.mContext = tc.GetTabContext();  }  mUniqueId = ++gTabId;  iter->second.mRemoteFrames[mUniqueId] = info;  return mUniqueId;}
开发者ID:npark-mozilla,项目名称:gecko-dev,代码行数:55,


示例15: core_error

void DivRep::computeExactFlags() {  if (!first->flagsComputed())    first->computeExactFlags();  if (!second->flagsComputed())    second->computeExactFlags();  if (!second->sign())    core_error("zero divisor.", __FILE__, __LINE__, true);  if (!first->sign()) {// value must be exactly zero.    reduceToZero();    return;  }  // rational node  if (rationalReduceFlag) {    if (first->ratFlag() > 0 && second->ratFlag() > 0) {      BigRat val = (*(first->ratValue()))/(*(second->ratValue()));      reduceToBigRat(val);      ratFlag() = first->ratFlag() + second->ratFlag();      return;    } else      ratFlag() = -1;  }  // value is irrational.  uMSB() = first->uMSB() - second->lMSB();  lMSB() = first->lMSB() - second->uMSB() - EXTLONG_ONE;  sign() = first->sign() * second->sign();  extLong df = first->d_e();  extLong ds = second->d_e();  // extLong lf = first->length();  // extLong ls = second->length();  // length() = df * ls + ds * lf;  measure() = (first->measure())*ds + (second->measure())*df;  // BFMSS[2,5] bound.  v2p() = first->v2p() + second->v2m();  v2m() = first->v2m() + second->v2p();  v5p() = first->v5p() + second->v5m();  v5m() = first->v5m() + second->v5p();  u25() = first->u25() + second->l25();  l25() = first->l25() + second->u25();  high() = first->high() + second->low();  low() = first->low() + second->high();  lc() = ds * first->lc() + df * second->tc();  tc() = core_min(ds * first->tc() + df * second->lc(), measure());  flagsComputed() = true;}
开发者ID:Fox-Heracles,项目名称:cgal,代码行数:54,


示例16: setPlainText

void UBTGAdaptableText::keyReleaseEvent(QKeyEvent* e){    QTextEdit::keyReleaseEvent(e);    if(mMaximumLength && toPlainText().length()>mMaximumLength){        setPlainText(toPlainText().left(mMaximumLength));        QTextCursor tc(document());        tc.setPosition(mMaximumLength);        setTextCursor(tc);    }}
开发者ID:Sankore,项目名称:Sankore-Plugins,代码行数:11,


示例17: tc

void TypeCompiler::visitParameterDeclaration(ParameterDeclarationAST* node){    TypeCompiler tc(m_session, m_visitor);    tc.run(node->type_specifier, node->declarator);    NameCompiler name_cc(m_session, m_visitor);    if (tc.type().isFunctionPointer() && node->declarator && node->declarator->sub_declarator)        name_cc.run(node->declarator->sub_declarator->id);    else if (node->declarator)        name_cc.run(node->declarator->id);    m_realType.appendParameter(Parameter(name_cc.name(), Type::registerType(tc.type())));}
开发者ID:BaderSZ,项目名称:qtbindings,代码行数:11,


示例18: tc

void Bomb::DoDraw() const {  if (!IsAlive())    return;  const double tile_width_in_px = 16.0;  const double tile_height_in_px = 16.0;  TexCoords tc((470.0+tile_width_in_px*m_anim_frame_num), 16.0, tile_width_in_px, tile_height_in_px);  Engine::Get().Renderer()->DrawSprite(tc, GetPosition());  if (g_render_aabbs)    Engine::Get().Renderer()->DrawAABB(GetAABB());}
开发者ID:mmilewski,项目名称:bynadlaster,代码行数:11,


示例19: tc

void DrawTool::parseGroup(xercesc::DOMElement * parentNode, crispr::xml::parser& xmlParser){        // create a new graph object    char * c_gid = tc(parentNode->getAttribute(xmlParser.attr_Gid()));    crispr::graph * current_graph = new crispr::graph(c_gid);    xr(&c_gid);    // change the max and min coverages back to their original values    resetInitialLimits();        DT_Graphs.push_back(current_graph);    for (xercesc::DOMElement * currentElement = parentNode->getFirstElementChild();          currentElement != NULL;          currentElement = currentElement->getNextElementSibling()) {                if (xercesc::XMLString::equals(currentElement->getTagName(), xmlParser.tag_Data())) {            parseData(currentElement, xmlParser, current_graph);            setColours();        } else if (xercesc::XMLString::equals(currentElement->getTagName(), xmlParser.tag_Assembly())) {            parseAssembly(currentElement, xmlParser, current_graph);        }            }        char * c_file_prefix = tc(parentNode->getAttribute(xmlParser.attr_Gid()));    std::string file_prefix = c_file_prefix;    std::string file_name = file_prefix + "." + DT_OutputFormat;    xr(&c_file_prefix);    char * file_name_c = strdup(file_name.c_str());    layoutGraph(current_graph->getGraph(), DT_RenderingAlgorithm);    renderGraphToFile(current_graph->getGraph(), DT_OutputFormat, file_name_c);    freeLayout(current_graph->getGraph());    // free the duplicated string    try {        delete file_name_c;    } catch (std::exception& e) {        std::cerr<<e.what()<<std::endl;    }}
开发者ID:EricDeveaud,项目名称:crass,代码行数:41,


示例20: tc

void KisMacroTest::testCreation(){    QList<KisRecordedAction*> actions;    TestAction tc("bla", "bla", KisNodeQueryPath::fromString("/"));    actions << &tc;    const KoColorSpace * cs = KoColorSpaceRegistry::instance()->rgb8();    KisImageSP image = new KisImage(0, 512, 512, cs, "test");    KisMacro a();    KisMacro b(actions);}
开发者ID:KDE,项目名称:calligra-history,代码行数:12,


示例21: whereToExplore

int3 whereToExplore(HeroPtr h){	//TODO it's stupid and ineffective, write sth better	cb->setSelection(*h);	int radius = h->getSightRadious();	int3 hpos = h->visitablePos();	//look for nearby objs -> visit them if they're close enouh	const int DIST_LIMIT = 3;	std::vector<const CGObjectInstance *> nearbyVisitableObjs;	for(const CGObjectInstance *obj : ai->getPossibleDestinations(h))	{		int3 op = obj->visitablePos();		CGPath p;		cb->getPath2(op, p);		if(p.nodes.size() && p.endPos() == op && p.nodes.size() <= DIST_LIMIT)			nearbyVisitableObjs.push_back(obj);	}	boost::sort(nearbyVisitableObjs, isCloser);	if(nearbyVisitableObjs.size())		return nearbyVisitableObjs.back()->visitablePos();	try	{		return ai->explorationBestNeighbour(hpos, radius, h);	}	catch(cannotFulfillGoalException &e)	{		std::vector<std::vector<int3> > tiles; //tiles[distance_to_fow]		try		{			return ai->explorationNewPoint(radius, h, tiles);		}		catch(cannotFulfillGoalException &e)		{			std::map<int, std::vector<int3> > profits;			{				TimeCheck tc("Evaluating exploration possibilities");				tiles[0].clear(); //we can't reach FoW anyway				for(auto &vt : tiles)					for(auto &tile : vt)						profits[howManyTilesWillBeDiscovered(tile, radius)].push_back(tile);			}			if(profits.empty())				return int3 (-1,-1,-1);			auto bestDest = profits.end();			bestDest--;			return bestDest->second.front(); //TODO which is the real best tile?		}	}}
开发者ID:janisozaur,项目名称:vcmi_old_mirror,代码行数:53,


示例22: getCorrection

static qint64 getCorrection() {    GCounter totalCounter("timer correction", "ticks", 1);    TimeCounter tc(&totalCounter, false);    tc.start(); tc.stop();    tc.start(); tc.stop();    tc.start(); tc.stop();    tc.start(); tc.stop();    qint64 correction = totalCounter.totalCount / 4;    return correction;}
开发者ID:m-angelov,项目名称:ugene,代码行数:12,


示例23: Log1

eFlag Tree::parse(Sit S, DataLine *d){    Log1(S, L1_PARSING, getURI());    double time_was = getMillisecs();    TreeConstructer tc(S);    eFlag retval = tc.parseDataLineUsingExpat(S, this, d);    if (!retval)    {        Log1(S, L1_PARSE_DONE, getMillisecsDiff(time_was));    }    return retval;}
开发者ID:alepharchives,项目名称:Sablotron,代码行数:12,


示例24: up

void Entity::render(const Map &map, const Camera &camera) const{    m_program->bind();    m_program->setUniformValue(m_matrixUniform, camera.viewProjectionMatrix());    QVector3D up(0, 0.65 * m_scale, 0);    QVector3D va = m_a;    QVector3D vb = m_a + up;    QVector3D vc = m_b + up;    QVector3D vd = m_b;    qreal dx = 1. / m_textureSize.width();    qreal dy = 1. / m_textureSize.height();    int index = m_angleIndex;    if (m_walking)        index += 8 + 8 * (m_animationIndex % 4);    qreal tx1 = (m_tileWidth * (index % m_tileMod) + 1) * dx;    qreal tx2 = tx1 + (m_tileWidth - 2) * dx;    qreal ty1 = (m_tileHeight * (index / m_tileMod) + 1) * dy;    qreal ty2 = ty1 + (m_tileHeight - 2) * dy;    QVector2D ta(tx2, ty2);    QVector2D tb(tx2, ty1);    QVector2D tc(tx1, ty1);    QVector2D td(tx1, ty2);    QVector<QVector3D> vertexBuffer;    vertexBuffer << va << vb << vd << vd << vb << vc;    QVector<QVector3D> texBuffer;    texBuffer << ta << tb << td << td << tb << tc;    m_program->enableAttributeArray(m_vertexAttr);    m_program->setAttributeArray(m_vertexAttr, vertexBuffer.constData());    m_program->enableAttributeArray(m_texAttr);    m_program->setAttributeArray(m_texAttr, texBuffer.constData());    glEnable(GL_BLEND);    glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);    glActiveTexture(GL_TEXTURE0);    glBindTexture(GL_TEXTURE_2D, m_texture);    glDrawArrays(GL_TRIANGLES, 0, 6);    glDisable(GL_BLEND);    m_program->disableAttributeArray(m_texAttr);    m_program->disableAttributeArray(m_vertexAttr);}
开发者ID:Kentzo,项目名称:mazecompositor,代码行数:53,


示例25: numLayers

voidFltExportVisitor::writeUVList( int numVerts, const osg::Geometry& geom, const std::vector<unsigned int>& indices ){    unsigned int numLayers( 0 );    uint32 flags( 0 );    unsigned int idx;    for( idx=1; idx<8; idx++)    {        if( isTextured( idx, geom ) )        {            flags |= LAYER_1 >> (idx-1);            numLayers++;        }    }    if( numLayers == 0 )        return;    uint16 length( 8 + (8*numLayers*numVerts) );    _records->writeInt16( (int16) UV_LIST_OP );    _records->writeUInt16( length );    _records->writeInt32( flags );    osg::Vec2 defaultCoord( 0., 0. );    // const osg::StateSet* ss = getCurrentStateSet();    for( int vertexIdx=0; vertexIdx<numVerts; vertexIdx++)    {        for( idx=1; idx<8; idx++)        {            if( isTextured( idx, geom ) )            {                osg::Array* t = const_cast<osg::Array*>( geom.getTexCoordArray( idx ) );                osg::ref_ptr<osg::Vec2Array> t2 = dynamic_cast<osg::Vec2Array*>( t );                if (!t2.valid())                {                    std::ostringstream warning;                    warning << "fltexp: No Texture2D for unit " << idx;                    OSG_WARN << warning.str() << std::endl;                    _fltOpt->getWriteResult().warn( warning.str() );                    t2 = new osg::Vec2Array;                }                const int size = t2->getNumElements();                int vIdx = indices[ vertexIdx ];                osg::Vec2& tc( defaultCoord );                if (vIdx < size)                    tc = ( *t2 )[ vIdx ];                _records->writeFloat32( tc[ 0 ] );                _records->writeFloat32( tc[ 1 ] );            }        }    }}
开发者ID:151706061,项目名称:OpenSceneGraph,代码行数:53,


示例26: Tu

/*!SLMesh::preShade calculates the rest of the intersection information after the final hit point is determined. Should be called just before the shading when the final intersection point of the closest triangle was found.*/void SLMesh::preShade(SLRay* ray){   SLFace* hit = ray->hitTriangle;      // calculate the hit point in world space   ray->hitPoint.set(ray->origin + ray->length * ray->dir);         // calculate the interpolated normal with vertex normals in object space   ray->hitNormal.set(N[hit->iA] * (1-(ray->hitU+ray->hitV)) +                       N[hit->iB] * ray->hitU +                       N[hit->iC] * ray->hitV);                         // transform normal back to world space   ray->hitNormal.set(ray->hitShape->wmN() * ray->hitNormal);                    // invert normal if the ray is inside a shape   if (!ray->isOutside) ray->hitNormal *= -1;      // for shading the normal is expected to be unit length   ray->hitNormal.normalize();      // calculate interpolated texture coordinates   SLVGLTexture& textures = ray->hitMat->textures();   if (textures.size() > 0)   {  SLVec2f Tu(Tc[hit->iB] - Tc[hit->iA]);      SLVec2f Tv(Tc[hit->iC] - Tc[hit->iA]);      SLVec2f tc(Tc[hit->iA] + ray->hitU*Tu + ray->hitV*Tv);      ray->hitTexCol.set(textures[0]->getTexelf(tc.x,tc.y));            // bumpmapping      if (textures.size() > 1)      {  if (T)         {              // calculate the interpolated tangent with vertex tangent in object space            SLVec4f hitT(T[hit->iA] * (1-(ray->hitU+ray->hitV)) +                          T[hit->iB] * ray->hitU +                          T[hit->iC] * ray->hitV);                                     SLVec3f T3(hitT.x,hitT.y,hitT.z);         // tangent with 3 components            T3.set(ray->hitShape->wmN() * T3);        // transform tangent back to world space            SLVec2f d = textures[1]->dsdt(tc.x,tc.y);  // slope of bumpmap at tc            SLVec3f N = ray->hitNormal;               // unperturbated normal            SLVec3f B(N^T3);                          // binormal tangent B            B *= T[hit->iA].w;                        // correct handedness            SLVec3f D(d.x*T3 + d.y*B);                // perturbation vector D            N+=D;            N.normalize();            ray->hitNormal.set(N);         }      }   }}
开发者ID:heweitykc,项目名称:opengl,代码行数:57,


示例27: TEST

TEST(BaseCluster, Read){    std::stringstream input;    tawara::UIntElement tc(tawara::ids::Timecode, 42);    tawara::UIntElement st1(tawara::ids::SilentTrackNumber, 1);    tawara::UIntElement st2(tawara::ids::SilentTrackNumber, 2);    tawara::UIntElement ps(tawara::ids::PrevSize, 0x1234);    FakeCluster e;    std::streamsize body_size(tc.size());    tawara::vint::write(body_size, input);    tc.write(input);    EXPECT_EQ(tawara::vint::size(body_size) + body_size,            e.read(input));    EXPECT_EQ(42, e.timecode());    EXPECT_TRUE(e.silent_tracks().empty());    EXPECT_EQ(0, e.previous_size());    body_size += tawara::ids::size(tawara::ids::SilentTracks) +        tawara::vint::size(st1.size() + st2.size()) +        st1.size() + st2.size() + ps.size();    tawara::vint::write(body_size, input);    tc.write(input);    tawara::ids::write(tawara::ids::SilentTracks, input);    tawara::vint::write(st1.size() + st2.size(), input);    st1.write(input);    st2.write(input);    ps.write(input);    EXPECT_EQ(tawara::vint::size(body_size) + body_size,            e.read(input));    EXPECT_EQ(42, e.timecode());    EXPECT_FALSE(e.silent_tracks().empty());    EXPECT_EQ(0x1234, e.previous_size());    // Body size value wrong (too small)    input.str(std::string());    tawara::vint::write(2, input);    tc.write(input);    ps.write(input);    EXPECT_THROW(e.read(input), tawara::BadBodySize);    // Invalid child    input.str(std::string());    tawara::UIntElement ue(tawara::ids::EBML, 0xFFFF);    tawara::vint::write(ue.size(), input);    ue.write(input);    EXPECT_THROW(e.read(input), tawara::InvalidChildID);    // Missing timecode    input.str(std::string());    tawara::vint::write(ps.size(), input);    ps.write(input);    EXPECT_THROW(e.read(input), tawara::MissingChild);}
开发者ID:gbiggs,项目名称:tawara,代码行数:52,


示例28: replic

void MainWindow::on_time(){    QTime time=QTime(0,0,0,0);    time=time.addMSecs(videoPlayer->currentTime());    if(sub!=NULL){        QString replic("");        TimeConteiner tc(time,time);        replic=sub->value(tc,replic).trimmed();        if(replic!=subtitles->toPlainText().trimmed()){            subtitles->setText(replic);        }    }    ui->label->setText(time.toString("hh:mm:ss"));}
开发者ID:isCompetent,项目名称:VoPlayer,代码行数:13,


示例29: tc

void info_manager::get_info_record(environment const & env, options const & o, io_state const & ios, pos_info pos,                                   json & record, std::function<bool (info_data const &)> pred) const {    type_context_old tc(env, o);    io_state_stream out = regular(env, ios, tc).update_options(o);    get_line_info_set(pos.first).for_each([&](unsigned c, list<info_data> const & ds) {        if (c == pos.second) {            for (auto const & d : ds) {                if (!pred || pred(d))                    d.report(out, record);            }        }    });}
开发者ID:fpvandoorn,项目名称:lean,代码行数:13,



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


C++ tc_init函数代码示例
C++ tboot_shutdown函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。