mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
fix windows build
This commit is contained in:
parent
32d7cc5e00
commit
460a60556f
@ -22,18 +22,18 @@ MACRO(ADD_GRASSLIB GRASS_BUILD_VERSION)
|
||||
SET(GRASS_MAJOR_VERSION ${GRASS_MAJOR_VERSION${GRASS_BUILD_VERSION}})
|
||||
SET(GRASS_MINOR_VERSION ${GRASS_MINOR_VERSION${GRASS_BUILD_VERSION}})
|
||||
|
||||
QT4_WRAP_CPP(GRASS_LIBRARY_MOC_SRCS
|
||||
../qgsgrass.h
|
||||
../qgsgrassprovider.h
|
||||
QT4_WRAP_CPP(GRASS_LIBRARY_MOC_SRCS
|
||||
../qgsgrass.h
|
||||
../qgsgrassprovider.h
|
||||
../qgsgrassimport.h
|
||||
../qgsgrassoptions.h
|
||||
)
|
||||
|
||||
SET (GRASS_LIBRARY_SRCS
|
||||
../qgsgrass.cpp
|
||||
../qgsgrassdatafile.cpp
|
||||
../qgsgrassfeatureiterator.cpp
|
||||
../qgsgrassprovider.cpp
|
||||
../qgsgrass.cpp
|
||||
../qgsgrassdatafile.cpp
|
||||
../qgsgrassfeatureiterator.cpp
|
||||
../qgsgrassprovider.cpp
|
||||
../qgsgrassimport.cpp
|
||||
../qgsgrassoptions.cpp
|
||||
)
|
||||
@ -42,8 +42,8 @@ MACRO(ADD_GRASSLIB GRASS_BUILD_VERSION)
|
||||
../qgsgrassoptionsbase.ui
|
||||
)
|
||||
|
||||
ADD_LIBRARY(qgisgrass${GRASS_BUILD_VERSION} SHARED
|
||||
${GRASS_LIBRARY_SRCS}
|
||||
ADD_LIBRARY(qgisgrass${GRASS_BUILD_VERSION} SHARED
|
||||
${GRASS_LIBRARY_SRCS}
|
||||
${GRASS_LIBRARY_MOC_SRCS}
|
||||
${GRASS_LIBRARY_UIS_H}
|
||||
)
|
||||
@ -178,7 +178,7 @@ MACRO(ADD_GRASSLIB GRASS_BUILD_VERSION)
|
||||
#
|
||||
ADD_EXECUTABLE(qgis.r.in${GRASS_BUILD_VERSION} ../qgis.r.in.cpp)
|
||||
SET_TARGET_PROPERTIES(qgis.r.in${GRASS_BUILD_VERSION} PROPERTIES
|
||||
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\" \"-DGRASS_LIB_EXPORT=${DLLEXPORT}\" \"-DGRASS_EXPORT=${DLLIMPORT}\""
|
||||
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\" \"-DGRASS_LIB_EXPORT=${DLLIMPORT}\" \"-DGRASS_EXPORT=${DLLIMPORT}\""
|
||||
)
|
||||
IF (GRASS_MAJOR_VERSION LESS 7 )
|
||||
TARGET_LINK_LIBRARIES(qgis.r.in${GRASS_BUILD_VERSION}
|
||||
@ -204,7 +204,7 @@ MACRO(ADD_GRASSLIB GRASS_BUILD_VERSION)
|
||||
#
|
||||
ADD_EXECUTABLE(qgis.v.in${GRASS_BUILD_VERSION} ../qgis.v.in.cpp)
|
||||
SET_TARGET_PROPERTIES(qgis.v.in${GRASS_BUILD_VERSION} PROPERTIES
|
||||
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\" \"-DGRASS_LIB_EXPORT=${DLLEXPORT}\" \"-DGRASS_EXPORT=${DLLIMPORT}\""
|
||||
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\" \"-DGRASS_LIB_EXPORT=${DLLIMPORT}\" \"-DGRASS_EXPORT=${DLLIMPORT}\""
|
||||
)
|
||||
TARGET_LINK_LIBRARIES(qgis.v.in${GRASS_BUILD_VERSION}
|
||||
qgisgrass${GRASS_BUILD_VERSION}
|
||||
@ -233,10 +233,10 @@ MACRO(ADD_GRASSLIB GRASS_BUILD_VERSION)
|
||||
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
|
||||
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
|
||||
|
||||
INSTALL(TARGETS
|
||||
qgis.d.rast${GRASS_BUILD_VERSION}
|
||||
qgis.g.info${GRASS_BUILD_VERSION}
|
||||
qgis.r.in${GRASS_BUILD_VERSION}
|
||||
INSTALL(TARGETS
|
||||
qgis.d.rast${GRASS_BUILD_VERSION}
|
||||
qgis.g.info${GRASS_BUILD_VERSION}
|
||||
qgis.r.in${GRASS_BUILD_VERSION}
|
||||
qgis.v.in${GRASS_BUILD_VERSION}
|
||||
RUNTIME DESTINATION ${QGIS_LIBEXEC_DIR}/grass/modules
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
@ -706,7 +706,7 @@ IF(WITH_GRASS_DIRECT)
|
||||
ELSE(MSVC)
|
||||
SET (FAKE_LIB_GRASS_GIS "grass_gis.${GRASS_VERSION}")
|
||||
ENDIF(MSVC)
|
||||
ADD_LIBRARY( ${FAKE_LIB_GRASS_GIS} MODULE qgsgrassgislib.cpp qgsgrassgislibfunctions.cpp )
|
||||
ADD_LIBRARY(${FAKE_LIB_GRASS_GIS} MODULE qgsgrassgislib.cpp qgsgrassgislibfunctions.cpp )
|
||||
|
||||
# GRASS_LIBRARY_gis is path to the GRASS library used for compilation, it is the same
|
||||
# on runtime on Linux and Mac but on Windows with OSGEO4W the GRASS may be installed
|
||||
|
@ -163,7 +163,7 @@ QString QgsGrassObject::elementName() const
|
||||
return elementName( mType );
|
||||
}
|
||||
|
||||
QString GRASS_LIB_EXPORT QgsGrassObject::elementName( Type type )
|
||||
QString QgsGrassObject::elementName( Type type )
|
||||
{
|
||||
if ( type == Raster )
|
||||
return "raster";
|
||||
@ -182,7 +182,7 @@ QString QgsGrassObject::dirName() const
|
||||
return dirName( mType );
|
||||
}
|
||||
|
||||
QString GRASS_LIB_EXPORT QgsGrassObject::dirName( Type type )
|
||||
QString QgsGrassObject::dirName( Type type )
|
||||
{
|
||||
if ( type == Raster )
|
||||
return "cellhd";
|
||||
@ -215,7 +215,7 @@ bool QgsGrassObject::mapsetIdentical( const QgsGrassObject &other ) const
|
||||
return fi == otherFi;
|
||||
}
|
||||
|
||||
QRegExp GRASS_LIB_EXPORT QgsGrassObject::newNameRegExp( Type type )
|
||||
QRegExp QgsGrassObject::newNameRegExp( Type type )
|
||||
{
|
||||
QRegExp rx;
|
||||
if ( type == QgsGrassObject::Vector )
|
||||
@ -237,7 +237,7 @@ bool QgsGrassObject::operator==( const QgsGrassObject& other ) const
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <windows.h>
|
||||
QString GRASS_LIB_EXPORT QgsGrass::shortPath( const QString &path )
|
||||
QString QgsGrass::shortPath( const QString &path )
|
||||
{
|
||||
TCHAR buf[MAX_PATH];
|
||||
int len = GetShortPathName( path.toUtf8().constData(), buf, MAX_PATH );
|
||||
@ -256,7 +256,7 @@ QString GRASS_LIB_EXPORT QgsGrass::shortPath( const QString &path )
|
||||
}
|
||||
#endif
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::init( void )
|
||||
void QgsGrass::init( void )
|
||||
{
|
||||
// Warning!!!
|
||||
// G_set_error_routine() once called from plugin
|
||||
@ -644,23 +644,23 @@ int QgsGrass::error_routine( const char *msg, int fatal )
|
||||
return 1;
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::resetError( void )
|
||||
void QgsGrass::resetError( void )
|
||||
{
|
||||
lastError = OK;
|
||||
}
|
||||
|
||||
int GRASS_LIB_EXPORT QgsGrass::error( void )
|
||||
int QgsGrass::error( void )
|
||||
{
|
||||
return lastError;
|
||||
}
|
||||
|
||||
QString GRASS_LIB_EXPORT QgsGrass::errorMessage( void )
|
||||
QString QgsGrass::errorMessage( void )
|
||||
{
|
||||
return error_message;
|
||||
}
|
||||
|
||||
QString GRASS_LIB_EXPORT QgsGrass::openMapset( const QString& gisdbase,
|
||||
const QString& location, const QString& mapset )
|
||||
QString QgsGrass::openMapset( const QString& gisdbase,
|
||||
const QString& location, const QString& mapset )
|
||||
{
|
||||
QgsDebugMsg( QString( "gisdbase = %1" ).arg( gisdbase.toUtf8().constData() ) );
|
||||
QgsDebugMsg( QString( "location = %1" ).arg( location.toUtf8().constData() ) );
|
||||
@ -845,7 +845,7 @@ QString GRASS_LIB_EXPORT QgsGrass::openMapset( const QString& gisdbase,
|
||||
return QString::null;
|
||||
}
|
||||
|
||||
QString GRASS_LIB_EXPORT QgsGrass::closeMapset()
|
||||
QString QgsGrass::closeMapset()
|
||||
{
|
||||
QgsDebugMsg( "entered." );
|
||||
|
||||
@ -908,7 +908,7 @@ QString GRASS_LIB_EXPORT QgsGrass::closeMapset()
|
||||
return QString::null;
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::saveMapset()
|
||||
void QgsGrass::saveMapset()
|
||||
{
|
||||
QgsDebugMsg( "entered." );
|
||||
|
||||
@ -923,7 +923,7 @@ void GRASS_LIB_EXPORT QgsGrass::saveMapset()
|
||||
getDefaultMapset() );
|
||||
}
|
||||
|
||||
QStringList GRASS_LIB_EXPORT QgsGrass::locations( const QString& gisdbase )
|
||||
QStringList QgsGrass::locations( const QString& gisdbase )
|
||||
{
|
||||
QgsDebugMsg( QString( "gisdbase = %1" ).arg( gisdbase ) );
|
||||
|
||||
@ -946,7 +946,7 @@ QStringList GRASS_LIB_EXPORT QgsGrass::locations( const QString& gisdbase )
|
||||
return list;
|
||||
}
|
||||
|
||||
QStringList GRASS_LIB_EXPORT QgsGrass::mapsets( const QString& gisdbase, const QString& locationName )
|
||||
QStringList QgsGrass::mapsets( const QString& gisdbase, const QString& locationName )
|
||||
{
|
||||
QgsDebugMsg( QString( "gisbase = %1 locationName = %2" ).arg( gisdbase ).arg( locationName ) );
|
||||
|
||||
@ -956,7 +956,7 @@ QStringList GRASS_LIB_EXPORT QgsGrass::mapsets( const QString& gisdbase, const Q
|
||||
return QgsGrass::mapsets( gisdbase + "/" + locationName );
|
||||
}
|
||||
|
||||
QStringList GRASS_LIB_EXPORT QgsGrass::mapsets( const QString& locationPath )
|
||||
QStringList QgsGrass::mapsets( const QString& locationPath )
|
||||
{
|
||||
QgsDebugMsg( QString( "locationPath = %1" ).arg( locationPath ) );
|
||||
|
||||
@ -978,8 +978,8 @@ QStringList GRASS_LIB_EXPORT QgsGrass::mapsets( const QString& locationPath )
|
||||
return list;
|
||||
}
|
||||
|
||||
QStringList GRASS_LIB_EXPORT QgsGrass::vectors( const QString& gisdbase, const QString& locationName,
|
||||
const QString& mapsetName )
|
||||
QStringList QgsGrass::vectors( const QString& gisdbase, const QString& locationName,
|
||||
const QString& mapsetName )
|
||||
{
|
||||
QgsDebugMsg( "entered." );
|
||||
|
||||
@ -1015,7 +1015,7 @@ QStringList GRASS_LIB_EXPORT QgsGrass::vectors( const QString& gisdbase, const Q
|
||||
return QgsGrass::vectors( gisdbase + "/" + locationName + "/" + mapsetName );
|
||||
}
|
||||
|
||||
QStringList GRASS_LIB_EXPORT QgsGrass::vectors( const QString& mapsetPath )
|
||||
QStringList QgsGrass::vectors( const QString& mapsetPath )
|
||||
{
|
||||
QgsDebugMsg( QString( "mapsetPath = %1" ).arg( mapsetPath ) );
|
||||
|
||||
@ -1040,8 +1040,8 @@ QStringList GRASS_LIB_EXPORT QgsGrass::vectors( const QString& mapsetPath )
|
||||
return list;
|
||||
}
|
||||
|
||||
bool GRASS_LIB_EXPORT QgsGrass::topoVersion( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& mapName, int &major, int &minor )
|
||||
bool QgsGrass::topoVersion( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& mapName, int &major, int &minor )
|
||||
{
|
||||
QString path = gisdbase + "/" + location + "/" + mapset + "/vector/" + mapName + "/topo";
|
||||
QFile file( path );
|
||||
@ -1063,8 +1063,8 @@ bool GRASS_LIB_EXPORT QgsGrass::topoVersion( const QString& gisdbase, const QStr
|
||||
return true;
|
||||
}
|
||||
|
||||
QStringList GRASS_LIB_EXPORT QgsGrass::vectorLayers( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& mapName )
|
||||
QStringList QgsGrass::vectorLayers( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& mapName )
|
||||
{
|
||||
GRASS_LOCK
|
||||
QgsDebugMsg( QString( "gisdbase = %1 location = %2 mapset = %3 mapName = %4" ).arg( gisdbase ).arg( location ).arg( mapset ).arg( mapName ) );
|
||||
@ -1222,8 +1222,8 @@ QStringList GRASS_LIB_EXPORT QgsGrass::vectorLayers( const QString& gisdbase, co
|
||||
return list;
|
||||
}
|
||||
|
||||
QStringList GRASS_LIB_EXPORT QgsGrass::rasters( const QString& gisdbase, const QString& locationName,
|
||||
const QString& mapsetName )
|
||||
QStringList QgsGrass::rasters( const QString& gisdbase, const QString& locationName,
|
||||
const QString& mapsetName )
|
||||
{
|
||||
QgsDebugMsg( "entered." );
|
||||
|
||||
@ -1260,7 +1260,7 @@ QStringList GRASS_LIB_EXPORT QgsGrass::rasters( const QString& gisdbase, const Q
|
||||
return QgsGrass::rasters( gisdbase + "/" + locationName + "/" + mapsetName );
|
||||
}
|
||||
|
||||
QStringList GRASS_LIB_EXPORT QgsGrass::rasters( const QString& mapsetPath )
|
||||
QStringList QgsGrass::rasters( const QString& mapsetPath )
|
||||
{
|
||||
QgsDebugMsg( QString( "mapsetPath = %1" ).arg( mapsetPath ) );
|
||||
|
||||
@ -1279,19 +1279,19 @@ QStringList GRASS_LIB_EXPORT QgsGrass::rasters( const QString& mapsetPath )
|
||||
return list;
|
||||
}
|
||||
|
||||
QStringList GRASS_LIB_EXPORT QgsGrass::groups( const QString& gisdbase, const QString& locationName,
|
||||
const QString& mapsetName )
|
||||
QStringList QgsGrass::groups( const QString& gisdbase, const QString& locationName,
|
||||
const QString& mapsetName )
|
||||
{
|
||||
return elements( gisdbase, locationName, mapsetName, "group" );
|
||||
}
|
||||
|
||||
QStringList GRASS_LIB_EXPORT QgsGrass::groups( const QString& mapsetPath )
|
||||
QStringList QgsGrass::groups( const QString& mapsetPath )
|
||||
{
|
||||
return elements( mapsetPath, "group" );
|
||||
}
|
||||
|
||||
QStringList GRASS_LIB_EXPORT QgsGrass::elements( const QString& gisdbase, const QString& locationName,
|
||||
const QString& mapsetName, const QString& element )
|
||||
QStringList QgsGrass::elements( const QString& gisdbase, const QString& locationName,
|
||||
const QString& mapsetName, const QString& element )
|
||||
{
|
||||
if ( gisdbase.isEmpty() || locationName.isEmpty() || mapsetName.isEmpty() )
|
||||
{
|
||||
@ -1301,7 +1301,7 @@ QStringList GRASS_LIB_EXPORT QgsGrass::elements( const QString& gisdbase, const
|
||||
return QgsGrass::elements( gisdbase + "/" + locationName + "/" + mapsetName, element );
|
||||
}
|
||||
|
||||
QStringList GRASS_LIB_EXPORT QgsGrass::elements( const QString& mapsetPath, const QString& element )
|
||||
QStringList QgsGrass::elements( const QString& mapsetPath, const QString& element )
|
||||
{
|
||||
QgsDebugMsg( QString( "mapsetPath = %1 element = %2" ).arg( mapsetPath ).arg( element ) );
|
||||
|
||||
@ -1327,12 +1327,12 @@ QStringList GRASS_LIB_EXPORT QgsGrass::elements( const QString& mapsetPath, con
|
||||
return list;
|
||||
}
|
||||
|
||||
QStringList GRASS_LIB_EXPORT QgsGrass::grassObjects( const QString& mapsetPath, QgsGrassObject::Type type )
|
||||
QStringList QgsGrass::grassObjects( const QString& mapsetPath, QgsGrassObject::Type type )
|
||||
{
|
||||
return QgsGrass::elements( mapsetPath, QgsGrassObject::dirName( type ) );
|
||||
}
|
||||
|
||||
bool GRASS_LIB_EXPORT QgsGrass::objectExists( const QgsGrassObject& grassObject )
|
||||
bool QgsGrass::objectExists( const QgsGrassObject& grassObject )
|
||||
{
|
||||
QString path = grassObject.mapsetPath() + "/" + QgsGrassObject::dirName( grassObject.type() )
|
||||
+ "/" + grassObject.name();
|
||||
@ -1340,7 +1340,7 @@ bool GRASS_LIB_EXPORT QgsGrass::objectExists( const QgsGrassObject& grassObject
|
||||
return fi.exists();
|
||||
}
|
||||
|
||||
QString GRASS_LIB_EXPORT QgsGrass::regionString( const struct Cell_head *window )
|
||||
QString QgsGrass::regionString( const struct Cell_head *window )
|
||||
{
|
||||
QString reg;
|
||||
int fmt;
|
||||
@ -1378,8 +1378,8 @@ QString GRASS_LIB_EXPORT QgsGrass::regionString( const struct Cell_head *window
|
||||
}
|
||||
|
||||
|
||||
bool GRASS_LIB_EXPORT QgsGrass::defaultRegion( const QString& gisdbase, const QString& location,
|
||||
struct Cell_head *window )
|
||||
bool QgsGrass::defaultRegion( const QString& gisdbase, const QString& location,
|
||||
struct Cell_head *window )
|
||||
{
|
||||
initRegion( window );
|
||||
QgsGrass::setLocation( gisdbase, location );
|
||||
@ -1390,13 +1390,14 @@ bool GRASS_LIB_EXPORT QgsGrass::defaultRegion( const QString& gisdbase, const QS
|
||||
}
|
||||
catch ( QgsGrass::Exception &e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::region( const QString& gisdbase,
|
||||
const QString& location, const QString& mapset,
|
||||
struct Cell_head *window ) throw( QgsGrass::Exception )
|
||||
void QgsGrass::region( const QString& gisdbase,
|
||||
const QString& location, const QString& mapset,
|
||||
struct Cell_head *window )
|
||||
{
|
||||
QgsGrass::setLocation( gisdbase, location );
|
||||
|
||||
@ -1411,14 +1412,14 @@ void GRASS_LIB_EXPORT QgsGrass::region( const QString& gisdbase,
|
||||
#endif
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::region( struct Cell_head *window ) throw( QgsGrass::Exception )
|
||||
void QgsGrass::region( struct Cell_head *window )
|
||||
{
|
||||
region( getDefaultGisdbase(), getDefaultLocation(), getDefaultMapset(), window );
|
||||
}
|
||||
|
||||
bool GRASS_LIB_EXPORT QgsGrass::writeRegion( const QString& gisbase,
|
||||
const QString& location, const QString& mapset,
|
||||
const struct Cell_head *window )
|
||||
bool QgsGrass::writeRegion( const QString& gisbase,
|
||||
const QString& location, const QString& mapset,
|
||||
const struct Cell_head *window )
|
||||
{
|
||||
QgsDebugMsg( "entered." );
|
||||
QgsDebugMsg( QString( "n = %1 s = %2" ).arg( window->north ).arg( window->south ) );
|
||||
@ -1434,8 +1435,8 @@ bool GRASS_LIB_EXPORT QgsGrass::writeRegion( const QString& gisbase,
|
||||
return true;
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::copyRegionExtent( struct Cell_head *source,
|
||||
struct Cell_head *target )
|
||||
void QgsGrass::copyRegionExtent( struct Cell_head *source,
|
||||
struct Cell_head *target )
|
||||
{
|
||||
target->north = source->north;
|
||||
target->south = source->south;
|
||||
@ -1445,8 +1446,8 @@ void GRASS_LIB_EXPORT QgsGrass::copyRegionExtent( struct Cell_head *source,
|
||||
target->bottom = source->bottom;
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::copyRegionResolution( struct Cell_head *source,
|
||||
struct Cell_head *target )
|
||||
void QgsGrass::copyRegionResolution( struct Cell_head *source,
|
||||
struct Cell_head *target )
|
||||
{
|
||||
target->ns_res = source->ns_res;
|
||||
target->ew_res = source->ew_res;
|
||||
@ -1455,8 +1456,8 @@ void GRASS_LIB_EXPORT QgsGrass::copyRegionResolution( struct Cell_head *source,
|
||||
target->ew_res3 = source->ew_res3;
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::extendRegion( struct Cell_head *source,
|
||||
struct Cell_head *target )
|
||||
void QgsGrass::extendRegion( struct Cell_head *source,
|
||||
struct Cell_head *target )
|
||||
{
|
||||
if ( source->north > target->north )
|
||||
target->north = source->north;
|
||||
@ -1477,7 +1478,7 @@ void GRASS_LIB_EXPORT QgsGrass::extendRegion( struct Cell_head *source,
|
||||
target->bottom = source->bottom;
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::initRegion( struct Cell_head *window )
|
||||
void QgsGrass::initRegion( struct Cell_head *window )
|
||||
{
|
||||
window->format = 0;
|
||||
window->rows = 0;
|
||||
@ -1503,7 +1504,7 @@ void GRASS_LIB_EXPORT QgsGrass::initRegion( struct Cell_head *window )
|
||||
window->cols = 1;
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::setRegion( struct Cell_head *window, QgsRectangle rect )
|
||||
void QgsGrass::setRegion( struct Cell_head *window, QgsRectangle rect )
|
||||
{
|
||||
window->west = rect.xMinimum();
|
||||
window->south = rect.yMinimum();
|
||||
@ -1511,7 +1512,7 @@ void GRASS_LIB_EXPORT QgsGrass::setRegion( struct Cell_head *window, QgsRectangl
|
||||
window->north = rect.yMaximum();
|
||||
}
|
||||
|
||||
QString GRASS_LIB_EXPORT QgsGrass::setRegion( struct Cell_head *window, QgsRectangle rect, int rows, int cols )
|
||||
QString QgsGrass::setRegion( struct Cell_head *window, QgsRectangle rect, int rows, int cols )
|
||||
{
|
||||
initRegion( window );
|
||||
window->west = rect.xMinimum();
|
||||
@ -1541,7 +1542,7 @@ QString GRASS_LIB_EXPORT QgsGrass::setRegion( struct Cell_head *window, QgsRecta
|
||||
return error;
|
||||
}
|
||||
|
||||
QgsRectangle GRASS_LIB_EXPORT QgsGrass::extent( struct Cell_head *window )
|
||||
QgsRectangle QgsGrass::extent( struct Cell_head *window )
|
||||
{
|
||||
if ( !window )
|
||||
{
|
||||
@ -1550,9 +1551,9 @@ QgsRectangle GRASS_LIB_EXPORT QgsGrass::extent( struct Cell_head *window )
|
||||
return QgsRectangle( window->west, window->south, window->east, window->north );
|
||||
}
|
||||
|
||||
bool GRASS_LIB_EXPORT QgsGrass::mapRegion( QgsGrassObject::Type type, QString gisdbase,
|
||||
QString location, QString mapset, QString map,
|
||||
struct Cell_head *window )
|
||||
bool QgsGrass::mapRegion( QgsGrassObject::Type type, QString gisdbase,
|
||||
QString location, QString mapset, QString map,
|
||||
struct Cell_head *window )
|
||||
{
|
||||
QgsDebugMsg( "entered." );
|
||||
QgsDebugMsg( QString( "map = %1" ).arg( map ) );
|
||||
@ -1645,9 +1646,9 @@ bool GRASS_LIB_EXPORT QgsGrass::mapRegion( QgsGrassObject::Type type, QString gi
|
||||
return true;
|
||||
}
|
||||
|
||||
QProcess GRASS_LIB_EXPORT *QgsGrass::startModule( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& moduleName, const QStringList& arguments,
|
||||
QTemporaryFile &gisrcFile, bool qgisModule )
|
||||
QProcess *QgsGrass::startModule( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& moduleName, const QStringList& arguments,
|
||||
QTemporaryFile &gisrcFile, bool qgisModule )
|
||||
{
|
||||
QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase ).arg( location ) );
|
||||
QProcess *process = new QProcess();
|
||||
@ -1693,9 +1694,9 @@ QProcess GRASS_LIB_EXPORT *QgsGrass::startModule( const QString& gisdbase, const
|
||||
return process;
|
||||
}
|
||||
|
||||
QByteArray GRASS_LIB_EXPORT QgsGrass::runModule( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& moduleName,
|
||||
const QStringList& arguments, int timeOut, bool qgisModule )
|
||||
QByteArray QgsGrass::runModule( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& moduleName,
|
||||
const QStringList& arguments, int timeOut, bool qgisModule )
|
||||
{
|
||||
QgsDebugMsg( QString( "gisdbase = %1 location = %2 timeOut = %3" ).arg( gisdbase ).arg( location ).arg( timeOut ) );
|
||||
|
||||
@ -1718,12 +1719,12 @@ QByteArray GRASS_LIB_EXPORT QgsGrass::runModule( const QString& gisdbase, const
|
||||
return data;
|
||||
}
|
||||
|
||||
QString GRASS_LIB_EXPORT QgsGrass::getInfo( const QString& info, const QString& gisdbase,
|
||||
const QString& location, const QString& mapset,
|
||||
const QString& map, const QgsGrassObject::Type type,
|
||||
double x, double y,
|
||||
const QgsRectangle& extent, int sampleRows,
|
||||
int sampleCols, int timeOut )
|
||||
QString QgsGrass::getInfo( const QString& info, const QString& gisdbase,
|
||||
const QString& location, const QString& mapset,
|
||||
const QString& map, const QgsGrassObject::Type type,
|
||||
double x, double y,
|
||||
const QgsRectangle& extent, int sampleRows,
|
||||
int sampleCols, int timeOut )
|
||||
{
|
||||
QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase ).arg( location ) );
|
||||
|
||||
@ -1768,7 +1769,7 @@ QString GRASS_LIB_EXPORT QgsGrass::getInfo( const QString& info, const QString&
|
||||
return QString( data );
|
||||
}
|
||||
|
||||
QgsCoordinateReferenceSystem GRASS_LIB_EXPORT QgsGrass::crs( const QString& gisdbase, const QString& location,
|
||||
QgsCoordinateReferenceSystem QgsGrass::crs( const QString& gisdbase, const QString& location,
|
||||
bool interactive )
|
||||
{
|
||||
QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase ).arg( location ) );
|
||||
@ -1792,7 +1793,7 @@ QgsCoordinateReferenceSystem GRASS_LIB_EXPORT QgsGrass::crs( const QString& gisd
|
||||
return crs;
|
||||
}
|
||||
|
||||
QgsCoordinateReferenceSystem GRASS_LIB_EXPORT QgsGrass::crsDirect( const QString& gisdbase, const QString& location )
|
||||
QgsCoordinateReferenceSystem QgsGrass::crsDirect( const QString& gisdbase, const QString& location )
|
||||
{
|
||||
QString Wkt;
|
||||
|
||||
@ -1831,9 +1832,9 @@ QgsCoordinateReferenceSystem GRASS_LIB_EXPORT QgsGrass::crsDirect( const QString
|
||||
return srs;
|
||||
}
|
||||
|
||||
QgsRectangle GRASS_LIB_EXPORT QgsGrass::extent( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& map,
|
||||
QgsGrassObject::Type type, bool interactive )
|
||||
QgsRectangle QgsGrass::extent( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& map,
|
||||
QgsGrassObject::Type type, bool interactive )
|
||||
{
|
||||
QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase ).arg( location ) );
|
||||
|
||||
@ -1858,8 +1859,8 @@ QgsRectangle GRASS_LIB_EXPORT QgsGrass::extent( const QString& gisdbase, const Q
|
||||
return QgsRectangle( 0, 0, 0, 0 );
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::size( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& map, int *cols, int *rows )
|
||||
void QgsGrass::size( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& map, int *cols, int *rows )
|
||||
{
|
||||
QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase ).arg( location ) );
|
||||
|
||||
@ -1885,13 +1886,13 @@ void GRASS_LIB_EXPORT QgsGrass::size( const QString& gisdbase, const QString& lo
|
||||
QgsDebugMsg( QString( "raster size = %1 %2" ).arg( *cols ).arg( *rows ) );
|
||||
}
|
||||
|
||||
QHash<QString, QString> GRASS_LIB_EXPORT QgsGrass::info( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& map,
|
||||
QgsGrassObject::Type type,
|
||||
const QString& info,
|
||||
const QgsRectangle& extent,
|
||||
int sampleRows, int sampleCols,
|
||||
int timeOut, bool interactive )
|
||||
QHash<QString, QString> QgsGrass::info( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& map,
|
||||
QgsGrassObject::Type type,
|
||||
const QString& info,
|
||||
const QgsRectangle& extent,
|
||||
int sampleRows, int sampleCols,
|
||||
int timeOut, bool interactive )
|
||||
{
|
||||
QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase ).arg( location ) );
|
||||
QHash<QString, QString> inf;
|
||||
@ -1924,7 +1925,7 @@ QHash<QString, QString> GRASS_LIB_EXPORT QgsGrass::info( const QString& gisdbase
|
||||
return inf;
|
||||
}
|
||||
|
||||
QList<QgsGrass::Color> GRASS_LIB_EXPORT QgsGrass::colors( QString gisdbase, QString location, QString mapset, QString map )
|
||||
QList<QgsGrass::Color> QgsGrass::colors( QString gisdbase, QString location, QString mapset, QString map )
|
||||
{
|
||||
QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase ).arg( location ) );
|
||||
QList<QgsGrass::Color> ct;
|
||||
@ -1954,7 +1955,7 @@ QList<QgsGrass::Color> GRASS_LIB_EXPORT QgsGrass::colors( QString gisdbase, QStr
|
||||
return ct;
|
||||
}
|
||||
|
||||
QMap<QString, QString> GRASS_LIB_EXPORT QgsGrass::query( QString gisdbase, QString location, QString mapset, QString map, QgsGrassObject::Type type, double x, double y )
|
||||
QMap<QString, QString> QgsGrass::query( QString gisdbase, QString location, QString mapset, QString map, QgsGrassObject::Type type, double x, double y )
|
||||
{
|
||||
QgsDebugMsg( QString( "gisdbase = %1 location = %2" ).arg( gisdbase ).arg( location ) );
|
||||
|
||||
@ -1977,7 +1978,7 @@ QMap<QString, QString> GRASS_LIB_EXPORT QgsGrass::query( QString gisdbase, QStri
|
||||
return result;
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::renameObject( const QgsGrassObject & object, const QString& newName )
|
||||
void QgsGrass::renameObject( const QgsGrassObject & object, const QString& newName )
|
||||
{
|
||||
QgsDebugMsg( "entered" );
|
||||
QString cmd = "g.rename";
|
||||
@ -1990,7 +1991,7 @@ void GRASS_LIB_EXPORT QgsGrass::renameObject( const QgsGrassObject & object, con
|
||||
QgsGrass::runModule( object.gisdbase(), object.location(), object.mapset(), cmd, arguments, timeout, false );
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::copyObject( const QgsGrassObject & srcObject, const QgsGrassObject & destObject )
|
||||
void QgsGrass::copyObject( const QgsGrassObject & srcObject, const QgsGrassObject & destObject )
|
||||
{
|
||||
QgsDebugMsg( "srcObject = " + srcObject.toString() );
|
||||
QgsDebugMsg( "destObject = " + destObject.toString() );
|
||||
@ -2011,7 +2012,7 @@ void GRASS_LIB_EXPORT QgsGrass::copyObject( const QgsGrassObject & srcObject, co
|
||||
QgsGrass::runModule( destObject.gisdbase(), destObject.location(), destObject.mapset(), cmd, arguments, timeout, false );
|
||||
}
|
||||
|
||||
bool GRASS_LIB_EXPORT QgsGrass::deleteObject( const QgsGrassObject & object )
|
||||
bool QgsGrass::deleteObject( const QgsGrassObject & object )
|
||||
{
|
||||
QgsDebugMsg( "entered" );
|
||||
|
||||
@ -2050,7 +2051,7 @@ bool GRASS_LIB_EXPORT QgsGrass::deleteObject( const QgsGrassObject & object )
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GRASS_LIB_EXPORT QgsGrass::deleteObjectDialog( const QgsGrassObject & object )
|
||||
bool QgsGrass::deleteObjectDialog( const QgsGrassObject & object )
|
||||
{
|
||||
QgsDebugMsg( "entered" );
|
||||
|
||||
@ -2059,7 +2060,7 @@ bool GRASS_LIB_EXPORT QgsGrass::deleteObjectDialog( const QgsGrassObject & objec
|
||||
QMessageBox::Yes | QMessageBox::No ) == QMessageBox::Yes;
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::createTable( dbDriver *driver, const QString tableName, const QgsFields &fields )
|
||||
void QgsGrass::createTable( dbDriver *driver, const QString tableName, const QgsFields &fields )
|
||||
{
|
||||
if ( !driver ) // should not happen
|
||||
{
|
||||
@ -2118,8 +2119,8 @@ void GRASS_LIB_EXPORT QgsGrass::createTable( dbDriver *driver, const QString tab
|
||||
}
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::insertRow( dbDriver *driver, const QString tableName,
|
||||
const QgsAttributes& attributes )
|
||||
void QgsGrass::insertRow( dbDriver *driver, const QString tableName,
|
||||
const QgsAttributes& attributes )
|
||||
{
|
||||
if ( !driver ) // should not happen
|
||||
{
|
||||
@ -2181,7 +2182,7 @@ void GRASS_LIB_EXPORT QgsGrass::insertRow( dbDriver *driver, const QString table
|
||||
}
|
||||
}
|
||||
|
||||
bool GRASS_LIB_EXPORT QgsGrass::isExternal( const QgsGrassObject & object )
|
||||
bool QgsGrass::isExternal( const QgsGrassObject & object )
|
||||
{
|
||||
if ( object.type() != QgsGrassObject::Raster )
|
||||
{
|
||||
@ -2199,7 +2200,7 @@ bool GRASS_LIB_EXPORT QgsGrass::isExternal( const QgsGrassObject & object )
|
||||
return isExternal;
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::adjustCellHead( struct Cell_head *cellhd, int row_flag, int col_flag ) throw( QgsGrass::Exception )
|
||||
void QgsGrass::adjustCellHead( struct Cell_head *cellhd, int row_flag, int col_flag )
|
||||
{
|
||||
#if (GRASS_VERSION_MAJOR < 7)
|
||||
char* err = G_adjust_Cell_head( cellhd, row_flag, col_flag );
|
||||
@ -2216,7 +2217,7 @@ void GRASS_LIB_EXPORT QgsGrass::adjustCellHead( struct Cell_head *cellhd, int ro
|
||||
// http://freegis.org/cgi-bin/viewcvs.cgi/grass6/include/version.h.in.diff?r1=1.4&r2=1.5
|
||||
// The following lines workaround this change
|
||||
|
||||
int GRASS_LIB_EXPORT QgsGrass::versionMajor()
|
||||
int QgsGrass::versionMajor()
|
||||
{
|
||||
#ifdef GRASS_VERSION_MAJOR
|
||||
return GRASS_VERSION_MAJOR;
|
||||
@ -2225,7 +2226,7 @@ int GRASS_LIB_EXPORT QgsGrass::versionMajor()
|
||||
#endif
|
||||
}
|
||||
|
||||
int GRASS_LIB_EXPORT QgsGrass::versionMinor()
|
||||
int QgsGrass::versionMinor()
|
||||
{
|
||||
#ifdef GRASS_VERSION_MINOR
|
||||
return GRASS_VERSION_MINOR;
|
||||
@ -2234,7 +2235,7 @@ int GRASS_LIB_EXPORT QgsGrass::versionMinor()
|
||||
#endif
|
||||
}
|
||||
|
||||
int GRASS_LIB_EXPORT QgsGrass::versionRelease()
|
||||
int QgsGrass::versionRelease()
|
||||
{
|
||||
#ifdef GRASS_VERSION_RELEASE
|
||||
#define QUOTE(x) #x
|
||||
@ -2243,12 +2244,12 @@ int GRASS_LIB_EXPORT QgsGrass::versionRelease()
|
||||
return QString( GRASS_VERSION_RELEASE ).toInt();
|
||||
#endif
|
||||
}
|
||||
QString GRASS_LIB_EXPORT QgsGrass::versionString()
|
||||
QString QgsGrass::versionString()
|
||||
{
|
||||
return QString( GRASS_VERSION_STRING );
|
||||
}
|
||||
|
||||
Qt::CaseSensitivity GRASS_LIB_EXPORT QgsGrass::caseSensitivity()
|
||||
Qt::CaseSensitivity QgsGrass::caseSensitivity()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
return Qt::CaseInsensitive;
|
||||
@ -2257,22 +2258,22 @@ Qt::CaseSensitivity GRASS_LIB_EXPORT QgsGrass::caseSensitivity()
|
||||
#endif
|
||||
}
|
||||
|
||||
bool GRASS_LIB_EXPORT QgsGrass::isLocation( const QString& path )
|
||||
bool QgsGrass::isLocation( const QString& path )
|
||||
{
|
||||
return G_is_location( path.toUtf8().constData() ) == 1;
|
||||
}
|
||||
|
||||
bool GRASS_LIB_EXPORT QgsGrass::isMapset( const QString& path )
|
||||
bool QgsGrass::isMapset( const QString& path )
|
||||
{
|
||||
return G_is_mapset( path.toUtf8().constData() ) == 1;
|
||||
}
|
||||
|
||||
QString GRASS_LIB_EXPORT QgsGrass::lockFilePath()
|
||||
QString QgsGrass::lockFilePath()
|
||||
{
|
||||
return mMapsetLock;
|
||||
}
|
||||
|
||||
QString GRASS_LIB_EXPORT QgsGrass::gisrcFilePath()
|
||||
QString QgsGrass::gisrcFilePath()
|
||||
{
|
||||
if ( mGisrc.isEmpty() )
|
||||
{
|
||||
@ -2285,7 +2286,7 @@ QString GRASS_LIB_EXPORT QgsGrass::gisrcFilePath()
|
||||
return mGisrc;
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::putEnv( QString name, QString value )
|
||||
void QgsGrass::putEnv( QString name, QString value )
|
||||
{
|
||||
QString env = name + "=" + value;
|
||||
/* _Correct_ putenv() implementation is not making copy! */
|
||||
@ -2294,7 +2295,7 @@ void GRASS_LIB_EXPORT QgsGrass::putEnv( QString name, QString value )
|
||||
putenv( envChar );
|
||||
}
|
||||
|
||||
QString GRASS_LIB_EXPORT QgsGrass::modulesConfigDefaultDirPath()
|
||||
QString QgsGrass::modulesConfigDefaultDirPath()
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
if ( QgsApplication::isRunningFromBuildDir() )
|
||||
@ -2305,7 +2306,7 @@ QString GRASS_LIB_EXPORT QgsGrass::modulesConfigDefaultDirPath()
|
||||
return QgsApplication::pkgDataPath() + "/grass/modules";
|
||||
}
|
||||
|
||||
QString GRASS_LIB_EXPORT QgsGrass::modulesConfigDirPath()
|
||||
QString QgsGrass::modulesConfigDirPath()
|
||||
{
|
||||
QSettings settings;
|
||||
bool customModules = settings.value( "/GRASS/modules/config/custom", false ).toBool();
|
||||
@ -2321,7 +2322,7 @@ QString GRASS_LIB_EXPORT QgsGrass::modulesConfigDirPath()
|
||||
}
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::setModulesConfig( bool custom, const QString &customDir )
|
||||
void QgsGrass::setModulesConfig( bool custom, const QString &customDir )
|
||||
{
|
||||
QSettings settings;
|
||||
|
||||
@ -2336,17 +2337,17 @@ void GRASS_LIB_EXPORT QgsGrass::setModulesConfig( bool custom, const QString &cu
|
||||
}
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::warning( const QString &message )
|
||||
void QgsGrass::warning( const QString &message )
|
||||
{
|
||||
QMessageBox::warning( 0, QObject::tr( "Warning" ), message );
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::warning( QgsGrass::Exception &e )
|
||||
void QgsGrass::warning( QgsGrass::Exception &e )
|
||||
{
|
||||
QMessageBox::warning( 0, QObject::tr( "Warning" ), e.what() );
|
||||
}
|
||||
|
||||
struct Map_info GRASS_LIB_EXPORT *QgsGrass::vectNewMapStruct()
|
||||
struct Map_info *QgsGrass::vectNewMapStruct()
|
||||
{
|
||||
// In OSGeo4W there is GRASS compiled by MinGW while QGIS compiled by MSVC, the compilers
|
||||
// may have different sizes of types, see issue #13002. Because there is no Vect_new_map_struct (GRASS 7.0.0, July 2015)
|
||||
@ -2359,7 +2360,7 @@ struct Map_info GRASS_LIB_EXPORT *QgsGrass::vectNewMapStruct()
|
||||
#endif
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::vectDestroyMapStruct( struct Map_info *map )
|
||||
void QgsGrass::vectDestroyMapStruct( struct Map_info *map )
|
||||
{
|
||||
// TODO: replace by Vect_destroy_map_struct once it appears in GRASS
|
||||
// TODO: until switch to hypothetical Vect_destroy_map_struct verify that Vect_destroy_map_struct cannot
|
||||
@ -2368,7 +2369,7 @@ void GRASS_LIB_EXPORT QgsGrass::vectDestroyMapStruct( struct Map_info *map )
|
||||
map = 0;
|
||||
}
|
||||
|
||||
void GRASS_LIB_EXPORT QgsGrass::sleep( int ms )
|
||||
void QgsGrass::sleep( int ms )
|
||||
{
|
||||
// Stolen from QTest::qSleep
|
||||
#ifdef Q_OS_WIN
|
||||
|
@ -132,7 +132,7 @@ class GRASS_LIB_EXPORT QgsGrass : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static GRASS_LIB_EXPORT jmp_buf jumper; // used to get back from fatal error
|
||||
static jmp_buf jumper; // used to get back from fatal error
|
||||
|
||||
// This does not work (gcc/Linux), such exception cannot be caught
|
||||
// so I have enabled the old version, if you are able to fix it, please
|
||||
@ -163,23 +163,23 @@ class GRASS_LIB_EXPORT QgsGrass : public QObject
|
||||
* Active mode means that GISRC is set up and GISRC file is available,
|
||||
* in that case default GISDBASE, LOCATION and MAPSET may be read by GetDefaul*() functions.
|
||||
* Passive mode means, that GISRC is not available. */
|
||||
static GRASS_LIB_EXPORT bool activeMode();
|
||||
static bool activeMode();
|
||||
|
||||
//! Get default GISDBASE, returns GISDBASE name or empty string if not in active mode
|
||||
static GRASS_LIB_EXPORT QString getDefaultGisdbase();
|
||||
static QString getDefaultGisdbase();
|
||||
|
||||
//! Get default LOCATION_NAME, returns LOCATION_NAME name or empty string if not in active mode
|
||||
static GRASS_LIB_EXPORT QString getDefaultLocation();
|
||||
static QString getDefaultLocation();
|
||||
|
||||
//! Get default MAPSET, returns MAPSET name or empty string if not in active mode
|
||||
static GRASS_LIB_EXPORT QString getDefaultMapset();
|
||||
static QString getDefaultMapset();
|
||||
|
||||
//! Init or reset GRASS library
|
||||
/*!
|
||||
\param gisdbase full path to GRASS GISDBASE.
|
||||
\param location location name (not path!).
|
||||
*/
|
||||
static GRASS_LIB_EXPORT void setLocation( QString gisdbase, QString location );
|
||||
static void setLocation( QString gisdbase, QString location );
|
||||
|
||||
/*!
|
||||
\param gisdbase full path to GRASS GISDBASE.
|
||||
@ -187,7 +187,7 @@ class GRASS_LIB_EXPORT QgsGrass : public QObject
|
||||
\param mapset current mupset. Note that some variables depend on mapset and
|
||||
may influence behaviour of some functions (e.g. search path etc.)
|
||||
*/
|
||||
static GRASS_LIB_EXPORT void setMapset( QString gisdbase, QString location, QString mapset );
|
||||
static void setMapset( QString gisdbase, QString location, QString mapset );
|
||||
|
||||
//! Error codes returned by error()
|
||||
enum GERROR
|
||||
@ -198,150 +198,150 @@ class GRASS_LIB_EXPORT QgsGrass : public QObject
|
||||
};
|
||||
|
||||
//! Reset error code (to OK). Call this before a piece of code where an error is expected
|
||||
static GRASS_LIB_EXPORT void resetError( void ); // reset error status
|
||||
static void resetError( void ); // reset error status
|
||||
|
||||
//! Check if any error occured in lately called functions. Returns value from ERROR.
|
||||
static GRASS_LIB_EXPORT int error( void );
|
||||
static int error( void );
|
||||
|
||||
//! Get last error message
|
||||
static GRASS_LIB_EXPORT QString errorMessage( void );
|
||||
static QString errorMessage( void );
|
||||
|
||||
/** Open existing GRASS mapset.
|
||||
* Emits signal mapsetChanged().
|
||||
* \return Empty string or error message
|
||||
*/
|
||||
static GRASS_LIB_EXPORT QString openMapset( const QString& gisdbase,
|
||||
const QString& location, const QString& mapset );
|
||||
static QString openMapset( const QString& gisdbase,
|
||||
const QString& location, const QString& mapset );
|
||||
|
||||
/** \brief Close mapset if it was opened from QGIS.
|
||||
* Delete GISRC, lock and temporary directory.
|
||||
* Emits signal mapsetChanged().
|
||||
* \return Empty string or error message
|
||||
*/
|
||||
static GRASS_LIB_EXPORT QString closeMapset();
|
||||
static QString closeMapset();
|
||||
|
||||
/** \brief Save current mapset to project file. */
|
||||
static GRASS_LIB_EXPORT void saveMapset();
|
||||
static void saveMapset();
|
||||
|
||||
//! Check if given directory contains a GRASS installation
|
||||
static GRASS_LIB_EXPORT bool isValidGrassBaseDir( const QString& gisBase );
|
||||
static bool isValidGrassBaseDir( const QString& gisBase );
|
||||
|
||||
//! Returns list of locations in given gisbase
|
||||
static QStringList GRASS_LIB_EXPORT locations( const QString& gisdbase );
|
||||
static QStringList locations( const QString& gisdbase );
|
||||
|
||||
//! Returns list of mapsets in location
|
||||
static GRASS_LIB_EXPORT QStringList mapsets( const QString& gisdbase, const QString& locationName );
|
||||
static GRASS_LIB_EXPORT QStringList mapsets( const QString& locationPath );
|
||||
static QStringList mapsets( const QString& gisdbase, const QString& locationName );
|
||||
static QStringList mapsets( const QString& locationPath );
|
||||
|
||||
//! List of vectors and rasters
|
||||
static GRASS_LIB_EXPORT QStringList vectors( const QString& gisdbase, const QString& locationName,
|
||||
const QString& mapsetName );
|
||||
static GRASS_LIB_EXPORT QStringList vectors( const QString& mapsetPath );
|
||||
static QStringList vectors( const QString& gisdbase, const QString& locationName,
|
||||
const QString& mapsetName );
|
||||
static QStringList vectors( const QString& mapsetPath );
|
||||
|
||||
static GRASS_LIB_EXPORT QStringList rasters( const QString& gisdbase, const QString& locationName,
|
||||
const QString& mapsetName );
|
||||
static GRASS_LIB_EXPORT QStringList rasters( const QString& mapsetPath );
|
||||
static QStringList rasters( const QString& gisdbase, const QString& locationName,
|
||||
const QString& mapsetName );
|
||||
static QStringList rasters( const QString& mapsetPath );
|
||||
|
||||
// imagery groups
|
||||
static GRASS_LIB_EXPORT QStringList groups( const QString& gisdbase, const QString& locationName,
|
||||
const QString& mapsetName );
|
||||
static GRASS_LIB_EXPORT QStringList groups( const QString& mapsetPath );
|
||||
static QStringList groups( const QString& gisdbase, const QString& locationName,
|
||||
const QString& mapsetName );
|
||||
static QStringList groups( const QString& mapsetPath );
|
||||
|
||||
//! Get topo file version 6, 7 or 0 if topo file does not exist
|
||||
static GRASS_LIB_EXPORT bool topoVersion( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& mapName, int &major, int &minor );
|
||||
static bool topoVersion( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& mapName, int &major, int &minor );
|
||||
|
||||
//! Get list of vector layers, throws QgsGrass::Exception
|
||||
static GRASS_LIB_EXPORT QStringList vectorLayers( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& mapName );
|
||||
static QStringList vectorLayers( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& mapName );
|
||||
|
||||
//! List of elements
|
||||
// TODO rename elements to objects
|
||||
static GRASS_LIB_EXPORT QStringList elements( const QString& gisdbase, const QString& locationName,
|
||||
const QString& mapsetName, const QString& element );
|
||||
static GRASS_LIB_EXPORT QStringList elements( const QString& mapsetPath, const QString& element );
|
||||
static QStringList elements( const QString& gisdbase, const QString& locationName,
|
||||
const QString& mapsetName, const QString& element );
|
||||
static QStringList elements( const QString& mapsetPath, const QString& element );
|
||||
|
||||
//! List of existing objects
|
||||
static GRASS_LIB_EXPORT QStringList grassObjects( const QString& mapsetPath, QgsGrassObject::Type type );
|
||||
static QStringList grassObjects( const QString& mapsetPath, QgsGrassObject::Type type );
|
||||
|
||||
// returns true if object (vector, raster, region) exists
|
||||
static GRASS_LIB_EXPORT bool objectExists( const QgsGrassObject& grassObject );
|
||||
static bool objectExists( const QgsGrassObject& grassObject );
|
||||
|
||||
//! Initialize GRASS region
|
||||
static GRASS_LIB_EXPORT void initRegion( struct Cell_head *window );
|
||||
static void initRegion( struct Cell_head *window );
|
||||
//! Set region extent
|
||||
static GRASS_LIB_EXPORT void setRegion( struct Cell_head *window, QgsRectangle rect );
|
||||
static void setRegion( struct Cell_head *window, QgsRectangle rect );
|
||||
/** Init region, set extent, rows and cols and adjust.
|
||||
* Returns error if adjustment failed. */
|
||||
static GRASS_LIB_EXPORT QString setRegion( struct Cell_head *window, QgsRectangle rect, int rows, int cols );
|
||||
static QString setRegion( struct Cell_head *window, QgsRectangle rect, int rows, int cols );
|
||||
//! Get extent from region
|
||||
static GRASS_LIB_EXPORT QgsRectangle extent( struct Cell_head *window );
|
||||
static QgsRectangle extent( struct Cell_head *window );
|
||||
|
||||
// ! Get map region
|
||||
static GRASS_LIB_EXPORT bool mapRegion( QgsGrassObject::Type type, QString gisdbase,
|
||||
QString location, QString mapset, QString map,
|
||||
struct Cell_head *window );
|
||||
static bool mapRegion( QgsGrassObject::Type type, QString gisdbase,
|
||||
QString location, QString mapset, QString map,
|
||||
struct Cell_head *window );
|
||||
|
||||
// ! String representation of region
|
||||
static GRASS_LIB_EXPORT QString regionString( const struct Cell_head *window );
|
||||
static QString regionString( const struct Cell_head *window );
|
||||
|
||||
// ! Read location default region (DEFAULT_WIND)
|
||||
static GRASS_LIB_EXPORT bool defaultRegion( const QString& gisdbase, const QString& location,
|
||||
struct Cell_head *window );
|
||||
static bool defaultRegion( const QString& gisdbase, const QString& location,
|
||||
struct Cell_head *window );
|
||||
|
||||
/** Read mapset current region (WIND)
|
||||
* @throws QgsGrass::Exception
|
||||
*/
|
||||
static GRASS_LIB_EXPORT void region( const QString& gisdbase, const QString& location, const QString& mapset,
|
||||
struct Cell_head *window ) throw( QgsGrass::Exception );
|
||||
static void region( const QString& gisdbase, const QString& location, const QString& mapset,
|
||||
struct Cell_head *window );
|
||||
|
||||
/** Read default mapset current region (WIND)
|
||||
* @throws QgsGrass::Exception
|
||||
*/
|
||||
static GRASS_LIB_EXPORT void region( struct Cell_head *window ) throw( QgsGrass::Exception );
|
||||
static void region( struct Cell_head *window );
|
||||
|
||||
// ! Write current mapset region
|
||||
static GRASS_LIB_EXPORT bool writeRegion( const QString& gisbase, const QString& location, const QString& mapset,
|
||||
const struct Cell_head *window );
|
||||
static bool writeRegion( const QString& gisbase, const QString& location, const QString& mapset,
|
||||
const struct Cell_head *window );
|
||||
|
||||
// ! Set (copy) region extent, resolution is not changed
|
||||
static GRASS_LIB_EXPORT void copyRegionExtent( struct Cell_head *source,
|
||||
struct Cell_head *target );
|
||||
static void copyRegionExtent( struct Cell_head *source,
|
||||
struct Cell_head *target );
|
||||
|
||||
// ! Set (copy) region resolution, extent is not changed
|
||||
static GRASS_LIB_EXPORT void copyRegionResolution( struct Cell_head *source,
|
||||
struct Cell_head *target );
|
||||
static void copyRegionResolution( struct Cell_head *source,
|
||||
struct Cell_head *target );
|
||||
|
||||
// ! Extend region in target to source
|
||||
static GRASS_LIB_EXPORT void extendRegion( struct Cell_head *source,
|
||||
struct Cell_head *target );
|
||||
static void extendRegion( struct Cell_head *source,
|
||||
struct Cell_head *target );
|
||||
|
||||
static GRASS_LIB_EXPORT void init( void );
|
||||
static void init( void );
|
||||
|
||||
//! test if the directory is location
|
||||
static GRASS_LIB_EXPORT bool isLocation( const QString& path );;
|
||||
static bool isLocation( const QString& path );;
|
||||
|
||||
// ! test if the directory is mapset
|
||||
static GRASS_LIB_EXPORT bool isMapset( const QString& path );
|
||||
static bool isMapset( const QString& path );
|
||||
|
||||
// ! Get the lock file
|
||||
static GRASS_LIB_EXPORT QString lockFilePath();
|
||||
static QString lockFilePath();
|
||||
|
||||
// ! Get current gisrc path
|
||||
static GRASS_LIB_EXPORT QString gisrcFilePath();
|
||||
static QString gisrcFilePath();
|
||||
|
||||
// ! Start a GRASS module in any gisdbase/location/mapset
|
||||
// @param qgisModule append GRASS major version (for modules built in qgis)
|
||||
static GRASS_LIB_EXPORT QProcess *startModule( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& moduleName,
|
||||
const QStringList& arguments, QTemporaryFile &gisrcFile,
|
||||
bool qgisModule = true );
|
||||
static QProcess *startModule( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& moduleName,
|
||||
const QStringList& arguments, QTemporaryFile &gisrcFile,
|
||||
bool qgisModule = true );
|
||||
|
||||
// ! Run a GRASS module in any gisdbase/location
|
||||
static GRASS_LIB_EXPORT QByteArray runModule( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& moduleName,
|
||||
const QStringList& arguments, int timeOut = 30000,
|
||||
bool qgisModule = true );
|
||||
static QByteArray runModule( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& moduleName,
|
||||
const QStringList& arguments, int timeOut = 30000,
|
||||
bool qgisModule = true );
|
||||
|
||||
/** \brief Get info string from qgis.g.info module
|
||||
* @param info info type
|
||||
@ -356,93 +356,93 @@ class GRASS_LIB_EXPORT QgsGrass : public QObject
|
||||
* @sampleSize sample size for statistics
|
||||
* @timeOut timeout
|
||||
*/
|
||||
static GRASS_LIB_EXPORT QString getInfo( const QString& info, const QString& gisdbase,
|
||||
const QString& location, const QString& mapset = "PERMANENT",
|
||||
const QString& map = QString::null, const QgsGrassObject::Type type = QgsGrassObject::None,
|
||||
double x = 0.0, double y = 0.0,
|
||||
const QgsRectangle& extent = QgsRectangle(), int sampleRows = 0,
|
||||
int sampleCols = 0, int timeOut = 30000 );
|
||||
static QString getInfo( const QString& info, const QString& gisdbase,
|
||||
const QString& location, const QString& mapset = "PERMANENT",
|
||||
const QString& map = QString::null, const QgsGrassObject::Type type = QgsGrassObject::None,
|
||||
double x = 0.0, double y = 0.0,
|
||||
const QgsRectangle& extent = QgsRectangle(), int sampleRows = 0,
|
||||
int sampleCols = 0, int timeOut = 30000 );
|
||||
|
||||
// ! Get location projection
|
||||
static GRASS_LIB_EXPORT QgsCoordinateReferenceSystem crs( const QString& gisdbase, const QString& location, bool interactive = true );
|
||||
static QgsCoordinateReferenceSystem crs( const QString& gisdbase, const QString& location, bool interactive = true );
|
||||
|
||||
// ! Get location projection calling directly GRASS library
|
||||
static GRASS_LIB_EXPORT QgsCoordinateReferenceSystem crsDirect( const QString& gisdbase, const QString& location );
|
||||
static QgsCoordinateReferenceSystem crsDirect( const QString& gisdbase, const QString& location );
|
||||
|
||||
// ! Get map extent
|
||||
// @param interactive - show warning dialog on error
|
||||
static GRASS_LIB_EXPORT QgsRectangle extent( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& map,
|
||||
QgsGrassObject::Type type = QgsGrassObject::None, bool interactive = true );
|
||||
static QgsRectangle extent( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& map,
|
||||
QgsGrassObject::Type type = QgsGrassObject::None, bool interactive = true );
|
||||
|
||||
// ! Get raster map size
|
||||
static GRASS_LIB_EXPORT void size( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& map, int *cols, int *rows );
|
||||
static void size( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& map, int *cols, int *rows );
|
||||
|
||||
// ! Get raster info, info is either 'info' or 'stats'
|
||||
// extent and sampleSize are stats options
|
||||
// @param interactive - show warning dialog on error
|
||||
static GRASS_LIB_EXPORT QHash<QString, QString> info( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& map,
|
||||
QgsGrassObject::Type type,
|
||||
const QString& info = "info",
|
||||
const QgsRectangle& extent = QgsRectangle(),
|
||||
int sampleRows = 0, int sampleCols = 0,
|
||||
int timeOut = 30000, bool interactive = true );
|
||||
static QHash<QString, QString> info( const QString& gisdbase, const QString& location,
|
||||
const QString& mapset, const QString& map,
|
||||
QgsGrassObject::Type type,
|
||||
const QString& info = "info",
|
||||
const QgsRectangle& extent = QgsRectangle(),
|
||||
int sampleRows = 0, int sampleCols = 0,
|
||||
int timeOut = 30000, bool interactive = true );
|
||||
|
||||
// ! List of Color
|
||||
static GRASS_LIB_EXPORT QList<QgsGrass::Color> colors( QString gisdbase, QString location,
|
||||
QString mapset, QString map );
|
||||
static QList<QgsGrass::Color> colors( QString gisdbase, QString location,
|
||||
QString mapset, QString map );
|
||||
|
||||
// ! Get map value / feature info
|
||||
static GRASS_LIB_EXPORT QMap<QString, QString> query( QString gisdbase, QString location,
|
||||
QString mapset, QString map, QgsGrassObject::Type type, double x, double y );
|
||||
static QMap<QString, QString> query( QString gisdbase, QString location,
|
||||
QString mapset, QString map, QgsGrassObject::Type type, double x, double y );
|
||||
|
||||
// ! Rename GRASS object, throws QgsGrass::Exception
|
||||
static GRASS_LIB_EXPORT void renameObject( const QgsGrassObject & object, const QString& newName );
|
||||
static void renameObject( const QgsGrassObject & object, const QString& newName );
|
||||
|
||||
// ! Copy GRASS object, throws QgsGrass::Exception
|
||||
static GRASS_LIB_EXPORT void copyObject( const QgsGrassObject & srcObject, const QgsGrassObject & destObject );
|
||||
static void copyObject( const QgsGrassObject & srcObject, const QgsGrassObject & destObject );
|
||||
|
||||
// ! Delete map
|
||||
static GRASS_LIB_EXPORT bool deleteObject( const QgsGrassObject & object );
|
||||
static bool deleteObject( const QgsGrassObject & object );
|
||||
|
||||
/** Ask user confirmation to delete a map
|
||||
* @return true if confirmed
|
||||
*/
|
||||
static GRASS_LIB_EXPORT bool deleteObjectDialog( const QgsGrassObject & object );
|
||||
static bool deleteObjectDialog( const QgsGrassObject & object );
|
||||
|
||||
/** Create new table. Throws QgsGrass::Exception */
|
||||
static GRASS_LIB_EXPORT void createTable( dbDriver *driver, const QString tableName, const QgsFields &fields );
|
||||
static void createTable( dbDriver *driver, const QString tableName, const QgsFields &fields );
|
||||
|
||||
/** Insert row to table. Throws QgsGrass::Exception */
|
||||
static GRASS_LIB_EXPORT void insertRow( dbDriver *driver, const QString tableName,
|
||||
const QgsAttributes& attributes );
|
||||
static void insertRow( dbDriver *driver, const QString tableName,
|
||||
const QgsAttributes& attributes );
|
||||
|
||||
/** Returns true if object is link to external data (created by r.external) */
|
||||
static GRASS_LIB_EXPORT bool isExternal( const QgsGrassObject & object );
|
||||
static bool isExternal( const QgsGrassObject & object );
|
||||
|
||||
/** Adjust cell header, G_adjust_Cell_head wrapper
|
||||
* @throws QgsGrass::Exception */
|
||||
static GRASS_LIB_EXPORT void adjustCellHead( struct Cell_head *cellhd, int row_flag, int col_flag ) throw( QgsGrass::Exception );
|
||||
static void adjustCellHead( struct Cell_head *cellhd, int row_flag, int col_flag );
|
||||
|
||||
//! Library version
|
||||
static GRASS_LIB_EXPORT int versionMajor();
|
||||
static GRASS_LIB_EXPORT int versionMinor();
|
||||
static GRASS_LIB_EXPORT int versionRelease();
|
||||
static GRASS_LIB_EXPORT QString versionString();
|
||||
static int versionMajor();
|
||||
static int versionMinor();
|
||||
static int versionRelease();
|
||||
static QString versionString();
|
||||
|
||||
// files case sensitivity (insensitive on windows)
|
||||
static GRASS_LIB_EXPORT Qt::CaseSensitivity caseSensitivity();
|
||||
static Qt::CaseSensitivity caseSensitivity();
|
||||
// set environment variable
|
||||
static GRASS_LIB_EXPORT void putEnv( QString name, QString value );
|
||||
static void putEnv( QString name, QString value );
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
static GRASS_LIB_EXPORT QString shortPath( const QString &path );
|
||||
static QString shortPath( const QString &path );
|
||||
#endif
|
||||
|
||||
// path to QGIS GRASS modules like qgis.g.info etc.
|
||||
static GRASS_LIB_EXPORT QString qgisGrassModulePath()
|
||||
static QString qgisGrassModulePath()
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
if ( QgsApplication::isRunningFromBuildDir() )
|
||||
@ -454,32 +454,32 @@ class GRASS_LIB_EXPORT QgsGrass : public QObject
|
||||
}
|
||||
|
||||
// path to default modules interface config dir
|
||||
static GRASS_LIB_EXPORT QString modulesConfigDefaultDirPath();
|
||||
static QString modulesConfigDefaultDirPath();
|
||||
|
||||
// path to modules interface config dir (default or custom)
|
||||
static GRASS_LIB_EXPORT QString modulesConfigDirPath();
|
||||
static QString modulesConfigDirPath();
|
||||
|
||||
void GRASS_LIB_EXPORT setModulesConfig( bool custom, const QString &customDir );
|
||||
void setModulesConfig( bool custom, const QString &customDir );
|
||||
|
||||
/** Show warning dialog with message */
|
||||
static GRASS_LIB_EXPORT void warning( const QString &message );
|
||||
static void warning( const QString &message );
|
||||
|
||||
/** Show warning dialog with exception message */
|
||||
static GRASS_LIB_EXPORT void warning( QgsGrass::Exception &e );
|
||||
static void warning( QgsGrass::Exception &e );
|
||||
|
||||
// Allocate struct Map_info
|
||||
static GRASS_LIB_EXPORT struct Map_info * vectNewMapStruct();
|
||||
static struct Map_info * vectNewMapStruct();
|
||||
// Free struct Map_info
|
||||
static GRASS_LIB_EXPORT void vectDestroyMapStruct( struct Map_info *map );
|
||||
static void vectDestroyMapStruct( struct Map_info *map );
|
||||
|
||||
// Sleep miliseconds (for debugging)
|
||||
static GRASS_LIB_EXPORT void sleep( int ms );
|
||||
static void sleep( int ms );
|
||||
|
||||
signals:
|
||||
/** Signal emited after mapset was opened */
|
||||
void mapsetChanged();
|
||||
|
||||
/** Emited when path to modules config dir changed */
|
||||
/** Emitted when path to modules config dir changed */
|
||||
void modulesConfigChanged();
|
||||
|
||||
private:
|
||||
|
@ -342,6 +342,7 @@ void TestQgsGrassProvider::region()
|
||||
}
|
||||
catch ( QgsGrass::Exception &e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
reportRow( "QgsGrass::region() failed" );
|
||||
ok = false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user