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


C++ CVF_ASSERT函数代码示例

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


在下文中一共展示了CVF_ASSERT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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,代码来源:RicRangeFilterInsertExec.cpp

示例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,代码来源:cvfPerformanceInfo.cpp

示例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,代码来源:RimGridCollection.cpp

示例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,代码来源:cvfPropertyXmlSerializer.cpp

示例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,代码来源:RiaSocketServer.cpp

示例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,代码来源:cafCategoryMapper.cpp

示例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,代码来源:cvfModelBasicTree.cpp

示例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,代码来源:cvfUniformSet.cpp

示例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,代码来源:RigFemPartResultsCollection.cpp

示例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,代码来源:RicPasteEclipseViewsFeature.cpp

示例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,代码来源:RigMainGrid.cpp

示例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,代码来源:RimGeoMechView.cpp

示例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,代码来源:RigFemPart.cpp

示例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,代码来源:RimGeoMechView.cpp

示例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,代码来源:RicNewValveTemplateFeature.cpp


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