<div dir="ltr">Hi All,<div><br></div><div>I have a patch in gerrit that modifies the python wrappers so that enum</div><div>types are wrapped.  This means that method parameters can be enum</div><div>types, something that wasn't possible for wrapped methods before.</div><div><a href="http://review.source.kitware.com/#/c/17993">http://review.source.kitware.com/#/c/17993</a><br></div><div><br></div><div>E.g.:</div><div><br></div><div>class vtkSomeObject</div><div>{</div><div>public:</div><div>  enum ColorEnum { Red, Blue };</div><div>  void SetColor(enum ColorEnum);</div><div>};</div><div><br></div><div>Each enum type is wrapped as a unique python type subclassed from</div><div>python's "int" type.  So an enum can be used wherever an int can be</div><div>used, but methods that take an enum will raise a TypeError unless</div><div>given a value of the correct enum type.</div><div><br></div><div>One caveat is that this only works if the method and the enum type are</div><div>members of the same class.  Sometime later I'll generalize it so that a</div><div>method can use an enum defined in a different class, but method & enum</div><div>in the same class seems to be the most common use case.</div><div><br></div><div>Cheers,</div><div><br></div><div>  - David</div></div>