1
/////////////////////////////////////////////////////////////
3
// Copyright (c) 2007-2011 by The University of Queensland //
4
// Earth Systems Science Computational Centre (ESSCC) //
5
// http://www.uq.edu.au/esscc //
7
// Primary Business: Brisbane, Queensland, Australia //
8
// Licensed under the Open Software License version 3.0 //
9
// http://www.opensource.org/licenses/osl-3.0.php //
11
/////////////////////////////////////////////////////////////
13
#include <boost/version.hpp>
14
#include "PolygonWithLines2DPy.h"
15
#include "PolygonWithLines2D.h"
17
using namespace boost::python;
19
void exportPolygonWithLines2D()
21
// Check that Boost 1.34.0 or higher is being used.
22
// If so, disable auto-generation of C++ signatures for Epydoc
23
// (which stumbles over indentation in the auto-generated strings).
24
#if ((BOOST_VERSION / 100000 >= 1) \
25
&& (BOOST_VERSION / 100 % 1000 >= 34)) \
26
|| (BOOST_VERSION / 100000 >= 2)
27
boost::python::docstring_options no_autogen(true,false);
30
class_<PolygonWithLines2D, bases<AVolume2D> >(
32
"A class defining a polygonal volume in 2D bounded by lines.",
35
.def(init<const PolygonWithLines2D &>())
37
init<boost::python::list>(
39
"Constructs a polygon from either a list of vertices or a specified centre, radius and number of sides.\n"
40
"@type corners: boost::python::list\n"
41
"@kwarg corners: list of vertices. Do not specify C{centre}, C{radius}, C{nsides} or C{smooth_edges} when using this parameter.\n"
45
init<Vector3,double,int,bool>(
46
( arg("centre"), arg("radius"), arg("nsides"), arg("smooth_edges") ),
47
"@type centre: L{Vector3}\n"
48
"@kwarg centre: Coordinates of the centre of the polygon. Do not specify C{corners} when using this parameter.\n"
49
"@type radius: double\n"
50
"@kwarg radius: Radius of circle enclosing the polygon. Do not specify C{corners} when using this parameter.\n"
52
"@kwarg nsides: Number of sides for the polygon (maximum of 50). Do not specify C{corners} when using this parameter.\n"
53
"@type smooth_edges: bool\n"
54
"@kwarg smooth_edges: Adds bounding lines to edges to achieve smooth edges. Do not specify C{corners} when using this parameter.\n"
59
&PolygonWithLines2D::addLine,
61
"Adds a line to the polygon for fitting particles.\n"
62
"@type line: L{Line2D}\n"
63
"@kwarg line: the line to add to the polygon\n"
66
.def(self_ns::str(self))
68
// boost::python::implicitly_convertible<PolygonWithLines2D, AVolume2D>();