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); } } }
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()); }
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; } } }
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()); }
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()); }
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()); }
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 if(node->GetNodeType() == INT_NODE) { int ival = node->AsInt(); if(ival >= 0 && ival < 3) SetVerticalJustification(LabelVerticalAlignment(ival)); } else if(node->GetNodeType() == STRING_NODE) { LabelVerticalAlignment value; if(LabelVerticalAlignment_FromString(node->AsString(), value)) SetVerticalJustification(value); } } if((node = searchNode->GetNode("depthTestMode")) != 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) SetDepthTestMode(DepthTestMode(ival)); } else if(node->GetNodeType() == STRING_NODE) { DepthTestMode value; if(DepthTestMode_FromString(node->AsString(), value)) SetDepthTestMode(value); } } if((node = searchNode->GetNode("formatTemplate")) != 0) SetFormatTemplate(node->AsString()); }
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) SetNWellBores(node->AsInt()); if((node = searchNode->GetNode("wellBores")) != 0) SetWellBores(node->AsIntVector()); if((node = searchNode->GetNode("wellNames")) != 0) SetWellNames(node->AsStringVector()); }
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()); }
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()); if((node = searchNode->GetNode("translateX")) != 0) { if(node->GetNodeType() == DOUBLE_NODE) SetTranslateX(node->AsDouble()); else if(node->GetNodeType() == FLOAT_NODE) SetTranslateX((double)node->AsFloat()); } if((node = searchNode->GetNode("translateY")) != 0) { if(node->GetNodeType() == DOUBLE_NODE) SetTranslateY(node->AsDouble()); else if(node->GetNodeType() == FLOAT_NODE) SetTranslateY((double)node->AsFloat()); } if((node = searchNode->GetNode("translateZ")) != 0) { if(node->GetNodeType() == DOUBLE_NODE) SetTranslateZ(node->AsDouble()); else if(node->GetNodeType() == FLOAT_NODE) SetTranslateZ((double)node->AsFloat()); } if((node = searchNode->GetNode("transformVectors")) != 0) SetTransformVectors(node->AsBool()); }