#include <cadex/Base_UTF16String.hxx>
#include <cadex/LicenseManager_Activate.h>
#include <cadex/ModelData_Assembly.hxx>
#include <cadex/ModelData_Instance.hxx>
#include <cadex/ModelData_ModelReader.hxx>
#include <cadex/ModelData_ModelWriter.hxx>
#include <cadex/ModelData_Part.hxx>
#include <iostream>
#include <stack>
#include <unordered_map>
#include <vector>
#include "../../cadex_license.cxx"
{
public:
std::vector <ModelData_Instance>,
ModelData_BaseObjectHash> RemovedSGEMapType;
myNameToRemove (theNameToRemove)
{}
{
mySGEsToRemove[theElement].push_back (aChild);
}
}
return true;
}
RemovedSGEMapType& SGEsToRemove()
{
return mySGEsToRemove;
}
private:
RemovedSGEMapType mySGEsToRemove;
};
int main (int argc, char** argv)
{
auto aKey = LicenseKey::Value();
if (!CADExLicense_Activate (aKey)) {
cerr << "Failed to activate CAD Exchanger license." << endl;
return 1;
}
if (argc != 4) {
cerr << "Usage: " << argv[0] << " <input_file> <output_file> <sge_to_remove>, where:" << endl;
cerr << " <input_file> is a name of the XML file to be read" << endl;
cerr << " <input_file> is a name of the XML file where the output should be stored" << endl;
cerr << " <sge_to_remove> is a name of the scene graph elements to remove" << endl;
return 1;
}
const char* aSource = argv[1];
const char* anOutput = argv[2];
cerr << "Failed to read the file " << aSource << endl;
return 1;
}
const char* aNameToRemove = argv[3];
std::vector <ModelData_SceneGraphElement> aRootsToRemove;
const auto& anElement = anIt.Next();
if (anElement.Name() == aNameToRemove) {
aRootsToRemove.push_back (anElement);
}
}
for (const auto& aRootToRemove : aRootsToRemove) {
}
RemovedSGEFinder aFinder (aNameToRemove);
auto& anSGEsToRemove = aFinder.SGEsToRemove();
for (const auto& aParentWithChildren : anSGEsToRemove) {
auto aParent = aParentWithChildren.first;
const auto& aChildrenToRemove = aParentWithChildren.second;
for (const auto& aChildToRemove : aChildrenToRemove) {
aParent.RemoveInstance (aChildToRemove);
}
}
return 0;
}