Commits

Asdrúbal Iván Suárez Rivera committed e7d162b

Añadidos algunos signals y slots en la GUI, solo falta la programación 2D

Comments (0)

Files changed (7)

src/arbol_prioridad/backend/arbol_prioridad.py

                 if medio <= x1:
                     self._max_y_rectangulo(x0, x1, y0, y1, nodo.der, medio, superior, par)
         return 
-    def rec_inf(self):
-        print "Infijo: "
-        self._rec_inf(self.raiz)
-    def _rec_inf(self, nodo):
+    def rec_inf(self, lista, imprimir=True):
+        if imprimir:
+            print "Infijo: "
+        self._rec_inf(self.raiz, lista, imprimir)
+    def _rec_inf(self, nodo, lista, imprimir):
         if nodo is None:
             return
-        self._rec_inf(nodo.izq)
-        print nodo
-        self._rec_inf(nodo.der)
-    def rec_pre(self):
+        self._rec_inf(nodo.izq, lista, imprimir)
+        if imprimir:
+            print nodo
+        lista.append(nodo)
+        self._rec_inf(nodo.der, lista, imprimir)
+    def rec_pre(self, lista):
         print "Prefijo: "
-        self._rec_pre(self.raiz)
-    def _rec_pre(self, nodo):
+        self._rec_pre(self.raiz, lista)
+    def _rec_pre(self, nodo, lista):
         if nodo is None:
             return
         print nodo
-        self._rec_pre(nodo.izq)
-        self._rec_pre(nodo.der)
+        lista.append(nodo)
+        self._rec_pre(nodo.izq, lista)
+        self._rec_pre(nodo.der, lista)
     def enum_int(self, rect1, rect2, lista):
         rect = Rectangulo.interseccion(rect1, rect2)
         if rect is not None:
         print val
     print "Min X"
     print arbol.min_x_rectangulo(12, 30, 0, 50000)
+    lista = []
+    arbol.enum_int(Rectangulo(1, 500, 2, 900), Rectangulo(300, 800, 10, 2900), lista)
+    for val in lista:
+        print val
     
 if __name__ == "__main__":
     main()

src/arbol_prioridad/backend/errores.py

 class ErrorClave(Exception):
     pass
 class NoEsPunto(Exception):
+    pass
+class ErrorRectangulo(Exception):
     pass

src/arbol_prioridad/backend/recorridos.py

+'''
+Created on 28/03/2012
+
+@author: asdrubal
+'''
+class Recorridos(object):
+    def __init__(self):
+        self.infijo = []
+        self.prefijo = []
+        self.sufijo = []

src/arbol_prioridad/backend/rectangulo.py

 '''
 
 from punto import Punto
+from errores import ErrorRectangulo
 
 class Rectangulo(object):
     '''
         '''
         Constructor
         '''
+        if x0 >= x1 or y0 >= y1:
+            raise ErrorRectangulo
         self.punto1 = Punto(x0, y0)
         self.punto2 = Punto(x1, y1)
     def __str__(self):
         y1 = min(rect1.punto2.y, rect2.punto2.y)
         if x0 > x1 or y0 > y1:
             return None
-        return Rectangulo(Punto(x0, y0), Punto(x1, y1))
+        return Rectangulo(x0, x1, y0, y1)

src/arbol_prioridad/frontend/ArbolGUI.py

 @author: asdrubal
 '''
 
-#from PySide.QtCore import QA
 from PySide.QtGui import QApplication, QMainWindow
 from ui_pantalla import Ui_CVentanaPrincipal
+from arbol_prioridad.backend.arbol_prioridad import ArbolPrioridad
+from arbol_prioridad.backend.nodo import Nodo
+from arbol_prioridad.backend.recorridos import Recorridos
+import random
 import sys
 
 class ArbolGUI(QMainWindow):
         '''
         QMainWindow.__init__(self, parent)
         self.ui = Ui_CVentanaPrincipal()
+        
         self.ui.setupUi(self)
