~ubuntu-branches/ubuntu/quantal/python-demgengeo/quantal

« back to all changes in this revision

Viewing changes to Python/BoxWithLines2DPy.cc

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2011-11-18 21:47:18 UTC
  • Revision ID: package-import@ubuntu.com-20111118214718-4ysqm3dhpqwdd7gd
Tags: upstream-0.99~bzr106
ImportĀ upstreamĀ versionĀ 0.99~bzr106

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/////////////////////////////////////////////////////////////
 
2
//                                                         //
 
3
// Copyright (c) 2007-2011 by The University of Queensland //
 
4
// Earth Systems Science Computational Centre (ESSCC)      //
 
5
// http://www.uq.edu.au/esscc                              //
 
6
//                                                         //
 
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          //
 
10
//                                                         //
 
11
/////////////////////////////////////////////////////////////
 
12
 
 
13
#include <boost/version.hpp>
 
14
#include "BoxWithLines2DPy.h"
 
15
#include "BoxWithLines2D.h"
 
16
 
 
17
using namespace boost::python;
 
18
 
 
19
    void exportBoxWithLines2D()
 
20
    {
 
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);
 
28
      #endif
 
29
 
 
30
      class_<BoxWithLines2D, bases<AVolume2D> >(
 
31
        "BoxWithLines2D",
 
32
        "A class defining a rectangular volume in 2D optionally bounded by lines.",
 
33
        init<>()
 
34
      )
 
35
      .def(init<const BoxWithLines2D &>())
 
36
      .def(
 
37
        init<Vector3,Vector3>(
 
38
          ( arg("minPoint"), arg("maxPoint") ),
 
39
          "Constructs a box with the specified corner points.\n"
 
40
          "@type minPoint: L{Vector3}\n"
 
41
          "@kwarg minPoint: Coordinate of bottom left corner of the box\n"
 
42
          "@type maxPoint: L{Vector3}\n"
 
43
          "@kwarg maxPoint: Coordinate of upper right corner of the box\n"
 
44
        )
 
45
      )
 
46
      .def(
 
47
        "addLine",
 
48
        &BoxWithLines2D::addLine,
 
49
        ( arg("line") ),
 
50
        "Adds a line to the box for fitting particles.\n"
 
51
        "@type line: L{Line2D}\n"
 
52
        "@kwarg line: the line to add to the box\n"
 
53
        "@rtype: void\n"
 
54
      )
 
55
      .def(self_ns::str(self))
 
56
      ;
 
57
//      boost::python::implicitly_convertible<BoxWithLines2D, AVolume2D>();
 
58
    }
 
59
 
 
60
 
 
61