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

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

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

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

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

示例1: createRangeFilter

//--------------------------------------------------------------------------------------------------/// //--------------------------------------------------------------------------------------------------void RicRangeFilterInsertExec::redo(){    RimCellRangeFilter* rangeFilter = createRangeFilter();    if (rangeFilter)    {        size_t index = m_cellRangeFilterCollection->rangeFilters.index(m_cellRangeFilter);        CVF_ASSERT(index < m_cellRangeFilterCollection->rangeFilters.size());        m_cellRangeFilterCollection->rangeFilters.insertAt(static_cast<int>(index), rangeFilter);        rangeFilter->setDefaultValues();        applyCommandDataOnFilter(rangeFilter);        m_cellRangeFilterCollection->updateDisplayModeNotifyManagedViews(NULL);        m_cellRangeFilterCollection->updateConnectedEditors();        RiuMainWindow::instance()->selectAsCurrentItem(rangeFilter);    }}
开发者ID:atgeirr,项目名称:ResInsight,代码行数:23,


示例2: CVF_ASSERT

//--------------------------------------------------------------------------------------------------///  //--------------------------------------------------------------------------------------------------void PerformanceInfo::update(const PerformanceInfo& perf){    totalDrawTime               += perf.totalDrawTime;    computeVisiblePartsTime     += perf.computeVisiblePartsTime;    buildRenderQueueTime        += perf.buildRenderQueueTime;    sortRenderQueueTime         += perf.sortRenderQueueTime;    renderEngineTime            += perf.renderEngineTime;    visiblePartsCount           += perf.visiblePartsCount;    renderedPartsCount          += perf.renderedPartsCount;    vertexCount                 += perf.vertexCount;    triangleCount               += perf.triangleCount;    openGLPrimitiveCount        += perf.openGLPrimitiveCount;    applyRenderStateCount       += perf.applyRenderStateCount;    shaderProgramChangesCount   += perf.shaderProgramChangesCount;    CVF_ASSERT(m_nextHistoryItem >= 0 && m_nextHistoryItem < NUM_PERFORMANCE_HISTORY_ITEMS);    m_totalDrawTimeHistory[m_nextHistoryItem] = totalDrawTime;    m_nextHistoryItem++;    if (m_nextHistoryItem >= NUM_PERFORMANCE_HISTORY_ITEMS) m_nextHistoryItem = 0;}
开发者ID:akva2,项目名称:ResInsight,代码行数:23,


示例3: CVF_ASSERT

//--------------------------------------------------------------------------------------------------/////--------------------------------------------------------------------------------------------------void RimGridCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField,                                         const QVariant&            oldValue,                                         const QVariant&            newValue){    if (changedField == &m_isActive)    {        RimGridView* rimView = nullptr;        this->firstAncestorOrThisOfType(rimView);        CVF_ASSERT(rimView);        if (rimView) rimView->showGridCells(m_isActive);        updateUiIconFromState(m_isActive);    }    RimGridView* rimView = nullptr;    this->firstAncestorOrThisOfType(rimView);    rimView->scheduleCreateDisplayModelAndRedraw();}
开发者ID:OPM,项目名称:ResInsight,代码行数:23,


示例4: CVF_ASSERT

//--------------------------------------------------------------------------------------------------/// //--------------------------------------------------------------------------------------------------cvf::Variant PropertyXmlSerializer::arrayVariantFromXmlElement(const XmlElement& xmlArrayVariantElement){    CVF_ASSERT(xmlArrayVariantElement.name().toLower() == "array");    std::vector<Variant> arr;    const XmlElement* xmlElem = xmlArrayVariantElement.firstChildElement();    while (xmlElem)    {        Variant variant = variantFromXmlElement(*xmlElem);        if (variant.isValid())        {            arr.push_back(variant);        }        xmlElem = xmlElem->nextSiblingElement();    }    return Variant(arr);}
开发者ID:CeetronAS,项目名称:CustomVisualizationCore,代码行数:23,


示例5: switch

