From f1460b78cd65ad640bcea9d75795c0c2d3c41bcd Mon Sep 17 00:00:00 2001 From: kunitoki Date: Sat, 22 Oct 2011 14:29:54 +0200 Subject: [PATCH] - fix indentation and trailing spaces (generally coding style) in rasterlite plugin partially related to #911 --- .../rasterlite/rasterlite_datasource.hpp | 43 ++++++++++--------- .../rasterlite/rasterlite_featureset.cpp | 41 +++++++++++------- .../rasterlite/rasterlite_featureset.hpp | 27 ++++++------ .../input/rasterlite/rasterlite_include.hpp | 5 +-- 4 files changed, 65 insertions(+), 51 deletions(-) diff --git a/plugins/input/rasterlite/rasterlite_datasource.hpp b/plugins/input/rasterlite/rasterlite_datasource.hpp index b3acd0117..85b0d6b9e 100644 --- a/plugins/input/rasterlite/rasterlite_datasource.hpp +++ b/plugins/input/rasterlite/rasterlite_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2007 Artem Pavlenko + * Copyright (C) 2011 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,36 +19,39 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * *****************************************************************************/ -//$Id$ #ifndef RASTERLITE_DATASOURCE_HPP #define RASTERLITE_DATASOURCE_HPP +// mapnik #include + +// boost #include #include "rasterlite_include.hpp" class rasterlite_datasource : public mapnik::datasource { - public: - rasterlite_datasource(mapnik::parameters const& params, bool bind=true); - virtual ~rasterlite_datasource (); - int type() const; - static std::string name(); - mapnik::featureset_ptr features(mapnik::query const& q) const; - mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt) const; - mapnik::box2d envelope() const; - mapnik::layer_descriptor get_descriptor() const; - void bind() const; - private: - inline void *open_dataset() const; - mutable mapnik::box2d extent_; - std::string dataset_name_; - std::string table_name_; - mapnik::layer_descriptor desc_; - unsigned width_; - unsigned height_; +public: + rasterlite_datasource(mapnik::parameters const& params, bool bind = true); + virtual ~rasterlite_datasource (); + int type() const; + static std::string name(); + mapnik::featureset_ptr features(mapnik::query const& q) const; + mapnik::featureset_ptr features_at_point(mapnik::coord2d const& pt) const; + mapnik::box2d envelope() const; + mapnik::layer_descriptor get_descriptor() const; + void bind() const; + +private: + inline void* open_dataset() const; + mutable mapnik::box2d extent_; + std::string dataset_name_; + std::string table_name_; + mapnik::layer_descriptor desc_; + unsigned width_; + unsigned height_; }; #endif // RASTERLITE_DATASOURCE_HPP diff --git a/plugins/input/rasterlite/rasterlite_featureset.cpp b/plugins/input/rasterlite/rasterlite_featureset.cpp index 69b11c964..8feb925ca 100644 --- a/plugins/input/rasterlite/rasterlite_featureset.cpp +++ b/plugins/input/rasterlite/rasterlite_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2007 Artem Pavlenko + * Copyright (C) 2011 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,7 +19,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * *****************************************************************************/ -//$Id$ #include "rasterlite_featureset.hpp" @@ -43,9 +42,9 @@ using mapnik::feature_factory; rasterlite_featureset::rasterlite_featureset(void* dataset, rasterlite_query q) - : dataset_(dataset), - gquery_(q), - first_(true) + : dataset_(dataset), + gquery_(q), + first_(true) { rasterliteSetBackgroundColor(dataset_, 255, 0, 255); rasterliteSetTransparentColor(dataset_, 255, 0, 255); @@ -67,11 +66,15 @@ feature_ptr rasterlite_featureset::next() first_ = false; query *q = boost::get(&gquery_); - if(q) { + if (q) + { return get_feature(*q); - } else { + } + else + { coord2d *p = boost::get(&gquery_); - if(p) { + if (p) + { return get_feature_at_point(*p); } } @@ -91,7 +94,7 @@ feature_ptr rasterlite_featureset::get_feature(mapnik::query const& q) double x0, y0, x1, y1; rasterliteGetExtent (dataset_, &x0, &y0, &x1, &y1); - box2d raster_extent(x0,y0,x1,y1); + box2d raster_extent(x0, y0, x1, y1); box2d intersect = raster_extent.intersect(q.get_bbox()); const int width = static_cast(boost::get<0>(q.resolution()) * intersect.width() + 0.5); @@ -104,8 +107,8 @@ feature_ptr rasterlite_featureset::get_feature(mapnik::query const& q) std::clog << "Rasterlite Plugin: Raster extent=" << raster_extent << std::endl; std::clog << "Rasterlite Plugin: View extent=" << q.get_bbox() << std::endl; std::clog << "Rasterlite Plugin: Intersect extent=" << intersect << std::endl; - std::clog << "Rasterlite Plugin: Query resolution=" << boost::get<0>(q.resolution()) - << "," << boost::get<1>(q.resolution()) << std::endl; + std::clog << "Rasterlite Plugin: Query resolution=" + << boost::get<0>(q.resolution()) << "," << boost::get<1>(q.resolution()) << std::endl; std::clog << "Rasterlite Plugin: Size=" << width << " " << height << std::endl; std::clog << "Rasterlite Plugin: Pixel Size=" << pixel_size << std::endl; #endif @@ -113,11 +116,19 @@ feature_ptr rasterlite_featureset::get_feature(mapnik::query const& q) if (width > 0 && height > 0) { int size = 0; - void *raster = 0; + void* raster = 0; if (rasterliteGetRawImageByRect(dataset_, - intersect.minx(), intersect.miny(), intersect.maxx(), intersect.maxy(), - pixel_size, width, height, GAIA_RGBA_ARRAY, &raster, &size) == RASTERLITE_OK) + intersect.minx(), + intersect.miny(), + intersect.maxx(), + intersect.maxy(), + pixel_size, + width, + height, + GAIA_RGBA_ARRAY, + &raster, + &size) == RASTERLITE_OK) { if (size > 0) { @@ -150,9 +161,7 @@ feature_ptr rasterlite_featureset::get_feature(mapnik::query const& q) return feature_ptr(); } - feature_ptr rasterlite_featureset::get_feature_at_point(mapnik::coord2d const& pt) { return feature_ptr(); } - diff --git a/plugins/input/rasterlite/rasterlite_featureset.hpp b/plugins/input/rasterlite/rasterlite_featureset.hpp index 0db77cce2..9b83c1fa2 100644 --- a/plugins/input/rasterlite/rasterlite_featureset.hpp +++ b/plugins/input/rasterlite/rasterlite_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2007 Artem Pavlenko + * Copyright (C) 2011 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,12 +19,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * *****************************************************************************/ -//$Id$ #ifndef RASTERLITE_FEATURESET_HPP #define RASTERLITE_FEATURESET_HPP +// mapnik #include + +// boost #include #include "rasterlite_include.hpp" @@ -33,16 +35,17 @@ typedef boost::variant rasterlite_query; class rasterlite_featureset : public mapnik::Featureset { - public: - rasterlite_featureset(void* dataset, rasterlite_query q); - virtual ~rasterlite_featureset(); - mapnik::feature_ptr next(); - private: - mapnik::feature_ptr get_feature(mapnik::query const& q); - mapnik::feature_ptr get_feature_at_point(mapnik::coord2d const& p); - void* dataset_; - rasterlite_query gquery_; - bool first_; +public: + rasterlite_featureset(void* dataset, rasterlite_query q); + virtual ~rasterlite_featureset(); + mapnik::feature_ptr next(); + +private: + mapnik::feature_ptr get_feature(mapnik::query const& q); + mapnik::feature_ptr get_feature_at_point(mapnik::coord2d const& p); + void* dataset_; + rasterlite_query gquery_; + bool first_; }; #endif // RASTERLITE_FEATURESET_HPP diff --git a/plugins/input/rasterlite/rasterlite_include.hpp b/plugins/input/rasterlite/rasterlite_include.hpp index c1c953768..cf7995a86 100644 --- a/plugins/input/rasterlite/rasterlite_include.hpp +++ b/plugins/input/rasterlite/rasterlite_include.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2007 Artem Pavlenko + * Copyright (C) 2011 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,7 +19,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * *****************************************************************************/ -//$Id$ #ifndef RASTERLITE_INCLUDE_HPP #define RASTERLITE_INCLUDE_HPP @@ -29,4 +28,4 @@ extern "C" { #include } -#endif // RASTERLITE_FEATURESET_HPP +#endif // RASTERLITE_INCLUDE_HPP