diff options
Diffstat (limited to 'src/OpenCSGRenderer.cc')
-rw-r--r-- | src/OpenCSGRenderer.cc | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/src/OpenCSGRenderer.cc b/src/OpenCSGRenderer.cc index e4ed928..8e4aba9 100644 --- a/src/OpenCSGRenderer.cc +++ b/src/OpenCSGRenderer.cc @@ -133,54 +133,3 @@ void OpenCSGRenderer::renderCSGChain(CSGChain *chain, GLint *shaderinfo, } std::for_each(primitives.begin(), primitives.end(), del_fun<OpenCSG::Primitive>()); } - -// miscellaneous code to prep OpenCSG render. -// returns 0 on success, 1 on failure -// csgInfo gets modified -int opencsg_prep( const Tree &tree, const AbstractNode *root_node, CsgInfo_OpenCSG &csgInfo ) -{ - CGALEvaluator cgalevaluator(tree); - CSGTermEvaluator evaluator(tree, &cgalevaluator.psevaluator); - boost::shared_ptr<CSGTerm> root_raw_term = evaluator.evaluateCSGTerm(*root_node, - csgInfo.highlight_terms, - csgInfo.background_terms); - - if (!root_raw_term) { - std::cerr << "Error: CSG generation failed! (no top level object found)\n"; - return 1; - } - - // CSG normalization - CSGTermNormalizer normalizer(5000); - csgInfo.root_norm_term = normalizer.normalize(root_raw_term); - if (csgInfo.root_norm_term) { - csgInfo.root_chain = new CSGChain(); - csgInfo.root_chain->import(csgInfo.root_norm_term); - fprintf(stderr, "Normalized CSG tree has %d elements\n", int(csgInfo.root_chain->polysets.size())); - } - else { - csgInfo.root_chain = NULL; - fprintf(stderr, "WARNING: CSG normalization resulted in an empty tree\n"); - } - - if (csgInfo.highlight_terms.size() > 0) { - std::cerr << "Compiling highlights (" << csgInfo.highlight_terms.size() << " CSG Trees)...\n"; - - csgInfo.highlights_chain = new CSGChain(); - for (unsigned int i = 0; i < csgInfo.highlight_terms.size(); i++) { - csgInfo.highlight_terms[i] = normalizer.normalize(csgInfo.highlight_terms[i]); - csgInfo.highlights_chain->import(csgInfo.highlight_terms[i]); - } - } - - if (csgInfo.background_terms.size() > 0) { - std::cerr << "Compiling background (" << csgInfo.background_terms.size() << " CSG Trees)...\n"; - - csgInfo.background_chain = new CSGChain(); - for (unsigned int i = 0; i < csgInfo.background_terms.size(); i++) { - csgInfo.background_terms[i] = normalizer.normalize(csgInfo.background_terms[i]); - csgInfo.background_chain->import(csgInfo.background_terms[i]); - } - } - return 0; -} |