-
+        #Variables Auxiliares
+        random.seed()
+        self.val_max = 5000
+        self.recorridos = Recorridos()
+        self.arbol = ArbolPrioridad(self.val_max)
+        #Conectar botones
+        self.ui.boton_anadir_pto.clicked.connect(self.anadir_nodo)
+        self.ui.boton_borrar_arbol.clicked.connect(self.borrar_arbol)
+        self.ui.boton_puntos_alea.clicked.connect(self.generar_puntos)
+        self.ui.boton_menor_x.clicked.connect(self.menor_punto_x)
+        self.ui.boton_mayor_y.clicked.connect(self.mayor_punto_y)
+        self.ui.boton_enumerar.clicked.connect(self.enumerar)
+    def anadir_nodo(self):
+        self.arbol.insertar(Nodo(self.ui.coord_x.value(), self.ui.coord_y.value()))
+        self.impr_inf()
+    def enumerar(self):
+        lista = []
+        self.arbol.enumerar(self.ui.x_pto1.value(), self.ui.x_pto2.value(), \
+                                     self.ui.y_pto1.value(), self.ui.y_pto2.value(),\
+                                    lista)
+        if len(lista) == 0:
+            self.ui.resultado_puntos.setText(u"No hay puntos en ese rectángulo")
+            return
+        texto = ''.join([str(val) + '\n' for val in lista])
+        self.ui.resultado_puntos.setText(texto)
+    def borrar_arbol(self):
+        self.arbol = ArbolPrioridad(self.val_max)
+        self.recorridos = Recorridos()
+        print "Arbol borrado"
+    def menor_punto_x(self):
+        val = self.arbol.min_x_rectangulo(self.ui.x_pto1.value(), self.ui.x_pto2.value(), \
+                                     self.ui.y_pto1.value(), self.ui.y_pto2.value())
+        if val.x is None and val.y is None:
+            self.ui.resultado_puntos.setText(u"No hay puntos")
+            return
+        self.ui.resultado_puntos.setText(str(val))
+    def mayor_punto_y(self):
+        val = self.arbol.max_y_rectangulo(self.ui.x_pto1.value(), self.ui.x_pto2.value(), \
+                                     self.ui.y_pto1.value(), self.ui.y_pto2.value())
+        if val.x is None and val.y is None:
+            self.ui.resultado_puntos.setText("No hay puntos")
+            return
+        self.ui.resultado_puntos.setText(str(val))
+    def impr_inf(self):
+        print "Llamado infijo: "
+        self.recorridos.infijo = []
+        self.arbol.rec_inf(self.recorridos.infijo, False)
+        for val in self.recorridos.infijo:
+            print val
+    def impr_pre(self):
+        self.recorridos.prefijo = []
+        self.arbol.rec_pre(self.recorridos.prefijo)
+        for val in self.recorridos.prefijo:
+            print val
+    def generar_puntos(self):
+        print "Generando puntos: "
+        for x in xrange(0, self.ui.ptos_aleatorios.value()):
+            self.arbol.insertar(Nodo(random.randint(0, self.val_max), random.randint(0, self.val_max)))
+        self.impr_inf()
 def main():
     app = QApplication(sys.argv)
     ventana = ArbolGUI()

src/arbol_prioridad/frontend/pantalla.ui

      <enum>QTabWidget::South</enum>
     </property>
     <property name="currentIndex">
-     <number>2</number>
+     <number>1</number>
     </property>
     <widget class="QWidget" name="tab_ins">
      <attribute name="title">
       <string>Insertar Puntos</string>
      </attribute>
-     <widget class="QWidget" name="">
+     <widget class="QWidget" name="layoutWidget">
       <property name="geometry">
        <rect>
         <x>40</x>
             </widget>
            </item>
            <item row="0" column="1">
-            <widget class="QSpinBox" name="spinBox">
+            <widget class="QSpinBox" name="coord_x">
              <property name="maximum">
               <number>5000</number>
              </property>
             </widget>
            </item>
            <item row="2" column="1">
-            <widget class="QSpinBox" name="spinBox_2">
+            <widget class="QSpinBox" name="coord_y">
              <property name="maximum">
               <number>5000</number>
              </property>
        </item>
       </layout>
      </widget>
-     <widget class="QWidget" name="">
+     <widget class="QWidget" name="layoutWidget">
       <property name="geometry">
        <rect>
         <x>470</x>
         <y>110</y>
-        <width>223</width>
+        <width>227</width>
         <height>58</height>
        </rect>
       </property>
           </widget>
          </item>
          <item>
-          <widget class="QSpinBox" name="spinBox_3"/>
+          <widget class="QSpinBox" name="ptos_aleatorios">
+           <property name="minimum">
+            <number>1</number>
+           </property>
+           <property name="maximum">
+            <number>5000</number>
+           </property>
+          </widget>
          </item>
          <item>
           <widget class="QLabel" name="label_5">
           </spacer>
          </item>
          <item>
-          <widget class="QPushButton" name="pushButton">
+          <widget class="QPushButton" name="boton_puntos_alea">
            <property name="text">
             <string>Aceptar</string>
            </property>
      <attribute name="title">
       <string>Buscar puntos en rectángulo</string>
      </attribute>
-     <widget class="QWidget" name="">
+     <widget class="QWidget" name="layoutWidget">
       <property name="geometry">
        <rect>
-        <x>180</x>
-        <y>20</y>
+        <x>10</x>
+        <y>30</y>
         <width>501</width>
         <height>150</height>
        </rect>
          <item>
           <layout class="QHBoxLayout" name="horizontalLayout_4">
            <item>
-            <widget class="QPushButton" name="pushButton_2">
+            <widget class="QPushButton" name="boton_menor_x">
              <property name="text">
               <string>Puntos con la menor coordenada X</string>
              </property>
             </spacer>
            </item>
            <item>
-            <widget class="QPushButton" name="pushButton_3">
+            <widget class="QPushButton" name="boton_mayor_y">
              <property name="text">
               <string>Puntos con la mayor coordenada Y</string>
              </property>
        </item>
       </layout>
      </widget>
