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

« back to all changes in this revision

Viewing changes to Python/TriPatchSetPy.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 <iostream>
 
15
#include <fstream>
 
16
#include <sstream>
 
17
#include "TriPatchSetPy.h"
 
18
 
 
19
using namespace std;
 
20
 
 
21
using namespace boost::python;
 
22
 
 
23
void exportTriPatchSet()
 
24
{
 
25
  // Check that Boost 1.34.0 or higher is being used.
 
26
  // If so, disable auto-generation of C++ signatures for Epydoc
 
27
  // (which stumbles over indentation in the auto-generated strings).
 
28
  #if ((BOOST_VERSION / 100000 >= 1) \
 
29
      && (BOOST_VERSION / 100 % 1000 >= 34)) \
 
30
      || (BOOST_VERSION / 100000 >= 2)
 
31
    boost::python::docstring_options no_autogen(true,false);
 
32
  #endif
 
33
 
 
34
    class_<TriPatchSet>(
 
35
      "TriPatchSet",
 
36
      "A collection of triangular patches defining a joint set",
 
37
      init<>()
 
38
    )
 
39
    .def(init<TriPatchSet &>())
 
40
    .def("addTriangle",
 
41
         &TriPatchSet::addTriangle,
 
42
         ( boost::python::arg("Point1"),boost::python::arg("Point2"),boost::python::arg("Point2"),boost::python::arg("tag")),
 
43
         "Adds a triangle by specifying corner coordinates\n"
 
44
         "@type Point1: L{Vector3}\n"
 
45
         "@kwarg Point1: location of first corner of the triangle\n"
 
46
         "@type Point2: L{Vector3}\n"
 
47
         "@kwarg Point2: location of second corner of the triangle\n"
 
48
         "@type Point3: L{Vector3}\n"
 
49
         "@kwarg Point3: location of third corner of the triangle\n"
 
50
         "@type tag: int\n"
 
51
         "@kwarg tag: the tag to assign to the triangle\n"
 
52
         )
 
53
    .def("isCrossing",
 
54
         &TriPatchSet::isCrossing,
 
55
         boost::python::arg("Point1"),boost::python::arg("Point2"),
 
56
         "Checks if the line between two specified points crosses a triangle\n"
 
57
         "@type Point1: L{Vector3}\n"
 
58
         "@kwarg Point1: location of first corner of the triangle\n"
 
59
         "@type Point2: L{Vector3}\n"
 
60
         "@kwarg Point2: location of second corner of the triangle\n"
 
61
         )
 
62
    .def("getMinPoint",
 
63
         &TriPatchSet::getMinPoint,
 
64
         "Returns minimum corner of the joint set bounding box"
 
65
         )
 
66
    .def("getMaxPoint",
 
67
         &TriPatchSet::getMaxPoint,
 
68
         "Returns maximum corner of the joint set bounding box"
 
69
     );
 
70
}