mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
raster sip fixes
This commit is contained in:
parent
94c2e1cbb0
commit
c6a29fa8a0
@ -6,7 +6,7 @@
|
||||
* sense for Raster layers.
|
||||
*/
|
||||
|
||||
class QgsRasterDataProvider : QgsDataProvider
|
||||
class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qgsrasterdataprovider.h>
|
||||
|
@ -7,7 +7,39 @@ class QgsRasterInterface
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qgsrasterinterface.h>
|
||||
#include <qgsrasterresamplefilter.h>
|
||||
//#include <qgsrasternuller.h>
|
||||
#include <qgsrasterrenderer.h>
|
||||
#include <qgsrasterprojector.h>
|
||||
#include <qgsrasterdataprovider.h>
|
||||
|
||||
// QgsRasterRenderer subclass headers must be here because ConvertToSubClassCode
|
||||
// from QgsRasterRenderer is probably included
|
||||
#include <qgspalettedrasterrenderer.h>
|
||||
#include <qgsmultibandcolorrenderer.h>
|
||||
#include <qgssinglebandpseudocolorrenderer.h>
|
||||
#include <qgssinglebandgrayrenderer.h>
|
||||
#include <qgssinglebandcolordatarenderer.h>
|
||||
%End
|
||||
|
||||
%ConvertToSubClassCode
|
||||
if (dynamic_cast<QgsRasterResampleFilter*>(sipCpp) != NULL)
|
||||
sipClass = sipClass_QgsRasterResampleFilter;
|
||||
// if (dynamic_cast<QgsRasterNuller*>(sipCpp) != NULL)
|
||||
// sipClass = sipClass_QgsRasterNuller;
|
||||
if (dynamic_cast<QgsRasterRenderer*>(sipCpp) != NULL)
|
||||
sipClass = sipClass_QgsRasterRenderer;
|
||||
if (dynamic_cast<QgsRasterProjector*>(sipCpp) != NULL)
|
||||
sipClass = sipClass_QgsRasterProjector;
|
||||
if (dynamic_cast<QgsRasterDataProvider*>(sipCpp) != NULL)
|
||||
{
|
||||
sipClass = sipClass_QgsRasterDataProvider;
|
||||
*sipCppRet = static_cast<QgsRasterDataProvider*>(sipCpp);
|
||||
}
|
||||
else
|
||||
sipClass = 0;
|
||||
%End
|
||||
|
||||
public:
|
||||
|
||||
enum DataType
|
||||
|
@ -23,11 +23,11 @@ class QgsRasterPipe
|
||||
|
||||
~QgsRasterPipe();
|
||||
|
||||
bool insert( int idx, QgsRasterInterface* theInterface );
|
||||
bool insert( int idx, QgsRasterInterface* theInterface /Transfer/ );
|
||||
|
||||
bool replace( int idx, QgsRasterInterface* theInterface );
|
||||
bool replace( int idx, QgsRasterInterface* theInterface /Transfer/ );
|
||||
|
||||
bool set( QgsRasterInterface * theInterface );
|
||||
bool set( QgsRasterInterface * theInterface /Transfer/ );
|
||||
|
||||
bool remove( int idx );
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/** Raster projector */
|
||||
|
||||
class QgsRasterProjector
|
||||
class QgsRasterProjector : QgsRasterInterface
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qgsrasterprojector.h>
|
||||
|
@ -1,4 +1,4 @@
|
||||
class QgsRasterRenderer
|
||||
class QgsRasterRenderer : QgsRasterInterface
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include "qgsrasterrenderer.h"
|
||||
@ -7,6 +7,7 @@ class QgsRasterRenderer
|
||||
#include "qgssinglebandpseudocolorrenderer.h"
|
||||
#include "qgssinglebandgrayrenderer.h"
|
||||
#include "qgssinglebandcolordatarenderer.h"
|
||||
#include "qgsrasterinterface.h"
|
||||
%End
|
||||
|
||||
%ConvertToSubClassCode
|
||||
@ -18,8 +19,8 @@ class QgsRasterRenderer
|
||||
sipClass = sipClass_QgsSingleBandPseudoColorRenderer;
|
||||
else if (dynamic_cast<QgsSingleBandGrayRenderer*>(sipCpp) != NULL)
|
||||
sipClass = sipClass_QgsSingleBandGrayRenderer;
|
||||
else if (dynamic_cast<QgsSingleBandGrayRenderer*>(sipCpp) != NULL)
|
||||
sipClass = sipClass_QgsSingleBandGrayRenderer;
|
||||
else if (dynamic_cast<QgsSingleBandGrayRenderer*>(sipCpp) != NULL)
|
||||
sipClass = sipClass_QgsSingleBandGrayRenderer;
|
||||
else
|
||||
sipClass = 0;
|
||||
%End
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/** Raster resample filter */
|
||||
|
||||
class QgsRasterResampleFilter
|
||||
class QgsRasterResampleFilter : QgsRasterInterface
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qgsrasterresamplefilter.h>
|
||||
|
@ -46,7 +46,7 @@ class TestQgsRasterFileWriter(unittest.TestCase):
|
||||
|
||||
projector = QgsRasterProjector()
|
||||
projector.setCRS( provider.crs(), provider.crs() )
|
||||
if not pipe.insert( 2, projector.clone() ):
|
||||
if not pipe.insert( 2, projector ):
|
||||
print "Cannot set pipe projector"
|
||||
return False
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user