mirror of https://github.com/CGAL/cgal
add do_not_triangulate_faces option in the plugin + fixes
This commit is contained in:
parent
546f823b48
commit
9f98b28eff
|
|
@ -122,7 +122,8 @@ public :
|
||||||
|
|
||||||
connect(ui_widget.clip_radioButton, &QRadioButton::toggled,
|
connect(ui_widget.clip_radioButton, &QRadioButton::toggled,
|
||||||
[this](bool b){
|
[this](bool b){
|
||||||
ui_widget.close_checkBox->setEnabled(!ui_widget.do_not_modify_CheckBox->isChecked() &&b);
|
ui_widget.close_checkBox->setEnabled(!ui_widget.do_not_modify_CheckBox->isChecked() && b);
|
||||||
|
ui_widget.coplanarCheckBox->setEnabled(ui_widget.clip_radioButton->isChecked());
|
||||||
});
|
});
|
||||||
connect(actionClipPolyhedra , SIGNAL(triggered()),
|
connect(actionClipPolyhedra , SIGNAL(triggered()),
|
||||||
this, SLOT(pop_widget()));
|
this, SLOT(pop_widget()));
|
||||||
|
|
@ -235,7 +236,7 @@ public Q_SLOTS:
|
||||||
for(int id : scene->selectionIndices())
|
for(int id : scene->selectionIndices())
|
||||||
{
|
{
|
||||||
Scene_surface_mesh_item *sm_item = qobject_cast<Scene_surface_mesh_item*>(scene->item(id));
|
Scene_surface_mesh_item *sm_item = qobject_cast<Scene_surface_mesh_item*>(scene->item(id));
|
||||||
if(sm_item && CGAL::is_triangle_mesh(*sm_item->polyhedron()))
|
if(sm_item)
|
||||||
{
|
{
|
||||||
if(!ui_widget.do_not_modify_CheckBox->isChecked() && CGAL::Polygon_mesh_processing::does_self_intersect(*sm_item->face_graph()))
|
if(!ui_widget.do_not_modify_CheckBox->isChecked() && CGAL::Polygon_mesh_processing::does_self_intersect(*sm_item->face_graph()))
|
||||||
CGAL::Three::Three::warning(tr("%1 has not been clipped because it has self intersections.").arg(sm_item->name()));
|
CGAL::Three::Three::warning(tr("%1 has not been clipped because it has self intersections.").arg(sm_item->name()));
|
||||||
|
|
@ -255,10 +256,10 @@ public Q_SLOTS:
|
||||||
{
|
{
|
||||||
CGAL::Polygon_mesh_processing::clip(*(sm_item->face_graph()),
|
CGAL::Polygon_mesh_processing::clip(*(sm_item->face_graph()),
|
||||||
plane->plane(),
|
plane->plane(),
|
||||||
CGAL::parameters::clip_volume(
|
CGAL::parameters::clip_volume(ui_widget.close_checkBox->isChecked())
|
||||||
ui_widget.close_checkBox->isChecked()).
|
.do_not_triangulate_faces(!ui_widget.triangulated_checkBox->isChecked())
|
||||||
throw_on_self_intersection(true).
|
.throw_on_self_intersection(true)
|
||||||
use_compact_clipper(
|
.use_compact_clipper(
|
||||||
!ui_widget.coplanarCheckBox->isChecked())
|
!ui_widget.coplanarCheckBox->isChecked())
|
||||||
.allow_self_intersections(ui_widget.do_not_modify_CheckBox->isChecked()));
|
.allow_self_intersections(ui_widget.do_not_modify_CheckBox->isChecked()));
|
||||||
}
|
}
|
||||||
|
|
@ -280,6 +281,7 @@ public Q_SLOTS:
|
||||||
CGAL::Polygon_mesh_processing::split(*(sm_item->face_graph()),
|
CGAL::Polygon_mesh_processing::split(*(sm_item->face_graph()),
|
||||||
plane->plane(),
|
plane->plane(),
|
||||||
CGAL::parameters::throw_on_self_intersection(true)
|
CGAL::parameters::throw_on_self_intersection(true)
|
||||||
|
.do_not_triangulate_faces(!ui_widget.triangulated_checkBox->isChecked())
|
||||||
.allow_self_intersections(ui_widget.do_not_modify_CheckBox->isChecked()));
|
.allow_self_intersections(ui_widget.do_not_modify_CheckBox->isChecked()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>386</width>
|
<width>326</width>
|
||||||
<height>231</height>
|
<height>358</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
|
@ -56,21 +56,10 @@
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout"/>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<spacer name="verticalSpacer_2">
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="title">
|
|
||||||
<string>Behavior</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,0,0" columnstretch="1,0">
|
|
||||||
<item row="6" column="1">
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -82,7 +71,71 @@
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Behavior</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="clip_radioButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Clip</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="split_radioButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Split</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="close_checkBox">
|
||||||
|
<property name="layoutDirection">
|
||||||
|
<enum>Qt::LeftToRight</enum>
|
||||||
|
</property>
|
||||||
|
<property name="autoFillBackground">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Keep Closed</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="triangulated_checkBox">
|
||||||
|
<property name="layoutDirection">
|
||||||
|
<enum>Qt::LeftToRight</enum>
|
||||||
|
</property>
|
||||||
|
<property name="autoFillBackground">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Keep Triangulated</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
<widget class="QCheckBox" name="coplanarCheckBox">
|
<widget class="QCheckBox" name="coplanarCheckBox">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
|
@ -99,37 +152,7 @@ Only available in Split mode.</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item>
|
||||||
<widget class="QCheckBox" name="close_checkBox">
|
|
||||||
<property name="layoutDirection">
|
|
||||||
<enum>Qt::LeftToRight</enum>
|
|
||||||
</property>
|
|
||||||
<property name="autoFillBackground">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>&Keep Closed</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QRadioButton" name="split_radioButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Split</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QRadioButton" name="clip_radioButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Clip</string>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="0">
|
|
||||||
<widget class="QCheckBox" name="do_not_modify_CheckBox">
|
<widget class="QCheckBox" name="do_not_modify_CheckBox">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Allow the use of a self-intersected clipper, but prevent the closing of the result.</string>
|
<string>Allow the use of a self-intersected clipper, but prevent the closing of the result.</string>
|
||||||
|
|
@ -139,20 +162,11 @@ Only available in Split mode.</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
</layout>
|
||||||
<widget class="QPushButton" name="flip_Button">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Flip plane</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
<item>
|
||||||
<widget class="QPushButton" name="clipButton">
|
<widget class="QPushButton" name="clipButton">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||||
|
|
@ -165,13 +179,23 @@ Only available in Split mode.</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
<item>
|
||||||
|
<widget class="QPushButton" name="flip_Button">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Flip plane</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer_2">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -185,6 +209,9 @@ Only available in Split mode.</string>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../../CGALlab.qrc"/>
|
<include location="../../CGALlab.qrc"/>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue