Skip to content
Snippets Groups Projects

rm node visitor

Merged Wuttke, Joachim requested to merge rmNodeVisitor into develop
1 file
+ 10
0
Compare changes
  • Side-by-side
  • Inline
@@ -16,24 +16,34 @@
@@ -16,24 +16,34 @@
#include "Base/Util/Assert.h"
#include "Base/Util/Assert.h"
#include "Sample/Material/Material.h"
#include "Sample/Material/Material.h"
#include <algorithm>
#include <algorithm>
 
#include <iostream>
#include <set>
#include <set>
#include <stdexcept>
#include <stdexcept>
void MaterialKeyHandler::insertMaterial(const Material* mat)
void MaterialKeyHandler::insertMaterial(const Material* mat)
{
{
 
std::cout << "MKH 0" << std::endl;
 
ASSERT(mat);
 
std::cout << "MKH insert " << mat->materialName() << std::endl;
for (const auto& it : m_Mat2Unique)
for (const auto& it : m_Mat2Unique)
if (*it.second == *mat) {
if (*it.second == *mat) {
m_Mat2Unique.emplace(mat, it.second);
m_Mat2Unique.emplace(mat, it.second);
 
std::cout << "MKH duplicate entry" << std::endl;
return;
return;
}
}
 
std::cout << "MKH 1" << std::endl;
m_Mat2Unique.emplace(mat, mat);
m_Mat2Unique.emplace(mat, mat);
 
std::cout << "MKH 2" << std::endl;
const std::string key = "material_" + mat->materialName();
const std::string key = "material_" + mat->materialName();
 
std::cout << "MKH key = " << key << std::endl;
if (m_Key2Mat.count(key))
if (m_Key2Mat.count(key))
throw std::runtime_error(
throw std::runtime_error(
"Material name " + mat->materialName()
"Material name " + mat->materialName()
+ " used more than once, which is not supported by Python exporter");
+ " used more than once, which is not supported by Python exporter");
 
std::cout << "MKH 3" << std::endl;
m_Key2Mat.emplace(key, mat);
m_Key2Mat.emplace(key, mat);
 
std::cout << "MKH 4" << std::endl;
}
}
const std::string& MaterialKeyHandler::mat2key(const Material* mat) const
const std::string& MaterialKeyHandler::mat2key(const Material* mat) const
Loading