소스 검색

Arreglos gramaticales, igual para los codigos fuentes

SaraB 7 년 전
부모
커밋
30fb8dc8fc
7개의 변경된 파일47개의 추가작업 그리고 75개의 파일을 삭제
  1. 5
    19
      README-en.md
  2. 4
    18
      README-es.md
  3. 3
    3
      dialog.cpp
  4. 3
    3
      dialog.h
  5. 13
    13
      grid.cpp
  6. 15
    15
      grid.h
  7. 4
    4
      tools.cpp

+ 5
- 19
README-en.md 파일 보기

4
 ![main2.png](images/main2.png)
4
 ![main2.png](images/main2.png)
5
 ![main3.png](images/main3-small.png)
5
 ![main3.png](images/main3-small.png)
6
 
6
 
7
-[Verano 2016- Tatiana - Ive - Tatiana]
8
 
7
 
9
 Recursion is a technique that is commonly used in programming. With this technique, problems are done by solving similar problems but for smaller cases. We can construct sets of objects or tasks using *recursive rules* and *initial values*. *Recursive functions* are functions that are self-invoking, using smaller sets or elements each time, until reaching a point where an initial value is used instead of self-invoking. In this laboratory experience, you will implement some tools to draw and practice the use of recursive functions to fill with color some figures.
8
 Recursion is a technique that is commonly used in programming. With this technique, problems are done by solving similar problems but for smaller cases. We can construct sets of objects or tasks using *recursive rules* and *initial values*. *Recursive functions* are functions that are self-invoking, using smaller sets or elements each time, until reaching a point where an initial value is used instead of self-invoking. In this laboratory experience, you will implement some tools to draw and practice the use of recursive functions to fill with color some figures.
10
 
9
 
57
 	**Figure 1.**  The image shows the direction in which the coordinates are ordered in `Qt` images.
56
 	**Figure 1.**  The image shows the direction in which the coordinates are ordered in `Qt` images.
58
 
57
 
59
 
58
 
60
-* When we want to insert two-dimensional data (like the entries of a grid that has coordinates in $$x$$ and $$y$$) in an one-dimensional array we use a formula to convert every coordinate $$(x,y)$$ to an index $$i$$ of the array. For every point with coordinates $$(x,y)$$ in the grid, we evaluate $$i=(number-of-columns)*y+x$$, where `number-of-columns` represents the width of the two-dimensional array, and the result $$i$$ will be the index of the one-dimensional array that corresponds to the point with coordinates $$(x,y)$$ in the grid. For example, the index $$i$$ that corresponds to the point $$(1,2)$$ in the grid of width $$5$$ is $$i=(5)*2+1=11$$.
59
+* When we want to insert two-dimensional data (like the entries of a grid that has coordinates in $$x$$ and $$y$$) in a one-dimensional array we use a formula to convert every coordinate $$(x,y)$$ to an index $$i$$ of the array. For every point with coordinates $$(x,y)$$ in the grid, we evaluate $$i=(number-of-columns)*y+x$$, where `number-of-columns` represents the width of the two-dimensional array, and the result $$i$$ will be the index of the one-dimensional array that corresponds to the point with coordinates $$(x,y)$$ in the grid. For example, the index $$i$$ that corresponds to the point $$(1,2)$$ in the grid of width $$5$$ is $$i=(5)*2+1=11$$.
61
 
60
 
62
 
61
 
63
 ---
62
 ---
71
 
70
 
72
 * `int qFloor(qreal v)` // Returns the “floor” value $$v$$.
71
 * `int qFloor(qreal v)` // Returns the “floor” value $$v$$.
73
 * `qreal qSqrt(qreal v)` // Returns the square root of the value $$v$$.
72
 * `qreal qSqrt(qreal v)` // Returns the square root of the value $$v$$.
74
-* `qreal qPow(qreal x, qreal y)` // Returns the value of $x$ to the power of $$y$$.
73
+* `qreal qPow(qreal x, qreal y)` // Returns the value of $$x$$ to the power of $$y$$.
75
 
74
 
76
 In addition, you will need to use the function that paints the grid:
75
 In addition, you will need to use the function that paints the grid:
77
 
76
 
135
 |---|----|----|
134
 |---|----|----|
136
 | ![](images/colMajor01-small.png) | ![](images/colMajor02-small.png) | ![](images/colMajor03-small.png)|  
135
 | ![](images/colMajor01-small.png) | ![](images/colMajor02-small.png) | ![](images/colMajor03-small.png)|  
137
 
136
 
138
-**Figure 3.** (a) A drawing with a white background and red dots (b) When the user clicks on the vertical line button (`ColMajorFill`) and clicks the cell shown, (c) a vertical line that expands to the left and to the right of the cell clicked is drawn, until it finds a cell with a different color from the color of the background. 
137
+**Figure 3.** (a) A drawing with a white background and red dots (b) When the user clicks on the vertical line button (`ColMajorFill`) and clicks the cell shown, (c) a vertical line that expands to the top and to the bottom of the cell clicked is drawn, until it finds a cell with a different color from the color of the background. 
139
  
138
  
140
 
139
 
141
 ##### `DiagonalLeft`
140
 ##### `DiagonalLeft`
167
 
166
 
168
 ### Exercise 2 - Implement the Functions that Operate the Buttons for Drawing Squares, Triangles and Circles. 
167
 ### Exercise 2 - Implement the Functions that Operate the Buttons for Drawing Squares, Triangles and Circles. 
169
 
168
 
170
-Now, you will implement the functionality to draw squares, circles and triangles. The **size** of the figure drawn will depend on the size selected on sliding bar in the interface.
169
+Now, you will implement the functionality to draw squares, circles and triangles. The **size** of the figure drawn will depend on the size selected on by using the sliding bar in the interface.
171
 
170
 
172
 
171
 
173
 #### 2a: Squares 
172
 #### 2a: Squares 
229
 
228
 
230
 ### Exercise 3 - Implement the Function that Fills the Figures using Recursion. 
229
 ### Exercise 3 - Implement the Function that Fills the Figures using Recursion. 
231
 
230
 
232
-In this exercise you will implement the functionality to fill the color of the figures.One of the more convinient ways to express the algorithm to fill the figures is using recursion. A basic recursive algorithm (but it’s pretty weak) is found in Wikipedia:
231
+In this exercise you will implement the functionality to fill the color of the figures. One of the most convinient ways to express the algorithm to fill the figures is using recursion. A basic recursive algorithm (but it’s pretty weak) is found in Wikipedia:
233
 
232
 
234
 
233
 
235
 ```
234
 ```
275
 
274
 
276
 [3] http://en.wikipedia.org/wiki/Flood_fill
275
 [3] http://en.wikipedia.org/wiki/Flood_fill
277
 
276
 
278
----
279
-
280
----
281
----
282
-
283
----
284
-
285
-----
286
-
287
-
288
-
289
-
290
-
291
 
277
 

+ 4
- 18
README-es.md 파일 보기

6
 
6
 
7
 
7
 
8
 
8
 
9
-La recursión es una técnica muy utilizada en programación. Con esta técnica se resuelven problemas resolviendo un problema similar pero para casos más pequeños. Podemos construir conjuntos de objetos o procesos utilizando *reglas recursivas* y *valores iniciales*. Las *funciones recursivas* son funciones que se auto-invocan, utilizando cada vez conjuntos o elementos más pequeños,  hasta llegar a un punto en donde se utiliza la condición inicial en lugar de auto-invocarse. En esta experiencia de laboratorio implementarás algunas herramientas para dibujar y practicarás el uso de funciones recursivas para rellenar de color algunas figuras.
9
+La recursión es una técnica muy utilizada en programación. Con esta técnica se resuelven problemas resolviendo un problema similar pero para casos más pequeños. Podemos construir conjuntos de objetos o procesos utilizando *reglas recursivas* y *valores iniciales*. Las *funciones recursivas* son funciones que se auto-invocan, utilizando cada vez conjuntos o elementos más pequeños,  hasta llegar a un punto en donde se utiliza la condición inicial en lugar de auto-invocarse. En esta experiencia de laboratorio implementarás algunas herramientas para dibujar y practicarás el uso de funciones recursivas para rellenar de color algunas figuras. Esta experiencia de laboratorio es una adaptación de la asignación *GridPlotter* presentada por Alyce Brady y Pamela Cutter en [1]. La implementación de la cuadrícula y la capacidad de pintar en ella fue presentada por Sacha Schutz en [2] pero fue arreglada, modificada y adaptada para esta experiencia de laboratorio.
10
+
10
 
11
 
11
 ## Objetivos:
12
 ## Objetivos:
12
 
13
 
13
 1. Definir e implementar funciones recursivas.
14
 1. Definir e implementar funciones recursivas.
14
 2. Practicar el uso de estructuras de repetición.
15
 2. Practicar el uso de estructuras de repetición.
15
 
16
 
16
-Esta experiencia de laboratorio es una adaptación de la asignación *GridPlotter* presentada por Alyce Brady y Pamela Cutter en [1]. La implementación de la cuadrícula y la capacidad de pintar en ella fue presentada por Sacha Schutz en [2] pero fue arreglada, modificada y adaptada para esta experiencia de laboratorio.
17
 
17
 
18
 
18
 
19
 ## Pre-Lab:
19
 ## Pre-Lab:
79
 
79
 
80
 * `void switchOn(int x, int y, const QColor& color);` // Pinta la celda $$(x,y)$$ con el color dado. (No tienes que preocuparte por `QColor` porque se pasa a la función por parámetro.)
80
 * `void switchOn(int x, int y, const QColor& color);` // Pinta la celda $$(x,y)$$ con el color dado. (No tienes que preocuparte por `QColor` porque se pasa a la función por parámetro.)
81
 
81
 
82
-Aunque no se ve en el archivo `tools.cpp`, hay una arreglo llamado `mColors` que contiene el color de todas las celdas de la cuadrilla. Esto te ayudará a saber cuál color está en una celda: `mColors[columns * y + x]`. Nota que el índice de este arreglo se calcula utilizando la conversión para cambiar coordenadas $$(x,y)$$ a índices que explicamos arriba.
82
+Aunque no se ve en el archivo `tools.cpp`, hay una arreglo llamado `mColors` que contiene el color de todas las celdas de la cuadrilla. Esto te ayudará a saber qué color está en una celda: `mColors[columns * y + x]`. Nota que el índice de este arreglo se calcula utilizando la conversión para cambiar coordenadas $$(x,y)$$ a índices que explicamos arriba.
83
 
83
 
84
 ---
84
 ---
85
 
85
 
108
 	* Utilizando la máquina virtual: Haz doble “click” en el archivo `GridPlotter.pro` que se encuentra  en el directorio `/home/eip/labs/recursion-gridplotter` de la máquina virtual.
108
 	* Utilizando la máquina virtual: Haz doble “click” en el archivo `GridPlotter.pro` que se encuentra  en el directorio `/home/eip/labs/recursion-gridplotter` de la máquina virtual.
109
 	* Descargando la carpeta del proyecto de `Bitbucket`: Utiliza un terminal y escribe el commando `git clone http:/bitbucket.org/eip-uprrp/recursion-gridplotter` para descargar la carpeta `recursion-gridplotter` de `Bitbucket`. En esa carpeta, haz doble “click” en el archivo `GridPlotter.pro`.
109
 	* Descargando la carpeta del proyecto de `Bitbucket`: Utiliza un terminal y escribe el commando `git clone http:/bitbucket.org/eip-uprrp/recursion-gridplotter` para descargar la carpeta `recursion-gridplotter` de `Bitbucket`. En esa carpeta, haz doble “click” en el archivo `GridPlotter.pro`.
110
 
110
 
111
-2. El proyecto contiene el esqueleto para una aplicación para dibujar líneas o figuras en una cuadrilla. La aplicación tiene una interfaz que le permite al usuario seleccionar el color para pintar, el color para el trasfondo de la cuadrilla, la figura que se va a dibujar (por ejemplo, círculo, cuadrado) y el tamaño de la figura. La figura seleccionada se dibuja cuando el usuario marca una celda en la cuadrilla.
111
+2. El proyecto contiene el esqueleto de una aplicación para dibujar líneas o figuras en una cuadrilla. La aplicación tiene una interfaz que le permite al usuario seleccionar el color para pintar, el color para el trasfondo de la cuadrilla, la figura que se va a dibujar (por ejemplo, círculo, cuadrado) y el tamaño de la figura. La figura seleccionada se dibuja cuando el usuario marca una celda en la cuadrilla.
112
 
112
 
113
 Estarás trabajando en el archivo `tools.cpp`. Tu primera tarea es implementar las funciones `RowMajorFill`, `ColMajorFill`, `DiagonalLeft` y `DiagonalRight` que hacen que los botones para dibujar líneas funcionen. La función `RowMajorFill` ya está implementada para que la tengas de ejemplo. Las funciones deben trabajar como se indica adelante.
