iLand
Public Slots | Public Member Functions | Static Public Member Functions | Properties | List of all members
MapGridWrapper Class Reference

#include <scriptglobal.h>

Inheritance diagram for MapGridWrapper:

Public Slots

double area (int id)
 retrieve the area (m2) of the polygon denoted by 'id' More...
 
void load (QString file_name)
 
void saveAsImage (QString file)
 
void paint (double min_value, double max_value)
 
void clear ()
 clears the map (set all values to 0) More...
 
void clearProjectArea ()
 clear the project area (set to 0), but copy mask with pixels from "outside of project area" (i.e., -1, -2) More...
 
void createStand (int stand_id, QString paint_function, bool wrap_around)
 paint a shape on the stand grid with id stand_id paint_function is a valid expression (paramters: x, y as metric coordinates) if wrap_around=true, then the shape is wrapped around the edges of the simulated area (torus) More...
 
double copyPolygonFromRect (QJSValue source, int id_in, int id, double destx, double desty, double x1, double y1, double x2, double y2)
 copy a bit of the source-map 'source' to this map. More...
 
void createMapIndex ()
 call after creating stands with copyPolygonFromRect More...
 

Public Member Functions

 MapGridWrapper (QObject *parent=nullptr)
 
 ~MapGridWrapper ()
 
MapGridmap () const
 acccess for C++ classes More...
 
bool isValid () const
 returns true if map is successfully loaded More...
 
QString name () const
 

Static Public Member Functions

static void addToScriptEngine (QJSEngine &engine)
 

Properties

int valid
 
QString name
 

Constructor & Destructor Documentation

◆ MapGridWrapper()

MapGridWrapper::MapGridWrapper ( QObject *  parent = nullptr)

◆ ~MapGridWrapper()

MapGridWrapper::~MapGridWrapper ( )

Member Function Documentation

◆ addToScriptEngine()

void MapGridWrapper::addToScriptEngine ( QJSEngine &  engine)
static

◆ area

double MapGridWrapper::area ( int  id)
slot

retrieve the area (m2) of the polygon denoted by 'id'

◆ clear

void MapGridWrapper::clear ( )
slot

clears the map (set all values to 0)

◆ clearProjectArea

void MapGridWrapper::clearProjectArea ( )
slot

clear the project area (set to 0), but copy mask with pixels from "outside of project area" (i.e., -1, -2)

◆ copyPolygonFromRect

double MapGridWrapper::copyPolygonFromRect ( QJSValue  source,
int  id_in,
int  id,
double  destx,
double  desty,
double  x1,
double  y1,
double  x2,
double  y2 
)
slot

copy a bit of the source-map 'source' to this map.

The source rectangle is given by coordinates (x1/y1) to (x2/y2). The rectangle will be blitted to the new coordinates destx/desty (moved from x1/y1). id_in: the id of the polygon to copy, id: the id of the pixels in the target return the size (ha) of the valid thing

◆ createMapIndex

void MapGridWrapper::createMapIndex ( )
slot

call after creating stands with copyPolygonFromRect

◆ createStand

void MapGridWrapper::createStand ( int  stand_id,
QString  paint_function,
bool  wrap_around 
)
slot

paint a shape on the stand grid with id stand_id paint_function is a valid expression (paramters: x, y as metric coordinates) if wrap_around=true, then the shape is wrapped around the edges of the simulated area (torus)

◆ isValid()

bool MapGridWrapper::isValid ( ) const

returns true if map is successfully loaded

◆ load

void MapGridWrapper::load ( QString  file_name)
slot

◆ map()

MapGrid * MapGridWrapper::map ( ) const
inline

acccess for C++ classes

◆ name()

QString MapGridWrapper::name ( ) const

◆ paint

void MapGridWrapper::paint ( double  min_value,
double  max_value 
)
slot

◆ saveAsImage

void MapGridWrapper::saveAsImage ( QString  file)
slot

Property Documentation

◆ name

QString MapGridWrapper::name
read

◆ valid

int MapGridWrapper::valid
read

The documentation for this class was generated from the following files: