mirror of https://github.com/CGAL/cgal
Merge pull request #3681 from maxGimeno/Demo-New_batch_of_bug_fixes-GF
Polyhedron Demo: new batch of bug fixes
This commit is contained in:
commit
c334407c46
|
|
@ -2433,7 +2433,7 @@ QString MainWindow::get_item_stats()
|
||||||
{
|
{
|
||||||
//1st step : get all classnames of the selected items
|
//1st step : get all classnames of the selected items
|
||||||
QList<QString> classnames;
|
QList<QString> classnames;
|
||||||
Q_FOREACH(int id, getSelectedSceneItemIndices())
|
Q_FOREACH(int id, scene->selectionIndices())
|
||||||
{
|
{
|
||||||
QString classname = scene->item(id)->metaObject()->className();
|
QString classname = scene->item(id)->metaObject()->className();
|
||||||
if(!classnames.contains(classname))
|
if(!classnames.contains(classname))
|
||||||
|
|
@ -2442,7 +2442,7 @@ QString MainWindow::get_item_stats()
|
||||||
//2nd step : separate the selection in lists corresponding to their classname
|
//2nd step : separate the selection in lists corresponding to their classname
|
||||||
QVector< QList<Scene_item*> > items;
|
QVector< QList<Scene_item*> > items;
|
||||||
items.resize(classnames.size());
|
items.resize(classnames.size());
|
||||||
Q_FOREACH(int id, getSelectedSceneItemIndices())
|
Q_FOREACH(int id, scene->selectionIndices())
|
||||||
{
|
{
|
||||||
Scene_item* s_item = scene->item(id);
|
Scene_item* s_item = scene->item(id);
|
||||||
for(int i=0; i<items.size(); i++)
|
for(int i=0; i<items.size(); i++)
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
#include <QColorDialog>
|
#include <QColorDialog>
|
||||||
#include <QPalette>
|
#include <QPalette>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
|
#include <QStyleFactory>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
#include <CGAL/boost/graph/helpers.h>
|
#include <CGAL/boost/graph/helpers.h>
|
||||||
|
|
@ -25,6 +26,7 @@
|
||||||
#include "triangulate_primitive.h"
|
#include "triangulate_primitive.h"
|
||||||
#include <CGAL/Buffer_for_vao.h>
|
#include <CGAL/Buffer_for_vao.h>
|
||||||
#include <CGAL/Three/Triangle_container.h>
|
#include <CGAL/Three/Triangle_container.h>
|
||||||
|
#include <CGAL/Dynamic_property_map.h>
|
||||||
|
|
||||||
#define ARBITRARY_DBL_MIN 1.0E-30
|
#define ARBITRARY_DBL_MIN 1.0E-30
|
||||||
#define ARBITRARY_DBL_MAX 1.0E+30
|
#define ARBITRARY_DBL_MAX 1.0E+30
|
||||||
|
|
@ -33,6 +35,7 @@
|
||||||
//Item for heat values
|
//Item for heat values
|
||||||
typedef CGAL::Three::Triangle_container Tri;
|
typedef CGAL::Three::Triangle_container Tri;
|
||||||
typedef CGAL::Three::Viewer_interface VI;
|
typedef CGAL::Three::Viewer_interface VI;
|
||||||
|
|
||||||
class Scene_heat_item
|
class Scene_heat_item
|
||||||
: public CGAL::Three::Scene_item_rendering_helper
|
: public CGAL::Three::Scene_item_rendering_helper
|
||||||
{
|
{
|
||||||
|
|
@ -309,6 +312,8 @@ class DisplayPropertyPlugin :
|
||||||
typedef SMesh::Property_map<boost::graph_traits<SMesh>::vertex_descriptor, double> Vertex_distance_map;
|
typedef SMesh::Property_map<boost::graph_traits<SMesh>::vertex_descriptor, double> Vertex_distance_map;
|
||||||
typedef CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3<SMesh> Heat_method;
|
typedef CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3<SMesh> Heat_method;
|
||||||
typedef CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3<SMesh, CGAL::Heat_method_3::Intrinsic_Delaunay> Heat_method_idt;
|
typedef CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3<SMesh, CGAL::Heat_method_3::Intrinsic_Delaunay> Heat_method_idt;
|
||||||
|
typedef CGAL::dynamic_vertex_property_t<bool> Vertex_source_tag;
|
||||||
|
typedef boost::property_map<SMesh, Vertex_source_tag>::type Vertex_source_map;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
@ -338,6 +343,8 @@ public:
|
||||||
this->current_item = NULL;
|
this->current_item = NULL;
|
||||||
|
|
||||||
QAction *actionDisplayAngles= new QAction(QString("Display Properties"), mw);
|
QAction *actionDisplayAngles= new QAction(QString("Display Properties"), mw);
|
||||||
|
QAction *actionHeatMethod= new QAction(QString("Heat Method"), mw);
|
||||||
|
actionHeatMethod->setProperty("submenuName", "Color");
|
||||||
|
|
||||||
rm = 1.0;
|
rm = 1.0;
|
||||||
rM = 0.0;
|
rM = 0.0;
|
||||||
|
|
@ -350,7 +357,16 @@ public:
|
||||||
if(actionDisplayAngles) {
|
if(actionDisplayAngles) {
|
||||||
connect(actionDisplayAngles, SIGNAL(triggered()),
|
connect(actionDisplayAngles, SIGNAL(triggered()),
|
||||||
this, SLOT(openDialog()));
|
this, SLOT(openDialog()));
|
||||||
|
if(actionHeatMethod)
|
||||||
|
{
|
||||||
|
connect(actionHeatMethod, &QAction::triggered,
|
||||||
|
this, [this](){
|
||||||
|
this->dock_widget->propertyBox->setCurrentIndex(2);
|
||||||
|
this->dock_widget->show();
|
||||||
|
});
|
||||||
|
}
|
||||||
_actions << actionDisplayAngles;
|
_actions << actionDisplayAngles;
|
||||||
|
_actions << actionHeatMethod;
|
||||||
|
|
||||||
}
|
}
|
||||||
dock_widget = new DockWidget("Property Displaying", mw);
|
dock_widget = new DockWidget("Property Displaying", mw);
|
||||||
|
|
@ -358,10 +374,12 @@ public:
|
||||||
addDockWidget(dock_widget);
|
addDockWidget(dock_widget);
|
||||||
QPalette palette(Qt::red);
|
QPalette palette(Qt::red);
|
||||||
dock_widget->minColorButton->setPalette(palette);
|
dock_widget->minColorButton->setPalette(palette);
|
||||||
|
dock_widget->minColorButton->setStyle(QStyleFactory::create("Fusion"));
|
||||||
dock_widget->minColorButton->update();
|
dock_widget->minColorButton->update();
|
||||||
|
|
||||||
palette = QPalette(Qt::green);
|
palette = QPalette(Qt::green);
|
||||||
dock_widget->maxColorButton->setPalette(palette);
|
dock_widget->maxColorButton->setPalette(palette);
|
||||||
|
dock_widget->maxColorButton->setStyle(QStyleFactory::create("Fusion"));
|
||||||
dock_widget->maxColorButton->update();
|
dock_widget->maxColorButton->update();
|
||||||
connect(dock_widget->colorizeButton, SIGNAL(clicked(bool)),
|
connect(dock_widget->colorizeButton, SIGNAL(clicked(bool)),
|
||||||
this, SLOT(colorize()));
|
this, SLOT(colorize()));
|
||||||
|
|
@ -387,6 +405,7 @@ public:
|
||||||
QPalette palette(minColor);
|
QPalette palette(minColor);
|
||||||
dock_widget->minColorButton->setPalette(palette);
|
dock_widget->minColorButton->setPalette(palette);
|
||||||
dock_widget->minColorButton->update();
|
dock_widget->minColorButton->update();
|
||||||
|
replaceRamp();
|
||||||
});
|
});
|
||||||
connect(dock_widget->maxColorButton, &QPushButton::pressed,
|
connect(dock_widget->maxColorButton, &QPushButton::pressed,
|
||||||
this, [this]()
|
this, [this]()
|
||||||
|
|
@ -401,6 +420,7 @@ public:
|
||||||
|
|
||||||
dock_widget->maxColorButton->setPalette(palette);
|
dock_widget->maxColorButton->setPalette(palette);
|
||||||
dock_widget->maxColorButton->update();
|
dock_widget->maxColorButton->update();
|
||||||
|
replaceRamp();
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(dock_widget->sourcePointsButton, SIGNAL(toggled(bool)),
|
connect(dock_widget->sourcePointsButton, SIGNAL(toggled(bool)),
|
||||||
|
|
@ -467,7 +487,6 @@ private Q_SLOTS:
|
||||||
replaceRamp();
|
replaceRamp();
|
||||||
item->face_graph()->collect_garbage();
|
item->face_graph()->collect_garbage();
|
||||||
|
|
||||||
item->face_graph()->collect_garbage();
|
|
||||||
switch(dock_widget->propertyBox->currentIndex()){
|
switch(dock_widget->propertyBox->currentIndex()){
|
||||||
case 0:
|
case 0:
|
||||||
displayAngles(item);
|
displayAngles(item);
|
||||||
|
|
@ -553,12 +572,6 @@ private Q_SLOTS:
|
||||||
{
|
{
|
||||||
smesh.remove_property_map(angles);
|
smesh.remove_property_map(angles);
|
||||||
}
|
}
|
||||||
SMesh::Property_map<vertex_descriptor, bool> is_source;
|
|
||||||
boost::tie(is_source, found) = smesh.property_map<vertex_descriptor,bool>("v:heat_source");
|
|
||||||
if(found)
|
|
||||||
{
|
|
||||||
smesh.remove_property_map(is_source);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void displayScaledJacobian(Scene_surface_mesh_item* item)
|
void displayScaledJacobian(Scene_surface_mesh_item* item)
|
||||||
|
|
@ -777,10 +790,7 @@ private Q_SLOTS:
|
||||||
bool displayHeatIntensity(Scene_surface_mesh_item* item, bool iDT = false)
|
bool displayHeatIntensity(Scene_surface_mesh_item* item, bool iDT = false)
|
||||||
{
|
{
|
||||||
SMesh& mesh = *item->face_graph();
|
SMesh& mesh = *item->face_graph();
|
||||||
bool found = false;
|
bool found = is_source.find(item) != is_source.end();
|
||||||
SMesh::Property_map<vertex_descriptor, bool> is_source ;
|
|
||||||
boost::tie(is_source, found)=
|
|
||||||
mesh.property_map<vertex_descriptor,bool>("v:heat_source");
|
|
||||||
if(!found
|
if(!found
|
||||||
|| ! source_points
|
|| ! source_points
|
||||||
|| source_points->point_set()->is_empty())
|
|| source_points->point_set()->is_empty())
|
||||||
|
|
@ -832,9 +842,8 @@ private Q_SLOTS:
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// AF: So far we only deal with adding sources
|
|
||||||
BOOST_FOREACH(vertex_descriptor vd, vertices(mesh)){
|
BOOST_FOREACH(vertex_descriptor vd, vertices(mesh)){
|
||||||
if(is_source[vd]){
|
if(get(is_source[item], vd)){
|
||||||
if(iDT){
|
if(iDT){
|
||||||
hm_idt->add_source(vd);
|
hm_idt->add_source(vd);
|
||||||
} else
|
} else
|
||||||
|
|
@ -1098,13 +1107,20 @@ private Q_SLOTS:
|
||||||
source_points=mesh_sources_map[current_item];
|
source_points=mesh_sources_map[current_item];
|
||||||
}
|
}
|
||||||
connect(item, SIGNAL(selected_vertex(void*)), this, SLOT(on_vertex_selected(void*)));
|
connect(item, SIGNAL(selected_vertex(void*)), this, SLOT(on_vertex_selected(void*)));
|
||||||
bool non_init;
|
bool non_init = is_source.find(item) == is_source.end();
|
||||||
SMesh::Property_map<vertex_descriptor, bool> is_source;
|
|
||||||
boost::tie(is_source, non_init) = current_item->face_graph()->add_property_map<vertex_descriptor, bool>("v:heat_source", false);
|
|
||||||
if(non_init)
|
if(non_init)
|
||||||
{
|
{
|
||||||
|
Vertex_source_map map = get(Vertex_source_tag(), *item->face_graph());
|
||||||
|
is_source.insert(std::make_pair(item, map));
|
||||||
connect(item, &Scene_surface_mesh_item::itemChanged,
|
connect(item, &Scene_surface_mesh_item::itemChanged,
|
||||||
this, &DisplayPropertyPlugin::resetProperty);
|
this, &DisplayPropertyPlugin::resetProperty);
|
||||||
|
connect(item, &Scene_surface_mesh_item::aboutToBeDestroyed,
|
||||||
|
[this, item](){
|
||||||
|
if(is_source.find(item) != is_source.end())
|
||||||
|
{
|
||||||
|
is_source.erase(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1121,19 +1137,17 @@ private Q_SLOTS:
|
||||||
typedef boost::graph_traits<SMesh>::vertices_size_type size_type;
|
typedef boost::graph_traits<SMesh>::vertices_size_type size_type;
|
||||||
size_type h = static_cast<size_type>(reinterpret_cast<std::size_t>(void_ptr));
|
size_type h = static_cast<size_type>(reinterpret_cast<std::size_t>(void_ptr));
|
||||||
vertex_descriptor vd = static_cast<vertex_descriptor>(h) ;
|
vertex_descriptor vd = static_cast<vertex_descriptor>(h) ;
|
||||||
bool found;
|
bool found = is_source.find(current_item) != is_source.end();
|
||||||
SMesh::Property_map<vertex_descriptor, bool> is_source;
|
|
||||||
boost::tie(is_source, found) = current_item->face_graph()->property_map<vertex_descriptor,bool>("v:heat_source");
|
|
||||||
if(found)
|
if(found)
|
||||||
{
|
{
|
||||||
if(!is_source[vd])
|
if(!get(is_source[current_item], vd))
|
||||||
{
|
{
|
||||||
is_source[vd]=true;
|
put(is_source[current_item], vd, true);
|
||||||
source_points->point_set()->insert(current_item->face_graph()->point(vd));
|
source_points->point_set()->insert(current_item->face_graph()->point(vd));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
is_source[vd]=false;
|
put(is_source[current_item], vd, false);
|
||||||
Point_set::iterator it;
|
Point_set::iterator it;
|
||||||
for(it = source_points->point_set()->begin(); it != source_points->point_set()->end(); ++it)
|
for(it = source_points->point_set()->begin(); it != source_points->point_set()->end(); ++it)
|
||||||
if(source_points->point_set()->point(*it) == current_item->face_graph()->point(vd))
|
if(source_points->point_set()->point(*it) == current_item->face_graph()->point(vd))
|
||||||
|
|
@ -1224,6 +1238,7 @@ private:
|
||||||
|
|
||||||
boost::unordered_map<Scene_surface_mesh_item*, std::pair<double, SMesh::Face_index> > angles_min;
|
boost::unordered_map<Scene_surface_mesh_item*, std::pair<double, SMesh::Face_index> > angles_min;
|
||||||
boost::unordered_map<Scene_surface_mesh_item*, std::pair<double, SMesh::Face_index> > angles_max;
|
boost::unordered_map<Scene_surface_mesh_item*, std::pair<double, SMesh::Face_index> > angles_max;
|
||||||
|
boost::unordered_map<Scene_surface_mesh_item*, Vertex_source_map> is_source;
|
||||||
|
|
||||||
|
|
||||||
double minBox;
|
double minBox;
|
||||||
|
|
|
||||||
|
|
@ -672,7 +672,7 @@ treat_result(Scene_item& source_item,
|
||||||
{
|
{
|
||||||
Scene_surface_mesh_item* new_item = new Scene_surface_mesh_item;
|
Scene_surface_mesh_item* new_item = new Scene_surface_mesh_item;
|
||||||
CGAL::facets_in_complex_3_to_triangle_mesh(result_item->c3t3(), *new_item->face_graph());
|
CGAL::facets_in_complex_3_to_triangle_mesh(result_item->c3t3(), *new_item->face_graph());
|
||||||
new_item->setName(tr("%1 [Remeshed as Surface_mesh]").arg(source_item.name()));
|
new_item->setName(tr("%1 [Remeshed]").arg(source_item.name()));
|
||||||
Q_FOREACH(int ind, scene->selectionIndices()) {
|
Q_FOREACH(int ind, scene->selectionIndices()) {
|
||||||
scene->item(ind)->setVisible(false);
|
scene->item(ind)->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -541,7 +541,6 @@ void Polyhedron_demo_affine_transform_plugin::start(Scene_points_with_normal_ite
|
||||||
|
|
||||||
|
|
||||||
void Polyhedron_demo_affine_transform_plugin::end(){
|
void Polyhedron_demo_affine_transform_plugin::end(){
|
||||||
QApplication::restoreOverrideCursor();
|
|
||||||
double matrix[16];
|
double matrix[16];
|
||||||
transformMatrix(&matrix[0]);
|
transformMatrix(&matrix[0]);
|
||||||
const CGAL::qglviewer::Vec offset = static_cast<CGAL::Three::Viewer_interface*>(CGAL::QGLViewer::QGLViewerPool().first())->offset();
|
const CGAL::qglviewer::Vec offset = static_cast<CGAL::Three::Viewer_interface*>(CGAL::QGLViewer::QGLViewerPool().first())->offset();
|
||||||
|
|
@ -600,6 +599,7 @@ void Polyhedron_demo_affine_transform_plugin::end(){
|
||||||
transform_points_item = NULL;
|
transform_points_item = NULL;
|
||||||
}
|
}
|
||||||
dock_widget->hide();
|
dock_widget->hide();
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Polyhedron_demo_affine_transform_plugin::updateUiMatrix()
|
void Polyhedron_demo_affine_transform_plugin::updateUiMatrix()
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ void Polyhedron_demo_orient_soup_plugin::init(QMainWindow* mainWindow,
|
||||||
scene = scene_interface;
|
scene = scene_interface;
|
||||||
mw = mainWindow;
|
mw = mainWindow;
|
||||||
messages = m;
|
messages = m;
|
||||||
actionOrientSM = new QAction(tr("&Orient Polygon Soup (as a surface_mesh)"), mainWindow);
|
actionOrientSM = new QAction(tr("&Orient Polygon Soup"), mainWindow);
|
||||||
actionOrientSM->setObjectName("actionOrientSM");
|
actionOrientSM->setObjectName("actionOrientSM");
|
||||||
actionOrientSM->setProperty("subMenuName", "Polygon Mesh Processing");
|
actionOrientSM->setProperty("subMenuName", "Polygon Mesh Processing");
|
||||||
connect(actionOrientSM, SIGNAL(triggered()),
|
connect(actionOrientSM, SIGNAL(triggered()),
|
||||||
|
|
|
||||||
|
|
@ -235,6 +235,7 @@ public Q_SLOTS:
|
||||||
if(face_sel.empty())
|
if(face_sel.empty())
|
||||||
{
|
{
|
||||||
contour_2d.clear();
|
contour_2d.clear();
|
||||||
|
qobject_cast<CGAL::Three::Viewer_interface*>(viewer)->set2DSelectionMode(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//get border edges of the selected patches
|
//get border edges of the selected patches
|
||||||
|
|
|
||||||
|
|
@ -789,7 +789,7 @@ public Q_SLOTS:
|
||||||
QMessageBox::warning(mw,
|
QMessageBox::warning(mw,
|
||||||
tr("Degenerated Face_graph"),
|
tr("Degenerated Face_graph"),
|
||||||
tr("Degenerated faces have been detected. Problems may occur "
|
tr("Degenerated faces have been detected. Problems may occur "
|
||||||
"for operations other tha \"Move point\". "));
|
"for operations other than \"Move point\". "));
|
||||||
}
|
}
|
||||||
//remove lasso mode
|
//remove lasso mode
|
||||||
selection_item->set_lasso_mode(false);
|
selection_item->set_lasso_mode(false);
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include <CGAL/Side_of_triangle_mesh.h>
|
#include <CGAL/Side_of_triangle_mesh.h>
|
||||||
#include <CGAL/Polygon_mesh_processing/bbox.h>
|
#include <CGAL/Polygon_mesh_processing/bbox.h>
|
||||||
|
#include <CGAL/Polygon_mesh_processing/orientation.h>
|
||||||
|
|
||||||
#include <CGAL/Timer.h>
|
#include <CGAL/Timer.h>
|
||||||
#include <CGAL/make_mesh_3.h>
|
#include <CGAL/make_mesh_3.h>
|
||||||
|
|
@ -297,6 +298,12 @@ CGAL::Three::Scene_item* cgal_off_meshing(QWidget*,
|
||||||
// add remesh as new polyhedron
|
// add remesh as new polyhedron
|
||||||
Result_mesh *pRemesh = new Result_mesh;
|
Result_mesh *pRemesh = new Result_mesh;
|
||||||
CGAL::facets_in_complex_3_to_triangle_mesh(c3t3, *pRemesh);
|
CGAL::facets_in_complex_3_to_triangle_mesh(c3t3, *pRemesh);
|
||||||
|
if(CGAL::is_closed(*pRemesh)
|
||||||
|
&& ! CGAL::Polygon_mesh_processing::is_outward_oriented(*pRemesh))
|
||||||
|
{
|
||||||
|
CGAL::Polygon_mesh_processing::reverse_face_orientations(*pRemesh);
|
||||||
|
}
|
||||||
|
|
||||||
return make_item(pRemesh);
|
return make_item(pRemesh);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -436,6 +443,7 @@ if(sm_item)
|
||||||
.arg(offset_value));
|
.arg(offset_value));
|
||||||
new_item->setColor(Qt::magenta);
|
new_item->setColor(Qt::magenta);
|
||||||
new_item->setRenderingMode(item->renderingMode());
|
new_item->setRenderingMode(item->renderingMode());
|
||||||
|
|
||||||
scene->addItem(new_item);
|
scene->addItem(new_item);
|
||||||
item->setVisible(false);
|
item->setVisible(false);
|
||||||
scene->itemChanged(index);
|
scene->itemChanged(index);
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,8 @@ struct PRIV{
|
||||||
};
|
};
|
||||||
|
|
||||||
Scene_item_rendering_helper::Scene_item_rendering_helper()
|
Scene_item_rendering_helper::Scene_item_rendering_helper()
|
||||||
:priv(new PRIV(this)){}
|
:Scene_item(0,0),
|
||||||
|
priv(new PRIV(this)){}
|
||||||
|
|
||||||
Scene_item_rendering_helper::~Scene_item_rendering_helper()
|
Scene_item_rendering_helper::~Scene_item_rendering_helper()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -384,21 +384,21 @@ public:
|
||||||
std::string line;
|
std::string line;
|
||||||
std::size_t id, id2;
|
std::size_t id, id2;
|
||||||
|
|
||||||
if(!std::getline(in, line)) { return true; }
|
if(!std::getline(in, line)) { compute_normal_maps(); return true; }
|
||||||
std::istringstream vertex_line(line);
|
std::istringstream vertex_line(line);
|
||||||
while(vertex_line >> id) {
|
while(vertex_line >> id) {
|
||||||
if(id >= all_vertices.size()) { return false; }
|
if(id >= all_vertices.size()) { return false; }
|
||||||
selected_vertices.insert(all_vertices[id]);
|
selected_vertices.insert(all_vertices[id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!std::getline(in, line)) { return true; }
|
if(!std::getline(in, line)) { compute_normal_maps(); return true; }
|
||||||
std::istringstream facet_line(line);
|
std::istringstream facet_line(line);
|
||||||
while(facet_line >> id) {
|
while(facet_line >> id) {
|
||||||
if(id >= all_facets.size()) { return false; }
|
if(id >= all_facets.size()) { return false; }
|
||||||
selected_facets.insert(all_facets[id]);
|
selected_facets.insert(all_facets[id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!std::getline(in, line)) { return true; }
|
if(!std::getline(in, line)) { compute_normal_maps(); return true; }
|
||||||
std::istringstream edge_line(line);
|
std::istringstream edge_line(line);
|
||||||
while(edge_line >> id >> id2) {
|
while(edge_line >> id >> id2) {
|
||||||
if(id >= all_edges.size() || id2 >= all_edges.size()) { return false; }
|
if(id >= all_edges.size() || id2 >= all_edges.size()) { return false; }
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,11 @@ Scene_polylines_item_private::computeElements() const
|
||||||
++it)
|
++it)
|
||||||
{
|
{
|
||||||
if(it->empty()) continue;
|
if(it->empty()) continue;
|
||||||
|
if(it->front() == it->back())
|
||||||
|
nb_vertices += it->size() - 1;
|
||||||
|
else
|
||||||
nb_vertices += it->size();
|
nb_vertices += it->size();
|
||||||
|
|
||||||
for(size_t i = 0, end = it->size()-1;
|
for(size_t i = 0, end = it->size()-1;
|
||||||
i < end; ++i)
|
i < end; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1429,18 +1429,18 @@ void Scene_surface_mesh_item::setItemIsMulticolor(bool b)
|
||||||
|
|
||||||
void Scene_surface_mesh_item::show_feature_edges(bool b)
|
void Scene_surface_mesh_item::show_feature_edges(bool b)
|
||||||
{
|
{
|
||||||
|
d->has_feature_edges = b;
|
||||||
if(b)
|
if(b)
|
||||||
{
|
{
|
||||||
d->e_is_feature_map = d->smesh_->add_property_map<boost::graph_traits<SMesh>::edge_descriptor,bool>("e:is_feature").first;
|
d->e_is_feature_map = d->smesh_->add_property_map<boost::graph_traits<SMesh>::edge_descriptor,bool>("e:is_feature").first;
|
||||||
invalidate(COLORS);
|
invalidate(COLORS);
|
||||||
itemChanged();
|
itemChanged();
|
||||||
}
|
}
|
||||||
d->has_feature_edges = b;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Scene_surface_mesh_item::isItemMulticolor()
|
bool Scene_surface_mesh_item::isItemMulticolor()
|
||||||
{
|
{
|
||||||
return d->has_fcolors;
|
return d->has_fcolors || d->has_vcolors;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Scene_surface_mesh_item::hasPatchIds()
|
bool Scene_surface_mesh_item::hasPatchIds()
|
||||||
|
|
@ -1709,7 +1709,7 @@ CGAL::Three::Scene_item::Header_data Scene_surface_mesh_item::header() const
|
||||||
data.titles.append(QString("#Border Edges"));
|
data.titles.append(QString("#Border Edges"));
|
||||||
data.titles.append(QString("Pure Triangle"));
|
data.titles.append(QString("Pure Triangle"));
|
||||||
data.titles.append(QString("Pure Quad"));
|
data.titles.append(QString("Pure Quad"));
|
||||||
data.titles.append(QString("#Degenerated Faces"));
|
data.titles.append(QString("#Degenerate Faces"));
|
||||||
data.titles.append(QString("Connected Components of the Boundary"));
|
data.titles.append(QString("Connected Components of the Boundary"));
|
||||||
data.titles.append(QString("Area"));
|
data.titles.append(QString("Area"));
|
||||||
data.titles.append(QString("Volume"));
|
data.titles.append(QString("Volume"));
|
||||||
|
|
@ -1729,7 +1729,7 @@ CGAL::Three::Scene_item::Header_data Scene_surface_mesh_item::header() const
|
||||||
data.titles.append(QString("Maximum Length"));
|
data.titles.append(QString("Maximum Length"));
|
||||||
data.titles.append(QString("Median Length"));
|
data.titles.append(QString("Median Length"));
|
||||||
data.titles.append(QString("Mean Length"));
|
data.titles.append(QString("Mean Length"));
|
||||||
data.titles.append(QString("#Null Length"));
|
data.titles.append(QString("#Degenerate Edges"));
|
||||||
data.titles.append(QString("Minimum"));
|
data.titles.append(QString("Minimum"));
|
||||||
data.titles.append(QString("Maximum"));
|
data.titles.append(QString("Maximum"));
|
||||||
data.titles.append(QString("Average"));
|
data.titles.append(QString("Average"));
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QOpenGLDebugLogger>
|
#include <QOpenGLDebugLogger>
|
||||||
|
#include <QStyleFactory>
|
||||||
|
|
||||||
#include "ui_LightingDialog.h"
|
#include "ui_LightingDialog.h"
|
||||||
|
|
||||||
|
|
@ -122,18 +123,21 @@ public:
|
||||||
255*d->ambient.z());
|
255*d->ambient.z());
|
||||||
palette.setColor(QPalette::Button,ambient);
|
palette.setColor(QPalette::Button,ambient);
|
||||||
ambientButton->setPalette(palette);
|
ambientButton->setPalette(palette);
|
||||||
|
ambientButton->setStyle(QStyleFactory::create("Fusion"));
|
||||||
|
|
||||||
diffuse=QColor(255*d->diffuse.x(),
|
diffuse=QColor(255*d->diffuse.x(),
|
||||||
255*d->diffuse.y(),
|
255*d->diffuse.y(),
|
||||||
255*d->diffuse.z());
|
255*d->diffuse.z());
|
||||||
palette.setColor(QPalette::Button,diffuse);
|
palette.setColor(QPalette::Button,diffuse);
|
||||||
diffuseButton->setPalette(palette);
|
diffuseButton->setPalette(palette);
|
||||||
|
diffuseButton->setStyle(QStyleFactory::create("Fusion"));
|
||||||
|
|
||||||
specular=QColor(255*d->specular.x(),
|
specular=QColor(255*d->specular.x(),
|
||||||
255*d->specular.y(),
|
255*d->specular.y(),
|
||||||
255*d->specular.z());
|
255*d->specular.z());
|
||||||
palette.setColor(QPalette::Button,specular);
|
palette.setColor(QPalette::Button,specular);
|
||||||
specularButton->setPalette(palette);
|
specularButton->setPalette(palette);
|
||||||
|
specularButton->setStyle(QStyleFactory::create("Fusion"));
|
||||||
spec_powrSlider->setValue(static_cast<int>(d->spec_power));
|
spec_powrSlider->setValue(static_cast<int>(d->spec_power));
|
||||||
|
|
||||||
connect(&ambient_dial, &QColorDialog::currentColorChanged, this, &LightingDialog::ambient_changed );
|
connect(&ambient_dial, &QColorDialog::currentColorChanged, this, &LightingDialog::ambient_changed );
|
||||||
|
|
|
||||||
|
|
@ -98,14 +98,15 @@ namespace CGAL {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
scanner.skip_to_next_vertex(i);
|
scanner.skip_to_next_vertex(i);
|
||||||
}
|
|
||||||
if(!in)
|
if(!in)
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
bool has_fcolors = false;
|
bool has_fcolors = false;
|
||||||
for (std::size_t i = 0; i < scanner.size_of_facets(); ++i) {
|
for (std::size_t i = 0; i < scanner.size_of_facets(); ++i) {
|
||||||
std::size_t no;
|
std::size_t no;
|
||||||
scanner.scan_facet( no, i);
|
scanner.scan_facet( no, i);
|
||||||
|
if(!in)
|
||||||
|
return false;
|
||||||
IO::internal::resize(polygons[i], no);
|
IO::internal::resize(polygons[i], no);
|
||||||
for(std::size_t j = 0; j < no; ++j) {
|
for(std::size_t j = 0; j < no; ++j) {
|
||||||
std::size_t id;
|
std::size_t id;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue