mirror of https://github.com/CGAL/cgal
Merge remote-tracking branch 'cgal/releases/CGAL-4.11-branch'
This commit is contained in:
commit
2de42e8f92
|
|
@ -792,22 +792,26 @@ void MainWindow::message(QString message, QString colorName, QString font) {
|
||||||
message.remove(message.length()-1, 1);
|
message.remove(message.length()-1, 1);
|
||||||
}
|
}
|
||||||
statusBar()->showMessage(message, 5000);
|
statusBar()->showMessage(message, 5000);
|
||||||
|
QTimer::singleShot(5000, [this]{this->statusBar()->setStyleSheet("");});
|
||||||
message = "<font color=\"" + colorName + "\" style=\"font-style: " + font + ";\" >" +
|
message = "<font color=\"" + colorName + "\" style=\"font-style: " + font + ";\" >" +
|
||||||
message + "</font><br>";
|
message + "</font><br>";
|
||||||
message = "[" + QTime::currentTime().toString() + "] " + message;
|
message = "[" + QTime::currentTime().toString() + "] " + message;
|
||||||
ui->consoleTextEdit->append(message);
|
ui->consoleTextEdit->append(message);
|
||||||
ui->consoleTextEdit->verticalScrollBar()->setValue(ui->consoleTextEdit->verticalScrollBar()->maximum());
|
ui->consoleTextEdit->verticalScrollBar()->setValue(ui->consoleTextEdit->verticalScrollBar()->maximum());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::information(QString text) {
|
void MainWindow::information(QString text) {
|
||||||
this->message("INFO: " + text, "");
|
statusBar()->setStyleSheet("color: blue");
|
||||||
|
this->message("INFO: " + text, "blue");
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::warning(QString text) {
|
void MainWindow::warning(QString text) {
|
||||||
this->message("WARNING: " + text, "blue");
|
statusBar()->setStyleSheet("color: orange");
|
||||||
|
this->message("WARNING: " + text, "orange");
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::error(QString text) {
|
void MainWindow::error(QString text) {
|
||||||
|
statusBar()->setStyleSheet("color: red");
|
||||||
this->message("ERROR: " + text, "red");
|
this->message("ERROR: " + text, "red");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2027,3 +2031,4 @@ void MainWindow::set_facegraph_mode_adapter(bool is_polyhedron)
|
||||||
else
|
else
|
||||||
set_face_graph_default_type(SURFACE_MESH);
|
set_face_graph_default_type(SURFACE_MESH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -349,7 +349,6 @@ protected Q_SLOTS:
|
||||||
void on_actionRecenterScene_triggered();
|
void on_actionRecenterScene_triggered();
|
||||||
//!Resizes the header of the scene view
|
//!Resizes the header of the scene view
|
||||||
void resetHeader();
|
void resetHeader();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QList<QAction*> createSubMenus(QList<QAction*>);
|
QList<QAction*> createSubMenus(QList<QAction*>);
|
||||||
/*! For each objects in the Geometric Objects view, loads the associated plugins.
|
/*! For each objects in the Geometric Objects view, loads the associated plugins.
|
||||||
|
|
|
||||||
|
|
@ -220,14 +220,16 @@ void Scene_points_with_normal_item_priv::initializeBuffers(CGAL::Three::Viewer_i
|
||||||
item->buffers[Edges_vertices].release();
|
item->buffers[Edges_vertices].release();
|
||||||
|
|
||||||
if (!(colors_points.empty()))
|
if (!(colors_points.empty()))
|
||||||
{
|
{
|
||||||
item->buffers[Points_colors].bind();
|
item->buffers[Points_colors].bind();
|
||||||
item->buffers[Points_colors].allocate (colors_points.data(),
|
item->buffers[Points_colors].allocate (colors_points.data(),
|
||||||
static_cast<int>(colors_points.size()*sizeof(CGAL_data_type)));
|
static_cast<int>(colors_points.size()*sizeof(CGAL_data_type)));
|
||||||
program->enableAttributeArray("colors");
|
program->enableAttributeArray("colors");
|
||||||
program->setAttributeBuffer("colors",CGAL_GL_data_type,0,3);
|
program->setAttributeBuffer("colors",CGAL_GL_data_type,0,3);
|
||||||
item->buffers[Points_colors].release();
|
item->buffers[Points_colors].release();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
program->disableAttributeArray("colors");
|
||||||
|
|
||||||
item->vaos[Edges]->release();
|
item->vaos[Edges]->release();
|
||||||
|
|
||||||
|
|
@ -253,22 +255,25 @@ void Scene_points_with_normal_item_priv::initializeBuffers(CGAL::Three::Viewer_i
|
||||||
program->setAttributeBuffer("vertex",CGAL_GL_data_type,0,3);
|
program->setAttributeBuffer("vertex",CGAL_GL_data_type,0,3);
|
||||||
item->buffers[Edges_vertices].release();
|
item->buffers[Edges_vertices].release();
|
||||||
if (!(colors_points.empty()))
|
if (!(colors_points.empty()))
|
||||||
{
|
{
|
||||||
item->buffers[Points_colors].bind();
|
item->buffers[Points_colors].bind();
|
||||||
item->buffers[Points_colors].allocate (colors_points.data(),
|
item->buffers[Points_colors].allocate (colors_points.data(),
|
||||||
static_cast<int>(colors_points.size()*sizeof(CGAL_data_type)));
|
static_cast<int>(colors_points.size()*sizeof(CGAL_data_type)));
|
||||||
program->enableAttributeArray("colors");
|
program->enableAttributeArray("colors");
|
||||||
program->setAttributeBuffer("colors",CGAL_GL_data_type,0,3,6*sizeof(CGAL_data_type));
|
program->setAttributeBuffer("colors",CGAL_GL_data_type,0,3,6*sizeof(CGAL_data_type));
|
||||||
item->buffers[Points_colors].release();
|
item->buffers[Points_colors].release();
|
||||||
colors_points.resize(0);
|
colors_points.resize(0);
|
||||||
std::vector<CGAL_data_type>(colors_points).swap(colors_points);
|
std::vector<CGAL_data_type>(colors_points).swap(colors_points);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
program->disableAttributeArray("colors");
|
||||||
item->vaos[ThePoints]->release();
|
item->vaos[ThePoints]->release();
|
||||||
program->release();
|
program->release();
|
||||||
|
|
||||||
if(item->has_normals())
|
if(item->has_normals())
|
||||||
{
|
{
|
||||||
program = item->getShaderProgram(Scene_points_with_normal_item::PROGRAM_WITH_LIGHT, viewer);
|
program = item->getShaderProgram(Scene_points_with_normal_item::PROGRAM_WITH_LIGHT, viewer);
|
||||||
|
program->bind();
|
||||||
item->vaos[TheShadedPoints]->bind();
|
item->vaos[TheShadedPoints]->bind();
|
||||||
item->buffers[Edges_vertices].bind();
|
item->buffers[Edges_vertices].bind();
|
||||||
program->enableAttributeArray("vertex");
|
program->enableAttributeArray("vertex");
|
||||||
|
|
@ -316,11 +321,13 @@ void Scene_points_with_normal_item_priv::initializeBuffers(CGAL::Three::Viewer_i
|
||||||
static_cast<int>(6*sizeof(CGAL_GL_data_type)));
|
static_cast<int>(6*sizeof(CGAL_GL_data_type)));
|
||||||
}
|
}
|
||||||
item->buffers[Edges_vertices].release();
|
item->buffers[Edges_vertices].release();
|
||||||
|
program->disableAttributeArray("colors");
|
||||||
item->vaos[Selected_points]->release();
|
item->vaos[Selected_points]->release();
|
||||||
program->release();
|
program->release();
|
||||||
if(item->has_normals())
|
if(item->has_normals())
|
||||||
{
|
{
|
||||||
program = item->getShaderProgram(Scene_points_with_normal_item::PROGRAM_WITH_LIGHT, viewer);
|
program = item->getShaderProgram(Scene_points_with_normal_item::PROGRAM_WITH_LIGHT, viewer);
|
||||||
|
program->bind();
|
||||||
item->vaos[Selected_shaded_points]->bind();
|
item->vaos[Selected_shaded_points]->bind();
|
||||||
item->buffers[Edges_vertices].bind();
|
item->buffers[Edges_vertices].bind();
|
||||||
program->enableAttributeArray("vertex");
|
program->enableAttributeArray("vertex");
|
||||||
|
|
@ -330,7 +337,7 @@ void Scene_points_with_normal_item_priv::initializeBuffers(CGAL::Three::Viewer_i
|
||||||
static_cast<int>(6*sizeof(CGAL_GL_data_type)));
|
static_cast<int>(6*sizeof(CGAL_GL_data_type)));
|
||||||
|
|
||||||
item->buffers[Edges_vertices].release();
|
item->buffers[Edges_vertices].release();
|
||||||
|
program->disableAttributeArray("colors");
|
||||||
item->buffers[Selected_points_normals].bind();
|
item->buffers[Selected_points_normals].bind();
|
||||||
item->buffers[Selected_points_normals].allocate(positions_selected_normals.data(),
|
item->buffers[Selected_points_normals].allocate(positions_selected_normals.data(),
|
||||||
static_cast<int>(positions_selected_normals.size()*sizeof(CGAL_data_type)));
|
static_cast<int>(positions_selected_normals.size()*sizeof(CGAL_data_type)));
|
||||||
|
|
@ -750,8 +757,8 @@ void Scene_points_with_normal_item::drawPoints(CGAL::Three::Viewer_interface* vi
|
||||||
viewer->glPointSize(d->point_Slider->value());
|
viewer->glPointSize(d->point_Slider->value());
|
||||||
double ratio_displayed = 1.0;
|
double ratio_displayed = 1.0;
|
||||||
if ((viewer->inFastDrawing () || d->isPointSliderMoving())
|
if ((viewer->inFastDrawing () || d->isPointSliderMoving())
|
||||||
&&((d->nb_points + d->nb_selected_points)/3 > limit_fast_drawing)) // arbitrary large value
|
&&((d->nb_points )/3 > limit_fast_drawing)) // arbitrary large value
|
||||||
ratio_displayed = 3 * limit_fast_drawing / (double)(d->nb_points + d->nb_selected_points);
|
ratio_displayed = 3 * limit_fast_drawing / (double)(d->nb_points);
|
||||||
|
|
||||||
// POINTS
|
// POINTS
|
||||||
if(has_normals() && renderingMode() == ShadedPoints)
|
if(has_normals() && renderingMode() == ShadedPoints)
|
||||||
|
|
@ -770,7 +777,7 @@ void Scene_points_with_normal_item::drawPoints(CGAL::Three::Viewer_interface* vi
|
||||||
if (!(d->m_points->has_colors()) || renderingMode() == ShadedPoints)
|
if (!(d->m_points->has_colors()) || renderingMode() == ShadedPoints)
|
||||||
d->program->setAttributeValue("colors", this->color());
|
d->program->setAttributeValue("colors", this->color());
|
||||||
viewer->glDrawArrays(GL_POINTS, 0,
|
viewer->glDrawArrays(GL_POINTS, 0,
|
||||||
static_cast<GLsizei>(((std::size_t)(ratio_displayed * d->nb_points)/3)));
|
static_cast<GLsizei>(((std::size_t)(ratio_displayed * (d->nb_points - d->nb_selected_points))/3)));
|
||||||
|
|
||||||
if(has_normals() && renderingMode() == ShadedPoints)
|
if(has_normals() && renderingMode() == ShadedPoints)
|
||||||
vaos[Scene_points_with_normal_item_priv::TheShadedPoints]->release();
|
vaos[Scene_points_with_normal_item_priv::TheShadedPoints]->release();
|
||||||
|
|
@ -778,9 +785,7 @@ void Scene_points_with_normal_item::drawPoints(CGAL::Three::Viewer_interface* vi
|
||||||
vaos[Scene_points_with_normal_item_priv::ThePoints]->release();
|
vaos[Scene_points_with_normal_item_priv::ThePoints]->release();
|
||||||
d->program->release();
|
d->program->release();
|
||||||
|
|
||||||
|
|
||||||
// SELECTED POINTS
|
// SELECTED POINTS
|
||||||
vaos[Scene_points_with_normal_item_priv::Selected_points]->bind();
|
|
||||||
if(has_normals() && renderingMode() == ShadedPoints)
|
if(has_normals() && renderingMode() == ShadedPoints)
|
||||||
{
|
{
|
||||||
vaos[Scene_points_with_normal_item_priv::Selected_shaded_points]->bind();
|
vaos[Scene_points_with_normal_item_priv::Selected_shaded_points]->bind();
|
||||||
|
|
@ -794,12 +799,12 @@ void Scene_points_with_normal_item::drawPoints(CGAL::Three::Viewer_interface* vi
|
||||||
attribBuffers(viewer,PROGRAM_NO_SELECTION);
|
attribBuffers(viewer,PROGRAM_NO_SELECTION);
|
||||||
}
|
}
|
||||||
d->program->bind();
|
d->program->bind();
|
||||||
d->program->setAttributeValue("colors", QColor(255,0,0));
|
d->program->setAttributeValue("colors", QColor(Qt::red));
|
||||||
viewer->glDrawArrays(GL_POINTS, 0,
|
viewer->glDrawArrays(GL_POINTS, 0,
|
||||||
static_cast<GLsizei>(((std::size_t)(ratio_displayed * d->nb_selected_points)/3)));
|
static_cast<GLsizei>(((std::size_t)(ratio_displayed * d->nb_selected_points)/3)));
|
||||||
|
|
||||||
if(has_normals() && renderingMode() == ShadedPoints)
|
if(has_normals() && renderingMode() == ShadedPoints)
|
||||||
vaos[Scene_points_with_normal_item_priv::Selected_shaded_points]->bind();
|
vaos[Scene_points_with_normal_item_priv::Selected_shaded_points]->release();
|
||||||
else
|
else
|
||||||
vaos[Scene_points_with_normal_item_priv::Selected_points]->release();
|
vaos[Scene_points_with_normal_item_priv::Selected_points]->release();
|
||||||
d->program->release();
|
d->program->release();
|
||||||
|
|
@ -885,7 +890,7 @@ QMenu* Scene_points_with_normal_item::contextMenu()
|
||||||
{
|
{
|
||||||
QMenu *container = new QMenu(tr("Normals Length"));
|
QMenu *container = new QMenu(tr("Normals Length"));
|
||||||
QWidgetAction *sliderAction = new QWidgetAction(0);
|
QWidgetAction *sliderAction = new QWidgetAction(0);
|
||||||
if((d->nb_points + d->nb_selected_points)/3 <= limit_fast_drawing)
|
if((d->nb_points)/3 <= limit_fast_drawing)
|
||||||
{
|
{
|
||||||
connect(d->normal_Slider, &QSlider::valueChanged, this, &Scene_points_with_normal_item::invalidateOpenGLBuffers);
|
connect(d->normal_Slider, &QSlider::valueChanged, this, &Scene_points_with_normal_item::invalidateOpenGLBuffers);
|
||||||
connect(d->normal_Slider, &QSlider::valueChanged, this, &Scene_points_with_normal_item::itemChanged);
|
connect(d->normal_Slider, &QSlider::valueChanged, this, &Scene_points_with_normal_item::itemChanged);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
template<class AK>
|
template<class AK>
|
||||||
void test_get_arithmetic_kernel(){
|
void test_get_arithmetic_kernel(){
|
||||||
typedef typename AK::Integer Integer;
|
CGAL_assertion_code(typedef typename AK::Integer Integer);
|
||||||
{
|
{
|
||||||
CGAL_assertion_code(typedef CGAL::Polynomial<Integer> POLY;)
|
CGAL_assertion_code(typedef CGAL::Polynomial<Integer> POLY;)
|
||||||
CGAL_assertion_code(typedef typename CGAL::Get_arithmetic_kernel<POLY>::Arithmetic_kernel AK_;)
|
CGAL_assertion_code(typedef typename CGAL::Get_arithmetic_kernel<POLY>::Arithmetic_kernel AK_;)
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ Hilbert mapping
|
||||||
|
|
||||||
Now given a set of 2D points, they can be sorted in the order they have on such
|
Now given a set of 2D points, they can be sorted in the order they have on such
|
||||||
a space filling curve. Note that at each step, we split a square exactly at its center; we call this
|
a space filling curve. Note that at each step, we split a square exactly at its center; we call this
|
||||||
subdivision policy: \f$middle\f$ policy (see \cgalFigureRef{Spatial_sorting_fig_Hilbert_median}).
|
subdivision policy: <i>middle</i> policy (see \cgalFigureRef{Spatial_sorting_fig_Hilbert_middle}).
|
||||||
|
|
||||||
\cgalFigureBegin{Spatial_sorting_fig_Hilbert_middle,Hilbert-middle.png}
|
\cgalFigureBegin{Spatial_sorting_fig_Hilbert_middle,Hilbert-middle.png}
|
||||||
Hilbert sort with middle policy
|
Hilbert sort with middle policy
|
||||||
|
|
@ -75,7 +75,7 @@ as above, we subdivide it
|
||||||
by splitting at the median point (in \f$ x\f$ or \f$ y\f$ directions alternating),
|
by splitting at the median point (in \f$ x\f$ or \f$ y\f$ directions alternating),
|
||||||
we construct a 2-d tree adapted to the point set. This tree can be visited in a
|
we construct a 2-d tree adapted to the point set. This tree can be visited in a
|
||||||
similar manner and we get also a suitable ordering of the points; we call this
|
similar manner and we get also a suitable ordering of the points; we call this
|
||||||
subdivision policy: \f$median\f$ policy (see \cgalFigureRef{Spatial_sorting_fig_Hilbert_median}).
|
subdivision policy: <i>median</i> policy (see \cgalFigureRef{Spatial_sorting_fig_Hilbert_median}).
|
||||||
|
|
||||||
\cgalFigureBegin{Spatial_sorting_fig_Hilbert_median,Hilbert-median.png}
|
\cgalFigureBegin{Spatial_sorting_fig_Hilbert_median,Hilbert-median.png}
|
||||||
Hilbert sort with median policy
|
Hilbert sort with median policy
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue