0001"""
0002**projection to the Riemann sphere** of objects of the complex plane
0003"""
0004
0005__Def__ = ['uTransform']
0006
0007__Classes__ = ['uStereoProject']
0008
0009__all__= __Classes__+ __Def__
0010
0011__doc_hints__={'m_type':'factory'}
0012
0013import pygeo.base.abstracts._usphere as USphere
0014
0015
0016
0017class uStereoProject(USphere._uTransformation):
0018 """
0019*stereographic projection* to the Riemann sphere of given **list of objects** of the complex plane
0020
0021 inherits
0022
0023 `_uTransformation`__
0024
0025__ class-base.abstracts._usphere._uTransformation.html
0026
0027 """
0028
0029 __doc_hints__= {'factory':'uTransform',
0030 'args':['[list of objects]']}
0031
0032 def __init__(self,elements,**kws):
0033 self.elements=[]
0034 for e in elements:
0035 for t in e:
0036 self.elements.append(t)
0037 args=[elements]
0038 for element in elements:
0039 if not element in args:
0040 args.append(element)
0041 USphere._uTransformation.__init__(self,*args,**kws)
0042 self.init()
0043
0044def uTransform(*args,**kws):
0045 """
0046'class factory' function returns instance of object derived from the
0047_uTransformation abstract class representing a projection from the complex
0048plane to the Riemann sphere
0049 """
0050
0051 from pygeo.base.abstracts._element import method_get
0052 from pygeo.base.support.pygeoexceptions import Argument_Type_Error
0053
0054 __sigs__=[[list]]
0055
0056 t,i = method_get(__sigs__,args)
0057
0058 if t is None:
0059 raise Argument_Type_Error(__sigs__,args)
0060 else:
0061 if i==0:
0062 return uStereoProject(t[0],**kws)
0063 else:
0064 raise Argument_Type_Error(__sigs__,args)