void QvisAppearanceWidget::singleColorOpacityChanged(int opacity) { int MultiCurve = viewer->GetPlotIndex("MultiCurve"); AttributeSubject *atts = viewer->DelayedState()->GetPlotAttributes(MultiCurve); if(atts != 0) { DataNode root("root"); atts->CreateNode(&root, true, false); DataNode *multiCurveNode = root.GetNode("MultiCurveAttributes"); DataNode *singleColorNode = multiCurveNode->GetNode("singleColor"); DataNode *colorAttributeNode = singleColorNode->GetNode("ColorAttribute"); DataNode *colorNode = colorAttributeNode->GetNode("color"); const unsigned char *oldColor = colorNode->AsUnsignedCharArray(); unsigned char newColor[4]; newColor[0] = oldColor[0]; newColor[1] = oldColor[1]; newColor[2] = oldColor[2]; newColor[3] = (unsigned char)opacity; DataNode *newColorNode = new DataNode("color", newColor, 4); colorAttributeNode->RemoveNode(colorNode); colorAttributeNode->AddNode(newColorNode); atts->SetFromNode(&root); atts->Notify(); emit multiCurveChanged(atts); } }
void QvisLegacyStreamlinePlotWindow::ProcessOldVersions(DataNode *parentNode, const char *configVersion) { if(parentNode == 0) return; DataNode *searchNode = parentNode->GetNode("Streamline plot attributes"); if(searchNode == 0) return; // Remove height/width information if the config file is older than // 1.4.1 since this window changed size quite a bit in version 1.4.1. if (LegacyStreamlineAttributes::VersionLessThan(configVersion, "1.4.1")) { searchNode->RemoveNode("width"); searchNode->RemoveNode("height"); } }
// **************************************************************************** // Method: AnimationAttributes::ProcessOldVersions // // Purpose: // This method creates modifies a DataNode representation of the object // so it conforms to the newest representation of the object, which can // can be read back in. // // Programmer: Kathleen Bonnell // Creation: January 12, 2005 // // Modifications: // // **************************************************************************** void AnimationAttributes::ProcessOldVersions(DataNode *parentNode, const char *configVersion) { if(parentNode == 0) return; DataNode *searchNode = parentNode->GetNode("AnimationAttributes"); if(searchNode == 0) return; DataNode *pcNode = searchNode->GetNode("pipelineCachingMode"); if (pcNode == 0) return; if (VersionLessThan(configVersion, "1.1.5")) searchNode->RemoveNode("pipelineCachingMode"); }