//--------------------------------------------------------------------------------------------------/////--------------------------------------------------------------------------------------------------void RiaSocketServer::slotReadyRead(){    switch (m_readState)    {        case ReadingCommand :        {            readCommandFromOctave();            break;        }        case ReadingPropertyData :        {            readPropertyDataFromOctave();            break;        }        default:            CVF_ASSERT(false);            break;    }}
开发者ID:isaushkin,项目名称:ResInsight,代码行数:24,


示例6: CVF_ASSERT

//--------------------------------------------------------------------------------------------------/// //--------------------------------------------------------------------------------------------------void CategoryMapper::recomputeMaxTexCoord(){    const uint numColors = static_cast<uint>(m_colors.size());    if (numColors == 0)    {        m_maxTexCoord = 1.0;        return;    }    const uint numPixelsPerColor = m_textureSize / numColors;    if (numPixelsPerColor == 0)    {        m_maxTexCoord = 1.0;        return;    }    uint texturePixelsInUse = numColors*numPixelsPerColor;    CVF_ASSERT(texturePixelsInUse <= m_textureSize);    m_maxTexCoord = static_cast<double>(texturePixelsInUse) / static_cast<double>(m_textureSize);}
开发者ID:magnesj,项目名称:ResInsight,代码行数:24,


示例7: childCount

//--------------------------------------------------------------------------------------------------/// Update the bounding box of this node (recursive)//--------------------------------------------------------------------------------------------------void ModelBasicTreeNode::updateBoundingBoxesRecursive(){    m_boundingBox.reset();    uint numChildren = childCount();    uint i;    for (i = 0; i < numChildren; i++)    {        ModelBasicTreeNode* c = child(i);        CVF_ASSERT(c);        c->updateBoundingBoxesRecursive();        m_boundingBox.add(c->boundingBox());    }    if (m_partList.notNull())    {        m_partList->updateBoundingBoxesRecursive();        m_boundingBox.add(m_partList->boundingBox());    }}
开发者ID:akva2,项目名称:ResInsight,代码行数:24,


示例8: CVF_ASSERT

//--------------------------------------------------------------------------------------------------/// Set or add a uniform to the UniformSet/// /// If a uniform with the same name as the incoming uniform is already present in the set,/// the existing uniform will be replaced.//--------------------------------------------------------------------------------------------------void UniformSet::setUniform(Uniform* uniform){    CVF_ASSERT(uniform);    // Check if uniform is already in the set    size_t numUniforms = m_uniforms.size();    for (size_t i = 0; i < numUniforms; ++i)    {        if (System::strcmp(m_uniforms[i]->name(), uniform->name()) == 0)        {            if (m_uniforms[i] != uniform)            {                m_uniforms[i] = uniform;            }            return;        }    }    m_uniforms.push_back(uniform);}
开发者ID:JacobStoren,项目名称:ResInsight,代码行数:27,


示例9: switch

//--------------------------------------------------------------------------------------------------/// //--------------------------------------------------------------------------------------------------std::vector< RigFemResultAddress> RigFemPartResultsCollection::getResAddrToComponentsToRead(const RigFemResultAddress& resVarAddr){    std::map<std::string, std::vector<std::string> > fieldAndComponentNames;    switch (resVarAddr.resultPosType)    {        case RIG_NODAL:            fieldAndComponentNames = m_readerInterface->scalarNodeFieldAndComponentNames();            break;        case RIG_ELEMENT_NODAL:            fieldAndComponentNames = m_readerInterface->scalarElementNodeFieldAndComponentNames();            break;        case RIG_INTEGRATION_POINT:            fieldAndComponentNames = m_readerInterface->scalarIntegrationPointFieldAndComponentNames();            break;    }    std::vector< RigFemResultAddress> resAddressToComponents;    std::map<std::string, std::vector<std::string> >::iterator fcIt = fieldAndComponentNames.find(resVarAddr.fieldName);    if (fcIt != fieldAndComponentNames.end())    {        std::vector<std::string> compNames = fcIt->second;        if (resVarAddr.componentName != "") // If we did not request a particular component, do not add the components        {            for (size_t cIdx = 0; cIdx < compNames.size(); ++cIdx)            {                resAddressToComponents.push_back(RigFemResultAddress(resVarAddr.resultPosType, resVarAddr.fieldName, compNames[cIdx]));            }        }        if (compNames.size() == 0) // This is a scalar field. Add one component named ""        {            CVF_ASSERT(resVarAddr.componentName == "");            resAddressToComponents.push_back(resVarAddr);        }    }    return resAddressToComponents;}
开发者ID:higgscc,项目名称:ResInsight,代码行数:43,


