bool
TimeFormat::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    TimeFormat defaultObject;
    bool addToParent = false;
    // Create a node for TimeFormat.
    DataNode *node = new DataNode("TimeFormat");

    if(completeSave || !FieldsEqual(ID_displayMode, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("displayMode", DisplayMode_ToString(displayMode)));
    }

    if(completeSave || !FieldsEqual(ID_precision, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("precision", precision));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
Exemplo n.º 2
0
bool
SiloDumpAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    SiloDumpAttributes defaultObject;
    bool addToParent = false;
    // Create a node for SiloDumpAttributes.
    DataNode *node = new DataNode("SiloDumpAttributes");

    if(completeSave || !FieldsEqual(ID_filename, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("filename", filename));
    }

    if(completeSave || !FieldsEqual(ID_display, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("display", display));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
Exemplo n.º 3
0
bool
ColorControlPoint::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    ColorControlPoint defaultObject;
    bool addToParent = false;
    // Create a node for ColorControlPoint.
    DataNode *node = new DataNode("ColorControlPoint");

    if(completeSave || !FieldsEqual(0, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("colors", colors, 4));
    }

    if(completeSave || !FieldsEqual(1, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("position", position));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
bool
VLIFileManager::WriteConfigFile(const char *filename)
{
    DataNode topLevel("topLevel");

    // Create the color table node.
    DataNode *ctNode = new DataNode("VLIFile");
    topLevel.AddNode(ctNode);
    ctNode->AddNode(new DataNode("Version", std::string(VISIT_VERSION)));

    // Let the vli file manager create and add its information to the node.
    ctNode->AddNode(Export());

    // Try to open the output file.
    if((fp = fopen(filename, "wb")) == 0)
    {
        return false;
    }

    // Write the output file.
    fprintf(fp, "<?xml version=\"1.0\"?>\n");
    WriteObject(ctNode);

    // Close the file
    fclose(fp);
    fp = 0;

    return true;
}
Exemplo n.º 5
0
bool
SphereAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    SphereAttributes defaultObject;
    bool addToParent = false;
    // Create a node for SphereAttributes.
    DataNode *node = new DataNode("SphereAttributes");

    if(completeSave || !FieldsEqual(ID_origin, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("origin", origin, 3));
    }

    if(completeSave || !FieldsEqual(ID_radius, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("radius", radius));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
Exemplo n.º 6
0
bool
TruecolorAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    TruecolorAttributes defaultObject;
    bool addToParent = false;
    // Create a node for TruecolorAttributes.
    DataNode *node = new DataNode("TruecolorAttributes");

    if(completeSave || !FieldsEqual(ID_opacity, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("opacity", opacity));
    }

    if(completeSave || !FieldsEqual(ID_lightingFlag, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("lightingFlag", lightingFlag));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
Exemplo n.º 7
0
bool
ProjectAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    ProjectAttributes defaultObject;
    bool addToParent = false;
    // Create a node for ProjectAttributes.
    DataNode *node = new DataNode("ProjectAttributes");

    if(completeSave || !FieldsEqual(ID_projectionType, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("projectionType", ProjectionType_ToString(projectionType)));
    }

    if(completeSave || !FieldsEqual(ID_vectorTransformMethod, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("vectorTransformMethod", VectorTransformMethod_ToString(vectorTransformMethod)));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
bool
RectilinearProject2DAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    RectilinearProject2DAttributes defaultObject;
    bool addToParent = false;
    // Create a node for RectilinearProject2DAttributes.
    DataNode *node = new DataNode("RectilinearProject2DAttributes");

    if(completeSave || !FieldsEqual(ID_reductionOperator, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("reductionOperator", ReductionOperator_ToString(reductionOperator)));
    }

    if(completeSave || !FieldsEqual(ID_mapGrid, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("mapGrid", mapGrid));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
Exemplo n.º 9
0
bool
AttributeSubjectMap::CreateNode(DataNode *parentNode)
{
    bool retval = false;

    if(parentNode == 0)
        return retval;

    if(nIndices > 0)
    {
        DataNode *mapNode = new DataNode("AttributeSubjectMap");
        parentNode->AddNode(mapNode);

        // Add the indices.
        intVector ids;
        int i;
        for(i = 0; i < nIndices; ++i)
            ids.push_back(indices[i]);
        mapNode->AddNode(new DataNode("indices", ids));

        // Add the attributes.
        DataNode *attNode = new DataNode("attributes");
        mapNode->AddNode(attNode);
        for(i = 0; i < nIndices; ++i)
            atts[i]->CreateNode(attNode, true, true);

        retval = true;
    }

    return retval;
}
Exemplo n.º 10
0
bool
CartographicProjectionAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    CartographicProjectionAttributes defaultObject;
    bool addToParent = false;
    // Create a node for CartographicProjectionAttributes.
    DataNode *node = new DataNode("CartographicProjectionAttributes");

    if(completeSave || !FieldsEqual(ID_projectionID, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("projectionID", ProjectionID_ToString(projectionID)));
    }

    if(completeSave || !FieldsEqual(ID_centralMeridian, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("centralMeridian", centralMeridian));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
Exemplo n.º 11
0
bool
ColorTableAttributes::CreateNode(DataNode *parentNode, bool, bool)
{
    if(parentNode == 0)
        return true;

    // Create a node for ColorTableAttributes.
    DataNode *node = new DataNode("ColorTableAttributes");
    node->AddNode(new DataNode("activeContinuous", activeContinuous));
    node->AddNode(new DataNode("activeDiscrete", activeDiscrete));

    // Add each color table specially.
    char tmp[100];
    ColorControlPointList defaultObject;
    int index = 0;
    for(size_t i = 0; i < colorTables.size(); ++i)    
    {
        const ColorControlPointList &ccpl = GetColorTables(i);
        if(!ccpl.GetExternalFlag())
        {
            SNPRINTF(tmp, 100, "table%02d", index++);
            DataNode *ctNode = new DataNode(tmp);
            // Add the color table attributes to the ctNode.
            ctNode->AddNode(new DataNode("ctName", names[i]));
            if(!ccpl.FieldsEqual(ColorControlPointList::ID_equalSpacingFlag, &defaultObject))
                ctNode->AddNode(new DataNode("equal", ccpl.GetEqualSpacingFlag()));
            if(!ccpl.FieldsEqual(ColorControlPointList::ID_smoothing, &defaultObject))
                ctNode->AddNode(new DataNode("smoothing", ccpl.GetSmoothing()));
            if(!ccpl.FieldsEqual(ColorControlPointList::ID_discreteFlag, &defaultObject))
                ctNode->AddNode(new DataNode("discrete", ccpl.GetDiscreteFlag()));

            // Add the control points to the vector that we'll save out.
            floatVector fvec;
            ctNode->AddNode(new DataNode("colorsHaveOpacity", true));
            for(int j = 0; j < ccpl.GetNumControlPoints(); ++j)
            {
                const ColorControlPoint &cp = ccpl.operator[](j);
                fvec.push_back(cp.GetPosition());
                fvec.push_back(float(cp.GetColors()[0]));
                fvec.push_back(float(cp.GetColors()[1]));
                fvec.push_back(float(cp.GetColors()[2]));
                fvec.push_back(float(cp.GetColors()[3]));
            }
            ctNode->AddNode(new DataNode("controlPts", fvec));
            node->AddNode(ctNode);
        }
    }

    node->AddNode(new DataNode("Ntables", index));

    // Add the node to the parent node.
    parentNode->AddNode(node);

    return true;
}
DataNode *
VLIAttribute::Export()
{
    DataNode *node = new DataNode("attribute");
    node->AddNode(new DataNode("name", name));
    node->AddNode(new DataNode("min", min));
    node->AddNode(new DataNode("max", max));
    node->AddNode(new DataNode("scaled", isScaled));

    return node;
}
Exemplo n.º 13
0
bool
FileOpenOptions::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    FileOpenOptions defaultObject;
    bool addToParent = false;
    // Create a node for FileOpenOptions.
    DataNode *node = new DataNode("FileOpenOptions");

    if(completeSave || !FieldsEqual(ID_typeNames, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("typeNames", typeNames));
    }

    if(completeSave || !FieldsEqual(ID_typeIDs, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("typeIDs", typeIDs));
    }

    if(completeSave || !FieldsEqual(ID_openOptions, &defaultObject))
    {
        addToParent = true;
        for(size_t i = 0; i < openOptions.size(); ++i)
            openOptions[i]->CreateNode(node, completeSave, true);
    }

    if(completeSave || !FieldsEqual(ID_Enabled, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("Enabled", Enabled));
    }

    if(completeSave || !FieldsEqual(ID_preferredIDs, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("preferredIDs", preferredIDs));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
bool
SaveSubWindowAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    SaveSubWindowAttributes defaultObject;
    bool addToParent = false;
    // Create a node for SaveSubWindowAttributes.
    DataNode *node = new DataNode("SaveSubWindowAttributes");

    if(completeSave || !FieldsEqual(ID_position, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("position", position, 2));
    }

    if(completeSave || !FieldsEqual(ID_size, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("size", size, 2));
    }

    if(completeSave || !FieldsEqual(ID_layer, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("layer", layer));
    }

    if(completeSave || !FieldsEqual(ID_transparency, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("transparency", transparency));
    }

    if(completeSave || !FieldsEqual(ID_omitWindow, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("omitWindow", omitWindow));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
Exemplo n.º 15
0
bool
LagrangianAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    LagrangianAttributes defaultObject;
    bool addToParent = false;
    // Create a node for LagrangianAttributes.
    DataNode *node = new DataNode("LagrangianAttributes");

    if(completeSave || !FieldsEqual(ID_seedPoint, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("seedPoint", seedPoint, 3));
    }

    if(completeSave || !FieldsEqual(ID_numSteps, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("numSteps", numSteps));
    }

    if(completeSave || !FieldsEqual(ID_XAxisSample, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("XAxisSample", sampleType_ToString(XAxisSample)));
    }

    if(completeSave || !FieldsEqual(ID_YAxisSample, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("YAxisSample", sampleType_ToString(YAxisSample)));
    }

    if(completeSave || !FieldsEqual(ID_variable, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("variable", variable));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
Exemplo n.º 16
0
bool
AnimationAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    AnimationAttributes defaultObject;
    bool addToParent = false;
    // Create a node for AnimationAttributes.
    DataNode *node = new DataNode("AnimationAttributes");

    if(completeSave || !FieldsEqual(ID_animationMode, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("animationMode", AnimationMode_ToString(animationMode)));
    }

    if(completeSave || !FieldsEqual(ID_pipelineCachingMode, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("pipelineCachingMode", pipelineCachingMode));
    }

    if(completeSave || !FieldsEqual(ID_frameIncrement, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("frameIncrement", frameIncrement));
    }

    if(completeSave || !FieldsEqual(ID_timeout, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("timeout", timeout));
    }

    if(completeSave || !FieldsEqual(ID_playbackMode, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("playbackMode", PlaybackMode_ToString(playbackMode)));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
bool
GaussianControlPoint::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    GaussianControlPoint defaultObject;
    bool addToParent = false;
    // Create a node for GaussianControlPoint.
    DataNode *node = new DataNode("GaussianControlPoint");

    if(completeSave || !FieldsEqual(ID_x, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("x", x));
    }

    if(completeSave || !FieldsEqual(ID_height, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("height", height));
    }

    if(completeSave || !FieldsEqual(ID_width, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("width", width));
    }

    if(completeSave || !FieldsEqual(ID_xBias, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("xBias", xBias));
    }

    if(completeSave || !FieldsEqual(ID_yBias, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("yBias", yBias));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
Exemplo n.º 18
0
bool
ToroidalPoloidalProjection::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    ToroidalPoloidalProjection defaultObject;
    bool addToParent = false;
    // Create a node for ToroidalPoloidalProjection.
    DataNode *node = new DataNode("ToroidalPoloidalProjection");

    if(completeSave || !FieldsEqual(ID_R0, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("R0", R0));
    }

    if(completeSave || !FieldsEqual(ID_r, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("r", r));
    }

    if(completeSave || !FieldsEqual(ID_centroidSource, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("centroidSource", CentroidSource_ToString(centroidSource)));
    }

    if(completeSave || !FieldsEqual(ID_centroid, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("centroid", centroid, 3));
    }

    if(completeSave || !FieldsEqual(ID_project2D, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("project2D", project2D));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
Exemplo n.º 19
0
bool
AxisTickMarks::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    AxisTickMarks defaultObject;
    bool addToParent = false;
    // Create a node for AxisTickMarks.
    DataNode *node = new DataNode("AxisTickMarks");

    if(completeSave || !FieldsEqual(ID_visible, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("visible", visible));
    }

    if(completeSave || !FieldsEqual(ID_majorMinimum, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("majorMinimum", majorMinimum));
    }

    if(completeSave || !FieldsEqual(ID_majorMaximum, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("majorMaximum", majorMaximum));
    }

    if(completeSave || !FieldsEqual(ID_minorSpacing, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("minorSpacing", minorSpacing));
    }

    if(completeSave || !FieldsEqual(ID_majorSpacing, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("majorSpacing", majorSpacing));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
Exemplo n.º 20
0
bool ColorControlPointList::CreateNode(DataNode* parentNode, bool completeSave, bool forceAdd)
{
  if (parentNode == 0)
    return false;

  ColorControlPointList defaultObject;
  bool addToParent = false;
  // Create a node for ColorControlPointList.
  DataNode* node = new DataNode("ColorControlPointList");

  if (completeSave || !FieldsEqual(0, &defaultObject))
  {
    addToParent = true;
    for (unsigned int i = 0; i < controlPoints.size(); ++i)
      controlPoints[i]->CreateNode(node, completeSave, true);
  }

  if (completeSave || !FieldsEqual(1, &defaultObject))
  {
    addToParent = true;
    node->AddNode(new DataNode("smoothingFlag", smoothingFlag));
  }

  if (completeSave || !FieldsEqual(2, &defaultObject))
  {
    addToParent = true;
    node->AddNode(new DataNode("equalSpacingFlag", equalSpacingFlag));
  }

  if (completeSave || !FieldsEqual(3, &defaultObject))
  {
    addToParent = true;
    node->AddNode(new DataNode("discreteFlag", discreteFlag));
  }

  if (completeSave || !FieldsEqual(4, &defaultObject))
  {
    addToParent = true;
    node->AddNode(new DataNode("externalFlag", externalFlag));
  }

  // Add the node to the parent node.
  if (addToParent || forceAdd)
    parentNode->AddNode(node);
  else
    delete node;

  return (addToParent || forceAdd);
}
Exemplo n.º 21
0
bool
Scale::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    Scale defaultObject;
    bool addToParent = false;
    // Create a node for Scale.
    DataNode *node = new DataNode("Scale");

    if(completeSave || !FieldsEqual(ID_ScaleFactor, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("ScaleFactor", ScaleFactor));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
bool
ViewerClientInformation::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    ViewerClientInformation defaultObject;
    bool addToParent = false;
    // Create a node for ViewerClientInformation.
    DataNode *node = new DataNode("ViewerClientInformation");

    if(completeSave || !FieldsEqual(ID_vars, &defaultObject))
    {
        addToParent = true;
        for(size_t i = 0; i < vars.size(); ++i)
            vars[i]->CreateNode(node, completeSave, true);
    }

    if(completeSave || !FieldsEqual(ID_supportedFormats, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("supportedFormats", supportedFormats));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
Exemplo n.º 23
0
bool
SyncAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    SyncAttributes defaultObject;
    bool addToParent = false;
    // Create a node for SyncAttributes.
    DataNode *node = new DataNode("SyncAttributes");

    if(completeSave || !FieldsEqual(ID_syncTag, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("syncTag", syncTag));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
bool
ProgrammableOpAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    ProgrammableOpAttributes defaultObject;
    bool addToParent = false;
    // Create a node for ProgrammableOpAttributes.
    DataNode *node = new DataNode("ProgrammableOpAttributes");

    if(completeSave || !FieldsEqual(ID_scriptMap, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("scriptMap", scriptMap));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
Exemplo n.º 25
0
bool
BoxExtents::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    BoxExtents defaultObject;
    bool addToParent = false;
    // Create a node for BoxExtents.
    DataNode *node = new DataNode("BoxExtents");

    if(completeSave || !FieldsEqual(ID_extents, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("extents", extents, 6));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
Exemplo n.º 26
0
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);
    }
}
Exemplo n.º 27
0
bool
BoundaryOpAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    BoundaryOpAttributes defaultObject;
    bool addToParent = false;
    // Create a node for BoundaryOpAttributes.
    DataNode *node = new DataNode("BoundaryOpAttributes");

    if(completeSave || !FieldsEqual(ID_smoothingLevel, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("smoothingLevel", smoothingLevel));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
Exemplo n.º 28
0
bool
DualMeshAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    DualMeshAttributes defaultObject;
    bool addToParent = false;
    // Create a node for DualMeshAttributes.
    DataNode *node = new DataNode("DualMeshAttributes");

    if(completeSave || !FieldsEqual(ID_mode, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("mode", ConversionMode_ToString(mode)));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
bool
SelectionList::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    SelectionList defaultObject;
    bool addToParent = false;
    // Create a node for SelectionList.
    DataNode *node = new DataNode("SelectionList");

    if(completeSave || !FieldsEqual(ID_autoApplyUpdates, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("autoApplyUpdates", autoApplyUpdates));
    }

    if(completeSave)
    {
        addToParent = true;
        for(size_t i = 0; i < selections.size(); ++i)
            selections[i]->CreateNode(node, completeSave, true);
    }

    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
bool
DecimateAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    DecimateAttributes defaultObject;
    bool addToParent = false;
    // Create a node for DecimateAttributes.
    DataNode *node = new DataNode("DecimateAttributes");

    if(completeSave || !FieldsEqual(ID_target, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("target", target));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}