113
 Estarás trabajando en el archivo `tools.cpp`. Tu primera tarea es implementar las funciones `RowMajorFill`, `ColMajorFill`, `DiagonalLeft` y `DiagonalRight` que hacen que los botones para dibujar líneas funcionen. La función `RowMajorFill` ya está implementada para que la tengas de ejemplo. Las funciones deben trabajar como se indica adelante.
114
 
114
 
283
 
283
 
284
 [3] http://en.wikipedia.org/wiki/Flood_fill
284
 [3] http://en.wikipedia.org/wiki/Flood_fill
285
 
285
 
286
----
287
-
288
----
289
----
290
-
291
----
292
-
293
-----
294
-
295
-
296
-
297
-
298
-
299
-
300
 
286
 

+ 3
- 3
dialog.cpp 파일 보기

40
 /// \~English
40
 /// \~English
41
 /// \brief  Enables the redo button
41
 /// \brief  Enables the redo button
42
 /// \~Spanish
42
 /// \~Spanish
43
-/// \brief Permite utilizar el boton de (rehacer)
43
+/// \brief Permite utilizar el boton de rehacer (redo)
44
 void Dialog::setRedo(bool can){
44
 void Dialog::setRedo(bool can){
45
     if (can == true) ui->redoButton->setDisabled(false);
45
     if (can == true) ui->redoButton->setDisabled(false);
46
     else ui->redoButton->setDisabled(true);
46
     else ui->redoButton->setDisabled(true);
127
 /// \~English
127
 /// \~English
128
 /// \brief Sets the tool to Diagonal Left fill
128
 /// \brief Sets the tool to Diagonal Left fill
129
 /// \~Spanish
129
 /// \~Spanish
130
-/// \brief Ajusta la herrramienta a llenar en diagonal a la izquierda
130
+/// \brief Ajusta la herrramienta a llenar la diagonal hacia la izquierda
131
 void Dialog::on_diagonalleftButton_clicked()
131
 void Dialog::on_diagonalleftButton_clicked()
132
 {
132
 {
133
     ui->mainGrid->setTool("diagonal left");
133
     ui->mainGrid->setTool("diagonal left");
137
 /// \~English
137
 /// \~English
138
 /// \brief Sets the tool to Diagonal Right fill
138
 /// \brief Sets the tool to Diagonal Right fill
139
 /// \~Spanish
139
 /// \~Spanish
140
-/// \brief Ajusta la herrramienta a llenar en diagonal a la derecha
140
+/// \brief Ajusta la herrramienta a llenar la diagonal hacia la derecha
141
 void Dialog::on_diagonalrightButton_clicked()
141
 void Dialog::on_diagonalrightButton_clicked()
142
 {
142
 {
143
     ui->mainGrid->setTool("diagonal right");
143
     ui->mainGrid->setTool("diagonal right");

+ 3
- 3
dialog.h 파일 보기

83
     /// \~English
83
     /// \~English
84
     /// \brief Sets the tool to Diagonal Left fill
84
     /// \brief Sets the tool to Diagonal Left fill
85
     /// \~Spanish
85
     /// \~Spanish
86
-    /// \brief Ajusta la herrramienta a llenar en diagonal a la izquierda
86
+    /// \brief Ajusta la herrramienta a llenar la diagonal hacia la izquierda
87
     void on_diagonalleftButton_clicked();
87
     void on_diagonalleftButton_clicked();
88
 
88
 
89
     /// \fn void Dialog::on_diagonalrightButton_clicked()
89
     /// \fn void Dialog::on_diagonalrightButton_clicked()
90
     /// \~English
90
     /// \~English
91
     /// \brief Sets the tool to Diagonal Right fill
91
     /// \brief Sets the tool to Diagonal Right fill
92
     /// \~Spanish
92
     /// \~Spanish
93
-    /// \brief Ajusta la herrramienta a llenar en diagonal a la derecha
93
+    /// \brief Ajusta la herrramienta a llenar la diagonal hacia la derecha
94
     void on_diagonalrightButton_clicked();
94
     void on_diagonalrightButton_clicked();
95
 
95
 
96
     /// \fn void Dialog::on_drawsquareButton_clicked()
96
     /// \fn void Dialog::on_drawsquareButton_clicked()
148
     /// \~English
148
     /// \~English
149
     /// \brief  Enables the redo button
149
     /// \brief  Enables the redo button
150
     /// \~Spanish
150
     /// \~Spanish
151
-    /// \brief Permite utilizar el boton de (rehacer)
151
+    /// \brief Permite utilizar el boton de rehacer (redo)
152
     void setRedo(bool cannot);
152
     void setRedo(bool cannot);
153
 
153
 
154
     void on_floodButton_clicked();
154
     void on_floodButton_clicked();

+ 13
- 13
grid.cpp 파일 보기

77
 /// \param rowCount number of rows in the grid
77
 /// \param rowCount number of rows in the grid
78
 /// \param columnCount number of columns in the grid
78
 /// \param columnCount number of columns in the grid
79
 /// \param parent parent window
79
 /// \param parent parent window
80
-/// \~English
80
+/// \~Spanish
81
 /// \brief Constructor que recibe el numero de filas y columnas en la cuadricula
81
 /// \brief Constructor que recibe el numero de filas y columnas en la cuadricula
82
 /// \param rowCount numero de filas en la cuadricula
82
 /// \param rowCount numero de filas en la cuadricula
83
 /// \param columnCount numero de columnas en la cuadricula
83
 /// \param columnCount numero de columnas en la cuadricula
103
 /// \~English
103
 /// \~English
104
 /// \param tool choosen tool
104
 /// \param tool choosen tool
105
 /// \brief Sets the tool
105
 /// \brief Sets the tool
106
-/// \param tool herramienta escogida
107
 /// \~Spanish
106
 /// \~Spanish
107
+/// \param tool herramienta escogida
108
 /// \brief Ajusta la herramienta
108
 /// \brief Ajusta la herramienta
109
 void GridWidget::setTool(QString tool){
109
 void GridWidget::setTool(QString tool){
110
     Tool = tool;
110
     Tool = tool;
208
 /// the redo vector(newStates) and the last state in the undo vector(oldStates)
208
 /// the redo vector(newStates) and the last state in the undo vector(oldStates)
209
 /// is painted on the grid.
209
 /// is painted on the grid.
210
 /// \~Spanish
210
 /// \~Spanish
211
-/// \brief Cuando el boton es apretado el estado acutual es empujado en
212
-/// el vector(newStates) de redo y el ultimo estado en el vector(oldStates) undo es
213
-/// pintado en la cuadricula
211
+/// \brief Cuando el boton de deshacer (undo) es presionado el estado actual es empujado
212
+/// al vector(newStates) de rehacer (redo) y el ultimo estado del vector(oldStates) de 
213
+/// deshacer (undo) es pintado en la cuadricula
214
 void GridWidget::undo(){
214
 void GridWidget::undo(){
215
 
215
 
216
     /* When the undo button is pressed the current state is pushed into
216
     /* When the undo button is pressed the current state is pushed into
217
      * the redo vector and the last state in the undo vector is painted
217
      * the redo vector and the last state in the undo vector is painted
218
      * on the grid.
218
      * on the grid.
219
-     * Cuando el boton undo es marcado el estado corriente es empujaro en
220
-     * el vector redo y el ultimo estado en el vector undo es pintado en la
221
-     * cuadricula
219
+     * Cuando el boton de deshacer (undo) es presionado  el estado corriente es empujado
220
+     * al vector de rehacer (redo) y el ultimo estado del vector de deshacer (undo) es
221
+     * pintado en la cuadricula
222
      */
222
      */
223
 
223
 
224
     if (!oldStates.empty()){
224
     if (!oldStates.empty()){
238
 /// \brief When the redo button is pressed the current state is pushed into
238
 /// \brief When the redo button is pressed the current state is pushed into
239
 /// the undo vector(oldStates) and the last state in the redo vector(newStates)
239
 /// the undo vector(oldStates) and the last state in the redo vector(newStates)
240
 /// is painted on the grid.
240
 /// is painted on the grid.
241
-/// \~Spanish Cuando el boton redo es marcado el estado actual es empujado en
242
-/// el vector(oldStates) undo y el ultimo estado en el vector redo(newStates) es
243
-/// pintaod en el grid.
241
+/// \~Spanish Cuando el boton de rehacer (redo) es presionado el estado actual es empujado 
242
+/// al vector(oldStates) de deshacer (undo) y el último estado del vector (newStates) de 
243
+/// de rehacer (redo) es pintado en la cuadrícula.
244
 ///
244
 ///
245
 void GridWidget::redo(){
245
 void GridWidget::redo(){
246
 
246
 
335
 /// \~English
335
 /// \~English
336
 /// \brief Clears the grid and sets it to its initial state
336
 /// \brief Clears the grid and sets it to its initial state
337
 /// \~Spanish
337
 /// \~Spanish
338
-/// \brief Limpa la cuadricula y la pone en su estado inicial.
338
+/// \brief Limpia la cuadricula y la pone en su estado inicial.
339
 void GridWidget::clear()
339
 void GridWidget::clear()
340
 {
340
 {
341
     oldStates.push_back(mColors);
341
     oldStates.push_back(mColors);
414
 /// \param x coordinate x of the cell in the grid.
414
 /// \param x coordinate x of the cell in the grid.
415
 /// \param y coordinate y of the cell in the grid.
415
 /// \param y coordinate y of the cell in the grid.
416
 /// \~Spanish
416
 /// \~Spanish
417
-/// \brief Esta funcion es llamada en cada evento de el mouse presionado dentro
417
+/// \brief Esta funcion es llamada en cada evento del mouse presionado dentro
418
 /// de la cuadricula.  Identifica la forma en que el grid va a ser pintado llamando
418
 /// de la cuadricula.  Identifica la forma en que el grid va a ser pintado llamando
419
 /// la funcion del tool recibido en los parametros (dot, rowfill, column fill, diagonal, square,
419
 /// la funcion del tool recibido en los parametros (dot, rowfill, column fill, diagonal, square,
420
 /// triangles and circles).
420
 /// triangles and circles).

+ 15
- 15
grid.h 파일 보기

66
     ///* Tool and ToolSize: Sets the Tool which is going to be used to draw the grid
66
     ///* Tool and ToolSize: Sets the Tool which is going to be used to draw the grid
67
     ///* frontColor: The color which will be used to paint to black
67
     ///* frontColor: The color which will be used to paint to black
68
     ///* backColor: Current clicked square
68
     ///* backColor: Current clicked square
69
-    ///* background: Sets the background color to white
69
+    ///* background: The background color to white
70
     /// \~English
70
     /// \~English
71
     /// \brief Constructor por defecto. Las propiedades de el grid se ajustan como sigue:
71
     /// \brief Constructor por defecto. Las propiedades de el grid se ajustan como sigue:
72
     /// * mCellSize: Ajusta el tamano de la celda a 10px
72
     /// * mCellSize: Ajusta el tamano de la celda a 10px
73
     /// * mRowCount: Ajusta el numero de filas en la cuadricula a 39
73
     /// * mRowCount: Ajusta el numero de filas en la cuadricula a 39
74
     /// * ColumnCount: Ajusta el numero de columnas en el grid a 27
74
     /// * ColumnCount: Ajusta el numero de columnas en el grid a 27
75
-    /// * Tool and ToolSize: Ajusta la herramiento que se va a utilizar para dibujar
75
+    /// * Tool and ToolSize: Ajusta la herramienta que se va a utilizar para dibujar
76
     /// el grid.
76
     /// el grid.
77
-    /// * frontColor: El color que se utilizara para pintar a negro
77
+    /// * frontColor: El color que se utilizara para pintar en negro
78
     /// * backColor: Cuadrado marcado actualmente
78
     /// * backColor: Cuadrado marcado actualmente
79
     /// * background: El color del fondo en blanco
79
     /// * background: El color del fondo en blanco
80
     GridWidget(QWidget *parent);
80
     GridWidget(QWidget *parent);
85
     /// \param rowCount number of rows
85
     /// \param rowCount number of rows
86
     /// \param columnCount number of columns
86
     /// \param columnCount number of columns
87
     /// \~Spanish
87
     /// \~Spanish
88
-    /// \brief Ajusta el numero de columnas y fileas de la cuadricula
88
+    /// \brief Ajusta el numero de columnas y filas de la cuadricula
89
     /// \param rowCount numero de filas
89
     /// \param rowCount numero de filas
90
     /// \param columnCount numero de columnas
90
     /// \param columnCount numero de columnas
91
     void setGridSize(int rowCount, int columnCount);
91
     void setGridSize(int rowCount, int columnCount);
126
     /// \param x coordinate x of the cell in the grid
126
     /// \param x coordinate x of the cell in the grid
127
     /// \param y coordinate y of the cell in the grid
127
     /// \param y coordinate y of the cell in the grid
128
     /// \~Spanish
128
     /// \~Spanish
129
-    /// \brief Remueve la posicion dada del vector que representa
129
+    /// \brief Elimina la posicion dada del vector que representa
130
     /// las celdas pintadas en la cuadricula
130
     /// las celdas pintadas en la cuadricula
131
     /// \param x coordenada x de la celda en el cuadricula
131
     /// \param x coordenada x de la celda en el cuadricula
132
     /// \param y coordenada y de la celda en la cuadricula
132
     /// \param y coordenada y de la celda en la cuadricula
155
     /// \~English
155
     /// \~English
156
     /// \brief Clears the grid and sets it to its initial state
156
     /// \brief Clears the grid and sets it to its initial state
157
     /// \~Spanish
157
     /// \~Spanish
158
-    /// \brief Limpa la cuadricula y la pone en su estado inicial.
158
+    /// \brief Limpia la cuadricula y la pone en su estado inicial.
159
     void clear();
159
     void clear();
160
 
160
 
161
     /// \fn void GridWidget::setCellSize(int size)
161
     /// \fn void GridWidget::setCellSize(int size)
169
 
169
 
170
     /// \fn void GridWidget::setTool(QString tool)
170
     /// \fn void GridWidget::setTool(QString tool)
171
     /// \~English
171
     /// \~English
172
-    /// \param tool choosen tool
172
+    /// \param tool chosen tool
173
     /// \brief Sets the tool
173
     /// \brief Sets the tool
174
-    /// \param tool herramienta escogida
175
     /// \~Spanish
174
     /// \~Spanish
175
+    /// \param tool herramienta escogida
176
     /// \brief Ajusta la herramienta
176
     /// \brief Ajusta la herramienta
177
     void setTool(QString tool);
177
     void setTool(QString tool);
178
 
178
 
209
     /// It identifies the way the grid will be painted calling the function of the
209
     /// It identifies the way the grid will be painted calling the function of the
210
     /// tool received in the parameters (dot, rowfill, column fill, diagonal, square,
210
     /// tool received in the parameters (dot, rowfill, column fill, diagonal, square,
211
     /// triangles and circles).
211
     /// triangles and circles).
212
-    /// \param tool the tool to be called by the funtion
212
+    /// \param tool the tool to be called by the function
213
     /// \param x coordinate x of the cell in the grid.
213
     /// \param x coordinate x of the cell in the grid.
214
     /// \param y coordinate y of the cell in the grid.
214
     /// \param y coordinate y of the cell in the grid.
215
     /// \~Spanish
215
     /// \~Spanish
216
-    /// \brief Esta funcion es llamada en cada evento de el mouse presionado dentro
216
+    /// \brief Esta funcion es llamada en cada evento del mouse presionado dentro
217
     /// de la cuadricula.  Identifica la forma en que el grid va a ser pintado llamando
217
     /// de la cuadricula.  Identifica la forma en que el grid va a ser pintado llamando
218
     /// la funcion del tool recibido en los parametros (dot, rowfill, column fill, diagonal, square,
218
     /// la funcion del tool recibido en los parametros (dot, rowfill, column fill, diagonal, square,
219
     /// triangles and circles).
219
     /// triangles and circles).
267
     /// \param toolColor color of the cells painted by the tool
267
     /// \param toolColor color of the cells painted by the tool
268
     /// \~Spanish
268
     /// \~Spanish
269
     /// \brief Recibe las coordenadas de la cuadricula donde el usuario marco
269
     /// \brief Recibe las coordenadas de la cuadricula donde el usuario marco
270
-    /// y pinta (desde ese punto hacia la arriba o abajo) la columna mas larga del mismo color
270
+    /// y pinta (desde ese punto hacia arriba o abajo) la columna mas larga del mismo color
271
     /// de la celda que fue marcada con el color de la herramienta.
271
     /// de la celda que fue marcada con el color de la herramienta.
272
     /// \param x coordenada x de la celda en la cuadricula
272
     /// \param x coordenada x de la celda en la cuadricula
273
     /// \param y coordenada y de la celda en la cuadricula
273
     /// \param y coordenada y de la celda en la cuadricula
370
     /// the redo vector(newStates) and the last state in the undo vector(oldStates)
370
     /// the redo vector(newStates) and the last state in the undo vector(oldStates)
371
     /// is painted on the grid.
371
     /// is painted on the grid.
372
     /// \~Spanish
372
     /// \~Spanish
373
-    /// \brief Cuando el boton es apretado el estado acutual es empujado en
374
-    /// el vector(newStates) de redo y el ultimo estado en el vector(oldStates) undo es
375
-    /// pintado en la cuadricula
373
+    /// \brief Cuando el boton de deshacer (undo) es presionado el estado actual es empujado 
374
+    /// al vector(newStates) de rehacer (redo) y el ultimo estado del vector(oldStates) de
375
+    /// deshacer (undo) es pintado en la cuadricula
376
     void undo();
376
     void undo();
377
 
377
 
378
 
378
 
424
     /// its parent receives a repaint signal.
424
     /// its parent receives a repaint signal.
425
     /// \param event received event reference
425
     /// \param event received event reference
426
     /// \~Spanish
426
     /// \~Spanish
427
-    /// \brief Esta funcion es invocada automaticmente cada ves que el widget o
427
+    /// \brief Esta funcion es invocada automaticmente cada vez que el widget o
428
     /// el padre recibe una senal de repintar.
428
     /// el padre recibe una senal de repintar.
429
     /// \param event referencia a un evento recibido
429
     /// \param event referencia a un evento recibido
430
     virtual void paintEvent(QPaintEvent *);
430
     virtual void paintEvent(QPaintEvent *);

+ 4
- 4
tools.cpp 파일 보기

15
 
15
 
16
 // Receives the x,y grid coordinates and the color of cell where the user
16
 // Receives the x,y grid coordinates and the color of cell where the user
17
 // clicked. Paints the row (from that point left and right) of color toolColor until
17
 // clicked. Paints the row (from that point left and right) of color toolColor until
18
-// it hits a cell of a different color than that one clicked.
18
+// it hits a cell of a different color than the one clicked.
19
 
19
 
20
 void GridWidget::RowMajorFill(int x, int y, QColor colorClicked, QColor toolColor){
20
 void GridWidget::RowMajorFill(int x, int y, QColor colorClicked, QColor toolColor){
21
      for (int i = x; i<getGridColumns() && (getCellColor(i,y) == colorClicked) ; i++)
21
      for (int i = x; i<getGridColumns() && (getCellColor(i,y) == colorClicked) ; i++)
28
 
28
 
29
 // Receives the grid x,y coordinates and the color of cell where the user
29
 // Receives the grid x,y coordinates and the color of cell where the user
30
 // clicked. Paints the column (from that point up and down) of color toolColor until
30
 // clicked. Paints the column (from that point up and down) of color toolColor until
31
-// it hits a cell of a different color than that one clicked.
31
+// it hits a cell of a different color than the one clicked.
32
 
32
 
33
 void GridWidget::ColMajorFill(int x, int y, QColor colorClicked, QColor toolColor){
33
 void GridWidget::ColMajorFill(int x, int y, QColor colorClicked, QColor toolColor){
34
 
34
 
37
 
37
 
38
 // Receives the grid x,y coordinates and the color of cell where the user
38
 // Receives the grid x,y coordinates and the color of cell where the user
39
 // clicked. Paints a left-diagonal of color toolColor until it hits a cell
39
 // clicked. Paints a left-diagonal of color toolColor until it hits a cell
40
-// of a different color than that one clicked.
40
+// of a different color than the one clicked.
41
 
41
 
42
 void GridWidget::DiagonalLeft(int x, int y, QColor colorClicked, QColor toolColor){
42
 void GridWidget::DiagonalLeft(int x, int y, QColor colorClicked, QColor toolColor){
43
 
43
 
46
 
46
 
47
 // Receives the grid x,y coordinates and the color of the cell where the user
47
 // Receives the grid x,y coordinates and the color of the cell where the user
48
 // clicked. Paints a right-diagonal of color toolColor until it hits a cell
48
 // clicked. Paints a right-diagonal of color toolColor until it hits a cell
49
-// of a different color than that one clicked.
49
+// of a different color than the one clicked.
50
 
50
 
51
 void GridWidget::DiagonalRight(int x, int y, QColor colorClicked, QColor toolColor){
51
 void GridWidget::DiagonalRight(int x, int y, QColor colorClicked, QColor toolColor){
52
 
52