示例10: assert

//--------------------------------------------------------------------------------------------------/// //--------------------------------------------------------------------------------------------------void RicPasteEclipseViewsFeature::onActionTriggered(bool isChecked){    PdmObjectHandle* destinationObject = dynamic_cast<PdmObjectHandle*>(SelectionManager::instance()->selectedItem());    RimEclipseCase* eclipseCase = RicPasteFeatureImpl::findEclipseCase(destinationObject);    assert(eclipseCase);    PdmObjectGroup objectGroup;    RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup);    if (objectGroup.objects.size() == 0) return;    std::vector<caf::PdmPointer<RimEclipseView> > eclipseViews;    objectGroup.objectsByType(&eclipseViews);    // Add cases to case group    for (size_t i = 0; i < eclipseViews.size(); i++)    {        RimEclipseView* rimReservoirView = dynamic_cast<RimEclipseView*>(eclipseViews[i]->xmlCapability()->copyByXmlSerialization(PdmDefaultObjectFactory::instance()));        CVF_ASSERT(rimReservoirView);        QString nameOfCopy = QString("Copy of ") + rimReservoirView->name;        rimReservoirView->name = nameOfCopy;        eclipseCase->reservoirViews().push_back(rimReservoirView);        rimReservoirView->setEclipseCase(eclipseCase);        // Resolve references after reservoir view has been inserted into Rim structures        // Intersections referencing a well path/ simulation well requires this        // TODO: initAfterReadRecursively can probably be removed        rimReservoirView->initAfterReadRecursively();        rimReservoirView->resolveReferencesRecursively();        rimReservoirView->loadDataAndUpdate();        caf::PdmDocument::updateUiIconStateRecursively(rimReservoirView);        eclipseCase->updateConnectedEditors();    }}
开发者ID:atgeirr,项目名称:ResInsight,代码行数:43,


示例11: CVF_ASSERT

//--------------------------------------------------------------------------------------------------/// //--------------------------------------------------------------------------------------------------const RigFault* RigMainGrid::findFaultFromCellIndexAndCellFace(size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face) const{    CVF_ASSERT(m_faultsPrCellAcc.notNull());    if (face == cvf::StructGridInterface::NO_FACE) return NULL;    int faultIdx = m_faultsPrCellAcc->faultIdx(reservoirCellIndex, face);    if (faultIdx !=  RigFaultsPrCellAccumulator::NO_FAULT )    {        return m_faults.at(faultIdx);    }#if 0    for (size_t i = 0; i < m_faults.size(); i++)    {        const RigFault* rigFault = m_faults.at(i);        const std::vector<RigFault::FaultFace>& faultFaces = rigFault->faultFaces();        for (size_t fIdx = 0; fIdx < faultFaces.size(); fIdx++)        {            if (faultFaces[fIdx].m_nativeReservoirCellIndex == cellIndex)            {                if (face == faultFaces[fIdx].m_nativeFace )                {                    return rigFault;                }            }            if (faultFaces[fIdx].m_oppositeReservoirCellIndex == cellIndex)            {                if (face == cvf::StructGridInterface::oppositeFace(faultFaces[fIdx].m_nativeFace))                {                    return rigFault;                }            }        }    }#endif    return NULL;}
开发者ID:magnesj,项目名称:ResInsight,代码行数:43,


示例12: progress

