Small changes in demo.

(Setting rendering mode for item)
This commit is contained in:
Ílker Yaz 2012-08-03 10:13:54 +00:00
parent 050562a5c8
commit bbec5ac94e
2 changed files with 11 additions and 7 deletions

View File

@ -111,6 +111,7 @@ void Polyhedron_demo_mesh_segmentation_plugin::on_SDF_button_clicked()
{
// create new item
new_item = new Scene_polyhedron_item(*item->polyhedron());
new_item->setGouraudMode();
item->setVisible(false);
index = scene->addItem(new_item);
@ -161,6 +162,7 @@ void Polyhedron_demo_mesh_segmentation_plugin::on_Partition_button_clicked()
{
// create new item
new_item = new Scene_polyhedron_item(*item->polyhedron());
new_item->setGouraudMode();
item->setVisible(false);
index = scene->addItem(new_item);
@ -225,11 +227,7 @@ void Polyhedron_demo_mesh_segmentation_plugin::colorize(
if(sdf)
{
double sdf_value = segmentation.get_sdf_value_of_facet(facet_const_it);
facet_sdf_values.push_back(std::pair<Polyhedron::Facet_iterator, double>(facet_it, sdf_value));
//int sdf_color = static_cast<int>(255.0 * sdf_value);
//
//color_vector.push_back(QColor(sdf_color,sdf_color,sdf_color));
//facet_it->set_patch_id(patch_id++);
facet_sdf_values.push_back(std::pair<Polyhedron::Facet_iterator, double>(facet_it, sdf_value));
}
else
{

View File

@ -112,6 +112,11 @@ public:
: mesh(mesh), facet_index_map(facet_index_map), is_pmmap_custom(true) {
}
// Copy-constructor
// Default, we store facet-to-id in property-map adaptor 'FacetIndexMap'.
// It stores a pointer to std::map instance which is a member variable.
// So default copy constructor is not working since copied property-map adaptor still
// points to std::map instance which exists in copied object (rhs).
Surface_mesh_segmentation(const
Surface_mesh_segmentation<Polyhedron, FacetIndexMap>& rhs):
mesh(rhs.mesh), sdf_values(rhs.sdf_values), centers(rhs.centers),
@ -123,8 +128,9 @@ public:
}
}
// use another copy of polyhedron but also copy state of rhs
// main difference between copy constructor is rhs.mesh is not equal to mesh.
// Use another copy of polyhedron but also copy the state of rhs.
// Main difference between copy constructor is rhs.mesh is NOT equal to this->mesh.
// So we cannot copy facet_index_map_internal since facet_iterators of 'this' is different than rhs.
Surface_mesh_segmentation(const Polyhedron& mesh,
const Surface_mesh_segmentation<Polyhedron, FacetIndexMap>& rhs)
: mesh(mesh), sdf_values(rhs.sdf_values), centers(rhs.centers),