[QGIS Commit] r13367 - trunk/qgis/src/plugins/spatialquery

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Apr 24 14:11:41 EDT 2010


Author: jef
Date: 2010-04-24 14:11:40 -0400 (Sat, 24 Apr 2010)
New Revision: 13367

Removed:
   trunk/qgis/src/plugins/spatialquery/ts/
Modified:
   trunk/qgis/src/plugins/spatialquery/CMakeLists.txt
   trunk/qgis/src/plugins/spatialquery/qgsspatialquery.cpp
   trunk/qgis/src/plugins/spatialquery/qgsspatialquery.h
   trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.cpp
   trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.h
   trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialogbase.ui
Log:
spatial query plugin: port to new QgsGeometry operators, gui cleanup

Modified: trunk/qgis/src/plugins/spatialquery/CMakeLists.txt
===================================================================
--- trunk/qgis/src/plugins/spatialquery/CMakeLists.txt	2010-04-24 18:07:59 UTC (rev 13366)
+++ trunk/qgis/src/plugins/spatialquery/CMakeLists.txt	2010-04-24 18:11:40 UTC (rev 13367)
@@ -41,13 +41,11 @@
      ../../core/symbology
      ../../gui
      ..
-     ${GEOS_INCLUDE_DIR}
 )
 
 TARGET_LINK_LIBRARIES(spatialqueryplugin
   qgis_core
   qgis_gui
-  ${GEOS_LIBRARY}
 )
 
 

Modified: trunk/qgis/src/plugins/spatialquery/qgsspatialquery.cpp
===================================================================
--- trunk/qgis/src/plugins/spatialquery/qgsspatialquery.cpp	2010-04-24 18:07:59 UTC (rev 13366)
+++ trunk/qgis/src/plugins/spatialquery/qgsspatialquery.cpp	2010-04-24 18:11:40 UTC (rev 13367)
@@ -55,7 +55,7 @@
   setQuery( lyrTarget, lyrReference );
 
   // Create Spatial index for Reference - Set mIndexReference
-  mPb->setFormat( "Processing 1/2 - %p%" );
+  mPb->setFormat( QObject::tr( "Processing 1/2 - %p%" ) );
   int totalStep = mUseReferenceSelection
                   ? mLayerReference->selectedFeatureCount()
                   : ( int )( mLayerReference->featureCount() );
@@ -63,7 +63,7 @@
   setSpatialIndexReference(); // Need set mLayerReference before
 
   // Make Query
-  mPb->setFormat( "Processing 2/2 - %p%" );
+  mPb->setFormat( QObject::tr( "Processing 2/2 - %p%" ) );
   totalStep = mUseTargetSelection
               ? mLayerTarget->selectedFeatureCount()
               : ( int )( mLayerTarget->featureCount() );
@@ -181,9 +181,7 @@
     return false;
   }
 
-  GEOSGeometry *geomGeos = geom->asGeos();
-
-  if ( GEOSisEmpty( geomGeos ) || 1 !=  GEOSisValid( geomGeos ) )
+  if ( geom->isGeosEmpty() || !geom->isGeosValid() )
   {
     return false;
   }
@@ -218,33 +216,32 @@
 
 void QgsSpatialQuery::execQuery( QSet<int> & qsetIndexResult, int relation )
 {
-  // Set GEOS function
-  char( *operation )( const GEOSGeometry *, const GEOSGeometry* );
+  bool ( QgsGeometry::* operation )( QgsGeometry * );
   switch ( relation )
   {
     case Disjoint:
-      operation = &GEOSDisjoint;
+      operation = &QgsGeometry::disjoint;
       break;
     case Equals:
-      operation = &GEOSEquals;
+      operation = &QgsGeometry::equals;
       break;
     case Touches:
-      operation = &GEOSTouches;
+      operation = &QgsGeometry::touches;
       break;
     case Overlaps:
-      operation = &GEOSOverlaps;
+      operation = &QgsGeometry::overlaps;
       break;
     case Within:
-      operation = &GEOSWithin;
+      operation = &QgsGeometry::within;
       break;
     case Contains:
-      operation = &GEOSContains;
+      operation = &QgsGeometry::contains;
       break;
     case Crosses:
-      operation = &GEOSCrosses;
+      operation = &QgsGeometry::crosses;
       break;
     case Intersects:
-      operation = &GEOSIntersects;
+      operation = &QgsGeometry::intersects;
       break;
   }
 
@@ -253,9 +250,7 @@
   coordinateTransform->setCoordinateTransform( mLayerTarget, mLayerReference );
 
   // Set function for populate result
-  void ( QgsSpatialQuery::* funcPopulateIndexResult )
-  ( QSet<int> &, int, QgsGeometry *,
-    char( * )( const GEOSGeometry *, const GEOSGeometry * ) );
+  void ( QgsSpatialQuery::* funcPopulateIndexResult )( QSet<int> &, int, QgsGeometry *, bool ( QgsGeometry::* )( QgsGeometry * ) );
   funcPopulateIndexResult = ( relation == Disjoint )
                             ? &QgsSpatialQuery::populateIndexResultDisjoint
                             : &QgsSpatialQuery::populateIndexResult;
@@ -263,10 +258,8 @@
   QgsFeature featureTarget;
   QgsGeometry * geomTarget;
   int step = 1;
-  while ( true )
+  while ( mReaderFeaturesTarget->nextFeature( featureTarget ) )
   {
-    if ( ! mReaderFeaturesTarget->nextFeature( featureTarget ) ) break;
-
     mPb->step( step++ );
 
     if ( ! hasValidGeometry( featureTarget ) )
@@ -285,7 +278,7 @@
 
 void QgsSpatialQuery::populateIndexResult(
   QSet<int> &qsetIndexResult, int idTarget, QgsGeometry * geomTarget,
-  char( *operation )( const GEOSGeometry *, const GEOSGeometry * ) )
+  bool ( QgsGeometry::* op )( QgsGeometry * ) )
 {
   QList<int> listIdReference;
   listIdReference = mIndexReference.intersects( geomTarget->boundingBox() );
@@ -293,7 +286,6 @@
   {
     return;
   }
-  GEOSGeometry * geosTarget = geomTarget->asGeos();
   QgsFeature featureReference;
   QgsGeometry * geomReference;
   QList<int>::iterator iterIdReference = listIdReference.begin();
@@ -301,7 +293,7 @@
   {
     mLayerReference->featureAtId( *iterIdReference, featureReference );
     geomReference = featureReference.geometry();
-    if (( *operation )( geosTarget, geomReference->asGeos() ) == 1 )
+    if (( geomTarget->*op )( geomReference ) == 1 )
     {
       qsetIndexResult.insert( idTarget );
       break;
@@ -312,7 +304,7 @@
 
 void QgsSpatialQuery::populateIndexResultDisjoint(
   QSet<int> &qsetIndexResult, int idTarget, QgsGeometry * geomTarget,
-  char( *operation )( const GEOSGeometry *, const GEOSGeometry * ) )
+  bool ( QgsGeometry::* op )( QgsGeometry * ) )
 {
   QList<int> listIdReference;
   listIdReference = mIndexReference.intersects( geomTarget->boundingBox() );
@@ -321,7 +313,6 @@
     qsetIndexResult.insert( idTarget );
     return;
   }
-  GEOSGeometry * geosTarget = geomTarget->asGeos();
   QgsFeature featureReference;
   QgsGeometry * geomReference;
   QList<int>::iterator iterIdReference = listIdReference.begin();
@@ -330,7 +321,7 @@
   {
     mLayerReference->featureAtId( *iterIdReference, featureReference );
     geomReference = featureReference.geometry();
-    if (( *operation )( geosTarget, geomReference->asGeos() ) == 0 )
+    if (( geomTarget->*op )( geomTarget ) == 0 )
     {
       addIndex = false;
       break;

Modified: trunk/qgis/src/plugins/spatialquery/qgsspatialquery.h
===================================================================
--- trunk/qgis/src/plugins/spatialquery/qgsspatialquery.h	2010-04-24 18:07:59 UTC (rev 13366)
+++ trunk/qgis/src/plugins/spatialquery/qgsspatialquery.h	2010-04-24 18:11:40 UTC (rev 13367)
@@ -19,8 +19,6 @@
 #ifndef SPATIALQUERY_H
 #define SPATIALQUERY_H
 
-#include <geos_c.h>
-
 #include <qgsvectorlayer.h>
 #include <qgsspatialindex.h>
 
@@ -137,7 +135,7 @@
     */
     void populateIndexResult(
       QSet<int> & qsetIndexResult, int idTarget, QgsGeometry * geomTarget,
-      char( *operation )( const GEOSGeometry *, const GEOSGeometry * ) );
+      bool ( QgsGeometry::* operation )( QgsGeometry * ) );
     /**
     * \brief Populate index Result Disjoint
     * \param qsetIndexResult    Reference to QSet contains the result query
@@ -147,7 +145,7 @@
     */
     void populateIndexResultDisjoint(
       QSet<int> & qsetIndexResult, int idTarget, QgsGeometry * geomTarget,
-      char( *operation )( const GEOSGeometry *, const GEOSGeometry * ) );
+      bool ( QgsGeometry::* operation )( QgsGeometry * ) );
 
     MngProgressBar *mPb;
     bool mUseReferenceSelection;

Modified: trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.cpp
===================================================================
--- trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.cpp	2010-04-24 18:07:59 UTC (rev 13366)
+++ trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.cpp	2010-04-24 18:11:40 UTC (rev 13367)
@@ -152,7 +152,7 @@
   checkbox->setChecked( isCheckBoxValid );
   checkbox->setEnabled( isCheckBoxValid );
   QString textCheckBox  = isCheckBoxValid
-                          ? QString::number( selectedCount ) + " " + tr( "Selected geometries" )
+                          ? tr( "%n selected geometries", "selected geometries", selectedCount )
                           : tr( "Selected geometries" );
   checkbox->setText( textCheckBox );
 
@@ -185,30 +185,37 @@
   buttonBox->setEnabled( true );
 
   grpResults->show();
-  grpInputs->hide();
+  setInputsVisible( false );
   progressBarStatus->hide();
   buttonBox->button( QDialogButtonBox::Close )->show();
   buttonBox->button( QDialogButtonBox::Cancel )->hide();
   buttonBox->button( QDialogButtonBox::Ok )->hide();
 } // void QgsSpatialQueryDialog::runQuery()
 
+void QgsSpatialQueryDialog::setInputsVisible( bool show )
+{
+  grpTargetGroupBox->setVisible( show );
+  grpReferenceGroupBox->setVisible( show );
+  grpOperationGroupBox->setVisible( show );
+}
+
 void QgsSpatialQueryDialog::showLogProcessing( bool hasShow )
 {
   static int heightDialogNoStatus = 0;
 
   hasShow ? textEditStatus->show() : textEditStatus->hide();
-  this->adjustSize();
+  adjustSize();
 
   if ( ! hasShow )
   {
     if ( heightDialogNoStatus == 0 )
     {
-      heightDialogNoStatus = this->geometry().height();
+      heightDialogNoStatus = geometry().height();
     }
     else
     {
-      this->setGeometry( this->geometry().x(), this->geometry().y(),
-                         this->geometry().width(), heightDialogNoStatus );
+      setGeometry( geometry().x(), geometry().y(),
+                   geometry().width(), heightDialogNoStatus );
     }
   }
 
@@ -613,18 +620,18 @@
   mRubberSelectId->reset();
   selectedFeatureListWidget->setEnabled( false );
 
-  QCursor cursor;
-  cursor.setShape( Qt::WaitCursor );
-  Qt::CursorShape shapeCurrent = this->cursor().shape();
-  this->setCursor( cursor );
-  cursor.setShape( shapeCurrent );
+  QCursor c;
+  c.setShape( Qt::WaitCursor );
+  Qt::CursorShape shapeCurrent = cursor().shape();
+  setCursor( c );
+  c.setShape( shapeCurrent );
 
   bool ok;
   int Id = currentText.toInt( &ok );
   mRubberSelectId->addFeature( mLayerTarget, Id );
 
   selectedFeatureListWidget->setEnabled( true );
-  this->setCursor( cursor );
+  setCursor( c );
   selectedFeatureListWidget->setFocus();
   mRubberSelectId->show();
 

Modified: trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.h
===================================================================
--- trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.h	2010-04-24 18:07:59 UTC (rev 13366)
+++ trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.h	2010-04-24 18:11:40 UTC (rev 13367)
@@ -122,10 +122,13 @@
     //! Rubber band for features result
     QgsRubberSelectId* mRubberSelectId;
 
-    // Menssage
+    // Message
     QString mMsgLayersLessTwo;
 
     void MsgDEBUG( QString sMSg );
+
+    //! show/hide target, reference and operation group box
+    void setInputsVisible( bool show );
 };
 
 #endif // SPATIALQUERYDIALOG_H

Modified: trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialogbase.ui
===================================================================
--- trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialogbase.ui	2010-04-24 18:07:59 UTC (rev 13366)
+++ trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialogbase.ui	2010-04-24 18:11:40 UTC (rev 13367)
@@ -9,8 +9,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>543</width>
-    <height>459</height>
+    <width>532</width>
+    <height>680</height>
    </rect>
   </property>
   <property name="minimumSize">
@@ -35,215 +35,39 @@
    <locale language="English" country="UnitedKingdom"/>
   </property>
   <layout class="QGridLayout" name="gridLayout_3">
-   <item row="0" column="0">
-    <widget class="QGroupBox" name="grpInputs">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="minimumSize">
-      <size>
-       <width>230</width>
-       <height>285</height>
-      </size>
-     </property>
+   <item row="8" column="0" colspan="2">
+    <widget class="QDialogButtonBox" name="buttonBox">
      <property name="maximumSize">
       <size>
        <width>16777215</width>
        <height>16777215</height>
       </size>
      </property>
-     <property name="title">
-      <string>Layers</string>
+     <property name="contextMenuPolicy">
+      <enum>Qt::DefaultContextMenu</enum>
      </property>
-     <layout class="QGridLayout" name="gridLayout_2">
-      <item row="0" column="0">
-       <widget class="QGroupBox" name="targetGroupBox">
-        <property name="toolTip">
-         <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Layer where yours &lt;/span&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;geometrys&lt;/span&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt; will be selected by topological operation&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-        </property>
-        <property name="title">
-         <string>Target layer</string>
-        </property>
-        <widget class="QCheckBox" name="usingSelectedTargetCheckBox">
-         <property name="geometry">
-          <rect>
-           <x>1</x>
-           <y>50</y>
-           <width>201</width>
-           <height>18</height>
-          </rect>
-         </property>
-         <property name="toolTip">
-          <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;When mark the  operation will be only selected geometry of target&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-         </property>
-         <property name="text">
-          <string>Selected feature(s) only</string>
-         </property>
-        </widget>
-        <widget class="QComboBox" name="targetLayerComboBox">
-         <property name="geometry">
-          <rect>
-           <x>1</x>
-           <y>18</y>
-           <width>211</width>
-           <height>26</height>
-          </rect>
-         </property>
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="minimumSize">
-          <size>
-           <width>206</width>
-           <height>26</height>
-          </size>
-         </property>
-         <property name="maximumSize">
-          <size>
-           <width>16777215</width>
-           <height>16777215</height>
-          </size>
-         </property>
-         <property name="toolTip">
-          <string>Select the target layer</string>
-         </property>
-        </widget>
-       </widget>
-      </item>
-      <item row="1" column="0">
-       <widget class="QGroupBox" name="OperationGroupBox">
-        <property name="toolTip">
-         <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Topological operations between layers of target and reference&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-        </property>
-        <property name="title">
-         <string>Topological operation</string>
-        </property>
-        <widget class="QComboBox" name="operantionComboBox">
-         <property name="geometry">
-          <rect>
-           <x>1</x>
-           <y>18</y>
-           <width>206</width>
-           <height>26</height>
-          </rect>
-         </property>
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
-           <horstretch>10</horstretch>
-           <verstretch>116</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="minimumSize">
-          <size>
-           <width>206</width>
-           <height>26</height>
-          </size>
-         </property>
-         <property name="maximumSize">
-          <size>
-           <width>16777215</width>
-           <height>16777215</height>
-          </size>
-         </property>
-         <property name="toolTip">
-          <string>Select the topological operation</string>
-         </property>
-        </widget>
-       </widget>
-      </item>
-      <item row="2" column="0">
-       <widget class="QGroupBox" name="ReferenceGroupBox">
-        <property name="toolTip">
-         <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Layer where yours geometrys will be used how reference by topological operation&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-        </property>
-        <property name="title">
-         <string>Reference layer</string>
-        </property>
-        <widget class="QCheckBox" name="usingSelectedReferenceCheckBox">
-         <property name="geometry">
-          <rect>
-           <x>1</x>
-           <y>50</y>
-           <width>201</width>
-           <height>18</height>
-          </rect>
-         </property>
-         <property name="maximumSize">
-          <size>
-           <width>16777215</width>
-           <height>18</height>
-          </size>
-         </property>
-         <property name="toolTip">
-          <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;When mark the  operation will be only selected geometry of reference&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-         </property>
-         <property name="text">
-          <string>Selected feature(s) only</string>
-         </property>
-        </widget>
-        <widget class="QComboBox" name="referenceLayerComboBox">
-         <property name="geometry">
-          <rect>
-           <x>1</x>
-           <y>18</y>
-           <width>206</width>
-           <height>26</height>
-          </rect>
-         </property>
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="minimumSize">
-          <size>
-           <width>206</width>
-           <height>26</height>
-          </size>
-         </property>
-         <property name="maximumSize">
-          <size>
-           <width>16777215</width>
-           <height>16777215</height>
-          </size>
-         </property>
-         <property name="toolTip">
-          <string>Select the reference layer</string>
-         </property>
-        </widget>
-       </widget>
-      </item>
-     </layout>
+     <property name="toolTip">
+      <string>Run query or close the window</string>
+     </property>
+     <property name="standardButtons">
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
+     </property>
     </widget>
    </item>
-   <item row="0" column="1" rowspan="2">
+   <item row="6" column="0" colspan="2">
+    <widget class="QProgressBar" name="progressBarStatus">
+     <property name="value">
+      <number>0</number>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignCenter</set>
+     </property>
+     <property name="textVisible">
+      <bool>false</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="7" column="0">
     <widget class="QGroupBox" name="grpResults">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
@@ -254,8 +78,8 @@
      <property name="title">
       <string>Results (click to highlight on map)</string>
      </property>
-     <layout class="QGridLayout" name="gridLayout">
-      <item row="0" column="0">
+     <layout class="QVBoxLayout" name="verticalLayout">
+      <item>
        <widget class="QListWidget" name="selectedFeatureListWidget">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -280,7 +104,17 @@
         </property>
        </widget>
       </item>
-      <item row="2" column="0">
+      <item>
+       <widget class="QCheckBox" name="showLogProcessingCheckBox">
+        <property name="toolTip">
+         <string>Check to show log processing of query</string>
+        </property>
+        <property name="text">
+         <string>Show log messages</string>
+        </property>
+       </widget>
+      </item>
+      <item>
        <widget class="QTextEdit" name="textEditStatus">
         <property name="enabled">
          <bool>true</bool>
@@ -290,7 +124,7 @@
         </property>
        </widget>
       </item>
-      <item row="3" column="0">
+      <item>
        <widget class="QLabel" name="countSelectedFeats">
         <property name="minimumSize">
          <size>
@@ -312,49 +146,154 @@
         </property>
        </widget>
       </item>
-      <item row="1" column="0">
-       <widget class="QCheckBox" name="showLogProcessingCheckBox">
+     </layout>
+    </widget>
+   </item>
+   <item row="0" column="0">
+    <widget class="QGroupBox" name="grpTargetGroupBox">
+     <property name="toolTip">
+      <string>Layer on which the topological operation will select geometries</string>
+     </property>
+     <property name="title">
+      <string>Target layer</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_3">
+      <item>
+       <widget class="QComboBox" name="targetLayerComboBox">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>206</width>
+          <height>26</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>16777215</height>
+         </size>
+        </property>
         <property name="toolTip">
-         <string>Mark to show log processing of query</string>
+         <string>Select the target layer</string>
         </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="usingSelectedTargetCheckBox">
+        <property name="toolTip">
+         <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;When checked the operation will only consider selected geometries of the target layer&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+        </property>
         <property name="text">
-         <string>Show log messages</string>
+         <string>Selected feature(s) only</string>
         </property>
        </widget>
       </item>
      </layout>
+     <zorder>usingSelectedTargetCheckBox</zorder>
+     <zorder>targetLayerComboBox</zorder>
     </widget>
    </item>
    <item row="1" column="0">
-    <widget class="QProgressBar" name="progressBarStatus">
-     <property name="value">
-      <number>0</number>
+    <widget class="QGroupBox" name="grpReferenceGroupBox">
+     <property name="toolTip">
+      <string>Layer whose geometries will be used as reference by the topological operation</string>
      </property>
-     <property name="alignment">
-      <set>Qt::AlignCenter</set>
+     <property name="title">
+      <string>Reference layer</string>
      </property>
-     <property name="textVisible">
-      <bool>false</bool>
-     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_4">
+      <item>
+       <widget class="QComboBox" name="referenceLayerComboBox">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>206</width>
+          <height>26</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>16777215</height>
+         </size>
+        </property>
+        <property name="toolTip">
+         <string>Select the reference layer</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="usingSelectedReferenceCheckBox">
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>18</height>
+         </size>
+        </property>
+        <property name="toolTip">
+         <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;When checked the operation will be only consider selected geometries of the reference layer&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+        </property>
+        <property name="text">
+         <string>Selected feature(s) only</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
     </widget>
    </item>
-   <item row="2" column="0" colspan="2">
-    <widget class="QDialogButtonBox" name="buttonBox">
-     <property name="maximumSize">
-      <size>
-       <width>16777215</width>
-       <height>16777215</height>
-      </size>
-     </property>
-     <property name="contextMenuPolicy">
-      <enum>Qt::DefaultContextMenu</enum>
-     </property>
+   <item row="5" column="0">
+    <widget class="QGroupBox" name="grpOperationGroupBox">
      <property name="toolTip">
-      <string>Run query or close the window</string>
+      <string>Topological operations between layers of target and reference</string>
      </property>
-     <property name="standardButtons">
-      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
+     <property name="title">
+      <string>Topological operation</string>
      </property>
+     <layout class="QVBoxLayout" name="verticalLayout_5">
+      <item>
+       <widget class="QComboBox" name="operantionComboBox">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+          <horstretch>10</horstretch>
+          <verstretch>116</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize">
+         <size>
+          <width>206</width>
+          <height>26</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>16777215</height>
+         </size>
+        </property>
+        <property name="toolTip">
+         <string>Select the topological operation</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
     </widget>
    </item>
   </layout>



More information about the QGIS-commit mailing list