//--------------------------------------------------------------------------------------------------/// //--------------------------------------------------------------------------------------------------void RimGeoMechView::loadDataAndUpdate(){    caf::ProgressInfo progress(7, "");    progress.setNextProgressIncrement(5);    updateScaleTransform();    if (m_geomechCase)    {        std::string errorMessage;        if (!m_geomechCase->openGeoMechCase(&errorMessage))        {            QString displayMessage = errorMessage.empty() ? "Could not open the Odb file: /n" + m_geomechCase->caseFileName() : QString::fromStdString(errorMessage);            QMessageBox::warning(RiuMainWindow::instance(),                             "File open error",                             displayMessage);            m_geomechCase = NULL;            return;        }    }    progress.incrementProgress();    progress.setProgressDescription("Reading Current Result");    CVF_ASSERT(this->cellResult() != NULL);    if (this->hasUserRequestedAnimation())    {        m_geomechCase->geoMechData()->femPartResults()->assertResultsLoaded(this->cellResult()->resultAddress());    }    progress.incrementProgress();    progress.setProgressDescription("Create Display model");       updateViewerWidget();    this->geoMechPropertyFilterCollection()->loadAndInitializePropertyFilters();    this->scheduleCreateDisplayModelAndRedraw();    progress.incrementProgress();}
开发者ID:atgeirr,项目名称:ResInsight,代码行数:43,


示例13: elementCount

//--------------------------------------------------------------------------------------------------/// //--------------------------------------------------------------------------------------------------float RigFemPart::characteristicElementSize(){    if (m_characteristicElementSize != std::numeric_limits<float>::infinity()) return m_characteristicElementSize;    // take 100 elements     float elmIdxJump = elementCount() / 100.0f;    int elmIdxIncrement = elmIdxJump < 1 ? 1: (int) elmIdxJump;    int elmsToAverageCount = 0;    float sumMaxEdgeLength = 0;    for (int elmIdx = 0; elmIdx < elementCount(); elmIdx += elmIdxIncrement)    {        RigElementType eType = this->elementType(elmIdx);        if (eType == HEX8 || eType == HEX8P)        {            const int* elmentConn = this->connectivities(elmIdx);            cvf::Vec3f nodePos0 = this->nodes().coordinates[elmentConn[0]];            cvf::Vec3f nodePos1 = this->nodes().coordinates[elmentConn[1]];            cvf::Vec3f nodePos3 = this->nodes().coordinates[elmentConn[3]];            cvf::Vec3f nodePos4 = this->nodes().coordinates[elmentConn[4]];            float l1 = (nodePos1-nodePos0).length();            float l3 = (nodePos3-nodePos0).length();            float l4 = (nodePos4-nodePos0).length();            float maxLength = l1 > l3 ? l1: l3;            maxLength = maxLength > l4 ? maxLength: l4;            sumMaxEdgeLength += maxLength;            ++elmsToAverageCount;        }    }    CVF_ASSERT(elmsToAverageCount);    m_characteristicElementSize = sumMaxEdgeLength/elmsToAverageCount;    return m_characteristicElementSize;}
开发者ID:atgeirr,项目名称:ResInsight,代码行数:42,


示例14: CVF_ASSERT

//--------------------------------------------------------------------------------------------------/// //--------------------------------------------------------------------------------------------------RimGeoMechView::RimGeoMechView(void){    RiaApplication* app = RiaApplication::instance();    RiaPreferences* preferences = app->preferences();    CVF_ASSERT(preferences);    CAF_PDM_InitObject("Geomechanical View", ":/ReservoirView.png", "", "");    CAF_PDM_InitFieldNoDefault(&cellResult, "GridCellResult", "Color Result", ":/CellResult.png", "", "");    cellResult = new RimGeoMechCellColors();    cellResult.uiCapability()->setUiHidden(true);    CAF_PDM_InitFieldNoDefault(&m_propertyFilterCollection, "PropertyFilters", "Property Filters", "", "", "");    m_propertyFilterCollection = new RimGeoMechPropertyFilterCollection();    m_propertyFilterCollection.uiCapability()->setUiHidden(true);    //this->cellResult()->setReservoirView(this);    this->cellResult()->legendConfig()->setReservoirView(this);    m_scaleTransform = new cvf::Transform();    m_vizLogic = new RivGeoMechVizLogic(this);}
开发者ID:atgeirr,项目名称:ResInsight,代码行数:25,