+     <widget class="QWidget" name="">
+      <property name="geometry">
+       <rect>
+        <x>570</x>
+        <y>10</y>
+        <width>258</width>
+        <height>211</height>
+       </rect>
+      </property>
+      <layout class="QVBoxLayout" name="verticalLayout_17">
+       <item>
+        <widget class="QTextEdit" name="resultado_puntos">
+         <property name="readOnly">
+          <bool>true</bool>
+         </property>
+         <property name="acceptRichText">
+          <bool>false</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_10">
+         <item>
+          <spacer name="horizontalSpacer_7">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QPushButton" name="boton_enumerar">
+           <property name="text">
+            <string>Enumerar puntos en rectángulo</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
     </widget>
     <widget class="QWidget" name="tab_inter">
      <attribute name="title">
       <string>Enumerar puntos en Intersección</string>
      </attribute>
-     <widget class="QWidget" name="">
+     <widget class="QWidget" name="layoutWidget">
       <property name="geometry">
        <rect>
         <x>560</x>
       </property>
       <layout class="QVBoxLayout" name="verticalLayout_16">
        <item>
-        <widget class="QCommandLinkButton" name="commandLinkButton">
+        <widget class="QCommandLinkButton" name="boton_interseccion">
          <property name="text">
           <string>Puntos en la Intersección</string>
          </property>
        </item>
       </layout>
      </widget>
-     <widget class="QWidget" name="">
+     <widget class="QWidget" name="layoutWidget">
       <property name="geometry">
        <rect>
         <x>10</x>

src/arbol_prioridad/frontend/ui_pantalla.py

 
 # Form implementation generated from reading ui file 'pantalla.ui'
 #
-# Created: Wed Mar 28 00:08:29 2012
+# Created: Wed Mar 28 17:05:25 2012
 #      by: pyside-uic 0.2.11 running on PySide 1.1.0
 #
 # WARNING! All changes made in this file will be lost!
         self.tab_principal.setObjectName("tab_principal")
         self.tab_ins = QtGui.QWidget()
         self.tab_ins.setObjectName("tab_ins")
-        self.widget = QtGui.QWidget(self.tab_ins)
-        self.widget.setGeometry(QtCore.QRect(40, 30, 122, 162))
-        self.widget.setObjectName("widget")
-        self.verticalLayout_2 = QtGui.QVBoxLayout(self.widget)
+        self.layoutWidget = QtGui.QWidget(self.tab_ins)
+        self.layoutWidget.setGeometry(QtCore.QRect(40, 30, 122, 162))
+        self.layoutWidget.setObjectName("layoutWidget")
+        self.verticalLayout_2 = QtGui.QVBoxLayout(self.layoutWidget)
         self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
         self.verticalLayout_2.setObjectName("verticalLayout_2")
         self.verticalLayout = QtGui.QVBoxLayout()
         self.verticalLayout.setObjectName("verticalLayout")
-        self.label = QtGui.QLabel(self.widget)
+        self.label = QtGui.QLabel(self.layoutWidget)
         self.label.setObjectName("label")
         self.verticalLayout.addWidget(self.label)
         spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
         self.verticalLayout.addItem(spacerItem)
         self.formLayout = QtGui.QFormLayout()
         self.formLayout.setObjectName("formLayout")
-        self.label_2 = QtGui.QLabel(self.widget)
+        self.label_2 = QtGui.QLabel(self.layoutWidget)
         self.label_2.setObjectName("label_2")
         self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_2)
-        self.spinBox = QtGui.QSpinBox(self.widget)
-        self.spinBox.setMaximum(5000)
-        self.spinBox.setObjectName("spinBox")
-        self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.spinBox)
-        self.spinBox_2 = QtGui.QSpinBox(self.widget)
-        self.spinBox_2.setMaximum(5000)
-        self.spinBox_2.setObjectName("spinBox_2")
-        self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.spinBox_2)
-        self.label_3 = QtGui.QLabel(self.widget)
+        self.coord_x = QtGui.QSpinBox(self.layoutWidget)
+        self.coord_x.setMaximum(5000)
+        self.coord_x.setObjectName("coord_x")
+        self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.coord_x)
+        self.coord_y = QtGui.QSpinBox(self.layoutWidget)
+        self.coord_y.setMaximum(5000)
+        self.coord_y.setObjectName("coord_y")
+        self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.coord_y)
+        self.label_3 = QtGui.QLabel(self.layoutWidget)
         self.label_3.setObjectName("label_3")
         self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.label_3)
         self.verticalLayout.addLayout(self.formLayout)
         self.verticalLayout_2.addLayout(self.verticalLayout)
-        self.boton_anadir_pto = QtGui.QPushButton(self.widget)
+        self.boton_anadir_pto = QtGui.QPushButton(self.layoutWidget)
         self.boton_anadir_pto.setObjectName("boton_anadir_pto")
         self.verticalLayout_2.addWidget(self.boton_anadir_pto)
-        self.widget1 = QtGui.QWidget(self.tab_ins)
-        self.widget1.setGeometry(QtCore.QRect(470, 110, 223, 58))
-        self.widget1.setObjectName("widget1")
-        self.verticalLayout_3 = QtGui.QVBoxLayout(self.widget1)
+        self.layoutWidget1 = QtGui.QWidget(self.tab_ins)
+        self.layoutWidget1.setGeometry(QtCore.QRect(470, 110, 227, 58))
+        self.layoutWidget1.setObjectName("layoutWidget1")
+        self.verticalLayout_3 = QtGui.QVBoxLayout(self.layoutWidget1)
         self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
         self.verticalLayout_3.setObjectName("verticalLayout_3")
         self.horizontalLayout = QtGui.QHBoxLayout()
         self.horizontalLayout.setObjectName("horizontalLayout")
-        self.label_4 = QtGui.QLabel(self.widget1)
+        self.label_4 = QtGui.QLabel(self.layoutWidget1)
         self.label_4.setObjectName("label_4")
         self.horizontalLayout.addWidget(self.label_4)
-        self.spinBox_3 = QtGui.QSpinBox(self.widget1)
-        self.spinBox_3.setObjectName("spinBox_3")
-        self.horizontalLayout.addWidget(self.spinBox_3)
-        self.label_5 = QtGui.QLabel(self.widget1)
+        self.ptos_aleatorios = QtGui.QSpinBox(self.layoutWidget1)
+        self.ptos_aleatorios.setMinimum(1)
+        self.ptos_aleatorios.setMaximum(5000)
+        self.ptos_aleatorios.setObjectName("ptos_aleatorios")
+        self.horizontalLayout.addWidget(self.ptos_aleatorios)
+        self.label_5 = QtGui.QLabel(self.layoutWidget1)
         self.label_5.setObjectName("label_5")
         self.horizontalLayout.addWidget(self.label_5)
         self.verticalLayout_3.addLayout(self.horizontalLayout)
         self.horizontalLayout_2.setObjectName("horizontalLayout_2")
         spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
         self.horizontalLayout_2.addItem(spacerItem1)
-        self.pushButton = QtGui.QPushButton(self.widget1)
-        self.pushButton.setObjectName("pushButton")
-        self.horizontalLayout_2.addWidget(self.pushButton)
+        self.boton_puntos_alea = QtGui.QPushButton(self.layoutWidget1)
+        self.boton_puntos_alea.setObjectName("boton_puntos_alea")
+        self.horizontalLayout_2.addWidget(self.boton_puntos_alea)
         self.verticalLayout_3.addLayout(self.horizontalLayout_2)
         self.tab_principal.addTab(self.tab_ins, "")
         self.tab_busc = QtGui.QWidget()
         self.tab_busc.setObjectName("tab_busc")
-        self.widget2 = QtGui.QWidget(self.tab_busc)
-        self.widget2.setGeometry(QtCore.QRect(180, 20, 501, 150))
-        self.widget2.setObjectName("widget2")
-        self.verticalLayout_7 = QtGui.QVBoxLayout(self.widget2)
+        self.layoutWidget2 = QtGui.QWidget(self.tab_busc)
+        self.layoutWidget2.setGeometry(QtCore.QRect(10, 30, 501, 150))
+        self.layoutWidget2.setObjectName("layoutWidget2")
+        self.verticalLayout_7 = QtGui.QVBoxLayout(self.layoutWidget2)
         self.verticalLayout_7.setContentsMargins(0, 0, 0, 0)
         self.verticalLayout_7.setObjectName("verticalLayout_7")
-        self.label_12 = QtGui.QLabel(self.widget2)
+        self.label_12 = QtGui.QLabel(self.layoutWidget2)
         self.label_12.setObjectName("label_12")
         self.verticalLayout_7.addWidget(self.label_12)
         self.verticalLayout_6 = QtGui.QVBoxLayout()
         self.horizontalLayout_3.setObjectName("horizontalLayout_3")
         self.verticalLayout_4 = QtGui.QVBoxLayout()
         self.verticalLayout_4.setObjectName("verticalLayout_4")
-        self.label_10 = QtGui.QLabel(self.widget2)
+        self.label_10 = QtGui.QLabel(self.layoutWidget2)
         self.label_10.setObjectName("label_10")
         self.verticalLayout_4.addWidget(self.label_10)
         self.formLayout_2 = QtGui.QFormLayout()
         self.formLayout_2.setObjectName("formLayout_2")
-        self.label_6 = QtGui.QLabel(self.widget2)
+        self.label_6 = QtGui.QLabel(self.layoutWidget2)
         self.label_6.setObjectName("label_6")
         self.formLayout_2.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_6)
-        self.x_pto1 = QtGui.QSpinBox(self.widget2)
+        self.x_pto1 = QtGui.QSpinBox(self.layoutWidget2)
         self.x_pto1.setMaximum(5000)
         self.x_pto1.setObjectName("x_pto1")
         self.formLayout_2.setWidget(0, QtGui.QFormLayout.FieldRole, self.x_pto1)
-        self.y_pto1 = QtGui.QSpinBox(self.widget2)
+        self.y_pto1 = QtGui.QSpinBox(self.layoutWidget2)
         self.y_pto1.setMaximum(5000)
         self.y_pto1.setObjectName("y_pto1")
         self.formLayout_2.setWidget(2, QtGui.QFormLayout.FieldRole, self.y_pto1)
-        self.label_7 = QtGui.QLabel(self.widget2)
+        self.label_7 = QtGui.QLabel(self.layoutWidget2)
         self.label_7.setObjectName("label_7")
         self.formLayout_2.setWidget(2, QtGui.QFormLayout.LabelRole, self.label_7)
         self.verticalLayout_4.addLayout(self.formLayout_2)
         self.horizontalLayout_3.addItem(spacerItem2)
         self.verticalLayout_5 = QtGui.QVBoxLayout()
         self.verticalLayout_5.setObjectName("verticalLayout_5")
-        self.label_11 = QtGui.QLabel(self.widget2)
+        self.label_11 = QtGui.QLabel(self.layoutWidget2)
         self.label_11.setObjectName("label_11")
         self.verticalLayout_5.addWidget(self.label_11)
         self.formLayout_3 = QtGui.QFormLayout()
         self.formLayout_3.setObjectName("formLayout_3")
-        self.label_8 = QtGui.QLabel(self.widget2)
+        self.label_8 = QtGui.QLabel(self.layoutWidget2)
         self.label_8.setObjectName("label_8")
         self.formLayout_3.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_8)
-        self.x_pto2 = QtGui.QSpinBox(self.widget2)
+        self.x_pto2 = QtGui.QSpinBox(self.layoutWidget2)
         self.x_pto2.setMaximum(5000)
         self.x_pto2.setObjectName("x_pto2")
         self.formLayout_3.setWidget(0, QtGui.QFormLayout.FieldRole, self.x_pto2)
-        self.y_pto2 = QtGui.QSpinBox(self.widget2)
+        self.y_pto2 = QtGui.QSpinBox(self.layoutWidget2)
         self.y_pto2.setMaximum(5000)
         self.y_pto2.setObjectName("y_pto2")
         self.formLayout_3.setWidget(2, QtGui.QFormLayout.FieldRole, self.y_pto2)
-        self.label_9 = QtGui.QLabel(self.widget2)
+        self.label_9 = QtGui.QLabel(self.layoutWidget2)
         self.label_9.setObjectName("label_9")
         self.formLayout_3.setWidget(2, QtGui.QFormLayout.LabelRole, self.label_9)
         self.verticalLayout_5.addLayout(self.formLayout_3)
         self.verticalLayout_6.addLayout(self.horizontalLayout_3)
         self.horizontalLayout_4 = QtGui.QHBoxLayout()
         self.horizontalLayout_4.setObjectName("horizontalLayout_4")
-        self.pushButton_2 = QtGui.QPushButton(self.widget2)
-        self.pushButton_2.setObjectName("pushButton_2")
-        self.horizontalLayout_4.addWidget(self.pushButton_2)
+        self.boton_menor_x = QtGui.QPushButton(self.layoutWidget2)
+        self.boton_menor_x.setObjectName("boton_menor_x")
+        self.horizontalLayout_4.addWidget(self.boton_menor_x)
         spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
         self.horizontalLayout_4.addItem(spacerItem3)
-        self.pushButton_3 = QtGui.QPushButton(self.widget2)
-        self.pushButton_3.setObjectName("pushButton_3")
-        self.horizontalLayout_4.addWidget(self.pushButton_3)
+        self.boton_mayor_y = QtGui.QPushButton(self.layoutWidget2)
+        self.boton_mayor_y.setObjectName("boton_mayor_y")
+        self.horizontalLayout_4.addWidget(self.boton_mayor_y)
         self.verticalLayout_6.addLayout(self.horizontalLayout_4)
         self.verticalLayout_7.addLayout(self.verticalLayout_6)
+        self.widget = QtGui.QWidget(self.tab_busc)
+        self.widget.setGeometry(QtCore.QRect(570, 10, 258, 211))
+        self.widget.setObjectName("widget")
+        self.verticalLayout_17 = QtGui.QVBoxLayout(self.widget)
+        self.verticalLayout_17.setContentsMargins(0, 0, 0, 0)
+        self.verticalLayout_17.setObjectName("verticalLayout_17")
+        self.resultado_puntos = QtGui.QTextEdit(self.widget)
+        self.resultado_puntos.setReadOnly(True)
+        self.resultado_puntos.setAcceptRichText(False)
+        self.resultado_puntos.setObjectName("resultado_puntos")
+        self.verticalLayout_17.addWidget(self.resultado_puntos)
+        self.horizontalLayout_10 = QtGui.QHBoxLayout()
+        self.horizontalLayout_10.setObjectName("horizontalLayout_10")
+        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        self.horizontalLayout_10.addItem(spacerItem4)
+        self.boton_enumerar = QtGui.QPushButton(self.widget)
+        self.boton_enumerar.setObjectName("boton_enumerar")
+        self.horizontalLayout_10.addWidget(self.boton_enumerar)
+        self.verticalLayout_17.addLayout(self.horizontalLayout_10)
         self.tab_principal.addTab(self.tab_busc, "")
         self.tab_inter = QtGui.QWidget()
         self.tab_inter.setObjectName("tab_inter")
