本文整理汇总了C++中DataNode类的典型用法代码示例。如果您正苦于以下问题:C++ DataNode类的具体用法?C++ DataNode怎么用?C++ DataNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DataNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DataNode
bool
ExtremeValueAnalysisAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
if(parentNode == 0)
return false;
ExtremeValueAnalysisAttributes defaultObject;
bool addToParent = false;
// Create a node for ExtremeValueAnalysisAttributes.
DataNode *node = new DataNode("ExtremeValueAnalysisAttributes");
if(completeSave || !FieldsEqual(ID_dataYearBegin, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("dataYearBegin", dataYearBegin));
}
if(completeSave || !FieldsEqual(ID_dataAnalysisYearRangeEnabled, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("dataAnalysisYearRangeEnabled", dataAnalysisYearRangeEnabled));
}
if(completeSave || !FieldsEqual(ID_dataAnalysisYear1, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("dataAnalysisYear1", dataAnalysisYear1));
}
if(completeSave || !FieldsEqual(ID_dataAnalysisYear2, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("dataAnalysisYear2", dataAnalysisYear2));
}
if(completeSave || !FieldsEqual(ID_ensemble, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("ensemble", ensemble));
}
if(completeSave || !FieldsEqual(ID_numEnsembles, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("numEnsembles", numEnsembles));
}
if(completeSave || !FieldsEqual(ID_dataScaling, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("dataScaling", dataScaling));
}
if(completeSave || !FieldsEqual(ID_extremeMethod, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("extremeMethod", ExtremeType_ToString(extremeMethod)));
}
if(completeSave || !FieldsEqual(ID_optimizationMethod, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("optimizationMethod", OptimizationType_ToString(optimizationMethod)));
}
if(completeSave || !FieldsEqual(ID_aggregation, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("aggregation", AggregationType_ToString(aggregation)));
}
if(completeSave || !FieldsEqual(ID_covariateModelScale, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("covariateModelScale", covariateModelScale));
}
if(completeSave || !FieldsEqual(ID_covariateModelLocation, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("covariateModelLocation", covariateModelLocation));
}
if(completeSave || !FieldsEqual(ID_covariateModelShape, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("covariateModelShape", covariateModelShape));
}
if(completeSave || !FieldsEqual(ID_computeReturnValues, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("computeReturnValues", computeReturnValues));
}
if(completeSave || !FieldsEqual(ID_returnValues, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("returnValues", returnValues));
}
//.........这里部分代码省略.........
示例2: DataNode
bool
ConstructDataBinningAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
if(parentNode == 0)
return false;
ConstructDataBinningAttributes defaultObject;
bool addToParent = false;
// Create a node for ConstructDataBinningAttributes.
DataNode *node = new DataNode("ConstructDataBinningAttributes");
if(completeSave || !FieldsEqual(ID_name, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("name", name));
}
if(completeSave || !FieldsEqual(ID_varnames, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("varnames", varnames));
}
if(completeSave || !FieldsEqual(ID_binType, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("binType", binType));
}
if(completeSave || !FieldsEqual(ID_binBoundaries, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("binBoundaries", binBoundaries));
}
if(completeSave || !FieldsEqual(ID_reductionOperator, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("reductionOperator", ReductionOperator_ToString(reductionOperator)));
}
if(completeSave || !FieldsEqual(ID_varForReductionOperator, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("varForReductionOperator", varForReductionOperator));
}
if(completeSave || !FieldsEqual(ID_undefinedValue, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("undefinedValue", undefinedValue));
}
if(completeSave || !FieldsEqual(ID_binningScheme, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("binningScheme", BinningScheme_ToString(binningScheme)));
}
if(completeSave || !FieldsEqual(ID_numBins, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("numBins", numBins));
}
if(completeSave || !FieldsEqual(ID_overTime, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("overTime", overTime));
}
if(completeSave || !FieldsEqual(ID_timeStart, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("timeStart", timeStart));
}
if(completeSave || !FieldsEqual(ID_timeEnd, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("timeEnd", timeEnd));
}
if(completeSave || !FieldsEqual(ID_timeStride, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("timeStride", timeStride));
}
if(completeSave || !FieldsEqual(ID_outOfBoundsBehavior, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("outOfBoundsBehavior", OutOfBoundsBehavior_ToString(outOfBoundsBehavior)));
}
// Add the node to the parent node.
if(addToParent || forceAdd)
parentNode->AddNode(node);
else
//.........这里部分代码省略.........
示例3: DataNode
bool
LineoutAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
if(parentNode == 0)
return false;
LineoutAttributes defaultObject;
bool addToParent = false;
// Create a node for LineoutAttributes.
DataNode *node = new DataNode("LineoutAttributes");
if(completeSave || !FieldsEqual(ID_point1, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("point1", point1, 3));
}
if(completeSave || !FieldsEqual(ID_point2, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("point2", point2, 3));
}
if(completeSave || !FieldsEqual(ID_interactive, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("interactive", interactive));
}
if(completeSave || !FieldsEqual(ID_ignoreGlobal, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("ignoreGlobal", ignoreGlobal));
}
if(completeSave || !FieldsEqual(ID_samplingOn, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("samplingOn", samplingOn));
}
if(completeSave || !FieldsEqual(ID_numberOfSamplePoints, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("numberOfSamplePoints", numberOfSamplePoints));
}
if(completeSave || !FieldsEqual(ID_reflineLabels, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("reflineLabels", reflineLabels));
}
if(completeSave || !FieldsEqual(ID_designator, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("designator", designator));
}
// Add the node to the parent node.
if(addToParent || forceAdd)
parentNode->AddNode(node);
else
delete node;
return (addToParent || forceAdd);
}
示例4: DataNode
bool
ConstructDDFAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
if(parentNode == 0)
return false;
ConstructDDFAttributes defaultObject;
bool addToParent = false;
// Create a node for ConstructDDFAttributes.
DataNode *node = new DataNode("ConstructDDFAttributes");
if(completeSave || !FieldsEqual(ID_ddfName, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("ddfName", ddfName));
}
if(completeSave || !FieldsEqual(ID_varnames, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("varnames", varnames));
}
if(completeSave || !FieldsEqual(ID_ranges, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("ranges", ranges));
}
if(completeSave || !FieldsEqual(ID_codomainName, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("codomainName", codomainName));
}
if(completeSave || !FieldsEqual(ID_statisticalOperator, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("statisticalOperator", StatisticalOperator_ToString(statisticalOperator)));
}
if(completeSave || !FieldsEqual(ID_percentile, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("percentile", percentile));
}
if(completeSave || !FieldsEqual(ID_undefinedValue, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("undefinedValue", undefinedValue));
}
if(completeSave || !FieldsEqual(ID_binningScheme, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("binningScheme", BinningScheme_ToString(binningScheme)));
}
if(completeSave || !FieldsEqual(ID_numSamples, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("numSamples", numSamples));
}
if(completeSave || !FieldsEqual(ID_overTime, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("overTime", overTime));
}
if(completeSave || !FieldsEqual(ID_timeStart, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("timeStart", timeStart));
}
if(completeSave || !FieldsEqual(ID_timeEnd, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("timeEnd", timeEnd));
}
if(completeSave || !FieldsEqual(ID_timeStride, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("timeStride", timeStride));
}
// Add the node to the parent node.
if(addToParent || forceAdd)
parentNode->AddNode(node);
else
delete node;
return (addToParent || forceAdd);
}
示例5: DataNode
bool
PersistentParticlesAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
if(parentNode == 0)
return false;
PersistentParticlesAttributes defaultObject;
bool addToParent = false;
// Create a node for PersistentParticlesAttributes.
DataNode *node = new DataNode("PersistentParticlesAttributes");
if(completeSave || !FieldsEqual(ID_startIndex, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("startIndex", startIndex));
}
if(completeSave || !FieldsEqual(ID_stopIndex, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("stopIndex", stopIndex));
}
if(completeSave || !FieldsEqual(ID_stride, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("stride", stride));
}
if(completeSave || !FieldsEqual(ID_startPathType, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("startPathType", PathTypeEnum_ToString(startPathType)));
}
if(completeSave || !FieldsEqual(ID_stopPathType, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("stopPathType", PathTypeEnum_ToString(stopPathType)));
}
if(completeSave || !FieldsEqual(ID_traceVariableX, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("traceVariableX", traceVariableX));
}
if(completeSave || !FieldsEqual(ID_traceVariableY, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("traceVariableY", traceVariableY));
}
if(completeSave || !FieldsEqual(ID_traceVariableZ, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("traceVariableZ", traceVariableZ));
}
if(completeSave || !FieldsEqual(ID_connectParticles, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("connectParticles", connectParticles));
}
if(completeSave || !FieldsEqual(ID_showPoints, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("showPoints", showPoints));
}
if(completeSave || !FieldsEqual(ID_indexVariable, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("indexVariable", indexVariable));
}
// Add the node to the parent node.
if(addToParent || forceAdd)
parentNode->AddNode(node);
else
delete node;
return (addToParent || forceAdd);
}
示例6: SetVisible
void
AxesArray::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("AxesArray");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("visible")) != 0)
SetVisible(node->AsBool());
if((node = searchNode->GetNode("ticksVisible")) != 0)
SetTicksVisible(node->AsBool());
if((node = searchNode->GetNode("autoSetTicks")) != 0)
SetAutoSetTicks(node->AsBool());
if((node = searchNode->GetNode("autoSetScaling")) != 0)
SetAutoSetScaling(node->AsBool());
if((node = searchNode->GetNode("lineWidth")) != 0)
SetLineWidth(node->AsInt());
if((node = searchNode->GetNode("axes")) != 0)
axes.SetFromNode(node);
}
示例7: DataNode
bool
NameschemeAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
if(parentNode == 0)
return false;
NameschemeAttributes defaultObject;
bool addToParent = false;
// Create a node for NameschemeAttributes.
DataNode *node = new DataNode("NameschemeAttributes");
if(completeSave || !FieldsEqual(ID_namescheme, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("namescheme", namescheme));
}
if(completeSave || !FieldsEqual(ID_externalArrayNames, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("externalArrayNames", externalArrayNames));
}
if(completeSave || !FieldsEqual(ID_externalArrayOffsets, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("externalArrayOffsets", externalArrayOffsets));
}
if(completeSave || !FieldsEqual(ID_externalArrayData, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("externalArrayData", externalArrayData));
}
if(completeSave || !FieldsEqual(ID_allExplicitNames, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("allExplicitNames", allExplicitNames));
}
if(completeSave || !FieldsEqual(ID_explicitIds, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("explicitIds", explicitIds));
}
if(completeSave || !FieldsEqual(ID_explicitNames, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("explicitNames", explicitNames));
}
// Add the node to the parent node.
if(addToParent || forceAdd)
parentNode->AddNode(node);
else
delete node;
return (addToParent || forceAdd);
}
示例8: hellocode
double hellocode(int seg, void* data) {
Hello_Data *d = (Hello_Data*) data;
int activeroute = 0;
int k, m, n;
double now;
double period;
HelloMsg *hellomsg;
GenericNwkMsg *nwkmsg;
RERRMsg *rerrmsg;
DataNode *dn;
DataNode *tmp;
switch (seg) {
case 1:
now = ttCurrentTime();
if (VERBOSE) {
mexPrintf("Time: %f Node#%d running periodic HELLO task\n", now, d->nodeID);
}
// Determine if any active routes exist
for (k=0; k<NBR_AODV; k++) {
if (d->routing_table[k].valid) {
activeroute = 1;
}
}
period = ttGetPeriod();
if (activeroute && (d->lastRREQ < now - period)) {
if (VERBOSE) {
mexPrintf("Broadcasting HELLO msg\n");
}
hellomsg = new HelloMsg;
hellomsg->hopCnt = 0;
hellomsg->dest = d->nodeID;
hellomsg->destSeqNbr = d->seqNbrs[d->nodeID];
hellomsg->src = 0;
hellomsg->lifetime = DELETE_PERIOD;
nwkmsg = new GenericNwkMsg;
nwkmsg->type = HELLO;
nwkmsg->intermed = d->nodeID;
nwkmsg->msg = hellomsg;
ttSendMsg(0, nwkmsg, 24);
}
//.........这里部分代码省略.........
示例9: DataNode
bool
MaterialAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
if(parentNode == 0)
return false;
MaterialAttributes defaultObject;
bool addToParent = false;
// Create a node for MaterialAttributes.
DataNode *node = new DataNode("MaterialAttributes");
if(completeSave || !FieldsEqual(ID_smoothing, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("smoothing", smoothing));
}
if(completeSave || !FieldsEqual(ID_forceMIR, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("forceMIR", forceMIR));
}
if(completeSave || !FieldsEqual(ID_cleanZonesOnly, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("cleanZonesOnly", cleanZonesOnly));
}
if(completeSave || !FieldsEqual(ID_needValidConnectivity, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("needValidConnectivity", needValidConnectivity));
}
if(completeSave || !FieldsEqual(ID_algorithm, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("algorithm", Algorithm_ToString(algorithm)));
}
if(completeSave || !FieldsEqual(ID_iterationEnabled, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("iterationEnabled", iterationEnabled));
}
if(completeSave || !FieldsEqual(ID_numIterations, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("numIterations", numIterations));
}
if(completeSave || !FieldsEqual(ID_iterationDamping, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("iterationDamping", iterationDamping));
}
if(completeSave || !FieldsEqual(ID_simplifyHeavilyMixedZones, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("simplifyHeavilyMixedZones", simplifyHeavilyMixedZones));
}
if(completeSave || !FieldsEqual(ID_maxMaterialsPerZone, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("maxMaterialsPerZone", maxMaterialsPerZone));
}
if(completeSave || !FieldsEqual(ID_isoVolumeFraction, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("isoVolumeFraction", isoVolumeFraction));
}
if(completeSave || !FieldsEqual(ID_annealingTime, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("annealingTime", annealingTime));
}
// Add the node to the parent node.
if(addToParent || forceAdd)
parentNode->AddNode(node);
else
delete node;
return (addToParent || forceAdd);
}
示例10: DataNode
bool
ViewAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
if(parentNode == 0)
return false;
ViewAttributes defaultObject;
bool addToParent = false;
// Create a node for ViewAttributes.
DataNode *node = new DataNode("ViewAttributes");
if(completeSave || !FieldsEqual(ID_viewNormal, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("viewNormal", viewNormal, 3));
}
if(completeSave || !FieldsEqual(ID_focus, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("focus", focus, 3));
}
if(completeSave || !FieldsEqual(ID_viewUp, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("viewUp", viewUp, 3));
}
if(completeSave || !FieldsEqual(ID_viewAngle, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("viewAngle", viewAngle));
}
if(completeSave || !FieldsEqual(ID_setScale, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("setScale", setScale));
}
if(completeSave || !FieldsEqual(ID_parallelScale, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("parallelScale", parallelScale));
}
if(completeSave || !FieldsEqual(ID_nearPlane, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("nearPlane", nearPlane));
}
if(completeSave || !FieldsEqual(ID_farPlane, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("farPlane", farPlane));
}
if(completeSave || !FieldsEqual(ID_imagePan, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("imagePan", imagePan, 2));
}
if(completeSave || !FieldsEqual(ID_imageZoom, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("imageZoom", imageZoom));
}
if(completeSave || !FieldsEqual(ID_perspective, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("perspective", perspective));
}
if(completeSave || !FieldsEqual(ID_windowCoords, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("windowCoords", windowCoords, 4));
}
if(completeSave || !FieldsEqual(ID_viewportCoords, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("viewportCoords", viewportCoords, 4));
}
if(completeSave || !FieldsEqual(ID_eyeAngle, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("eyeAngle", eyeAngle));
}
// Add the node to the parent node.
if(addToParent || forceAdd)
parentNode->AddNode(node);
else
//.........这里部分代码省略.........
示例11: SetViewNormal
void
ViewAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("ViewAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("viewNormal")) != 0)
SetViewNormal(node->AsDoubleArray());
if((node = searchNode->GetNode("focus")) != 0)
SetFocus(node->AsDoubleArray());
if((node = searchNode->GetNode("viewUp")) != 0)
SetViewUp(node->AsDoubleArray());
if((node = searchNode->GetNode("viewAngle")) != 0)
SetViewAngle(node->AsDouble());
if((node = searchNode->GetNode("setScale")) != 0)
SetSetScale(node->AsBool());
if((node = searchNode->GetNode("parallelScale")) != 0)
SetParallelScale(node->AsDouble());
if((node = searchNode->GetNode("nearPlane")) != 0)
SetNearPlane(node->AsDouble());
if((node = searchNode->GetNode("farPlane")) != 0)
SetFarPlane(node->AsDouble());
if((node = searchNode->GetNode("imagePan")) != 0)
SetImagePan(node->AsDoubleArray());
if((node = searchNode->GetNode("imageZoom")) != 0)
SetImageZoom(node->AsDouble());
if((node = searchNode->GetNode("perspective")) != 0)
SetPerspective(node->AsBool());
if((node = searchNode->GetNode("windowCoords")) != 0)
SetWindowCoords(node->AsDoubleArray());
if((node = searchNode->GetNode("viewportCoords")) != 0)
SetViewportCoords(node->AsDoubleArray());
if((node = searchNode->GetNode("eyeAngle")) != 0)
SetEyeAngle(node->AsDouble());
}
示例12: if
void
PeaksOverThresholdAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("PeaksOverThresholdAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("dataYearBegin")) != 0)
SetDataYearBegin(node->AsInt());
if((node = searchNode->GetNode("dataAnalysisYearRangeEnabled")) != 0)
SetDataAnalysisYearRangeEnabled(node->AsBool());
if((node = searchNode->GetNode("dataAnalysisYearRange")) != 0)
SetDataAnalysisYearRange(node->AsIntArray());
if((node = searchNode->GetNode("aggregation")) != 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)
SetAggregation(AggregationType(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
AggregationType value;
if(AggregationType_FromString(node->AsString(), value))
SetAggregation(value);
}
}
if((node = searchNode->GetNode("annualPercentile")) != 0)
SetAnnualPercentile(node->AsDouble());
if((node = searchNode->GetNode("seasonalPercentile")) != 0)
SetSeasonalPercentile(node->AsDoubleArray());
if((node = searchNode->GetNode("monthlyPercentile")) != 0)
SetMonthlyPercentile(node->AsDoubleArray());
if((node = searchNode->GetNode("displaySeason")) != 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)
SetDisplaySeason(SeasonType(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
SeasonType value;
if(SeasonType_FromString(node->AsString(), value))
SetDisplaySeason(value);
}
}
if((node = searchNode->GetNode("displayMonth")) != 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 < 12)
SetDisplayMonth(MonthType(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
MonthType value;
if(MonthType_FromString(node->AsString(), value))
SetDisplayMonth(value);
}
}
if((node = searchNode->GetNode("cutoff")) != 0)
SetCutoff(node->AsFloat());
if((node = searchNode->GetNode("computeParamValues")) != 0)
SetComputeParamValues(node->AsBool());
if((node = searchNode->GetNode("computeCovariates")) != 0)
SetComputeCovariates(node->AsBool());
if((node = searchNode->GetNode("covariateReturnYears")) != 0)
SetCovariateReturnYears(node->AsIntVector());
if((node = searchNode->GetNode("covariateModelLocation")) != 0)
SetCovariateModelLocation(node->AsBool());
if((node = searchNode->GetNode("covariateModelShape")) != 0)
SetCovariateModelShape(node->AsBool());
if((node = searchNode->GetNode("covariateModelScale")) != 0)
SetCovariateModelScale(node->AsBool());
if((node = searchNode->GetNode("computeRVDifferences")) != 0)
SetComputeRVDifferences(node->AsBool());
if((node = searchNode->GetNode("rvDifferences")) != 0)
SetRvDifferences(node->AsIntArray());
if((node = searchNode->GetNode("dataScaling")) != 0)
SetDataScaling(node->AsDouble());
if((node = searchNode->GetNode("dumpData")) != 0)
SetDumpData(node->AsBool());
}
示例13: if
void
ExtremeValueAnalysisAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("ExtremeValueAnalysisAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("dataYearBegin")) != 0)
SetDataYearBegin(node->AsInt());
if((node = searchNode->GetNode("dataAnalysisYearRangeEnabled")) != 0)
SetDataAnalysisYearRangeEnabled(node->AsBool());
if((node = searchNode->GetNode("dataAnalysisYear1")) != 0)
SetDataAnalysisYear1(node->AsInt());
if((node = searchNode->GetNode("dataAnalysisYear2")) != 0)
SetDataAnalysisYear2(node->AsInt());
if((node = searchNode->GetNode("ensemble")) != 0)
SetEnsemble(node->AsBool());
if((node = searchNode->GetNode("numEnsembles")) != 0)
SetNumEnsembles(node->AsInt());
if((node = searchNode->GetNode("dataScaling")) != 0)
SetDataScaling(node->AsDouble());
if((node = searchNode->GetNode("extremeMethod")) != 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)
SetExtremeMethod(ExtremeType(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
ExtremeType value;
if(ExtremeType_FromString(node->AsString(), value))
SetExtremeMethod(value);
}
}
if((node = searchNode->GetNode("optimizationMethod")) != 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)
SetOptimizationMethod(OptimizationType(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
OptimizationType value;
if(OptimizationType_FromString(node->AsString(), value))
SetOptimizationMethod(value);
}
}
if((node = searchNode->GetNode("aggregation")) != 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)
SetAggregation(AggregationType(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
AggregationType value;
if(AggregationType_FromString(node->AsString(), value))
SetAggregation(value);
}
}
if((node = searchNode->GetNode("covariateModelScale")) != 0)
SetCovariateModelScale(node->AsBool());
if((node = searchNode->GetNode("covariateModelLocation")) != 0)
SetCovariateModelLocation(node->AsBool());
if((node = searchNode->GetNode("covariateModelShape")) != 0)
SetCovariateModelShape(node->AsBool());
if((node = searchNode->GetNode("computeReturnValues")) != 0)
SetComputeReturnValues(node->AsBool());
if((node = searchNode->GetNode("returnValues")) != 0)
SetReturnValues(node->AsIntVector());
if((node = searchNode->GetNode("computeRVDifferences")) != 0)
SetComputeRVDifferences(node->AsBool());
if((node = searchNode->GetNode("rvDifference1")) != 0)
SetRvDifference1(node->AsInt());
if((node = searchNode->GetNode("rvDifference2")) != 0)
SetRvDifference2(node->AsInt());
if((node = searchNode->GetNode("displayMonth")) != 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 < 12)
SetDisplayMonth(MonthType(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
//.........这里部分代码省略.........
示例14: SNPRINTF
void
ColorTableAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("ColorTableAttributes");
if(searchNode == 0)
return;
// Look for the number of color tables.
DataNode *node = 0;
if((node = searchNode->GetNode("Ntables")) != 0)
{
char tmp[100];
int ntables = node->AsInt();
// Look for ntables color table nodes.
for(int i = 0; i < ntables; ++i)
{
SNPRINTF(tmp, 100, "table%02d", i);
if((node = searchNode->GetNode(tmp)) != 0)
{
DataNode *nameNode = node->GetNode("ctName");
DataNode *pointNode = node->GetNode("controlPts");
// If we have the name node and the pointNode, we can add a
// color table.
if(nameNode && pointNode)
{
ColorControlPointList ccpl;
// Try and set the equal flag.
DataNode *tmpNode;
if((tmpNode = node->GetNode("equal")) != 0)
ccpl.SetEqualSpacingFlag(tmpNode->AsBool());
// Try and set the smooth flag.
if((tmpNode = node->GetNode("smooth")) != 0)
ccpl.SetSmoothingFlag(tmpNode->AsBool());
if((tmpNode = node->GetNode("discrete")) != 0)
ccpl.SetDiscreteFlag(tmpNode->AsBool());
// Set the color control points.
floatVector fvec = pointNode->AsFloatVector();
for(size_t j = 0; j < fvec.size() / 4; ++j)
{
// Create a control point based on the values
// in the float vector.
int index = j * 4;
ColorControlPoint cpt(fvec[index],
(unsigned char)(fvec[index+1]),
(unsigned char)(fvec[index+2]),
(unsigned char)(fvec[index+3]),
255);
ccpl.AddControlPoints(cpt);
}
// If the color table is already in the list, remove it.
// Then add the new color table to the list.
RemoveColorTable(nameNode->AsString());
AddColorTable(nameNode->AsString(), ccpl);
}
}
} // end for i
}
if((node = searchNode->GetNode("activeContinuous")) != 0)
SetActiveContinuous(node->AsString());
if((node = searchNode->GetNode("activeDiscrete")) != 0)
SetActiveDiscrete(node->AsString());
// For older version compatibility...
if((node = searchNode->GetNode("activeColorTable")) != 0)
SetActiveContinuous(node->AsString());
}
示例15: 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());
}