示例15: CVF_ASSERT

//--------------------------------------------------------------------------------------------------/////--------------------------------------------------------------------------------------------------RimValveTemplate* RicNewValveTemplateFeature::createNewValveTemplate(){    RimProject* project = RiaApplication::instance()->project();    CVF_ASSERT(project);    RimOilField* oilfield = project->activeOilField();    if (oilfield == nullptr) return nullptr;    RimValveTemplateCollection* valveTemplateColl = oilfield->valveTemplateCollection();    if (valveTemplateColl)    {        RimValveTemplate* valveTemplate = new RimValveTemplate();        QString           userLabel = QString("Valve Template #%1").arg(valveTemplateColl->valveTemplates().size() + 1);        valveTemplate->setUserLabel(userLabel);        valveTemplateColl->addValveTemplate(valveTemplate);        valveTemplate->setUnitSystem(valveTemplateColl->defaultUnitSystemType());        valveTemplate->setDefaultValuesFromUnits();        return valveTemplate;    }    return nullptr;}
开发者ID:OPM,项目名称:ResInsight,代码行数:25,


示例16: CVF_ASSERT

//--------------------------------------------------------------------------------------------------/// //--------------------------------------------------------------------------------------------------void LocatorPanWalkRotate::updatePan(double tx, double ty){    CVF_ASSERT(m_camera.notNull());    // Viewport size in world coordinates    const double aspect = m_camera->aspectRatio();    const double vpWorldSizeY = m_camera->frontPlaneFrustumHeight();    const double vpWorldSizeX = vpWorldSizeY*aspect;    const Vec3d camUp = m_camera->up();    const Vec3d camRight = m_camera->right();    Camera::ProjectionType projType = m_camera->projection();     if (projType == Camera::PERSPECTIVE)    {        // Compute distance from camera to point projected onto camera forward direction        const Vec3d camPos = m_camera->position();        const Vec3d camDir = m_camera->direction();        const Vec3d vDiff = m_pos - camPos;        const double camPointDist = Math::abs(camDir*vDiff);        const double nearPlane = m_camera->nearPlane();        Vec3d vX =  camRight*((tx*vpWorldSizeX)/nearPlane)*camPointDist;        Vec3d vY =  camUp*((ty*vpWorldSizeY)/nearPlane)*camPointDist;                Vec3d translation = vX + vY;        m_pos += translation;    }    else if (projType == Camera::ORTHO)    {        Vec3d vX =  camRight*tx*vpWorldSizeX;        Vec3d vY =  camUp*ty*vpWorldSizeY;        Vec3d translation = vX + vY;        m_pos += translation;    }}
开发者ID:PETECLAM,项目名称:ResInsight,代码行数:42,


示例17: CVF_ASSERT

//--------------------------------------------------------------------------------------------------/// //--------------------------------------------------------------------------------------------------void RicCopyIntersectionsToAllViewsInCaseFeature::copyIntersectionBoxesToOtherViews(RimCase& gridCase, std::vector<RimIntersectionBox*> intersectionBoxes){    for (RimIntersectionBox* intersectionBox : intersectionBoxes)    {        for (Rim3dView* const view : gridCase.views())        {            RimGridView* currGridView = dynamic_cast<RimGridView*>(view);            RimGridView* parentView = nullptr;            intersectionBox->firstAncestorOrThisOfType(parentView);            if (currGridView && parentView != nullptr && parentView != currGridView)            {                RimIntersectionCollection* destCollection = currGridView->crossSectionCollection();                RimIntersectionBox* copy = dynamic_cast<RimIntersectionBox*>(intersectionBox->xmlCapability()->copyByXmlSerialization(caf::PdmDefaultObjectFactory::instance()));                CVF_ASSERT(copy);                destCollection->appendIntersectionBoxAndUpdate(copy);            }        }    }}
开发者ID:OPM,项目名称:ResInsight,代码行数:25,


示例18: CVF_ASSERT

