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


C++ DataNode::AsFloat方法代码示例

本文整理汇总了C++中DataNode::AsFloat方法的典型用法代码示例。如果您正苦于以下问题:C++ DataNode::AsFloat方法的具体用法?C++ DataNode::AsFloat怎么用?C++ DataNode::AsFloat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataNode的用法示例。


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

示例1: if

void
ParallelCoordinatesAttributes::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("ParallelCoordinatesAttributes");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("scalarAxisNames")) != 0)
        SetScalarAxisNames(node->AsStringVector());
    if((node = searchNode->GetNode("visualAxisNames")) != 0)
        SetVisualAxisNames(node->AsStringVector());
    if((node = searchNode->GetNode("extentMinima")) != 0)
        SetExtentMinima(node->AsDoubleVector());
    if((node = searchNode->GetNode("extentMaxima")) != 0)
        SetExtentMaxima(node->AsDoubleVector());
    if((node = searchNode->GetNode("drawLines")) != 0)
        SetDrawLines(node->AsBool());
    if((node = searchNode->GetNode("linesColor")) != 0)
        linesColor.SetFromNode(node);
    if((node = searchNode->GetNode("drawContext")) != 0)
        SetDrawContext(node->AsBool());
    if((node = searchNode->GetNode("contextGamma")) != 0)
        SetContextGamma(node->AsFloat());
    if((node = searchNode->GetNode("contextNumPartitions")) != 0)
        SetContextNumPartitions(node->AsInt());
    if((node = searchNode->GetNode("contextColor")) != 0)
        contextColor.SetFromNode(node);
    if((node = searchNode->GetNode("drawLinesOnlyIfExtentsOn")) != 0)
        SetDrawLinesOnlyIfExtentsOn(node->AsBool());
    if((node = searchNode->GetNode("unifyAxisExtents")) != 0)
        SetUnifyAxisExtents(node->AsBool());
    if((node = searchNode->GetNode("linesNumPartitions")) != 0)
        SetLinesNumPartitions(node->AsInt());
    if((node = searchNode->GetNode("focusGamma")) != 0)
        SetFocusGamma(node->AsFloat());
    if((node = searchNode->GetNode("drawFocusAs")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 3)
                SetDrawFocusAs(FocusRendering(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            FocusRendering value;
            if(FocusRendering_FromString(node->AsString(), value))
                SetDrawFocusAs(value);
        }
    }
}
开发者ID:,项目名称:,代码行数:56,代码来源:

示例2: if

void
MaterialAttributes::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("MaterialAttributes");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("smoothing")) != 0)
        SetSmoothing(node->AsBool());
    if((node = searchNode->GetNode("forceMIR")) != 0)
        SetForceMIR(node->AsBool());
    if((node = searchNode->GetNode("cleanZonesOnly")) != 0)
        SetCleanZonesOnly(node->AsBool());
    if((node = searchNode->GetNode("needValidConnectivity")) != 0)
        SetNeedValidConnectivity(node->AsBool());
    if((node = searchNode->GetNode("algorithm")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 5)
                SetAlgorithm(Algorithm(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            Algorithm value;
            if(Algorithm_FromString(node->AsString(), value))
                SetAlgorithm(value);
        }
    }
    if((node = searchNode->GetNode("iterationEnabled")) != 0)
        SetIterationEnabled(node->AsBool());
    if((node = searchNode->GetNode("numIterations")) != 0)
        SetNumIterations(node->AsInt());
    if((node = searchNode->GetNode("iterationDamping")) != 0)
        SetIterationDamping(node->AsFloat());
    if((node = searchNode->GetNode("simplifyHeavilyMixedZones")) != 0)
        SetSimplifyHeavilyMixedZones(node->AsBool());
    if((node = searchNode->GetNode("maxMaterialsPerZone")) != 0)
        SetMaxMaterialsPerZone(node->AsInt());
    if((node = searchNode->GetNode("isoVolumeFraction")) != 0)
        SetIsoVolumeFraction(node->AsFloat());
    if((node = searchNode->GetNode("annealingTime")) != 0)
        SetAnnealingTime(node->AsInt());
}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:50,代码来源:MaterialAttributes.C

示例3:

