本文整理汇总了C++中DataNode::AsBool方法的典型用法代码示例。如果您正苦于以下问题:C++ DataNode::AsBool方法的具体用法?C++ DataNode::AsBool怎么用?C++ DataNode::AsBool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataNode
的用法示例。
在下文中一共展示了DataNode::AsBool方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
ContourOpAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("ContourOpAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("contourNLevels")) != 0)
SetContourNLevels(node->AsInt());
if((node = searchNode->GetNode("contourValue")) != 0)
SetContourValue(node->AsDoubleVector());
if((node = searchNode->GetNode("contourPercent")) != 0)
SetContourPercent(node->AsDoubleVector());
if((node = searchNode->GetNode("contourMethod")) != 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)
SetContourMethod(ContourMethod(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
ContourMethod value;
if(ContourMethod_FromString(node->AsString(), value))
SetContourMethod(value);
}
}
if((node = searchNode->GetNode("minFlag")) != 0)
SetMinFlag(node->AsBool());
if((node = searchNode->GetNode("maxFlag")) != 0)
SetMaxFlag(node->AsBool());
if((node = searchNode->GetNode("min")) != 0)
SetMin(node->AsDouble());
if((node = searchNode->GetNode("max")) != 0)
SetMax(node->AsDouble());
if((node = searchNode->GetNode("scaling")) != 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)
SetScaling(ContourScaling(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
ContourScaling value;
if(ContourScaling_FromString(node->AsString(), value))
SetScaling(value);
}
}
if((node = searchNode->GetNode("variable")) != 0)
SetVariable(node->AsString());
}
示例2: SetStrainVar
void
CracksClipperAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("CracksClipperAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("crack1Var")) != 0)
SetCrack1Var(node->AsString());
if((node = searchNode->GetNode("crack2Var")) != 0)
SetCrack2Var(node->AsString());
if((node = searchNode->GetNode("crack3Var")) != 0)
SetCrack3Var(node->AsString());
if((node = searchNode->GetNode("strainVar")) != 0)
SetStrainVar(node->AsString());
if((node = searchNode->GetNode("showCrack1")) != 0)
SetShowCrack1(node->AsBool());
if((node = searchNode->GetNode("showCrack2")) != 0)
SetShowCrack2(node->AsBool());
if((node = searchNode->GetNode("showCrack3")) != 0)
SetShowCrack3(node->AsBool());
if((node = searchNode->GetNode("inMassVar")) != 0)
SetInMassVar(node->AsString());
}
示例3: SetInteractive
void
LineoutAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("LineoutAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("point1")) != 0)
SetPoint1(node->AsDoubleArray());
if((node = searchNode->GetNode("point2")) != 0)
SetPoint2(node->AsDoubleArray());
if((node = searchNode->GetNode("interactive")) != 0)
SetInteractive(node->AsBool());
if((node = searchNode->GetNode("ignoreGlobal")) != 0)
SetIgnoreGlobal(node->AsBool());
if((node = searchNode->GetNode("samplingOn")) != 0)
SetSamplingOn(node->AsBool());
if((node = searchNode->GetNode("numberOfSamplePoints")) != 0)
SetNumberOfSamplePoints(node->AsInt());
if((node = searchNode->GetNode("reflineLabels")) != 0)
SetReflineLabels(node->AsBool());
if((node = searchNode->GetNode("designator")) != 0)
SetDesignator(node->AsString());
}
示例4: SetUseUnitCellVectors
void
ReplicateAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("ReplicateAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("useUnitCellVectors")) != 0)
SetUseUnitCellVectors(node->AsBool());
if((node = searchNode->GetNode("xVector")) != 0)
SetXVector(node->AsDoubleArray());
if((node = searchNode->GetNode("yVector")) != 0)
SetYVector(node->AsDoubleArray());
if((node = searchNode->GetNode("zVector")) != 0)
SetZVector(node->AsDoubleArray());
if((node = searchNode->GetNode("xReplications")) != 0)
SetXReplications(node->AsInt());
if((node = searchNode->GetNode("yReplications")) != 0)
SetYReplications(node->AsInt());
if((node = searchNode->GetNode("zReplications")) != 0)
SetZReplications(node->AsInt());
if((node = searchNode->GetNode("mergeResults")) != 0)
SetMergeResults(node->AsBool());
if((node = searchNode->GetNode("replicateUnitCellAtoms")) != 0)
SetReplicateUnitCellAtoms(node->AsBool());
if((node = searchNode->GetNode("shiftPeriodicAtomOrigin")) != 0)
SetShiftPeriodicAtomOrigin(node->AsBool());
if((node = searchNode->GetNode("newPeriodicOrigin")) != 0)
SetNewPeriodicOrigin(node->AsDoubleArray());
}
示例5: SetPrinterName
void
PrinterAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("PrinterAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("printerName")) != 0)
SetPrinterName(node->AsString());
if((node = searchNode->GetNode("printProgram")) != 0)
SetPrintProgram(node->AsString());
if((node = searchNode->GetNode("documentName")) != 0)
SetDocumentName(node->AsString());
if((node = searchNode->GetNode("creator")) != 0)
SetCreator(node->AsString());
if((node = searchNode->GetNode("numCopies")) != 0)
SetNumCopies(node->AsInt());
if((node = searchNode->GetNode("portrait")) != 0)
SetPortrait(node->AsBool());
if((node = searchNode->GetNode("printColor")) != 0)
SetPrintColor(node->AsBool());
if((node = searchNode->GetNode("outputToFile")) != 0)
SetOutputToFile(node->AsBool());
if((node = searchNode->GetNode("outputToFileName")) != 0)
SetOutputToFileName(node->AsString());
if((node = searchNode->GetNode("pageSize")) != 0)
SetPageSize(node->AsInt());
}
示例6: 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);
}
}
}
示例7: if
void
InteractorAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("InteractorAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("showGuidelines")) != 0)
SetShowGuidelines(node->AsBool());
if((node = searchNode->GetNode("clampSquare")) != 0)
SetClampSquare(node->AsBool());
if((node = searchNode->GetNode("fillViewportOnZoom")) != 0)
SetFillViewportOnZoom(node->AsBool());
if((node = searchNode->GetNode("navigationMode")) != 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)
SetNavigationMode(NavigationMode(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
NavigationMode value;
if(NavigationMode_FromString(node->AsString(), value))
SetNavigationMode(value);
}
}
if((node = searchNode->GetNode("axisArraySnap")) != 0)
SetAxisArraySnap(node->AsBool());
if((node = searchNode->GetNode("boundingBoxMode")) != 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)
SetBoundingBoxMode(BoundingBoxMode(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
BoundingBoxMode value;
if(BoundingBoxMode_FromString(node->AsString(), value))
SetBoundingBoxMode(value);
}
}
}
示例8: SetInvertLinearTransform
void
LinearTransformAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("LinearTransformAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("m00")) != 0)
SetM00(node->AsDouble());
if((node = searchNode->GetNode("m01")) != 0)
SetM01(node->AsDouble());
if((node = searchNode->GetNode("m02")) != 0)
SetM02(node->AsDouble());
if((node = searchNode->GetNode("m03")) != 0)
SetM03(node->AsDouble());
if((node = searchNode->GetNode("m10")) != 0)
SetM10(node->AsDouble());
if((node = searchNode->GetNode("m11")) != 0)
SetM11(node->AsDouble());
if((node = searchNode->GetNode("m12")) != 0)
SetM12(node->AsDouble());
if((node = searchNode->GetNode("m13")) != 0)
SetM13(node->AsDouble());
if((node = searchNode->GetNode("m20")) != 0)
SetM20(node->AsDouble());
if((node = searchNode->GetNode("m21")) != 0)
SetM21(node->AsDouble());
if((node = searchNode->GetNode("m22")) != 0)
SetM22(node->AsDouble());
if((node = searchNode->GetNode("m23")) != 0)
SetM23(node->AsDouble());
if((node = searchNode->GetNode("m30")) != 0)
SetM30(node->AsDouble());
if((node = searchNode->GetNode("m31")) != 0)
SetM31(node->AsDouble());
if((node = searchNode->GetNode("m32")) != 0)
SetM32(node->AsDouble());
if((node = searchNode->GetNode("m33")) != 0)
SetM33(node->AsDouble());
if((node = searchNode->GetNode("invertLinearTransform")) != 0)
SetInvertLinearTransform(node->AsBool());
if((node = searchNode->GetNode("transformVectors")) != 0)
SetTransformVectors(node->AsBool());
}
示例9: if
void
MeshManagementAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("MeshManagementAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("discretizationTolerance")) != 0)
{
if (node->AsDoubleVector().size() == 3)
SetDiscretizationTolerance(node->AsDoubleVector());
else
{
MeshManagementAttributes tmp;
SetDiscretizationTolerance(tmp.GetDiscretizationTolerance());
}
}
if((node = searchNode->GetNode("discretizationToleranceX")) != 0)
SetDiscretizationToleranceX(node->AsDoubleVector());
if((node = searchNode->GetNode("discretizationToleranceY")) != 0)
SetDiscretizationToleranceY(node->AsDoubleVector());
if((node = searchNode->GetNode("discretizationToleranceZ")) != 0)
SetDiscretizationToleranceZ(node->AsDoubleVector());
if((node = searchNode->GetNode("discretizationMode")) != 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)
SetDiscretizationMode(DiscretizationModes(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
DiscretizationModes value;
if(DiscretizationModes_FromString(node->AsString(), value))
SetDiscretizationMode(value);
}
}
if((node = searchNode->GetNode("discretizeBoundaryOnly")) != 0)
SetDiscretizeBoundaryOnly(node->AsBool());
if((node = searchNode->GetNode("passNativeCSG")) != 0)
SetPassNativeCSG(node->AsBool());
}
示例10: if
void
RectilinearProject2DAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("RectilinearProject2DAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("reductionOperator")) != 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)
SetReductionOperator(ReductionOperator(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
ReductionOperator value;
if(ReductionOperator_FromString(node->AsString(), value))
SetReductionOperator(value);
}
}
if((node = searchNode->GetNode("mapGrid")) != 0)
SetMapGrid(node->AsBool());
}
示例11: SetOutputMeshType
void
ThresholdAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("ThresholdAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("outputMeshType")) != 0)
SetOutputMeshType(node->AsInt());
if((node = searchNode->GetNode("listedVarNames")) != 0)
SetListedVarNames(node->AsStringVector());
if((node = searchNode->GetNode("zonePortions")) != 0)
SetZonePortions(node->AsIntVector());
if((node = searchNode->GetNode("lowerBounds")) != 0)
SetLowerBounds(node->AsDoubleVector());
if((node = searchNode->GetNode("upperBounds")) != 0)
SetUpperBounds(node->AsDoubleVector());
if((node = searchNode->GetNode("defaultVarName")) != 0)
SetDefaultVarName(node->AsString());
if((node = searchNode->GetNode("defaultVarIsScalar")) != 0)
SetDefaultVarIsScalar(node->AsBool());
}
示例12: SetUseSystemDefault
void
AppearanceAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("AppearanceAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("useSystemDefault")) != 0)
SetUseSystemDefault(node->AsBool());
if((node = searchNode->GetNode("background")) != 0)
SetBackground(node->AsString());
if((node = searchNode->GetNode("foreground")) != 0)
SetForeground(node->AsString());
if((node = searchNode->GetNode("fontName")) != 0)
SetFontName(node->AsString());
if((node = searchNode->GetNode("style")) != 0)
SetStyle(node->AsString());
if((node = searchNode->GetNode("orientation")) != 0)
SetOrientation(node->AsInt());
if((node = searchNode->GetNode("defaultForeground")) != 0)
SetDefaultForeground(node->AsString());
if((node = searchNode->GetNode("defaultBackground")) != 0)
SetDefaultBackground(node->AsString());
if((node = searchNode->GetNode("defaultFontName")) != 0)
SetDefaultFontName(node->AsString());
if((node = searchNode->GetNode("defaultStyle")) != 0)
SetDefaultStyle(node->AsString());
if((node = searchNode->GetNode("defaultOrientation")) != 0)
SetDefaultOrientation(node->AsInt());
}
示例13: if
void
MessageAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("MessageAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("text")) != 0)
SetText(node->AsString());
if((node = searchNode->GetNode("unicode")) != 0)
SetUnicode(node->AsUnsignedCharVector());
if((node = searchNode->GetNode("hasUnicode")) != 0)
SetHasUnicode(node->AsBool());
if((node = searchNode->GetNode("severity")) != 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)
SetSeverity(Severity(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
Severity value;
if(Severity_FromString(node->AsString(), value))
SetSeverity(value);
}
}
}
示例14:
void
MovieSequenceCompositeTransition::ReadUIValues(QWidget *ui, DataNode *node)
{
const char *mName = "MovieSequenceCompositeTransition::ReadUIValues: ";
if(node != 0)
{
QvisCompositeTransition *UI = (QvisCompositeTransition *)ui;
// Read the number of frames.
DataNode *nFramesNode = node->GetNode("nFrames");
if(nFramesNode !=0 && nFramesNode->GetNodeType() == INT_NODE)
{
UI->setNFrames(nFramesNode->AsInt());
}
else
{
debug4 << mName << "nFrames not found in node." << endl;
}
// Read the reverse flag.
DataNode *reverseNode = node->GetNode("reverse");
if(reverseNode !=0 && reverseNode->GetNodeType() == BOOL_NODE)
{
UI->setReverse(reverseNode->AsBool());
}
else
{
debug4 << mName << "reverse not found in node." << endl;
}
}
}
示例15: SetAllTimes
void
ExportDBAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("ExportDBAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("allTimes")) != 0)
SetAllTimes(node->AsBool());
if((node = searchNode->GetNode("db_type")) != 0)
SetDb_type(node->AsString());
if((node = searchNode->GetNode("db_type_fullname")) != 0)
SetDb_type_fullname(node->AsString());
if((node = searchNode->GetNode("filename")) != 0)
SetFilename(node->AsString());
if((node = searchNode->GetNode("dirname")) != 0)
SetDirname(node->AsString());
if((node = searchNode->GetNode("variables")) != 0)
SetVariables(node->AsStringVector());
if((node = searchNode->GetNode("opts")) != 0)
opts.SetFromNode(node);
}