//--------------------------------------------------------------------------------------------------/// Get set of Eclipse files based on an input file and its path//--------------------------------------------------------------------------------------------------bool RifEclipseOutputFileTools::findSiblingFilesWithSameBaseName(const QString& fullPathFileName, QStringList* baseNameFiles){    CVF_ASSERT(baseNameFiles);    baseNameFiles->clear();    QString filePath = QFileInfo(fullPathFileName).absoluteFilePath();    filePath = QFileInfo(filePath).path();    QString fileNameBase = QFileInfo(fullPathFileName).completeBaseName();    stringlist_type* eclipseFiles = stringlist_alloc_new();    ecl_util_select_filelist(RiaStringEncodingTools::toNativeEncoded(filePath).data(), RiaStringEncodingTools::toNativeEncoded(fileNameBase).data(), ECL_OTHER_FILE, false, eclipseFiles);    int i;    for (i = 0; i < stringlist_get_size(eclipseFiles); i++)    {        baseNameFiles->append(RiaStringEncodingTools::fromNativeEncoded(stringlist_safe_iget(eclipseFiles, i)));    }    stringlist_free(eclipseFiles);    return baseNameFiles->count() > 0;}
开发者ID:OPM,项目名称:ResInsight,代码行数:25,


示例19: CVF_ASSERT

//--------------------------------------------------------------------------------------------------/// //--------------------------------------------------------------------------------------------------void RimCellRangeFilter::setDefaultValues(){    CVF_ASSERT(m_parentContainer);    RigGridBase* grid = selectedGrid();    RigActiveCellInfo* actCellInfo = m_parentContainer->activeCellInfo();    if (grid == m_parentContainer->mainGrid() && actCellInfo)    {        cvf::Vec3st min, max;        actCellInfo->IJKBoundingBox(min, max);        // Adjust to Eclipse indexing        min.x() = min.x() + 1;        min.y() = min.y() + 1;        min.z() = min.z() + 1;        max.x() = max.x() + 1;        max.y() = max.y() + 1;        max.z() = max.z() + 1;        startIndexI = static_cast<int>(min.x());        startIndexJ = static_cast<int>(min.y());        startIndexK = static_cast<int>(min.z());        cellCountI = static_cast<int>(max.x() - min.x() + 1);        cellCountJ = static_cast<int>(max.y() - min.y() + 1);        cellCountK = static_cast<int>(max.z() - min.z() + 1);    }    else    {        startIndexI = 1;        startIndexJ = 1;        startIndexK = 1;        cellCountI = static_cast<int>(grid->cellCountI() );        cellCountJ = static_cast<int>(grid->cellCountJ() );        cellCountK = static_cast<int>(grid->cellCountK() );    }}
开发者ID:PETECLAM,项目名称:ResInsight,代码行数:41,


示例20: CVF_ASSERT

//--------------------------------------------------------------------------------------------------/// //--------------------------------------------------------------------------------------------------void RicPasteSummaryPlotFeature::copyPlotAndAddToCollection(RimSummaryPlot *sourcePlot){    RimSummaryPlotCollection* plotColl = caf::firstAncestorOfTypeFromSelectedObject<RimSummaryPlotCollection*>();    if (plotColl)    {        RimSummaryPlot* newSummaryPlot = dynamic_cast<RimSummaryPlot*>(sourcePlot->xmlCapability()->copyByXmlSerialization(caf::PdmDefaultObjectFactory::instance()));        CVF_ASSERT(newSummaryPlot);        plotColl->summaryPlots.push_back(newSummaryPlot);        // Resolve references after object has been inserted into the data model        newSummaryPlot->resolveReferencesRecursively();        newSummaryPlot->initAfterReadRecursively();        QString nameOfCopy = QString("Copy of ") + newSummaryPlot->description();        newSummaryPlot->setDescription(nameOfCopy);        plotColl->updateConnectedEditors();        newSummaryPlot->loadDataAndUpdate();    }}
开发者ID:OPM,项目名称:ResInsight,代码行数:26,


示例21: CVF_ASSERT

