Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CellulutLO21
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LO21_Pin_Noir_Boucher_Bouri_Detree
CellulutLO21
Commits
16baf339
Unverified
Commit
16baf339
authored
3 years ago
by
Merwane Bouri
Browse files
Options
Downloads
Patches
Plain Diff
Ajout du bouton reset grid (la satisfaction quand ça marche :) )
parent
f917721b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
forms/interface.ui
+8
-1
8 additions, 1 deletion
forms/interface.ui
include/interface.hpp
+5
-0
5 additions, 0 deletions
include/interface.hpp
src/interface.cpp
+27
-0
27 additions, 0 deletions
src/interface.cpp
with
40 additions
and
1 deletion
forms/interface.ui
+
8
−
1
View file @
16baf339
...
...
@@ -380,6 +380,13 @@ pattern recorded :</string>
</item>
</layout>
</item>
<item>
<widget
class=
"QPushButton"
name=
"pushButton"
>
<property
name=
"text"
>
<string>
Reset grid
</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
...
...
@@ -556,7 +563,7 @@ pattern recorded :</string>
<x>
0
</x>
<y>
0
</y>
<width>
1068
</width>
<height>
2
5
</height>
<height>
2
2
</height>
</rect>
</property>
<widget
class=
"QMenu"
name=
"menuFichier"
>
...
...
This diff is collapsed.
Click to expand it.
include/interface.hpp
+
5
−
0
View file @
16baf339
...
...
@@ -83,6 +83,11 @@ private slots:
void
on_recordSpinBox_valueChanged
(
int
arg1
);
void
on_pushButton_clicked
();
private:
//! \brief Initialiser la liste des transitions et voisinages disponibles
void
init_transition_neighborhood_list
();
...
...
This diff is collapsed.
Click to expand it.
src/interface.cpp
+
27
−
0
View file @
16baf339
...
...
@@ -676,3 +676,30 @@ void MainWindow::on_resetButton_clicked() {
void
MainWindow
::
on_recordSpinBox_valueChanged
(
int
newSize
)
{
simulation
.
setHistorySize
(
newSize
);
}
void
MainWindow
::
on_pushButton_clicked
()
{
Grid
oldGrid
=
ui
->
grid_view
->
get_grid
();
unsigned
nbrRow
=
oldGrid
.
get_rows
();
// rows = nbr de lignes => axe y
unsigned
nbrCol
=
oldGrid
.
get_col
();
// col = nbr de colonne => axe x
Grid
newGrid
(
nbrRow
,
nbrCol
);
for
(
unsigned
y
=
0
;
y
<
nbrRow
;
++
y
)
{
for
(
unsigned
x
=
0
;
x
<
nbrCol
;
++
x
)
{
unsigned
state
=
0
;
Coord
pos
=
{
static_cast
<
int
>
(
x
),
static_cast
<
int
>
(
y
)};
newGrid
.
set_cell
(
pos
,
state
);
}
}
ui
->
grid_view
->
copy_grid
(
newGrid
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment