本文整理汇总了C++中DataNode::AddNode方法的典型用法代码示例。如果您正苦于以下问题:C++ DataNode::AddNode方法的具体用法?C++ DataNode::AddNode怎么用?C++ DataNode::AddNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataNode
的用法示例。
在下文中一共展示了DataNode::AddNode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DataNode
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);
}
示例2: DataNode
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);
}
示例3: DataNode
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);
}
示例4: topLevel
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;
}
示例5: DataNode
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);
}
示例6: DataNode
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);
}
示例7: DataNode
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);
}
示例8: DataNode
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;
}
示例9: DataNode
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;
}
示例10: DataNode
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;
}
示例11: DataNode
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);
}
示例12: DataNode
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);
}
示例13: DataNode
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);
}
示例14: DataNode
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);
}
示例15: DataNode
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);
}