void
MovieSequenceRotate::ReadUIValues(QWidget *ui, DataNode *node)
{
    const char *mName = "MovieSequenceRotate::ReadUIValues: ";

    if(node != 0)
    {
        QvisRotationTransition *UI = (QvisRotationTransition *)ui;

        // Read the start angle and put it into the UI.
        DataNode *saNode = node->GetNode("startAngle");
        if(saNode != 0 && saNode->GetNodeType() == FLOAT_NODE)
            UI->setStartAngle(saNode->AsFloat());                
        else
        {
            debug4 << mName << "startAngle not found or it was the "
                   << "wrong type." << endl;
        }

        // Read the start angle and put it into the UI.
        DataNode *eaNode = node->GetNode("endAngle");
        if(eaNode != 0 && eaNode->GetNodeType() == FLOAT_NODE)
            UI->setEndAngle(eaNode->AsFloat());                
        else
        {
            debug4 << mName << "endAngle not found or it was the "
                   << "wrong type." << endl;
        }

        // Read the number of steps.
        DataNode *nStepsNode = node->GetNode("nSteps");
        if(nStepsNode !=0 && nStepsNode->GetNodeType() == INT_NODE)
        {
            UI->setNSteps(nStepsNode->AsInt());
        }
        else
        {
            debug4 << mName << "nSteps not found in node." << endl;
        }
    }
}
开发者ID:,项目名称:,代码行数:41,代码来源:

示例4: SetX

void
GaussianControlPoint::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("GaussianControlPoint");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("x")) != 0)
        SetX(node->AsFloat());
    if((node = searchNode->GetNode("height")) != 0)
        SetHeight(node->AsFloat());
    if((node = searchNode->GetNode("width")) != 0)
        SetWidth(node->AsFloat());
    if((node = searchNode->GetNode("xBias")) != 0)
        SetXBias(node->AsFloat());
    if((node = searchNode->GetNode("yBias")) != 0)
        SetYBias(node->AsFloat());
}
开发者ID:HarinarayanKrishnan,项目名称:VisIt26RC_Trunk,代码行数:22,代码来源:GaussianControlPoint.C

示例5: SetUseTargetVal

void
InternalResampleAttributes::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("InternalResampleAttributes");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("useTargetVal")) != 0)
        SetUseTargetVal(node->AsBool());
    if((node = searchNode->GetNode("targetVal")) != 0)
        SetTargetVal(node->AsInt());
    if((node = searchNode->GetNode("width")) != 0)
        SetWidth(node->AsInt());
    if((node = searchNode->GetNode("height")) != 0)
        SetHeight(node->AsInt());
    if((node = searchNode->GetNode("depth")) != 0)
        SetDepth(node->AsInt());
    if((node = searchNode->GetNode("prefersPowersOfTwo")) != 0)
        SetPrefersPowersOfTwo(node->AsBool());
    if((node = searchNode->GetNode("defaultVal")) != 0)
        SetDefaultVal(node->AsFloat());
    if((node = searchNode->GetNode("useBounds")) != 0)
        SetUseBounds(node->AsBool());
    if((node = searchNode->GetNode("minX")) != 0)
        SetMinX(node->AsDouble());
    if((node = searchNode->GetNode("minY")) != 0)
        SetMinY(node->AsDouble());
    if((node = searchNode->GetNode("minZ")) != 0)
        SetMinZ(node->AsDouble());
    if((node = searchNode->GetNode("maxX")) != 0)
        SetMaxX(node->AsDouble());
    if((node = searchNode->GetNode("maxY")) != 0)
        SetMaxY(node->AsDouble());
    if((node = searchNode->GetNode("maxZ")) != 0)
        SetMaxZ(node->AsDouble());
    if((node = searchNode->GetNode("useArbitrator")) != 0)
        SetUseArbitrator(node->AsBool());
    if((node = searchNode->GetNode("arbitratorLessThan")) != 0)
        SetArbitratorLessThan(node->AsBool());
    if((node = searchNode->GetNode("arbitratorVarName")) != 0)
        SetArbitratorVarName(node->AsString());
    if((node = searchNode->GetNode("distributedResample")) != 0)
        SetDistributedResample(node->AsBool());
}
开发者ID:HarinarayanKrishnan,项目名称:VisIt26RC_Trunk,代码行数:48,代码来源:InternalResampleAttributes.C

示例6: SetColors

void
ColorControlPoint::SetFromNode(DataNode *parentNode)
{
    //int i;
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("ColorControlPoint");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("colors")) != 0)
        SetColors(node->AsUnsignedCharArray());
    if((node = searchNode->GetNode("position")) != 0)
        SetPosition(node->AsFloat());
}
开发者ID:151706061,项目名称:ParaView,代码行数:17,代码来源:ColorControlPoint.cpp

