[Liblas-commits] hg-main-tree: leave the options static,
but .add() new options t...
liblas-commits at liblas.org
liblas-commits at liblas.org
Wed Aug 3 09:50:52 EDT 2011
details: http://hg.libpc.orghg-main-tree/rev/c270b378d302
changeset: 1000:c270b378d302
user: Howard Butler <hobu.inc at gmail.com>
date: Wed Aug 03 08:50:33 2011 -0500
description:
leave the options static, but .add() new options to it. Use our Bounds<double> option here instead of std::string
Subject: hg-main-tree: test new Bounds<double> option
details: http://hg.libpc.orghg-main-tree/rev/3d24e634e1c2
changeset: 1001:3d24e634e1c2
user: Howard Butler <hobu.inc at gmail.com>
date: Wed Aug 03 08:50:45 2011 -0500
description:
test new Bounds<double> option
diffstat:
src/filters/CropFilter.cpp | 5 +++--
test/unit/OptionsTest.cpp | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diffs (35 lines):
diff -r a6cfc29e0c28 -r 3d24e634e1c2 src/filters/CropFilter.cpp
--- a/src/filters/CropFilter.cpp Tue Aug 02 17:17:46 2011 -0700
+++ b/src/filters/CropFilter.cpp Wed Aug 03 08:50:45 2011 -0500
@@ -76,8 +76,9 @@
const Options& CropFilter::s_getDefaultOptions()
{
- static Option<std::string> option1("bounds","","bounds to crop to");
- static Options options(option1);
+ static Options options;
+ Option<Bounds<double> > bounds("bounds",Bounds<double>(),"bounds to crop to");
+ options.add(bounds);
return options;
}
diff -r a6cfc29e0c28 -r 3d24e634e1c2 test/unit/OptionsTest.cpp
--- a/test/unit/OptionsTest.cpp Tue Aug 02 17:17:46 2011 -0700
+++ b/test/unit/OptionsTest.cpp Wed Aug 03 08:50:45 2011 -0500
@@ -38,6 +38,7 @@
#include <string>
#include <pdal/Options.hpp>
+#include <pdal/Bounds.hpp>
#include <pdal/filters/CropFilter.hpp>
@@ -52,7 +53,7 @@
{
const pdal::Options& opts = pdal::filters::CropFilter::s_getDefaultOptions();
- BOOST_CHECK(opts.hasOption<std::string>("bounds"));
+ BOOST_CHECK(opts.hasOption<pdal::Bounds<double> >("bounds"));
BOOST_CHECK(!opts.hasOption<std::string>("metes"));
const boost::property_tree::ptree& pt = opts.getPTree();
BOOST_CHECK(pt.size() == 1);
More information about the Liblas-commits
mailing list