File: pyAtomHashGrid.sip

package info (click to toggle)
ball 1.5.0%2Bgit20180813.37fc53c-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 239,888 kB
  • sloc: cpp: 326,149; ansic: 4,208; python: 2,303; yacc: 1,778; lex: 1,099; xml: 958; sh: 322; makefile: 95
file content (160 lines) | stat: -rw-r--r-- 3,623 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
class AtomHashGrid3BoxIterator
{
%TypeHeaderCode
	#include <BALL/DATATYPE/hashGrid.h>
	#include <BALL/KERNEL/atom.h>

	using AtomHashGridBox3 = HashGridBox3<Atom*>;
	using AtomHashGrid3BoxIterator = HashGridBox3<Atom*>::BoxIterator;
%End
	AtomHashGrid3BoxIterator& __iter__();
%MethodCode
	sipRes = sipCpp;
%End

	AtomHashGridBox3& __next__();
%MethodCode
	if(sipCpp->isEnd())
	{
		PyErr_SetNone(PyExc_StopIteration);
		return NULL;
	}

	sipRes = &**sipCpp;

	++*sipCpp;
%End
};

class AtomHashGrid3BoxDataIterator
{
%TypeHeaderCode
	#include <BALL/DATATYPE/hashGrid.h>
	#include <BALL/KERNEL/atom.h>
	using AtomHashGridBox3 = HashGridBox3<Atom*>;
	using AtomHashGrid3BoxDataIterator = HashGridBox3<Atom*>::DataIterator;
%End
	AtomHashGrid3BoxDataIterator& __iter__();
%MethodCode
	sipRes = sipCpp;
%End

	Atom& __next__();
%MethodCode
	if(sipCpp->isEnd())
	{
		PyErr_SetNone(PyExc_StopIteration);
		return NULL;
	}

	sipRes = **sipCpp;

	++*sipCpp;
%End
};

class AtomHashGridBox3
{
%TypeHeaderCode
	#include <BALL/DATATYPE/hashGrid.h>
	#include <BALL/KERNEL/atom.h>
	using AtomHashGridBox3 = HashGridBox3<Atom*>;
%End
	public:

	AtomHashGridBox3(AtomHashGrid3* parent);
	~AtomHashGridBox3();
	void clear();
	void destroy();

	Size getSize() const;
	void insert(Atom*);
	bool remove(Atom*);
	bool removeAll(Atom*);

	bool operator == (const AtomHashGridBox3) const;
	bool operator != (const AtomHashGridBox3) const;
	bool has(Atom*) const;

	bool isEmpty() const;
	bool isValid() const;

	AtomHashGrid3BoxIterator iterboxes();
%MethodCode
	return BALL_CONVERT_FROM_INSTANCE(new AtomHashGrid3BoxIterator(sipCpp->beginBox()), AtomHashGrid3BoxIterator, Py_None);
%End

	AtomHashGrid3BoxDataIterator iterdata();
%MethodCode
	return BALL_CONVERT_FROM_INSTANCE(new AtomHashGrid3BoxDataIterator(sipCpp->beginData()), AtomHashGrid3BoxDataIterator, Py_None);
%End
};

class AtomHashGrid3
{
%TypeHeaderCode
	#include <BALL/DATATYPE/hashGrid.h>
	#include <BALL/KERNEL/atom.h>

	using AtomHashGrid3 = HashGrid3<Atom*>;
%End
	public:

	AtomHashGrid3();
	AtomHashGrid3(const Vector3, Size, Size,
		Size, float, float, float);
	AtomHashGrid3(const Vector3, Size, Size,
		Size, float);
	AtomHashGrid3(const Vector3, const Vector3, float);
	AtomHashGrid3(const AtomHashGrid3, bool);

	virtual void clear();
	void clear(Position, Position, Position);
	void clear(const Vector3);
	void destroy();
	void destroy(Position, Position, Position);
	void destroy(const Vector3);
	void set(const Vector3, const Vector3,
		Size, Size, Size);

	void set(const Vector3, float, Size);
	void set(const AtomHashGrid3, bool);

	void get(Vector3, Vector3, Size, Size, Size) const;
	void get(AtomHashGrid3, bool) const;

	Size countNonEmptyBoxes() const;
	Size getSize() const;
	Vector3& getOrigin();
	Vector3& getUnit();

	Size getSizeX() const;
	Size getSizeY() const;
	Size getSizeZ() const;

	AtomHashGridBox3* getBox(Position, Position, Position);
	AtomHashGridBox3* getBox(const Vector3);

	bool getIndices(const AtomHashGridBox3, Position& /Out/, Position& /Out/, Position& /Out/) const;

	void insert(Position, Position, Position, Atom*);
	void insert(const Vector3, Atom*);

	bool remove(Position, Position, Position, Atom*);
	bool remove(const Vector3, Atom*);

	bool operator == (const AtomHashGrid3) const;
	bool operator != (const AtomHashGrid3) const;

	bool isEmpty() const;

	virtual bool isValid() const;

	const Atom& getClosestItem(const Vector3& /In/, Size) const;
%MethodCode
	Atom* const* atom_ptr_ptr = sipCpp->getClosestItem(*a0, a1);
	sipRes = &(**atom_ptr_ptr);
%End

	static float calculateMinSpacing(LongIndex, const Vector3);
};