~ubuntu-branches/ubuntu/saucy/python-demgengeo/saucy

« back to all changes in this revision

Viewing changes to Python/LineSegment2DPy.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 "LineSegment2DPy.h"
 
15
 
 
16
using namespace boost::python;
 
17
 
 
18
    using boost::python::arg;
 
19
    void exportLineSegment2D()
 
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_<LineSegment2D, bases<Line2D> >(
 
31
        "LineSegment2D",
 
32
        "A class defining a line segment in 2 dimensions.",
 
33
        init<>()
 
34
      )
 
35
      .def(init<const LineSegment2D &>())
 
36
      .def(
 
37
        init<Vector3,Vector3>(
 
38
          ( arg("startPoint"), arg("endPoint") ),
 
39
          "Constructs a 2D line with specified endpoints.\n"
 
40
          "N.B. This is not an L{AVolume2D} so cannot be used with C{InsertGenerators}.\n"
 
41
          "@type startPoint: L{Vector3}\n"
 
42
          "@kwarg startPoint: the starting point of the line\n"
 
43
          "@type endPoint: L{Vector3}\n"
 
44
          "@kwarg endPoint: the end point of the line\n"
 
45
        )
 
46
      )
 
47
      .def(self_ns::str(self))
 
48
      ;
 
49
    }