--User changes

-Add new options to EmberGenome to better help assess which variations have certain characteristics. The options are:
  --sumvars: Display the names of all regular variations which have the default behavior of summing their outputs and exit.
  --assignvars: Display the names of all regular variations which have the non-standard behavior of assigning their outputs and exit.
  --ppsumvars: Display the names of all pre/post variations which have the non-standard behavior of summing their outputs and exit.
  --ppassignvars: Display the names of all pre/post variations which have the default behavior of assigning their outputs and exit.
  --dcvars: Display the names of all variations which use direct coloring and exit.
  --parvars: Display the names of all variations which have parameters and exit.
  --nonparvars: Display the names of all variations which do not have parameters (weight only) and exit.

--Code changes
 -Make VariationList vectors have const elements since no callers should ever change them.
 -Add new function to VariationList to retrieve a const ref to the parametric variations.
 -Move some search functions out of EmberTester and into EmberCommon.h.
 -General code cleanup.
This commit is contained in:
mfeemster
2016-05-14 23:33:08 -07:00
parent 5b6c62b95d
commit 5aec58b4a2
11 changed files with 283 additions and 135 deletions

View File

@ -66,7 +66,9 @@ bool EmberGenome(EmberOptions& opt)
auto varList = VariationList<T>::Instance();
if (opt.AllVars() || opt.RegVars() || opt.PreVars() || opt.PostVars())
if (opt.AllVars() || opt.SumVars() || opt.AssignVars() || opt.PpSumVars() || opt.PpAssignVars() ||
opt.DcVars() || opt.ParVars() || opt.NonParVars() ||
opt.RegVars() || opt.PreVars() || opt.PostVars())
{
if (opt.AllVars())
{
@ -75,9 +77,76 @@ bool EmberGenome(EmberOptions& opt)
for (auto& v : vars)
cout << v->Name() << "\n";
}
else if (opt.SumVars())
{
auto& reg = varList->RegVars();
auto matches = FindVarsWithout<T>(varList->RegVars(), vector<string> { "outPoint->m_X =", "outPoint->m_Y =", "outPoint->m_Z =",
"outPoint->m_X=", "outPoint->m_Y=", "outPoint->m_Z="
});
for (auto& v : matches)
cout << v->Name() << "\n";
}
else if (opt.AssignVars())
{
auto matches = FindVarsWith<T>(varList->RegVars(), vector<string> { "outPoint->m_X =", "outPoint->m_Y =", "outPoint->m_Z =",
"outPoint->m_X=", "outPoint->m_Y=", "outPoint->m_Z="
});
for (auto& v : matches)
cout << v->Name() << "\n";
}
else if (opt.PpSumVars())
{
auto& pre = varList->PreVars();
auto& post = varList->PostVars();
for (auto& v : pre)
if (v->AssignType() == eVariationAssignType::ASSIGNTYPE_SUM)
cout << v->Name() << "\n";
for (auto& v : post)
if (v->AssignType() == eVariationAssignType::ASSIGNTYPE_SUM)
cout << v->Name() << "\n";
}
else if (opt.PpAssignVars())
{
auto& pre = varList->PreVars();
auto& post = varList->PostVars();
for (auto& v : pre)
if (v->AssignType() == eVariationAssignType::ASSIGNTYPE_SET)
cout << v->Name() << "\n";
for (auto& v : post)
if (v->AssignType() == eVariationAssignType::ASSIGNTYPE_SET)
cout << v->Name() << "\n";
}
else if (opt.DcVars())
{
auto& all = varList->AllVars();
auto matches = FindVarsWith<T>(all, vector<string> { "m_ColorX" });
for (auto& v : matches)
cout << v->Name() << "\n";
}
else if (opt.ParVars())
{
auto& par = varList->ParametricVariations();
for (auto& v : par)
cout << v->Name() << "\n";
}
else if (opt.NonParVars())
{
auto& par = varList->NonParametricVariations();
for (auto& v : par)
cout << v->Name() << "\n";
}
else
{
vector<Variation<T>*> vars;
vector<const Variation<T>*> vars;
if (opt.RegVars())
vars.insert(vars.end(), varList->RegVars().begin(), varList->RegVars().end());