本文整理汇总了C++中DataNode::GetNodeType方法的典型用法代码示例。如果您正苦于以下问题:C++ DataNode::GetNodeType方法的具体用法?C++ DataNode::GetNodeType怎么用?C++ DataNode::GetNodeType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataNode
的用法示例。
在下文中一共展示了DataNode::GetNodeType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
TimeFormat::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("TimeFormat");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("displayMode")) != 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)
SetDisplayMode(DisplayMode(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
DisplayMode value;
if(DisplayMode_FromString(node->AsString(), value))
SetDisplayMode(value);
}
}
if((node = searchNode->GetNode("precision")) != 0)
SetPrecision(node->AsInt());
}
示例2: 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());
}
示例3: if
void
DualMeshAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("DualMeshAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("mode")) != 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)
SetMode(ConversionMode(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
ConversionMode value;
if(ConversionMode_FromString(node->AsString(), value))
SetMode(value);
}
}
}
示例4: 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());
}
示例5:
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;
}
}
}
示例6: if
void
DelaunayAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("DelaunayAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("dimension")) != 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)
SetDimension(Dimension(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
Dimension value;
if(Dimension_FromString(node->AsString(), value))
SetDimension(value);
}
}
}
示例7: if
void
CartographicProjectionAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("CartographicProjectionAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("projectionID")) != 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 < 11)
SetProjectionID(ProjectionID(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
ProjectionID value;
if(ProjectionID_FromString(node->AsString(), value))
SetProjectionID(value);
}
}
if((node = searchNode->GetNode("centralMeridian")) != 0)
SetCentralMeridian(node->AsDouble());
}
示例8: 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);
}
}
}
示例9: if
void
DatabaseCorrelationList::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("DatabaseCorrelationList");
if(searchNode == 0)
return;
DataNode *node;
DataNode **children;
// Clear all the DatabaseCorrelations if we got any.
bool clearedCorrelations = false;
// Go through all of the children and construct a new
// DatabaseCorrelation for each one of them.
children = searchNode->GetChildren();
if(children != 0)
{
for(int i = 0; i < searchNode->GetNumChildren(); ++i)
{
if(children[i]->GetKey() == std::string("DatabaseCorrelation"))
{
if (!clearedCorrelations)
{
ClearCorrelations();
clearedCorrelations = true;
}
DatabaseCorrelation temp;
temp.SetFromNode(children[i]);
AddCorrelations(temp);
}
}
}
if((node = searchNode->GetNode("needPermission")) != 0)
SetNeedPermission(node->AsBool());
if((node = searchNode->GetNode("defaultCorrelationMethod")) != 0)
SetDefaultCorrelationMethod(node->AsInt());
if((node = searchNode->GetNode("whenToCorrelate")) != 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)
SetWhenToCorrelate(WhenToCorrelate(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
WhenToCorrelate value;
if(WhenToCorrelate_FromString(node->AsString(), value))
SetWhenToCorrelate(value);
}
}
}
示例10: 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);
}
}
}
示例11: 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());
}
示例12: if
void
AnimationAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("AnimationAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("animationMode")) != 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)
SetAnimationMode(AnimationMode(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
AnimationMode value;
if(AnimationMode_FromString(node->AsString(), value))
SetAnimationMode(value);
}
}
if((node = searchNode->GetNode("pipelineCachingMode")) != 0)
SetPipelineCachingMode(node->AsBool());
if((node = searchNode->GetNode("frameIncrement")) != 0)
SetFrameIncrement(node->AsInt());
if((node = searchNode->GetNode("timeout")) != 0)
SetTimeout(node->AsInt());
if((node = searchNode->GetNode("playbackMode")) != 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)
SetPlaybackMode(PlaybackMode(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
PlaybackMode value;
if(PlaybackMode_FromString(node->AsString(), value))
SetPlaybackMode(value);
}
}
}
示例13: if
void
LagrangianAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("LagrangianAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("seedPoint")) != 0)
SetSeedPoint(node->AsDoubleArray());
if((node = searchNode->GetNode("numSteps")) != 0)
SetNumSteps(node->AsInt());
if((node = searchNode->GetNode("XAxisSample")) != 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 < 6)
SetXAxisSample(sampleType(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
sampleType value;
if(sampleType_FromString(node->AsString(), value))
SetXAxisSample(value);
}
}
if((node = searchNode->GetNode("YAxisSample")) != 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 < 6)
SetYAxisSample(sampleType(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
sampleType value;
if(sampleType_FromString(node->AsString(), value))
SetYAxisSample(value);
}
}
if((node = searchNode->GetNode("variable")) != 0)
SetVariable(node->AsString());
}
示例14: 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());
}
示例15: objectName
static void
InitializeDataNodeFromQComboBox(QComboBox *co, DataNode *node)
{
std::string objectName(co->objectName().toStdString());
DataNode *currentNode = node->GetNode(objectName);
if(currentNode != 0)
{
// Use int or string, depending on what the node was initially.
NodeTypeEnum t = currentNode->GetNodeType();
if(t != INT_NODE && t != STRING_NODE)
{
debug1 << "InitializeDataNodeFromQComboBox: only supports INT_NODE, STRING_NODE"
<< endl;
t = INT_NODE;
}
node->RemoveNode(objectName);
if(t == INT_NODE)
node->AddNode(new DataNode(objectName, co->currentIndex()));
else if(t == STRING_NODE)
{
node->AddNode(new DataNode(objectName,
co->currentText().toStdString()));
}
}
else
{
// There's no preference on which type to use so use int.
node->AddNode(new DataNode(objectName, co->currentIndex()));
}
}