mirror of https://github.com/CGAL/cgal
made multi line input and added tetrahedron generation
This commit is contained in:
parent
455f625e8a
commit
74a4bef885
|
|
@ -634,18 +634,18 @@ void Basic_generator_plugin::generateTetrahedron()
|
|||
}
|
||||
else
|
||||
{
|
||||
QString text = dock_widget->extremaEdit_2->text();
|
||||
QString text = dock_widget->point_textEdit_2->toPlainText();
|
||||
QStringList list = text.split(QRegExp("\\s+"), CGAL_QT_SKIP_EMPTY_PARTS);
|
||||
if (list.isEmpty()) return;
|
||||
if (list.size() != 3) {
|
||||
if (list.size() != 12) {
|
||||
QMessageBox* msgBox = new QMessageBox;
|
||||
msgBox->setWindowTitle("Error");
|
||||
msgBox->setText("ERROR : Input should consists of 3 doubles.");
|
||||
msgBox->setText("ERROR : Input should consists of 12 doubles.");
|
||||
msgBox->exec();
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
for (int i = 0; i < 12; ++i)
|
||||
{
|
||||
bool ok;
|
||||
list.at(i).toDouble(&ok);
|
||||
|
|
@ -658,8 +658,12 @@ void Basic_generator_plugin::generateTetrahedron()
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CGAL::make_tetrahedron(
|
||||
Point(list.at(0).toDouble(), list.at(1).toDouble(), list.at(2).toDouble()),
|
||||
Point(list.at(3).toDouble(), list.at(4).toDouble(), list.at(5).toDouble()),
|
||||
Point(list.at(6).toDouble(), list.at(7).toDouble(), list.at(8).toDouble()),
|
||||
Point(list.at(9).toDouble(), list.at(10).toDouble(), list.at(11).toDouble()),
|
||||
tetrahedron);
|
||||
}
|
||||
|
||||
Facegraph_item* tet_item = new Facegraph_item(tetrahedron);
|
||||
|
|
|
|||
|
|
@ -856,35 +856,38 @@ QGroupBox::title {
|
|||
</widget>
|
||||
<widget class="QWidget" name="tetraTab">
|
||||
<attribute name="title">
|
||||
<string>Bbox</string>
|
||||
<string>Multi-line</string>
|
||||
</attribute>
|
||||
<widget class="QLabel" name="label_33">
|
||||
<widget class="QTextEdit" name="point_textEdit_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>8</x>
|
||||
<y>9</y>
|
||||
<width>46</width>
|
||||
<height>207</height>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>451</width>
|
||||
<height>201</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Coordinates of the minimum and the maximum of the Bbox.</p></body></html></string>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Extrema:</string>
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
hr { height: 1px; border-width: 0; }
|
||||
li.unchecked::marker { content: "\2610"; }
|
||||
li.checked::marker { content: "\2612"; }
|
||||
</style></head><body style=" font-family:'Segoe UI'; font-size:9pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:10pt;"><br /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="extremaEdit_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>100</y>
|
||||
<width>401</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
<property name="overwriteMode">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>1.0 1.0 1.0</string>
|
||||
<property name="placeholderText">
|
||||
<string notr="true">Point format: P0x P0y P0z P1x P1y P1z P2x P2y P2z P3x P3y P3z </string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
|
|
|
|||
Loading…
Reference in New Issue