-        self.widget3 = QtGui.QWidget(self.tab_inter)
-        self.widget3.setGeometry(QtCore.QRect(560, 10, 211, 171))
-        self.widget3.setObjectName("widget3")
-        self.verticalLayout_16 = QtGui.QVBoxLayout(self.widget3)
+        self.layoutWidget3 = QtGui.QWidget(self.tab_inter)
+        self.layoutWidget3.setGeometry(QtCore.QRect(560, 10, 211, 171))
+        self.layoutWidget3.setObjectName("layoutWidget3")
+        self.verticalLayout_16 = QtGui.QVBoxLayout(self.layoutWidget3)
         self.verticalLayout_16.setContentsMargins(0, 0, 0, 0)
         self.verticalLayout_16.setObjectName("verticalLayout_16")
-        self.commandLinkButton = QtGui.QCommandLinkButton(self.widget3)
-        self.commandLinkButton.setObjectName("commandLinkButton")
-        self.verticalLayout_16.addWidget(self.commandLinkButton)
-        self.textBrowser = QtGui.QTextBrowser(self.widget3)
+        self.boton_interseccion = QtGui.QCommandLinkButton(self.layoutWidget3)
+        self.boton_interseccion.setObjectName("boton_interseccion")
+        self.verticalLayout_16.addWidget(self.boton_interseccion)
+        self.textBrowser = QtGui.QTextBrowser(self.layoutWidget3)
         self.textBrowser.setObjectName("textBrowser")
         self.verticalLayout_16.addWidget(self.textBrowser)
-        self.widget4 = QtGui.QWidget(self.tab_inter)
-        self.widget4.setGeometry(QtCore.QRect(10, 10, 471, 171))
-        self.widget4.setObjectName("widget4")
-        self.horizontalLayout_9 = QtGui.QHBoxLayout(self.widget4)
+        self.layoutWidget4 = QtGui.QWidget(self.tab_inter)
+        self.layoutWidget4.setGeometry(QtCore.QRect(10, 10, 471, 171))
+        self.layoutWidget4.setObjectName("layoutWidget4")
+        self.horizontalLayout_9 = QtGui.QHBoxLayout(self.layoutWidget4)
         self.horizontalLayout_9.setContentsMargins(0, 0, 0, 0)
         self.horizontalLayout_9.setObjectName("horizontalLayout_9")
         self.verticalLayout_8 = QtGui.QVBoxLayout()
         self.verticalLayout_8.setObjectName("verticalLayout_8")
-        self.label_13 = QtGui.QLabel(self.widget4)
+        self.label_13 = QtGui.QLabel(self.layoutWidget4)
         self.label_13.setObjectName("label_13")
         self.verticalLayout_8.addWidget(self.label_13)
         self.verticalLayout_9 = QtGui.QVBoxLayout()
         self.horizontalLayout_5.setObjectName("horizontalLayout_5")
         self.verticalLayout_10 = QtGui.QVBoxLayout()
         self.verticalLayout_10.setObjectName("verticalLayout_10")
-        self.label_14 = QtGui.QLabel(self.widget4)
+        self.label_14 = QtGui.QLabel(self.layoutWidget4)
         self.label_14.setObjectName("label_14")
         self.verticalLayout_10.addWidget(self.label_14)
         self.formLayout_4 = QtGui.QFormLayout()
         self.formLayout_4.setObjectName("formLayout_4")
-        self.label_15 = QtGui.QLabel(self.widget4)
+        self.label_15 = QtGui.QLabel(self.layoutWidget4)
         self.label_15.setObjectName("label_15")
         self.formLayout_4.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_15)
-        self.x_pto1_2 = QtGui.QSpinBox(self.widget4)
+        self.x_pto1_2 = QtGui.QSpinBox(self.layoutWidget4)
         self.x_pto1_2.setMaximum(5000)
         self.x_pto1_2.setObjectName("x_pto1_2")
         self.formLayout_4.setWidget(0, QtGui.QFormLayout.FieldRole, self.x_pto1_2)
-        self.y_pto1_2 = QtGui.QSpinBox(self.widget4)
+        self.y_pto1_2 = QtGui.QSpinBox(self.layoutWidget4)
         self.y_pto1_2.setMaximum(5000)
         self.y_pto1_2.setObjectName("y_pto1_2")
         self.formLayout_4.setWidget(2, QtGui.QFormLayout.FieldRole, self.y_pto1_2)
-        self.label_16 = QtGui.QLabel(self.widget4)
+        self.label_16 = QtGui.QLabel(self.layoutWidget4)
         self.label_16.setObjectName("label_16")
         self.formLayout_4.setWidget(2, QtGui.QFormLayout.LabelRole, self.label_16)
         self.verticalLayout_10.addLayout(self.formLayout_4)
         self.horizontalLayout_5.addLayout(self.verticalLayout_10)
-        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        self.horizontalLayout_5.addItem(spacerItem4)
+        spacerItem5 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        self.horizontalLayout_5.addItem(spacerItem5)
         self.verticalLayout_11 = QtGui.QVBoxLayout()
         self.verticalLayout_11.setObjectName("verticalLayout_11")
-        self.label_17 = QtGui.QLabel(self.widget4)
+        self.label_17 = QtGui.QLabel(self.layoutWidget4)
         self.label_17.setObjectName("label_17")
         self.verticalLayout_11.addWidget(self.label_17)
         self.formLayout_5 = QtGui.QFormLayout()
         self.formLayout_5.setObjectName("formLayout_5")
