Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LO21_Pin_Noir_Boucher_Bouri_Detree
CellulutLO21
Commits
7a041595
Commit
7a041595
authored
Jun 05, 2021
by
Yann Boucher
Browse files
Merge branch 'master' of
https://gitlab.utc.fr/lo21_pin_noir_boucher_bouri_detree/cellulutlo21
parents
dc4a5568
fb263da3
Pipeline
#79243
failed with stage
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
forms/neighborhoodDialog.ui
0 → 100644
View file @
7a041595
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
NeighborhoodDialog
</class>
<widget
class=
"QDialog"
name=
"NeighborhoodDialog"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
894
</width>
<height>
441
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Dialog
</string>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item>
<layout
class=
"QHBoxLayout"
name=
"mainLayout"
stretch=
"1,0"
>
<item>
<widget
class=
"QWidget"
name=
"grid"
native=
"true"
>
<property
name=
"enabled"
>
<bool>
true
</bool>
</property>
<property
name=
"minimumSize"
>
<size>
<width>
100
</width>
<height>
100
</height>
</size>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout_3"
>
<item
row=
"0"
column=
"0"
>
<widget
class=
"GridView"
name=
"grid_view"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Preferred"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"frameShape"
>
<enum>
QFrame::StyledPanel
</enum>
</property>
<property
name=
"frameShadow"
>
<enum>
QFrame::Raised
</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout
class=
"QVBoxLayout"
name=
"settingsLayout_2"
>
<property
name=
"sizeConstraint"
>
<enum>
QLayout::SetDefaultConstraint
</enum>
</property>
<item>
<layout
class=
"QFormLayout"
name=
"gridDimLayout_2"
>
<property
name=
"fieldGrowthPolicy"
>
<enum>
QFormLayout::FieldsStayAtSizeHint
</enum>
</property>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"widthLabel_2"
>
<property
name=
"text"
>
<string>
Width :
</string>
</property>
<property
name=
"buddy"
>
<cstring>
widthSpinBox
</cstring>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QSpinBox"
name=
"widthSpinBox_2"
>
<property
name=
"minimum"
>
<number>
1
</number>
</property>
<property
name=
"maximum"
>
<number>
9999
</number>
</property>
<property
name=
"value"
>
<number>
10
</number>
</property>
</widget>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLabel"
name=
"heightLabel_2"
>
<property
name=
"text"
>
<string>
Height :
</string>
</property>
<property
name=
"buddy"
>
<cstring>
heightSpinBox
</cstring>
</property>
</widget>
</item>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QSpinBox"
name=
"heightSpinBox_2"
>
<property
name=
"minimum"
>
<number>
1
</number>
</property>
<property
name=
"maximum"
>
<number>
9999
</number>
</property>
<property
name=
"value"
>
<number>
10
</number>
</property>
</widget>
</item>
<item
row=
"2"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"validateGridDim_2"
>
<property
name=
"enabled"
>
<bool>
false
</bool>
</property>
<property
name=
"text"
>
<string>
OK
</string>
</property>
</widget>
</item>
<item
row=
"3"
column=
"1"
>
<widget
class=
"QDialogButtonBox"
name=
"buttonBox"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"standardButtons"
>
<set>
QDialogButtonBox::Cancel|QDialogButtonBox::Ok
</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>
GridView
</class>
<extends>
QFrame
</extends>
<header>
gridview.hpp
</header>
<container>
1
</container>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>
buttonBox
</sender>
<signal>
accepted()
</signal>
<receiver>
NeighborhoodDialog
</receiver>
<slot>
accept()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
248
</x>
<y>
254
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
157
</x>
<y>
274
</y>
</hint>
</hints>
</connection>
<connection>
<sender>
buttonBox
</sender>
<signal>
rejected()
</signal>
<receiver>
NeighborhoodDialog
</receiver>
<slot>
reject()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
316
</x>
<y>
260
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
286
</x>
<y>
274
</y>
</hint>
</hints>
</connection>
</connections>
</ui>
forms/neighborhoodWidget.ui
View file @
7a041595
...
@@ -116,15 +116,9 @@
...
@@ -116,15 +116,9 @@
</layout>
</layout>
</item>
</item>
<item>
<item>
<widget
class=
"QPushButton"
name=
"validationButton"
>
<widget
class=
"QDialogButtonBox"
name=
"buttonBox"
>
<property
name=
"sizePolicy"
>
<property
name=
"standardButtons"
>
<sizepolicy
hsizetype=
"Fixed"
vsizetype=
"Fixed"
>
<set>
QDialogButtonBox::Cancel|QDialogButtonBox::Ok
</set>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"text"
>
<string>
Validate
</string>
</property>
</property>
</widget>
</widget>
</item>
</item>
...
...
include/neighborhood
Widget
.hpp
→
include/neighborhood
Dialog
.hpp
View file @
7a041595
#ifndef NEIGHBORHOOD
WIDGET
_HPP
#ifndef NEIGHBORHOOD
DIALOG
_HPP
#define NEIGHBORHOOD
WIDGET
_HPP
#define NEIGHBORHOOD
DIALOG
_HPP
#include
<QDialog>
#include
<QDialog>
#include
"neighborhood.hpp"
#include
"neighborhood.hpp"
#include
"gridview.hpp"
#include
"gridview.hpp"
namespace
Ui
{
namespace
Ui
{
class
Neighborhood
Widget
;
class
Neighborhood
Dialog
;
}
}
//! \brief Fenêtre de dialogue permettant de choisir les voisins d'une cellule de manière graphique.
//! \brief Fenêtre de dialogue permettant de choisir les voisins d'une cellule de manière graphique.
class
Neighborhood
Widget
:
public
Q
Widget
class
Neighborhood
Dialog
:
public
Q
Dialog
{
{
Q_OBJECT
Q_OBJECT
Coord
currentPoint
;
Coord
currentPoint
;
public:
public:
explicit
Neighborhood
Widget
(
QWidget
*
parent
=
nullptr
);
explicit
Neighborhood
Dialog
(
QWidget
*
parent
=
nullptr
);
~
Neighborhood
Widget
();
~
Neighborhood
Dialog
();
//! \brief Retourne le voisinage
//! \brief Retourne le voisinage
Neighborhood
*
getVoisinage
()
const
;
Neighborhood
*
getVoisinage
()
const
;
QPushButton
*
getValidateButton
()
const
;
GridView
&
getGridView
()
const
;
GridView
&
getGridView
()
const
;
public
slots
:
public
slots
:
Neighborhood
&
getNeighborhood
()
const
;
Neighborhood
&
getNeighborhood
()
const
;
protected:
void
done
(
int
r
);
private
slots
:
private
slots
:
private:
private:
Ui
::
Neighborhood
Widget
*
ui
;
Ui
::
Neighborhood
Dialog
*
ui
;
};
};
#endif // NEIGHBORHOOD
WIDGET
_HPP
#endif // NEIGHBORHOOD
DIALOG
_HPP
include/property.hpp
View file @
7a041595
...
@@ -33,7 +33,7 @@ Fichier définissant la classe Property représentant une propriété chargable,
...
@@ -33,7 +33,7 @@ Fichier définissant la classe Property représentant une propriété chargable,
#include
"coord.hpp"
#include
"coord.hpp"
#include
"neighborhood.hpp"
#include
"neighborhood.hpp"
#include
"neighborhood
Widget
.hpp"
#include
"neighborhood
Dialog
.hpp"
struct
StringProperty
;
struct
StringProperty
;
struct
IntegerProperty
;
struct
IntegerProperty
;
...
...
src/interface.cpp
View file @
7a041595
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
#include
"propertyvisitors.hpp"
#include
"propertyvisitors.hpp"
#include
"modelloadingdialog.hpp"
#include
"modelloadingdialog.hpp"
#include
"configurationloadingdialog.hpp"
#include
"configurationloadingdialog.hpp"
#include
"neighborhood
Widget
.hpp"
#include
"neighborhood
Dialog
.hpp"
#include
<QJsonArray>
#include
<QJsonArray>
#include
<QDate>
#include
<QDate>
...
...
src/neighborhood
Widget
.cpp
→
src/neighborhood
Dialog
.cpp
View file @
7a041595
#include
"neighborhood
Widget
.hpp"
#include
"neighborhood
Dialog
.hpp"
#include
"ui_neighborhood
Widget
.h"
#include
"ui_neighborhood
Dialog
.h"
#include
<QDate>
#include
<QDate>
#include
<QMessageBox>
#include
<QMessageBox>
Neighborhood
Widget
::
Neighborhood
Widget
(
QWidget
*
parent
)
:
Neighborhood
Dialog
::
Neighborhood
Dialog
(
QWidget
*
parent
)
:
Q
Widget
(
parent
),
ui
(
new
Ui
::
Neighborhood
Widget
)
Q
Dialog
(
parent
),
ui
(
new
Ui
::
Neighborhood
Dialog
)
{
{
ui
->
setupUi
(
this
);
ui
->
setupUi
(
this
);
GridView
&
gv
=
*
(
*
ui
).
grid_view
;
GridView
&
gv
=
*
(
*
ui
).
grid_view
;
...
@@ -33,25 +33,34 @@ NeighborhoodWidget::NeighborhoodWidget(QWidget *parent) :
...
@@ -33,25 +33,34 @@ NeighborhoodWidget::NeighborhoodWidget(QWidget *parent) :
// TODO le clic sur la cellule centrale
// TODO le clic sur la cellule centrale
}
}
Neighborhood
Widget
::~
Neighborhood
Widget
()
Neighborhood
Dialog
::~
Neighborhood
Dialog
()
{
{
delete
ui
;
delete
ui
;
}
}
Neighborhood
*
NeighborhoodWidget
::
getVoisinage
()
const
void
NeighborhoodDialog
::
done
(
int
r
)
{
{
return
nullptr
;
if
(
QDialog
::
Accepted
==
r
)
// ok was pressed
{
}
else
// cancel, close or exc was pressed
{
QDialog
::
done
(
r
);
return
;
}
}
}
QPushButton
*
NeighborhoodWidget
::
getValidateButton
()
const
{
Neighborhood
*
NeighborhoodDialog
::
getVoisinage
()
const
return
ui
->
validationButton
;
{
return
nullptr
;
}
}
GridView
&
Neighborhood
Widget
::
getGridView
()
const
{
GridView
&
Neighborhood
Dialog
::
getGridView
()
const
{
return
*
(
ui
->
grid_view
);
return
*
(
ui
->
grid_view
);
}
}
Neighborhood
&
Neighborhood
Widget
::
getNeighborhood
()
const
Neighborhood
&
Neighborhood
Dialog
::
getNeighborhood
()
const
{
{
Neighborhood
*
newNeighborhood
=
new
Neighborhood
;
Neighborhood
*
newNeighborhood
=
new
Neighborhood
;
Grid
currentGrid
=
ui
->
grid_view
->
get_grid
();
Grid
currentGrid
=
ui
->
grid_view
->
get_grid
();
...
...
src/src.pro
View file @
7a041595
...
@@ -18,7 +18,7 @@ SOURCES += \
...
@@ -18,7 +18,7 @@ SOURCES += \
neighborhood_rules
/
arbitraryneighborhoodrule
.
cpp
\
neighborhood_rules
/
arbitraryneighborhoodrule
.
cpp
\
automaton
.
cpp
\
automaton
.
cpp
\
gridview
.
cpp
\
gridview
.
cpp
\
neighborhood
Widget
.
cpp
\
neighborhood
Dialog
.
cpp
\
savingdialog
.
cpp
\
savingdialog
.
cpp
\
transition_rules
/
circulartransition
.
cpp
\
transition_rules
/
circulartransition
.
cpp
\
transition_rules
/
lifegametransition
.
cpp
\
transition_rules
/
lifegametransition
.
cpp
\
...
@@ -71,7 +71,7 @@ HEADERS += \
...
@@ -71,7 +71,7 @@ HEADERS += \
..
/
include
/
transition_rules
/
circulartransition
.
hpp
\
..
/
include
/
transition_rules
/
circulartransition
.
hpp
\
..
/
include
/
transition_rules
/
totalistictransition
.
hpp
\
..
/
include
/
transition_rules
/
totalistictransition
.
hpp
\
..
/
include
/
modelloadingdialog
.
hpp
\
..
/
include
/
modelloadingdialog
.
hpp
\
..
/
include
/
neighborhood
Widget
.
hpp
\
..
/
include
/
neighborhood
Dialog
.
hpp
\
..
/
include
/
configurationloadingdialog
.
hpp
\
..
/
include
/
configurationloadingdialog
.
hpp
\
..
/
include
/
transition_rules
/
nonisotropictransition
.
hpp
..
/
include
/
transition_rules
/
nonisotropictransition
.
hpp
...
@@ -82,6 +82,7 @@ FORMS += \
...
@@ -82,6 +82,7 @@ FORMS += \
..
/
forms
/
structurelibraryview
.
ui
\
..
/
forms
/
structurelibraryview
.
ui
\
..
/
forms
/
modelloadingdialog
.
ui
\
..
/
forms
/
modelloadingdialog
.
ui
\
..
/
forms
/
neighborhoodWidget
.
ui
\
..
/
forms
/
neighborhoodWidget
.
ui
\
..
/
forms
/
neighborhoodDialog
.
ui
\
..
/
forms
/
configurationloadingdialog
.
ui
..
/
forms
/
configurationloadingdialog
.
ui
...
...
src/uibuildervisitor.cpp
View file @
7a041595
#include
"propertyvisitors.hpp"
#include
"propertyvisitors.hpp"
#include
"neighborhood
Widget
.hpp"
#include
"neighborhood
Dialog
.hpp"
#include
<QGroupBox>
#include
<QGroupBox>
#include
<QPushButton>
#include
<QPushButton>
...
@@ -186,17 +186,17 @@ void UIBuilderVisitor::visit(PropertyList &list)
...
@@ -186,17 +186,17 @@ void UIBuilderVisitor::visit(PropertyList &list)
}
}
});
});
QObject
::
connect
(
widgetGridNeighborhoodButton
,
&
QPushButton
::
pressed
,
[
&
list
]()
{
QObject
::
connect
(
widgetGridNeighborhoodButton
,
&
QPushButton
::
pressed
,
[
&
list
]()
{
Neighborhood
Widget
*
nw
=
new
Neighborhood
Widget
;
Neighborhood
Dialog
*
nw
=
new
Neighborhood
Dialog
;
nw
->
show
();
nw
->
exec
();
QPushButton
*
validateButton
=
nw
->
getValidateButton
();
/*
QObject::connect(validateButton, &QPushButton::pressed, [&list, &nw] () {
QObject::connect(validateButton, &QPushButton::pressed, [&list, &nw] () {
list.clear();
list.clear();
Neighborhood newNeighborhood = nw->getNeighborhood();
Neighborhood newNeighborhood = nw->getNeighborhood();
// TODO a finir
// TODO a finir
list.push_back();
list.push_back();
});
});
*/
QObject
::
connect
(
validateButton
,
&
QPushButton
::
pressed
,
nw
,
&
Q
Widget
::
clos
e
);
//
QObject::connect(validateButton, &QPushButton::pressed, nw, &Q
Dialog::don
e );
});
});
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment