本文整理汇总了C++中DataNode::GetNumChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ DataNode::GetNumChildren方法的具体用法?C++ DataNode::GetNumChildren怎么用?C++ DataNode::GetNumChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataNode
的用法示例。
在下文中一共展示了DataNode::GetNumChildren方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ClearColors
void
ColorAttributeList::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("ColorAttributeList");
if(searchNode == 0)
return;
DataNode *node;
DataNode **children;
// Clear all the ColorAttributes.
ClearColors();
// Go through all of the children and construct a new
// ColorAttribute for each one of them.
children = searchNode->GetChildren();
if(children != 0)
{
for(int i = 0; i < searchNode->GetNumChildren(); ++i)
{
if(children[i]->GetKey() == std::string("ColorAttribute"))
{
ColorAttribute temp;
temp.SetFromNode(children[i]);
AddColors(temp);
}
}
}
}
示例2: ClearControlPoints
void
GaussianControlPointList::SetFromNode(DataNode *parentNode)
{
int i;
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("GaussianControlPointList");
if(searchNode == 0)
return;
//DataNode *node;
DataNode **children;
// Clear all the GaussianControlPoints.
ClearControlPoints();
// Go through all of the children and construct a new
// GaussianControlPoint for each one of them.
children = searchNode->GetChildren();
for(i = 0; i < searchNode->GetNumChildren(); ++i)
{
if(children[i]->GetKey() == std::string("GaussianControlPoint"))
{
GaussianControlPoint temp;
temp.SetFromNode(children[i]);
AddControlPoints(temp);
}
}
}
示例3:
void
AttributeSubjectMap::ProcessOldVersions(DataNode *parentNode,
const std::string &configVersion, AttributeSubject *obj)
{
//
// Look for the required nodes.
//
if(parentNode == 0)
return;
DataNode *mapNode = parentNode->GetNode("AttributeSubjectMap");
if(mapNode == 0)
return;
DataNode *indicesNode = mapNode->GetNode("indices");
if(indicesNode == 0)
return;
DataNode *attsNode = mapNode->GetNode("attributes");
if(attsNode == 0)
return;
//
// Now that we have all of the nodes that we need, process old versions
// of each of the input data nodes.
//
const intVector &iv = indicesNode->AsIntVector();
DataNode **attsObjects = attsNode->GetChildren();
const int numAtts = attsNode->GetNumChildren();
for(int i = 0; i < iv.size(); ++i)
{
if(i < numAtts)
obj->ProcessOldVersions(attsObjects[i], configVersion.c_str());
}
}
示例4: if
void
DatabaseCorrelationList::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("DatabaseCorrelationList");
if(searchNode == 0)
return;
DataNode *node;
DataNode **children;
// Clear all the DatabaseCorrelations if we got any.
bool clearedCorrelations = false;
// Go through all of the children and construct a new
// DatabaseCorrelation for each one of them.
children = searchNode->GetChildren();
if(children != 0)
{
for(int i = 0; i < searchNode->GetNumChildren(); ++i)
{
if(children[i]->GetKey() == std::string("DatabaseCorrelation"))
{
if (!clearedCorrelations)
{
ClearCorrelations();
clearedCorrelations = true;
}
DatabaseCorrelation temp;
temp.SetFromNode(children[i]);
AddCorrelations(temp);
}
}
}
if((node = searchNode->GetNode("needPermission")) != 0)
SetNeedPermission(node->AsBool());
if((node = searchNode->GetNode("defaultCorrelationMethod")) != 0)
SetDefaultCorrelationMethod(node->AsInt());
if((node = searchNode->GetNode("whenToCorrelate")) != 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)
SetWhenToCorrelate(WhenToCorrelate(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
WhenToCorrelate value;
if(WhenToCorrelate_FromString(node->AsString(), value))
SetWhenToCorrelate(value);
}
}
}
示例5: ClearAtts
void
AttributeSubjectMap::SetFromNode(DataNode *parentNode,
AttributeSubject *factoryObj)
{
//
// Clear the attributes.
//
ClearAtts();
//
// Look for the required nodes.
//
if(parentNode == 0)
return;
DataNode *mapNode = parentNode->GetNode("AttributeSubjectMap");
if(mapNode == 0)
return;
DataNode *indicesNode = mapNode->GetNode("indices");
if(indicesNode == 0)
return;
DataNode *attsNode = mapNode->GetNode("attributes");
if(attsNode == 0)
return;
//
// Now that we have all of the nodes that we need, read in the objects
// and add them to the "map".
//
const intVector &iv = indicesNode->AsIntVector();
DataNode **attsObjects = attsNode->GetChildren();
const int numAtts = attsNode->GetNumChildren();
for(int i = 0; i < iv.size(); ++i)
{
if(i < numAtts)
{
// Create a fresh AttributeSubject so that its fields are
// initialized to the default values and not those last read in.
AttributeSubject *reader = factoryObj->NewInstance(false);
// Initialize the object using the data node.
reader->SetFromNode(attsObjects[i]);
// Add the object to the map.
SetAtts(iv[i], reader);
// delete the reader object.
delete reader;
}
}
}
示例6: SetTypeNames
void
FileOpenOptions::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("FileOpenOptions");
if(searchNode == 0)
return;
DataNode *node;
DataNode **children;
if((node = searchNode->GetNode("typeNames")) != 0)
SetTypeNames(node->AsStringVector());
if((node = searchNode->GetNode("typeIDs")) != 0)
SetTypeIDs(node->AsStringVector());
// Clear all the DBOptionsAttributess if we got any.
bool clearedOpenOptions = false;
// Go through all of the children and construct a new
// DBOptionsAttributes for each one of them.
children = searchNode->GetChildren();
if(children != 0)
{
for(int i = 0; i < searchNode->GetNumChildren(); ++i)
{
if(children[i]->GetKey() == std::string("DBOptionsAttributes"))
{
if (!clearedOpenOptions)
{
ClearOpenOptions();
clearedOpenOptions = true;
}
DBOptionsAttributes temp;
temp.SetFromNode(children[i]);
AddOpenOptions(temp);
}
}
}
if((node = searchNode->GetNode("Enabled")) != 0)
SetEnabled(node->AsIntVector());
if((node = searchNode->GetNode("preferredIDs")) != 0)
SetPreferredIDs(node->AsStringVector());
}
示例7:
void
AnnotationObjectList::ProcessOldVersions(DataNode *parentNode,
const char *configVersion)
{
if (parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("AnnotationObjectList");
if (searchNode == 0)
return;
int nChildren = searchNode->GetNumChildren();
DataNode **children = searchNode->GetChildren();
for (int i = 0; i < nChildren; ++i)
{
AnnotationObject annot;
annot.ProcessOldVersions(children[i], configVersion);
}
}
示例8: SetEngineName
void
EngineList::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("EngineList");
if(searchNode == 0)
return;
DataNode *node;
DataNode **children;
if((node = searchNode->GetNode("engineName")) != 0)
SetEngineName(node->AsStringVector());
if((node = searchNode->GetNode("simulationName")) != 0)
SetSimulationName(node->AsStringVector());
// Clear all the EnginePropertiess if we got any.
bool clearedProperties = false;
// Go through all of the children and construct a new
// EngineProperties for each one of them.
children = searchNode->GetChildren();
if(children != 0)
{
for(int i = 0; i < searchNode->GetNumChildren(); ++i)
{
if(children[i]->GetKey() == std::string("EngineProperties"))
{
if (!clearedProperties)
{
ClearProperties();
clearedProperties = true;
}
EngineProperties temp;
temp.SetFromNode(children[i]);
AddProperties(temp);
}
}
}
}
示例9: SetAutoApplyUpdates
void
SelectionList::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("SelectionList");
if(searchNode == 0)
return;
DataNode *node;
DataNode **children;
if((node = searchNode->GetNode("autoApplyUpdates")) != 0)
SetAutoApplyUpdates(node->AsBool());
// Clear all the SelectionPropertiess if we got any.
bool clearedSelections = false;
// Go through all of the children and construct a new
// SelectionProperties for each one of them.
children = searchNode->GetChildren();
if(children != 0)
{
for(int i = 0; i < searchNode->GetNumChildren(); ++i)
{
if(children[i]->GetKey() == std::string("SelectionProperties"))
{
if (!clearedSelections)
{
ClearSelections();
clearedSelections = true;
}
SelectionProperties temp;
temp.SetFromNode(children[i]);
AddSelections(temp);
}
}
}
// Clear all the SelectionSummary list.
ClearSelectionSummarys();
}
示例10: ClearVars
void
ViewerClientInformation::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("ViewerClientInformation");
if(searchNode == 0)
return;
DataNode *node;
DataNode **children;
// Clear all the ViewerClientInformationElements if we got any.
bool clearedVars = false;
// Go through all of the children and construct a new
// ViewerClientInformationElement for each one of them.
children = searchNode->GetChildren();
if(children != 0)
{
for(int i = 0; i < searchNode->GetNumChildren(); ++i)
{
if(children[i]->GetKey() == std::string("ViewerClientInformationElement"))
{
if (!clearedVars)
{
ClearVars();
clearedVars = true;
}
ViewerClientInformationElement temp;
temp.SetFromNode(children[i]);
AddVars(temp);
}
}
}
if((node = searchNode->GetNode("supportedFormats")) != 0)
SetSupportedFormats(node->AsStringVector());
}
示例11: ClearMachines
void
HostProfileList::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("HostProfileList");
if(searchNode == 0)
return;
DataNode **children;
// Clear all the MachineProfiles if we got any.
bool clearedMachines = false;
// Go through all of the children and construct a new
// MachineProfile for each one of them.
children = searchNode->GetChildren();
if(children != 0)
{
for(int i = 0; i < searchNode->GetNumChildren(); ++i)
{
if(children[i]->GetKey() == std::string("MachineProfile"))
{
if (!clearedMachines)
{
ClearMachines();
clearedMachines = true;
}
MachineProfile temp;
temp.SetFromNode(children[i]);
AddMachines(temp);
}
}
}
}
示例12: ClearAnnotations
void
AnnotationObjectList::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("AnnotationObjectList");
if(searchNode == 0)
return;
DataNode **children;
// Clear all the AnnotationObjects if we got any.
bool clearedAnnotations = false;
// Go through all of the children and construct a new
// AnnotationObject for each one of them.
children = searchNode->GetChildren();
if(children != 0)
{
for(int i = 0; i < searchNode->GetNumChildren(); ++i)
{
if(children[i]->GetKey() == std::string("AnnotationObject"))
{
if (!clearedAnnotations)
{
ClearAnnotations();
clearedAnnotations = true;
}
AnnotationObject temp;
temp.SetFromNode(children[i]);
AddAnnotation(temp);
}
}
}
}
示例13: SetNSets
void
SILAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("SILAttributes");
if(searchNode == 0)
return;
DataNode *node;
DataNode **children;
if((node = searchNode->GetNode("nSets")) != 0)
SetNSets(node->AsInt());
if((node = searchNode->GetNode("setNames")) != 0)
SetSetNames(node->AsStringVector());
if((node = searchNode->GetNode("setIds")) != 0)
SetSetIds(node->AsIntVector());
if((node = searchNode->GetNode("wholeList")) != 0)
SetWholeList(node->AsIntVector());
if((node = searchNode->GetNode("nCollections")) != 0)
SetNCollections(node->AsInt());
if((node = searchNode->GetNode("category")) != 0)
SetCategory(node->AsStringVector());
if((node = searchNode->GetNode("role")) != 0)
SetRole(node->AsIntVector());
if((node = searchNode->GetNode("superset")) != 0)
SetSuperset(node->AsIntVector());
// Clear all the NamespaceAttributess if we got any.
bool clearedNspaces = false;
// Go through all of the children and construct a new
// NamespaceAttributes for each one of them.
children = searchNode->GetChildren();
if(children != 0)
{
for(int i = 0; i < searchNode->GetNumChildren(); ++i)
{
if(children[i]->GetKey() == std::string("NamespaceAttributes"))
{
if (!clearedNspaces)
{
ClearNspaces();
clearedNspaces = true;
}
NamespaceAttributes temp;
temp.SetFromNode(children[i]);
AddNspace(temp);
}
}
}
// Clear all the SILMatrixAttributess if we got any.
bool clearedMatrices = false;
// Go through all of the children and construct a new
// SILMatrixAttributes for each one of them.
children = searchNode->GetChildren();
if(children != 0)
{
for(int i = 0; i < searchNode->GetNumChildren(); ++i)
{
if(children[i]->GetKey() == std::string("SILMatrixAttributes"))
{
if (!clearedMatrices)
{
ClearMatrices();
clearedMatrices = true;
}
SILMatrixAttributes temp;
temp.SetFromNode(children[i]);
AddMatrices(temp);
}
}
}
// Clear all the SILArrayAttributess if we got any.
bool clearedArrays = false;
// Go through all of the children and construct a new
// SILArrayAttributes for each one of them.
children = searchNode->GetChildren();
if(children != 0)
{
for(int i = 0; i < searchNode->GetNumChildren(); ++i)
{
if(children[i]->GetKey() == std::string("SILArrayAttributes"))
{
if (!clearedArrays)
{
ClearArrays();
clearedArrays = true;
}
SILArrayAttributes temp;
temp.SetFromNode(children[i]);
AddArrays(temp);
}
}
}
//.........这里部分代码省略.........
示例14: SetFromNode
void ColorControlPointList::SetFromNode(DataNode* parentNode)
{
if (parentNode == 0)
return;
DataNode* searchNode = parentNode->GetNode("ColorControlPointList");
if (searchNode == 0)
return;
DataNode* node;
DataNode** children;
// Clear all the ColorControlPoints.
ClearControlPoints();
//
// Try setting the colors from the compact color and position vectors.
//
bool colorsAreSet = false;
DataNode* compactColorNode = searchNode->GetNode("compactColors");
DataNode* compactPositionNode = searchNode->GetNode("compactPositions");
if (compactColorNode != 0 && compactPositionNode != 0)
{
const unsignedCharVector& colors = compactColorNode->AsUnsignedCharVector();
const floatVector& positions = compactPositionNode->AsFloatVector();
unsigned int npts = static_cast<unsigned int>(colors.size() / 4);
if (npts > static_cast<unsigned int>(positions.size()))
npts = static_cast<unsigned int>(positions.size());
if (npts > 0)
{
for (unsigned int i = 0; i < npts; ++i)
{
int index = i << 2;
AddControlPoints(ColorControlPoint(
positions[i], colors[index], colors[index + 1], colors[index + 2], colors[index + 3]));
}
colorsAreSet = true;
}
}
if (!colorsAreSet)
{
// Go through all of the children and construct a new
// ColorControlPoint for each one of them.
children = searchNode->GetChildren();
for (int i = 0; i < searchNode->GetNumChildren(); ++i)
{
if (children[i]->GetKey() == std::string("ColorControlPoint"))
{
ColorControlPoint temp;
temp.SetFromNode(children[i]);
AddControlPoints(temp);
}
}
}
if ((node = searchNode->GetNode("smoothingFlag")) != 0)
SetSmoothingFlag(node->AsBool());
if ((node = searchNode->GetNode("equalSpacingFlag")) != 0)
SetEqualSpacingFlag(node->AsBool());
if ((node = searchNode->GetNode("discreteFlag")) != 0)
SetDiscreteFlag(node->AsBool());
if ((node = searchNode->GetNode("externalFlag")) != 0)
SetExternalFlag(node->AsBool());
}
示例15: SetTypes
void
DBPluginInfoAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("DBPluginInfoAttributes");
if(searchNode == 0)
return;
DataNode *node;
DataNode **children;
if((node = searchNode->GetNode("types")) != 0)
SetTypes(node->AsStringVector());
if((node = searchNode->GetNode("hasWriter")) != 0)
SetHasWriter(node->AsIntVector());
// Clear all the DBOptionsAttributess if we got any.
bool clearedDbReadOptions = false;
// Go through all of the children and construct a new
// DBOptionsAttributes for each one of them.
children = searchNode->GetChildren();
if(children != 0)
{
for(int i = 0; i < searchNode->GetNumChildren(); ++i)
{
if(children[i]->GetKey() == std::string("DBOptionsAttributes"))
{
if (!clearedDbReadOptions)
{
ClearDbReadOptions();
clearedDbReadOptions = true;
}
DBOptionsAttributes temp;
temp.SetFromNode(children[i]);
AddDbReadOptions(temp);
}
}
}
// Clear all the DBOptionsAttributess if we got any.
bool clearedDbWriteOptions = false;
// Go through all of the children and construct a new
// DBOptionsAttributes for each one of them.
children = searchNode->GetChildren();
if(children != 0)
{
for(int i = 0; i < searchNode->GetNumChildren(); ++i)
{
if(children[i]->GetKey() == std::string("DBOptionsAttributes"))
{
if (!clearedDbWriteOptions)
{
ClearDbWriteOptions();
clearedDbWriteOptions = true;
}
DBOptionsAttributes temp;
temp.SetFromNode(children[i]);
AddDbWriteOptions(temp);
}
}
}
if((node = searchNode->GetNode("typesFullNames")) != 0)
SetTypesFullNames(node->AsStringVector());
if((node = searchNode->GetNode("license")) != 0)
SetLicense(node->AsStringVector());
if((node = searchNode->GetNode("host")) != 0)
SetHost(node->AsString());
}