//--------------------------------------------------------------------------------------------------/// Add one face /// /// The type of primitive added will be determined from the number of indices passed in /a indices/// /// /remarks Currently, points and lines are not supported. Faces with more than 4 indices will///          be triangulated using fanning//--------------------------------------------------------------------------------------------------void GeometryBuilder::addFace(const UIntArray& indices){    size_t numIndices = indices.size();    CVF_ASSERT(numIndices >= 3);    if (numIndices == 3)    {        addTriangle(indices[0], indices[1], indices[2]);    }    else if (numIndices == 4)    {        addQuad(indices[0], indices[1], indices[2], indices[3]);    }    else    {        size_t numTriangles = numIndices - 2;        size_t i;        for (i = 0; i < numTriangles; i++)        {            addTriangle(indices[0], indices[i + 1], indices[i + 2]);        }    }}
开发者ID:akva2,项目名称:ResInsight,代码行数:31,


示例22: CVF_ASSERT

//--------------------------------------------------------------------------------------------------/// //--------------------------------------------------------------------------------------------------void RivTernaryTextureCoordsCreator::createTextureCoords(cvf::Vec2fArray* textureCoords, const std::vector<size_t>& triangleToCellIdx, const RigTernaryResultAccessor* resultAccessor, const RivTernaryResultToTextureMapper* texMapper){    CVF_ASSERT(textureCoords && resultAccessor && texMapper);    size_t numVertices = triangleToCellIdx.size() * 3;    textureCoords->resize(numVertices);    cvf::Vec2f* rawPtr = textureCoords->ptr();#pragma omp parallel for    for (int i = 0; i < static_cast<int>(triangleToCellIdx.size()); i++)    {        size_t cellIdx = triangleToCellIdx[i];        cvf::Vec2d resultValue = resultAccessor->cellScalarGlobIdx(cellIdx);        cvf::Vec2f texCoord = texMapper->getTexCoord(resultValue.x(), resultValue.y(), cellIdx);        size_t j;        for (j = 0; j < 3; j++)        {            rawPtr[i * 3 + j] = texCoord;        }    }}
开发者ID:OPM,项目名称:ResInsight,代码行数:26,


示例23: CVF_ASSERT

//--------------------------------------------------------------------------------------------------/// //--------------------------------------------------------------------------------------------------void RimCellPropertyFilter::computeResultValueRange(){    CVF_ASSERT(m_parentContainer);    double min = 0.0;    double max = 0.0;    size_t scalarIndex = resultDefinition->scalarResultIndex();    if (scalarIndex != cvf::UNDEFINED_SIZE_T)    {        RimReservoirCellResultsStorage* results = resultDefinition->currentGridCellResults();        if (results)        {            results->cellResults()->minMaxCellScalarValues(scalarIndex, min, max);        }    }    m_maximumResultValue = max;    m_minimumResultValue = min;    lowerBound.setUiName(QString("Min (%1)").arg(min));    upperBound.setUiName(QString("Max (%1)").arg(max));}
开发者ID:JacobStoren,项目名称:ResInsight,代码行数:26,


示例24: CVF_ASSERT

//--------------------------------------------------------------------------------------------------/// Restart timer and laptime//--------------------------------------------------------------------------------------------------void Timer::restart(){    CVF_ASSERT(m_timerState);#ifdef WIN32    LARGE_INTEGER tick;    QueryPerformanceCounter(&tick);    m_timerState->m_startTick = tick.QuadPart;    m_timerState->m_lastLapTick = m_timerState->m_startTick;#elif defined(CVF_LINUX) || defined(CVF_ANDROID)    clock_gettime(CLOCK_MONOTONIC, &m_timerState->m_timeStart);    m_timerState->m_timeMark = m_timerState->m_timeStart;#elif defined(CVF_IOS) || defined(CVF_OSX)    m_timerState->m_startTime = mach_absolute_time();    m_timerState->m_lastLapTime   = m_timerState->m_startTime;#endif}
开发者ID:CeetronAS,项目名称:CustomVisualizationCore,代码行数:26,



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


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