mirror of https://github.com/CGAL/cgal
Merge pull request #1029 from maxGimeno/Add_name_to_PS_and_Polylines-GF
Polyline demo : names for items created on the fly
This commit is contained in:
commit
b600f9b30a
|
|
@ -42,6 +42,27 @@ p, li { white-space: pre-wrap; }
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Item's name:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="name_lineEdit">
|
||||||
|
<property name="autoFillBackground">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="sizeConstraint">
|
<property name="sizeConstraint">
|
||||||
|
|
|
||||||
|
|
@ -44,10 +44,40 @@ p, li { white-space: pre-wrap; }
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="placeholderText">
|
<property name="placeholderText">
|
||||||
<string notr="true">Polyline format: Ax Ay A3 Bx By Bz ... Zx Zy Zz </string>
|
<string notr="true">Polyline format: Ax Ay Az Bx By Bz ... Zx Zy Zz </string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Item's name :</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="name_lineEdit">
|
||||||
|
<property name="autoFillBackground">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="clearButtonEnabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="sizeConstraint">
|
<property name="sizeConstraint">
|
||||||
|
|
|
||||||
|
|
@ -254,8 +254,15 @@ void Polyhedron_demo_polylines_io_plugin::addPolylineButton_clicked()
|
||||||
add_polydiagui->textEdit->clear();
|
add_polydiagui->textEdit->clear();
|
||||||
Scene_polylines_item* item = new Scene_polylines_item;
|
Scene_polylines_item* item = new Scene_polylines_item;
|
||||||
item->polylines = polylines;
|
item->polylines = polylines;
|
||||||
nb_of_polylines++;
|
QString name;
|
||||||
QString name = QString("Polyline #%1").arg(QString::number(nb_of_polylines));
|
if(add_polydiagui->name_lineEdit->text() != "")
|
||||||
|
name = add_polydiagui->name_lineEdit->text();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nb_of_polylines++;
|
||||||
|
name = QString("Polyline #%1").arg(QString::number(nb_of_polylines));
|
||||||
|
}
|
||||||
|
add_polydiagui->name_lineEdit->clear();
|
||||||
item->setName(name);
|
item->setName(name);
|
||||||
item->setColor(Qt::black);
|
item->setColor(Qt::black);
|
||||||
item->setProperty("polylines metadata", polylines_metadata);
|
item->setProperty("polylines metadata", polylines_metadata);
|
||||||
|
|
|
||||||
|
|
@ -206,8 +206,14 @@ void Polyhedron_demo_xyz_plugin::addPointSetButton_clicked()
|
||||||
{
|
{
|
||||||
add_pointsetdiagui->textEdit->clear();
|
add_pointsetdiagui->textEdit->clear();
|
||||||
item->point_set()->unselect_all();
|
item->point_set()->unselect_all();
|
||||||
nb_of_point_set++;
|
QString name;
|
||||||
QString name = QString("Point_set #%1").arg(QString::number(nb_of_point_set));
|
if(add_pointsetdiagui->name_lineEdit->text()!="")
|
||||||
|
name = add_pointsetdiagui->name_lineEdit->text();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nb_of_point_set++;
|
||||||
|
name = QString("Point_set #%1").arg(QString::number(nb_of_point_set));
|
||||||
|
}
|
||||||
item->setName(name);
|
item->setName(name);
|
||||||
item->setColor(Qt::black);
|
item->setColor(Qt::black);
|
||||||
item->invalidateOpenGLBuffers();
|
item->invalidateOpenGLBuffers();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue