Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hillshade layer improvements #378

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions all/modules/core/DoubleVector.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#ifndef _DOUBLEVECTOR_I
#define _DOUBLEVECTOR_I

#pragma SWIG nowarn=302

%module DoubleVector

%include <std_vector.i>

!value_type(std::vector<double>, core.DoubleVector)

#ifdef SWIGOBJECTIVEC
%template(NTDoubleVector) std::vector<double>;
#else
%template(DoubleVector) std::vector<double>;
#endif

#endif
6 changes: 5 additions & 1 deletion all/modules/layers/HillshadeRasterTileLayer.i
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

%module HillshadeRasterTileLayer

!proxy_imports(carto::HillshadeRasterTileLayer, datasources.TileDataSource, graphics.Color, layers.RasterTileLayer)
!proxy_imports(carto::HillshadeRasterTileLayer, core.MapPos, core.MapPosVector, core.DoubleVector, datasources.TileDataSource, rastertiles.ElevationDecoder, graphics.Color, layers.RasterTileLayer)

%{
#include "layers/HillshadeRasterTileLayer.h"
Expand All @@ -15,13 +15,17 @@
%include <cartoswig.i>

%import "datasources/TileDataSource.i"
%import "rastertiles/ElevationDecoder.i"
%import "graphics/Color.i"
%import "layers/RasterTileLayer.i"
%import "core/DoubleVector.i"

!polymorphic_shared_ptr(carto::HillshadeRasterTileLayer, layers.HillshadeRasterTileLayer)

%attribute(carto::HillshadeRasterTileLayer, float, Contrast, getContrast, setContrast)
%attribute(carto::HillshadeRasterTileLayer, float, HeightScale, getHeightScale, setHeightScale)
%attribute(carto::HillshadeRasterTileLayer, float, IlluminationDirection, getIlluminationDirection, setIlluminationDirection)
%attribute(carto::HillshadeRasterTileLayer, bool, IlluminationMapRotationEnabled, getIlluminationMapRotationEnabled, setIlluminationMapRotationEnabled)
%attributeval(carto::HillshadeRasterTileLayer, carto::Color, ShadowColor, getShadowColor, setShadowColor)
%attributeval(carto::HillshadeRasterTileLayer, carto::Color, HighlightColor, getHighlightColor, setHighlightColor)
%std_exceptions(carto::HillshadeRasterTileLayer::HillshadeRasterTileLayer)
Expand Down
26 changes: 26 additions & 0 deletions all/modules/rastertiles/ElevationDecoder.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ifndef _ELEVATIONDECODER_I
#define _ELEVATIONDECODER_I

%module ElevationDecoder

!proxy_imports(carto::ElevationDecoder, graphics.Color)

%{
#include "rastertiles/ElevationDecoder.h"
#include <memory>
%}

%include <std_shared_ptr.i>
%include <cartoswig.i>

%import "graphics/Color.i"

!polymorphic_shared_ptr(carto::ElevationDecoder, rastertiles.ElevationDecoder)

!standard_equals(carto::ElevationDecoder);
%ignore carto::ElevationDecoder::getColorComponentCoefficients;
%ignore carto::ElevationDecoder::getVectorTileScales;

%include "rastertiles/ElevationDecoder.h"

#endif
30 changes: 30 additions & 0 deletions all/modules/rastertiles/MapBoxElevationDataDecoder.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#ifndef _MAPBOXELEVATIONDATADECODER_I
#define _MAPBOXELEVATIONDATADECODER_I

%module MapBoxElevationDataDecoder

%module(directors="1") MapBoxElevationDataDecoder
!proxy_imports(carto::MapBoxElevationDataDecoder, graphics.Color, core.MapPos, core.MapPosVector, datasources.TileDataSource, rastertiles.ElevationDecoder)

%{
#include "rastertiles/MapBoxElevationDataDecoder.h"
#include <memory>
%}

%include <std_shared_ptr.i>
%include <cartoswig.i>

%import "graphics/Color.i"
%import "rastertiles/ElevationDecoder.i"

!polymorphic_shared_ptr(carto::MapBoxElevationDataDecoder, rastertiles.MapBoxElevationDataDecoder)
!standard_equals(carto::MapBoxElevationDataDecoder);

%feature("director") carto::MapBoxElevationDataDecoder;

%ignore carto::MapBoxElevationDataDecoder::getColorComponentCoefficients;
%ignore carto::MapBoxElevationDataDecoder::getVectorTileScales;

%include "rastertiles/MapBoxElevationDataDecoder.h"

#endif
30 changes: 30 additions & 0 deletions all/modules/rastertiles/TerrariumElevationDataDecoder.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#ifndef _TERRARIUMELEVATIONDATADECODER_I
#define _TERRARIUMELEVATIONDATADECODER_I

%module TerrariumElevationDataDecoder

%module(directors="1") TerrariumElevationDataDecoder
!proxy_imports(carto::TerrariumElevationDataDecoder, graphics.Color, core.MapPos, core.MapPosVector, datasources.TileDataSource, rastertiles.ElevationDecoder)

%{
#include "rastertiles/TerrariumElevationDataDecoder.h"
#include <memory>
%}

%include <std_shared_ptr.i>
%include <cartoswig.i>

%import "graphics/Color.i"
%import "rastertiles/ElevationDecoder.i"

!polymorphic_shared_ptr(carto::TerrariumElevationDataDecoder, rastertiles.TerrariumElevationDataDecoder)
!standard_equals(carto::TerrariumElevationDataDecoder);

%feature("director") carto::TerrariumElevationDataDecoder;

%ignore carto::TerrariumElevationDataDecoder::getColorComponentCoefficients;
%ignore carto::TerrariumElevationDataDecoder::getVectorTileScales;

%include "rastertiles/TerrariumElevationDataDecoder.h"

#endif
4 changes: 3 additions & 1 deletion all/modules/routing/PackageManagerValhallaRoutingService.i
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#if defined(_CARTO_ROUTING_SUPPORT) && defined(_CARTO_VALHALLA_ROUTING_SUPPORT) && defined(_CARTO_PACKAGEMANAGER_SUPPORT)

!proxy_imports(carto::PackageManagerValhallaRoutingService, packagemanager.PackageManager, core.Variant, routing.RoutingService, routing.RoutingRequest, routing.RoutingResult, routing.RouteMatchingRequest, routing.RouteMatchingResult)
!proxy_imports(carto::PackageManagerValhallaRoutingService, packagemanager.PackageManager, core.Variant, routing.RoutingService, routing.RoutingRequest, routing.RoutingResult, routing.RouteMatchingRequest, routing.RouteMatchingResult, datasources.TileDataSource, rastertiles.ElevationDecoder)

%{
#include "routing/PackageManagerValhallaRoutingService.h"
Expand All @@ -20,6 +20,8 @@
%import "core/Variant.i"
%import "routing/RoutingService.i"
%import "packagemanager/PackageManager.i"
%import "datasources/TileDataSource.i"
%import "rastertiles/ElevationDecoder.i"

!polymorphic_shared_ptr(carto::PackageManagerValhallaRoutingService, routing.PackageManagerValhallaRoutingService)

Expand Down
4 changes: 3 additions & 1 deletion all/modules/routing/ValhallaOfflineRoutingService.i
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#if defined(_CARTO_ROUTING_SUPPORT) && defined(_CARTO_VALHALLA_ROUTING_SUPPORT) && defined(_CARTO_OFFLINE_SUPPORT)

!proxy_imports(carto::ValhallaOfflineRoutingService, core.Variant, routing.RoutingService, routing.RoutingRequest, routing.RoutingResult, routing.RouteMatchingRequest, routing.RouteMatchingResult)
!proxy_imports(carto::ValhallaOfflineRoutingService, core.Variant, routing.RoutingService, routing.RoutingRequest, routing.RoutingResult, routing.RouteMatchingRequest, routing.RouteMatchingResult, datasources.TileDataSource, rastertiles.ElevationDecoder)

%{
#include "routing/ValhallaOfflineRoutingService.h"
Expand All @@ -19,6 +19,8 @@

%import "core/Variant.i"
%import "routing/RoutingService.i"
%import "datasources/TileDataSource.i"
%import "rastertiles/ElevationDecoder.i"

!polymorphic_shared_ptr(carto::ValhallaOfflineRoutingService, routing.ValhallaOfflineRoutingService)

Expand Down
Loading