File: SoPath.i

package info (click to toggle)
pivy 0.6.10-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 11,232 kB
  • sloc: python: 36,331; cpp: 787; ansic: 733; makefile: 30; sh: 27; objc: 5
file content (17 lines) | stat: -rw-r--r-- 457 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* add operator overloading methods instead of the global functions */
%extend SoPath {

/* extend __iter__ to return a new iterator object */
%pythoncode %{
   def __iter__(self):
      for i in range(self.getLength()):
         yield self.getNode(i)

   def index(self):
      for i in range(self.getLength()):
         yield self.getIndex(i)
%}

  int __eq__(const SoPath &u) { return *self == u; }
  int __nq__(const SoPath &u) { return *self != u; }
}