void MultiCurveAttributes::SetFromNode(DataNode *parentNode) { if(parentNode == 0) return; DataNode *searchNode = parentNode->GetNode("MultiCurveAttributes"); 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 < 2) SetColorType(ColoringMethod(ival)); } else if(node->GetNodeType() == STRING_NODE) { ColoringMethod value; if(ColoringMethod_FromString(node->AsString(), value)) SetColorType(value); } } if((node = searchNode->GetNode("singleColor")) != 0) singleColor.SetFromNode(node); if((node = searchNode->GetNode("multiColor")) != 0) multiColor.SetFromNode(node); if((node = searchNode->GetNode("lineStyle")) != 0) SetLineStyle(node->AsInt()); if((node = searchNode->GetNode("lineWidth")) != 0) SetLineWidth(node->AsInt()); if((node = searchNode->GetNode("yAxisTitleFormat")) != 0) SetYAxisTitleFormat(node->AsString()); if((node = searchNode->GetNode("useYAxisTickSpacing")) != 0) SetUseYAxisTickSpacing(node->AsBool()); if((node = searchNode->GetNode("yAxisTickSpacing")) != 0) SetYAxisTickSpacing(node->AsDouble()); if((node = searchNode->GetNode("displayMarkers")) != 0) SetDisplayMarkers(node->AsBool()); if((node = searchNode->GetNode("markerVariable")) != 0) SetMarkerVariable(node->AsString()); if((node = searchNode->GetNode("displayIds")) != 0) SetDisplayIds(node->AsBool()); if((node = searchNode->GetNode("idVariable")) != 0) SetIdVariable(node->AsString()); if((node = searchNode->GetNode("legendFlag")) != 0) SetLegendFlag(node->AsBool()); }
void SubsetAttributes::SetFromNode(DataNode *parentNode) { if(parentNode == 0) return; DataNode *searchNode = parentNode->GetNode("SubsetAttributes"); if(searchNode == 0) return; DataNode *node; 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("filledFlag")) != 0) SetFilledFlag(node->AsBool()); if((node = searchNode->GetNode("legendFlag")) != 0) SetLegendFlag(node->AsBool()); if((node = searchNode->GetNode("lineStyle")) != 0) SetLineStyle(node->AsInt()); if((node = searchNode->GetNode("lineWidth")) != 0) SetLineWidth(node->AsInt()); if((node = searchNode->GetNode("singleColor")) != 0) singleColor.SetFromNode(node); if((node = searchNode->GetNode("multiColor")) != 0) multiColor.SetFromNode(node); if((node = searchNode->GetNode("subsetNames")) != 0) SetSubsetNames(node->AsStringVector()); if((node = searchNode->GetNode("subsetType")) != 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) SetSubsetType(Subset_Type(ival)); } else if(node->GetNodeType() == STRING_NODE) { Subset_Type value; if(Subset_Type_FromString(node->AsString(), value)) SetSubsetType(value); } } if((node = searchNode->GetNode("opacity")) != 0) SetOpacity(node->AsDouble()); if((node = searchNode->GetNode("wireframe")) != 0) SetWireframe(node->AsBool()); if((node = searchNode->GetNode("drawInternal")) != 0) SetDrawInternal(node->AsBool()); if((node = searchNode->GetNode("smoothingLevel")) != 0) SetSmoothingLevel(node->AsInt()); if((node = searchNode->GetNode("pointSize")) != 0) SetPointSize(node->AsDouble()); if((node = searchNode->GetNode("pointType")) != 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 < 8) SetPointType(PointType(ival)); } else if(node->GetNodeType() == STRING_NODE) { PointType value; if(PointType_FromString(node->AsString(), value)) SetPointType(value); } } if((node = searchNode->GetNode("pointSizeVarEnabled")) != 0) SetPointSizeVarEnabled(node->AsBool()); if((node = searchNode->GetNode("pointSizeVar")) != 0) SetPointSizeVar(node->AsString()); if((node = searchNode->GetNode("pointSizePixels")) != 0) SetPointSizePixels(node->AsInt()); }
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 FilledBoundaryAttributes::SetFromNode(DataNode *parentNode) { if(parentNode == 0) return; DataNode *searchNode = parentNode->GetNode("FilledBoundaryAttributes"); if(searchNode == 0) return; DataNode *node; 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("filledFlag")) != 0) SetFilledFlag(node->AsBool()); if((node = searchNode->GetNode("legendFlag")) != 0) SetLegendFlag(node->AsBool()); if((node = searchNode->GetNode("lineStyle")) != 0) SetLineStyle(node->AsInt()); if((node = searchNode->GetNode("lineWidth")) != 0) SetLineWidth(node->AsInt()); if((node = searchNode->GetNode("singleColor")) != 0) singleColor.SetFromNode(node); if((node = searchNode->GetNode("multiColor")) != 0) multiColor.SetFromNode(node); if((node = searchNode->GetNode("boundaryNames")) != 0) SetBoundaryNames(node->AsStringVector()); if((node = searchNode->GetNode("boundaryType")) != 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) SetBoundaryType(Boundary_Type(ival)); } else if(node->GetNodeType() == STRING_NODE) { Boundary_Type value; if(Boundary_Type_FromString(node->AsString(), value)) SetBoundaryType(value); } } if((node = searchNode->GetNode("opacity")) != 0) SetOpacity(node->AsDouble()); if((node = searchNode->GetNode("wireframe")) != 0) SetWireframe(node->AsBool()); if((node = searchNode->GetNode("drawInternal")) != 0) SetDrawInternal(node->AsBool()); if((node = searchNode->GetNode("smoothingLevel")) != 0) SetSmoothingLevel(node->AsInt()); if((node = searchNode->GetNode("cleanZonesOnly")) != 0) SetCleanZonesOnly(node->AsBool()); if((node = searchNode->GetNode("mixedColor")) != 0) mixedColor.SetFromNode(node); if((node = searchNode->GetNode("pointSize")) != 0) SetPointSize(node->AsDouble()); if((node = searchNode->GetNode("pointType")) != 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 < 8) SetPointType(PointType(ival)); } else if(node->GetNodeType() == STRING_NODE) { PointType value; if(PointType_FromString(node->AsString(), value)) SetPointType(value); } } if((node = searchNode->GetNode("pointSizeVarEnabled")) != 0) SetPointSizeVarEnabled(node->AsBool()); if((node = searchNode->GetNode("pointSizeVar")) != 0) SetPointSizeVar(node->AsString()); if((node = searchNode->GetNode("pointSizePixels")) != 0) SetPointSizePixels(node->AsInt()); // We are no longer using MultiColor as the source for the "mixed" // color (in clean zones only), but someone may have saved their // settings with the "mixed" color in the list. Remove it if it's // in there. // // NOTE: This code can be removed in a few months, as soon as // 1.3 is at least a few versions old, since it represents a little // bit of a hack. bool done = false; while (!done) { done = true; size_t index; for (index=0; index<boundaryNames.size(); index++) { if (boundaryNames[index] == "mixed") { done = false; break; } } if (!done) { multiColor.RemoveColors((int)index); for (size_t i=index+1; i<boundaryNames.size(); i++) boundaryNames[i-1] = boundaryNames[i]; boundaryNames.resize(boundaryNames.size() - 1); } } }
void SurfaceAttributes::SetFromNode(DataNode *parentNode) { if(parentNode == 0) return; DataNode *searchNode = parentNode->GetNode("SurfaceAttributes"); if(searchNode == 0) return; DataNode *node; if((node = searchNode->GetNode("legendFlag")) != 0) SetLegendFlag(node->AsBool()); if((node = searchNode->GetNode("lightingFlag")) != 0) SetLightingFlag(node->AsBool()); if((node = searchNode->GetNode("surfaceFlag")) != 0) SetSurfaceFlag(node->AsBool()); if((node = searchNode->GetNode("wireframeFlag")) != 0) SetWireframeFlag(node->AsBool()); if((node = searchNode->GetNode("limitsMode")) != 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) SetLimitsMode(LimitsMode(ival)); } else if(node->GetNodeType() == STRING_NODE) { LimitsMode value; if(LimitsMode_FromString(node->AsString(), value)) SetLimitsMode(value); } } if((node = searchNode->GetNode("minFlag")) != 0) SetMinFlag(node->AsBool()); if((node = searchNode->GetNode("maxFlag")) != 0) SetMaxFlag(node->AsBool()); if((node = searchNode->GetNode("colorByZFlag")) != 0) SetColorByZFlag(node->AsBool()); 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 < 3) SetScaling(Scaling(ival)); } else if(node->GetNodeType() == STRING_NODE) { Scaling value; if(Scaling_FromString(node->AsString(), value)) SetScaling(value); } } if((node = searchNode->GetNode("lineStyle")) != 0) SetLineStyle(node->AsInt()); if((node = searchNode->GetNode("lineWidth")) != 0) SetLineWidth(node->AsInt()); if((node = searchNode->GetNode("surfaceColor")) != 0) surfaceColor.SetFromNode(node); if((node = searchNode->GetNode("wireframeColor")) != 0) wireframeColor.SetFromNode(node); if((node = searchNode->GetNode("skewFactor")) != 0) SetSkewFactor(node->AsDouble()); if((node = searchNode->GetNode("min")) != 0) SetMin(node->AsDouble()); if((node = searchNode->GetNode("max")) != 0) SetMax(node->AsDouble()); if((node = searchNode->GetNode("colorTableName")) != 0) SetColorTableName(node->AsString()); if((node = searchNode->GetNode("invertColorTable")) != 0) SetInvertColorTable(node->AsBool()); }
void ContourAttributes::SetFromNode(DataNode *parentNode) { if(parentNode == 0) return; DataNode *searchNode = parentNode->GetNode("ContourAttributes"); if(searchNode == 0) return; DataNode *node; // Set the default palette from the values in the DataNode. if((node = searchNode->GetNode("defaultPalette")) != 0) defaultPalette.SetFromNode(node); 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("legendFlag")) != 0) SetLegendFlag(node->AsBool()); if((node = searchNode->GetNode("invertColorTable")) != 0) SetInvertColorTable(node->AsBool()); if((node = searchNode->GetNode("lineStyle")) != 0) SetLineStyle(node->AsInt()); if((node = searchNode->GetNode("lineWidth")) != 0) SetLineWidth(node->AsInt()); if((node = searchNode->GetNode("singleColor")) != 0) singleColor.SetFromNode(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(Select_by(ival)); } else if(node->GetNodeType() == STRING_NODE) { Select_by value; if(Select_by_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(Scaling(ival)); } else if(node->GetNodeType() == STRING_NODE) { Scaling value; if(Scaling_FromString(node->AsString(), value)) SetScaling(value); } } if((node = searchNode->GetNode("wireframe")) != 0) SetWireframe(node->AsBool()); }