示例7: if

void
LabelAttributes::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("LabelAttributes");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("varType")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 10)
                SetVarType(VariableType(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            VariableType value;
            if(VariableType_FromString(node->AsString(), value))
                SetVarType(value);
        }
    }
    if((node = searchNode->GetNode("legendFlag")) != 0)
        SetLegendFlag(node->AsBool());
    if((node = searchNode->GetNode("showNodes")) != 0)
        SetShowNodes(node->AsBool());
    if((node = searchNode->GetNode("showCells")) != 0)
        SetShowCells(node->AsBool());
    if((node = searchNode->GetNode("restrictNumberOfLabels")) != 0)
        SetRestrictNumberOfLabels(node->AsBool());
    if((node = searchNode->GetNode("drawLabelsFacing")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 3)
                SetDrawLabelsFacing(LabelDrawFacing(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            LabelDrawFacing value;
            if(LabelDrawFacing_FromString(node->AsString(), value))
                SetDrawLabelsFacing(value);
        }
    }
    if((node = searchNode->GetNode("labelDisplayFormat")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 3)
                SetLabelDisplayFormat(LabelIndexDisplay(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            LabelIndexDisplay value;
            if(LabelIndexDisplay_FromString(node->AsString(), value))
                SetLabelDisplayFormat(value);
        }
    }
    if((node = searchNode->GetNode("numberOfLabels")) != 0)
        SetNumberOfLabels(node->AsInt());
    if((node = searchNode->GetNode("specifyTextColor1")) != 0)
        SetSpecifyTextColor1(node->AsBool());
    if((node = searchNode->GetNode("textColor1")) != 0)
        textColor1.SetFromNode(node);
    if((node = searchNode->GetNode("textHeight1")) != 0)
        SetTextHeight1(node->AsFloat());
    if((node = searchNode->GetNode("specifyTextColor2")) != 0)
        SetSpecifyTextColor2(node->AsBool());
    if((node = searchNode->GetNode("textColor2")) != 0)
        textColor2.SetFromNode(node);
    if((node = searchNode->GetNode("textHeight2")) != 0)
        SetTextHeight2(node->AsFloat());
    if((node = searchNode->GetNode("horizontalJustification")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 3)
                SetHorizontalJustification(LabelHorizontalAlignment(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            LabelHorizontalAlignment value;
            if(LabelHorizontalAlignment_FromString(node->AsString(), value))
                SetHorizontalJustification(value);
        }
    }
    if((node = searchNode->GetNode("verticalJustification")) != 0)
    {
        // Allow enums to be int or string in the config file
//.........这里部分代码省略.........
开发者ID:HarinarayanKrishnan,项目名称:VisIt28RC_Trunk,代码行数:101,代码来源:LabelAttributes.C

示例8: if

void
WellBoreAttributes::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("WellBoreAttributes");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("defaultPalette")) != 0)
        defaultPalette.SetFromNode(node);
    if((node = searchNode->GetNode("changedColors")) != 0)
        SetChangedColors(node->AsUnsignedCharVector());
    if((node = searchNode->GetNode("colorType")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 3)
                SetColorType(ColoringMethod(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            ColoringMethod value;
            if(ColoringMethod_FromString(node->AsString(), value))
                SetColorType(value);
        }
    }
    if((node = searchNode->GetNode("colorTableName")) != 0)
        SetColorTableName(node->AsString());
    if((node = searchNode->GetNode("invertColorTable")) != 0)
        SetInvertColorTable(node->AsBool());
    if((node = searchNode->GetNode("singleColor")) != 0)
        singleColor.SetFromNode(node);
    if((node = searchNode->GetNode("multiColor")) != 0)
        multiColor.SetFromNode(node);
    if((node = searchNode->GetNode("drawWellsAs")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 2)
                SetDrawWellsAs(WellRenderingMode(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            WellRenderingMode value;
            if(WellRenderingMode_FromString(node->AsString(), value))
                SetDrawWellsAs(value);
        }
    }
    if((node = searchNode->GetNode("wellCylinderQuality")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 4)
                SetWellCylinderQuality(DetailLevel(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            DetailLevel value;
            if(DetailLevel_FromString(node->AsString(), value))
                SetWellCylinderQuality(value);
        }
    }
    if((node = searchNode->GetNode("wellRadius")) != 0)
        SetWellRadius(node->AsFloat());
    if((node = searchNode->GetNode("wellLineWidth")) != 0)
        SetWellLineWidth(node->AsInt());
    if((node = searchNode->GetNode("wellLineStyle")) != 0)
        SetWellLineStyle(node->AsInt());
    if((node = searchNode->GetNode("wellAnnotation")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 4)
                SetWellAnnotation(WellAnnotation(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            WellAnnotation value;
            if(WellAnnotation_FromString(node->AsString(), value))
                SetWellAnnotation(value);
        }
    }
    if((node = searchNode->GetNode("wellStemHeight")) != 0)
        SetWellStemHeight(node->AsFloat());
    if((node = searchNode->GetNode("wellNameScale")) != 0)
        SetWellNameScale(node->AsFloat());
    if((node = searchNode->GetNode("legendFlag")) != 0)
        SetLegendFlag(node->AsBool());
    if((node = searchNode->GetNode("nWellBores")) != 0)
//.........这里部分代码省略.........
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:101,代码来源:WellBoreAttributes.C

示例9: if

void
SimilarityTransformAttributes::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("SimilarityTransformAttributes");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("doRotate")) != 0)
        SetDoRotate(node->AsBool());
    if((node = searchNode->GetNode("rotateOrigin")) != 0)
    {
        if(node->GetNodeType() == DOUBLE_ARRAY_NODE)
        {
            SetRotateOrigin(node->AsDoubleArray());
        }
        else if(node->GetNodeType() == FLOAT_ARRAY_NODE)
        {
            const float *fa = node->AsFloatArray();
            double da[3] = {fa[0], fa[1], fa[2]};
            SetRotateOrigin(da);
        }
    }
    if((node = searchNode->GetNode("rotateAxis")) != 0)
    {
        if(node->GetNodeType() == DOUBLE_ARRAY_NODE)
        {
            SetRotateAxis(node->AsDoubleArray());
        }
        else if(node->GetNodeType() == FLOAT_ARRAY_NODE)
        {
            const float *fa = node->AsFloatArray();
            double da[3] = {fa[0], fa[1], fa[2]};
            SetRotateAxis(da);
        }
    }
    if((node = searchNode->GetNode("rotateAmount")) != 0)
    {
        if(node->GetNodeType() == DOUBLE_NODE)
            SetRotateAmount(node->AsDouble());
        else if(node->GetNodeType() == FLOAT_NODE)
            SetRotateAmount((double)node->AsFloat());
    }
    if((node = searchNode->GetNode("rotateType")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 2)
                SetRotateType(AngleType(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            AngleType value;
            if(AngleType_FromString(node->AsString(), value))
                SetRotateType(value);
        }
    }
    if((node = searchNode->GetNode("doScale")) != 0)
        SetDoScale(node->AsBool());
    if((node = searchNode->GetNode("scaleOrigin")) != 0)
    {
        if(node->GetNodeType() == DOUBLE_ARRAY_NODE)
        {
            SetScaleOrigin(node->AsDoubleArray());
        }
        else if(node->GetNodeType() == FLOAT_ARRAY_NODE)
        {
            const float *fa = node->AsFloatArray();
            double da[3] = {fa[0], fa[1], fa[2]};
            SetScaleOrigin(da);
        }
    }
    if((node = searchNode->GetNode("scaleX")) != 0)
    {
        if(node->GetNodeType() == DOUBLE_NODE)
            SetScaleX(node->AsDouble());
        else if(node->GetNodeType() == FLOAT_NODE)
            SetScaleX((double)node->AsFloat());
    }
    if((node = searchNode->GetNode("scaleY")) != 0)
    {
        if(node->GetNodeType() == DOUBLE_NODE)
            SetScaleY(node->AsDouble());
        else if(node->GetNodeType() == FLOAT_NODE)
            SetScaleY((double)node->AsFloat());
    }
    if((node = searchNode->GetNode("scaleZ")) != 0)
    {
        if(node->GetNodeType() == DOUBLE_NODE)
            SetScaleZ(node->AsDouble());
        else if(node->GetNodeType() == FLOAT_NODE)
            SetScaleZ((double)node->AsFloat());
    }
    if((node = searchNode->GetNode("doTranslate")) != 0)
        SetDoTranslate(node->AsBool());
//.........这里部分代码省略.........
开发者ID:HarinarayanKrishnan,项目名称:VisIt28RC_Trunk,代码行数:101,代码来源:SimilarityTransformAttributes.C


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