-        self.label_18 = QtGui.QLabel(self.widget4)
+        self.label_18 = QtGui.QLabel(self.layoutWidget4)
         self.label_18.setObjectName("label_18")
         self.formLayout_5.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_18)
-        self.x_pto2_2 = QtGui.QSpinBox(self.widget4)
+        self.x_pto2_2 = QtGui.QSpinBox(self.layoutWidget4)
         self.x_pto2_2.setMaximum(5000)
         self.x_pto2_2.setObjectName("x_pto2_2")
         self.formLayout_5.setWidget(0, QtGui.QFormLayout.FieldRole, self.x_pto2_2)
-        self.y_pto2_2 = QtGui.QSpinBox(self.widget4)
+        self.y_pto2_2 = QtGui.QSpinBox(self.layoutWidget4)
         self.y_pto2_2.setMaximum(5000)
         self.y_pto2_2.setObjectName("y_pto2_2")
         self.formLayout_5.setWidget(2, QtGui.QFormLayout.FieldRole, self.y_pto2_2)
-        self.label_19 = QtGui.QLabel(self.widget4)
+        self.label_19 = QtGui.QLabel(self.layoutWidget4)
         self.label_19.setObjectName("label_19")
         self.formLayout_5.setWidget(2, QtGui.QFormLayout.LabelRole, self.label_19)
         self.verticalLayout_11.addLayout(self.formLayout_5)
         self.verticalLayout_9.addLayout(self.horizontalLayout_6)
         self.verticalLayout_8.addLayout(self.verticalLayout_9)
         self.horizontalLayout_9.addLayout(self.verticalLayout_8)
-        spacerItem5 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        self.horizontalLayout_9.addItem(spacerItem5)
+        spacerItem6 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        self.horizontalLayout_9.addItem(spacerItem6)
         self.verticalLayout_12 = QtGui.QVBoxLayout()
         self.verticalLayout_12.setObjectName("verticalLayout_12")
-        self.label_20 = QtGui.QLabel(self.widget4)
+        self.label_20 = QtGui.QLabel(self.layoutWidget4)
         self.label_20.setObjectName("label_20")
         self.verticalLayout_12.addWidget(self.label_20)
         self.verticalLayout_13 = QtGui.QVBoxLayout()
         self.horizontalLayout_7.setObjectName("horizontalLayout_7")
         self.verticalLayout_14 = QtGui.QVBoxLayout()
         self.verticalLayout_14.setObjectName("verticalLayout_14")
-        self.label_21 = QtGui.QLabel(self.widget4)
+        self.label_21 = QtGui.QLabel(self.layoutWidget4)
         self.label_21.setObjectName("label_21")
         self.verticalLayout_14.addWidget(self.label_21)
         self.formLayout_6 = QtGui.QFormLayout()
         self.formLayout_6.setObjectName("formLayout_6")
-        self.label_22 = QtGui.QLabel(self.widget4)
+        self.label_22 = QtGui.QLabel(self.layoutWidget4)
         self.label_22.setObjectName("label_22")
         self.formLayout_6.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_22)
-        self.x_pto1_3 = QtGui.QSpinBox(self.widget4)
+        self.x_pto1_3 = QtGui.QSpinBox(self.layoutWidget4)
         self.x_pto1_3.setMaximum(5000)
         self.x_pto1_3.setObjectName("x_pto1_3")
         self.formLayout_6.setWidget(0, QtGui.QFormLayout.FieldRole, self.x_pto1_3)
-        self.y_pto1_3 = QtGui.QSpinBox(self.widget4)
+        self.y_pto1_3 = QtGui.QSpinBox(self.layoutWidget4)
         self.y_pto1_3.setMaximum(5000)
         self.y_pto1_3.setObjectName("y_pto1_3")
         self.formLayout_6.setWidget(2, QtGui.QFormLayout.FieldRole, self.y_pto1_3)
-        self.label_23 = QtGui.QLabel(self.widget4)
+        self.label_23 = QtGui.QLabel(self.layoutWidget4)
         self.label_23.setObjectName("label_23")
         self.formLayout_6.setWidget(2, QtGui.QFormLayout.LabelRole, self.label_23)
         self.verticalLayout_14.addLayout(self.formLayout_6)
         self.horizontalLayout_7.addLayout(self.verticalLayout_14)
-        spacerItem6 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
-        self.horizontalLayout_7.addItem(spacerItem6)
+        spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+        self.horizontalLayout_7.addItem(spacerItem7)
         self.verticalLayout_15 = QtGui.QVBoxLayout()
         self.verticalLayout_15.setObjectName("verticalLayout_15")
-        self.label_24 = QtGui.QLabel(self.widget4)
+        self.label_24 = QtGui.QLabel(self.layoutWidget4)
         self.label_24.setObjectName("label_24")
         self.verticalLayout_15.addWidget(self.label_24)
         self.formLayout_7 = QtGui.QFormLayout()
         self.formLayout_7.setObjectName("formLayout_7")
