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

« back to all changes in this revision

Viewing changes to Python/ShapeListPy.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 "ShapeListPy.h"
 
15
 
 
16
using namespace boost::python;
 
17
 
 
18
void exportShapeList ()
 
19
{
 
20
  // Check that Boost 1.34.0 or higher is being used.
 
21
  // If so, disable auto-generation of C++ signatures for Epydoc
 
22
  // (which stumbles over indentation in the auto-generated strings).
 
23
  #if ((BOOST_VERSION / 100000 >= 1) \
 
24
      && (BOOST_VERSION / 100 % 1000 >= 34)) \
 
25
      || (BOOST_VERSION / 100000 >= 2)
 
26
    boost::python::docstring_options no_autogen(true,false);
 
27
  #endif
 
28
 
 
29
      class_<ShapeList>(
 
30
        "ShapeList",
 
31
        "A list of 3D shapes to be inserted into a packing by replacing spheres with scaled versions of the specified shape.\n"
 
32
        "Shapes may be read from a shape database file and the probability with which a given shape is inserted into a packing may be specified.\n",
 
33
        init<>()
 
34
      )
 
35
      .def(
 
36
        "addHexShape",
 
37
        &ShapeList::addHexShape,
 
38
        ( arg("bias") ),
 
39
        ( arg("random") ),
 
40
        "Adds a hexagonal aggregate to the L{ShapeList}\n"
 
41
        "@type bias: int\n"
 
42
        "@kwarg bias: How often the shape should be added\n"
 
43
        "@type random: int\n"
 
44
        "@kwarg random: 1 to randomly orientate this shape, 0 to have all constant\n"
 
45
      )
 
46
      .def(
 
47
        "addGenericShape",
 
48
        &ShapeList::addGenericShape,
 
49
        ( arg("db"), 
 
50
        arg("name"),
 
51
        arg("bias"),
 
52
        arg("random"),
 
53
        arg("particleTag"),
 
54
        arg("bondTag") ),
 
55
        "Adds a shape from a database file into the list\n"
 
56
        "@type db: string\n"
 
57
        "@kwarg db: The filename of the database file\n"
 
58
        "@type name: string\n"
 
59
        "@kwarg name: The name of the shape to be added, as per database file\n"
 
60
        "@type bias: int\n"
 
61
        "@kwarg bias: The bias of the new shape; in other words, how often it will be added\n"
 
62
        "@type random: int\n"
 
63
        "@kwarg random: Whether the shape should be orientated randomly at each insertion:\n"
 
64
        "0 for not random, 1 for always random\n"
 
65
        "@type particleTag: int\n"
 
66
        "@kwarg particleTag: the ID of each particle inside each inserted shape\n"
 
67
        "@type bondTag: int\n"
 
68
        "@kwarg bondTag: the bond ID of each bond internal to each shape\n"
 
69
      )
 
70
      ;
 
71
}