Commit bf7e8a7f authored by Bob Obara's avatar Bob Obara Committed by Kitware Robot
Browse files

Merge topic 'RemovingNumberOfRrquiredValuesFromParsers'

8d3fb9aa

 ENH: Removed NumberOfRequiredValues being mandatory in attribute files
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: John Tourtellott's avatarJohn Tourtellott <john.tourtellott@kitware.com>
Merge-request: !551
parents 9735626f 8d3fb9aa
...@@ -24,7 +24,7 @@ RefItemDefinition(const std::string &myName): ...@@ -24,7 +24,7 @@ RefItemDefinition(const std::string &myName):
ItemDefinition(myName), m_definition() ItemDefinition(myName), m_definition()
{ {
this->m_useCommonLabel = false; this->m_useCommonLabel = false;
this->m_numberOfRequiredValues = 0; this->m_numberOfRequiredValues = 1;
} }
RefItemDefinition::~RefItemDefinition() RefItemDefinition::~RefItemDefinition()
......
...@@ -992,12 +992,6 @@ void XmlDocV1Parser::processModelEntityDef(pugi::xml_node &node, ...@@ -992,12 +992,6 @@ void XmlDocV1Parser::processModelEntityDef(pugi::xml_node &node,
{ {
idef->setNumberOfRequiredValues(xatt.as_int()); idef->setNumberOfRequiredValues(xatt.as_int());
} }
else
{
smtkErrorMacro(this->m_logger,
"Missing XML Attribute NumberOfRequiredValues for Item Definition : "
<< idef->name());
}
xatt = node.attribute("Extensible"); xatt = node.attribute("Extensible");
if (xatt) if (xatt)
...@@ -1073,7 +1067,7 @@ void XmlDocV1Parser::processValueDef(pugi::xml_node &node, ...@@ -1073,7 +1067,7 @@ void XmlDocV1Parser::processValueDef(pugi::xml_node &node,
this->processItemDef(node, idef); this->processItemDef(node, idef);
xatt = node.attribute("NumberOfRequiredValues"); xatt = node.attribute("NumberOfRequiredValues");
std::size_t numberOfComponents = 0; std::size_t numberOfComponents = idef->numberOfRequiredValues();
if (xatt) if (xatt)
{ {
numberOfComponents = xatt.as_uint(); numberOfComponents = xatt.as_uint();
...@@ -1331,12 +1325,6 @@ void XmlDocV1Parser::processRefDef(pugi::xml_node &node, ...@@ -1331,12 +1325,6 @@ void XmlDocV1Parser::processRefDef(pugi::xml_node &node,
{ {
idef->setNumberOfRequiredValues(xatt.as_int()); idef->setNumberOfRequiredValues(xatt.as_int());
} }
else
{
smtkErrorMacro(this->m_logger,
"Missing XML Attribute NumberOfRequiredValues for Item Definition : "
<< idef->name());
}
// Lets see if there are labels // Lets see if there are labels
if(node.child("Labels")) if(node.child("Labels"))
...@@ -1377,12 +1365,6 @@ void XmlDocV1Parser::processDirectoryDef(pugi::xml_node &node, ...@@ -1377,12 +1365,6 @@ void XmlDocV1Parser::processDirectoryDef(pugi::xml_node &node,
{ {
idef->setNumberOfRequiredValues(xatt.as_int()); idef->setNumberOfRequiredValues(xatt.as_int());
} }
else
{
smtkErrorMacro(this->m_logger,
"Missing XML Attribute NumberOfRequiredValues for Item Definition : "
<< idef->name());
}
xatt = node.attribute("ShouldExist"); xatt = node.attribute("ShouldExist");
if (xatt) if (xatt)
...@@ -1429,12 +1411,6 @@ void XmlDocV1Parser::processFileDef(pugi::xml_node &node, ...@@ -1429,12 +1411,6 @@ void XmlDocV1Parser::processFileDef(pugi::xml_node &node,
{ {
idef->setNumberOfRequiredValues(xatt.as_int()); idef->setNumberOfRequiredValues(xatt.as_int());
} }
else
{
smtkErrorMacro(this->m_logger,
"Missing XML Attribute NumberOfRequiredValues for Item Definition : "
<< idef->name());
}
xatt = node.attribute("ShouldExist"); xatt = node.attribute("ShouldExist");
if (xatt) if (xatt)
......
...@@ -580,12 +580,6 @@ void XmlDocV2Parser::processMeshEntityDef(pugi::xml_node &node, ...@@ -580,12 +580,6 @@ void XmlDocV2Parser::processMeshEntityDef(pugi::xml_node &node,
{ {
idef->setNumberOfRequiredValues(xatt.as_int()); idef->setNumberOfRequiredValues(xatt.as_int());
} }
else
{
smtkErrorMacro(this->m_logger,
"Missing XML Attribute NumberOfRequiredValues for Item Definition : "
<< idef->name());
}
xatt = node.attribute("Extensible"); xatt = node.attribute("Extensible");
if (xatt) if (xatt)
......
...@@ -108,7 +108,7 @@ void XmlDocV3Parser::processDateTimeDef( ...@@ -108,7 +108,7 @@ void XmlDocV3Parser::processDateTimeDef(
xml_attribute xatt; xml_attribute xatt;
xatt = node.attribute("NumberOfRequiredValues"); xatt = node.attribute("NumberOfRequiredValues");
std::size_t numberOfComponents = 0; std::size_t numberOfComponents = idef->numberOfRequiredValues();
if (xatt) if (xatt)
{ {
numberOfComponents = xatt.as_uint(); numberOfComponents = xatt.as_uint();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment