void Scene_c3t3_item::c3t3_changed() { // Update colors // Fill indices map and get max subdomain value indices_.clear(); int max = 0; for (C3t3::Cells_in_complex_iterator cit = this->c3t3().cells_in_complex_begin(), end = this->c3t3().cells_in_complex_end(); cit != end; ++cit) { max = (std::max)(max, cit->subdomain_index()); indices_.insert(cit->subdomain_index()); } for (C3t3::Facets_in_complex_iterator fit = this->c3t3().facets_in_complex_begin(), end = this->c3t3().facets_in_complex_end(); fit != end; ++fit) { max = (std::max)(max, fit->first->surface_patch_index(fit->second)); indices_.insert(fit->first->surface_patch_index(fit->second)); } d->colors.resize(max + 1); compute_color_map(color_); // Rebuild histogram build_histogram(); }
void Scene_c3t3_item::compute_bbox() const { if (isEmpty()) _bbox = Bbox(); else { CGAL::Bbox_3 result = c3t3().cells_in_complex_begin()->vertex(0)->point().bbox(); for (C3t3::Cells_in_complex_iterator cit = ++c3t3().cells_in_complex_begin(), cend = c3t3().cells_in_complex_end(); cit != cend; ++cit) { result = result + cit->vertex(0)->point().bbox(); //only one vertex should be a satisfactory approximation } _bbox = Bbox(result.xmin(), result.ymin(), result.zmin(), result.xmax(), result.ymax(), result.zmax()); } }
void Scene_c3t3_item::c3t3_changed() { // Update colors // Fill indices map and get max subdomain value indices_.clear(); int max = 0; for (C3t3::Cells_in_complex_iterator cit = this->c3t3().cells_in_complex_begin(), end = this->c3t3().cells_in_complex_end(); cit != end; ++cit) { max = (std::max)(max, cit->subdomain_index()); indices_.insert(cit->subdomain_index()); } d->colors.resize(max + 1); compute_color_map(color_); // Rebuild histogram build_histogram(); //compute_elements(); this->invalidate_buffers(); need_changed = false; }