-        self.label_25 = QtGui.QLabel(self.widget4)
+        self.label_25 = QtGui.QLabel(self.layoutWidget4)
         self.label_25.setObjectName("label_25")
         self.formLayout_7.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_25)
-        self.x_pto2_3 = QtGui.QSpinBox(self.widget4)
+        self.x_pto2_3 = QtGui.QSpinBox(self.layoutWidget4)
         self.x_pto2_3.setMaximum(5000)
         self.x_pto2_3.setObjectName("x_pto2_3")
         self.formLayout_7.setWidget(0, QtGui.QFormLayout.FieldRole, self.x_pto2_3)
-        self.y_pto2_3 = QtGui.QSpinBox(self.widget4)
+        self.y_pto2_3 = QtGui.QSpinBox(self.layoutWidget4)
         self.y_pto2_3.setMaximum(5000)
         self.y_pto2_3.setObjectName("y_pto2_3")
         self.formLayout_7.setWidget(2, QtGui.QFormLayout.FieldRole, self.y_pto2_3)
-        self.label_26 = QtGui.QLabel(self.widget4)
+        self.label_26 = QtGui.QLabel(self.layoutWidget4)
         self.label_26.setObjectName("label_26")
         self.formLayout_7.setWidget(2, QtGui.QFormLayout.LabelRole, self.label_26)
         self.verticalLayout_15.addLayout(self.formLayout_7)
         CVentanaPrincipal.setStatusBar(self.statusbar)
 
         self.retranslateUi(CVentanaPrincipal)
-        self.tab_principal.setCurrentIndex(2)
+        self.tab_principal.setCurrentIndex(1)
         QtCore.QMetaObject.connectSlotsByName(CVentanaPrincipal)
 
     def retranslateUi(self, CVentanaPrincipal):
         self.boton_anadir_pto.setText(QtGui.QApplication.translate("CVentanaPrincipal", "Añadir Punto", None, QtGui.QApplication.UnicodeUTF8))
         self.label_4.setText(QtGui.QApplication.translate("CVentanaPrincipal", "Generar", None, QtGui.QApplication.UnicodeUTF8))
         self.label_5.setText(QtGui.QApplication.translate("CVentanaPrincipal", "puntos aleatorios", None, QtGui.QApplication.UnicodeUTF8))
-        self.pushButton.setText(QtGui.QApplication.translate("CVentanaPrincipal", "Aceptar", None, QtGui.QApplication.UnicodeUTF8))
+        self.boton_puntos_alea.setText(QtGui.QApplication.translate("CVentanaPrincipal", "Aceptar", None, QtGui.QApplication.UnicodeUTF8))
         self.tab_principal.setTabText(self.tab_principal.indexOf(self.tab_ins), QtGui.QApplication.translate("CVentanaPrincipal", "Insertar Puntos", None, QtGui.QApplication.UnicodeUTF8))
         self.label_12.setText(QtGui.QApplication.translate("CVentanaPrincipal", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
 "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
         self.label_11.setText(QtGui.QApplication.translate("CVentanaPrincipal", "Punto 2", None, QtGui.QApplication.UnicodeUTF8))
         self.label_8.setText(QtGui.QApplication.translate("CVentanaPrincipal", "X", None, QtGui.QApplication.UnicodeUTF8))
         self.label_9.setText(QtGui.QApplication.translate("CVentanaPrincipal", "Y", None, QtGui.QApplication.UnicodeUTF8))
-        self.pushButton_2.setText(QtGui.QApplication.translate("CVentanaPrincipal", "Puntos con la menor coordenada X", None, QtGui.QApplication.UnicodeUTF8))
-        self.pushButton_3.setText(QtGui.QApplication.translate("CVentanaPrincipal", "Puntos con la mayor coordenada Y", None, QtGui.QApplication.UnicodeUTF8))
+        self.boton_menor_x.setText(QtGui.QApplication.translate("CVentanaPrincipal", "Puntos con la menor coordenada X", None, QtGui.QApplication.UnicodeUTF8))
+        self.boton_mayor_y.setText(QtGui.QApplication.translate("CVentanaPrincipal", "Puntos con la mayor coordenada Y", None, QtGui.QApplication.UnicodeUTF8))
+        self.boton_enumerar.setText(QtGui.QApplication.translate("CVentanaPrincipal", "Enumerar puntos en rectángulo", None, QtGui.QApplication.UnicodeUTF8))
         self.tab_principal.setTabText(self.tab_principal.indexOf(self.tab_busc), QtGui.QApplication.translate("CVentanaPrincipal", "Buscar puntos en rectángulo", None, QtGui.QApplication.UnicodeUTF8))
-        self.commandLinkButton.setText(QtGui.QApplication.translate("CVentanaPrincipal", "Puntos en la Intersección", None, QtGui.QApplication.UnicodeUTF8))
+        self.boton_interseccion.setText(QtGui.QApplication.translate("CVentanaPrincipal", "Puntos en la Intersección", None, QtGui.QApplication.UnicodeUTF8))
         self.label_13.setText(QtGui.QApplication.translate("CVentanaPrincipal", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
 "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
 "p, li { white-space: pre-wrap; }\n"