<s> from sympy . matrices . expressions import Identity <EOL> from . visualization_frame import VisualizationFrame <EOL> __all__ = [ '<STR_LIT>' ] <EOL> class PointLight ( VisualizationFrame ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> self . _color = kwargs [ '<STR_LIT>' ] <EOL> except KeyError : <EOL> self . _color = '<STR_LIT>' <EOL> i = <NUM_LIT:0> <EOL> if isinstance ( args [ i ] , str ) : <EOL> self . _name = args [ i ] <EOL> i += <NUM_LIT:1> <EOL> else : <EOL> self . _name = '<STR_LIT>' <EOL> try : <EOL> self . _reference_frame = args [ i ] . get_frame ( ) <EOL> self . _origin = args [ i ] . masscenter <EOL> except AttributeError : <EOL> try : <EOL> dcm = args [ i ] . _dcm_dict <EOL> self . _reference_frame = args [ i ] <EOL> i += <NUM_LIT:1> <EOL> except AttributeError : <EOL> raise TypeError ( '''<STR_LIT>''' ) <EOL> try : <EOL> self . _origin = args [ i ] . point <EOL> except AttributeError : <EOL> self . _origin = args [ i ] <EOL> self . _transform = Identity ( <NUM_LIT:4> ) . as_mutable ( ) <EOL> def __str__ ( self ) : <EOL> return '<STR_LIT>' + self . _name <EOL> def __repr__ ( self ) : <EOL> return '<STR_LIT>' <EOL> @ property <EOL> def color ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _color <EOL> @ color . setter <EOL> def color ( self , new_color ) : <EOL> """<STR_LIT>""" <EOL> if not isinstance ( new_color , str ) : <EOL> raise TypeError ( '''<STR_LIT>''' ) <EOL> else : <EOL> self . _color = new_color <EOL> def color_in_rgb ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _color_rgb <EOL> def generate_scene_dict ( self ) : <EOL> """<STR_LIT>""" <EOL> scene_dict = { id ( self ) : { } } <EOL> scene_dict [ id ( self ) ] [ '<STR_LIT:name>' ] = self . name <EOL> scene_dict [ id ( self ) ] [ '<STR_LIT:type>' ] = self . __repr__ ( ) <EOL> scene_dict [ id ( self ) ] [ '<STR_LIT>' ] = self . color <EOL> scene_dict [ id ( self ) ] [ "<STR_LIT>" ] = id ( self ) <EOL> scene_dict [ id ( self ) ] [ "<STR_LIT>" ] = self . _visualization_matrix [ <NUM_LIT:0> ] <EOL> return scene_dict <EOL> def generate_simulation_dict ( self ) : <EOL> """<STR_LIT>""" <EOL> simulation_dict = { } <EOL> try : <EOL> simulation_dict [ id ( self ) ] = self . _visualization_matrix <EOL> except : <EOL> raise RuntimeError ( "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" ) <EOL> return simulation_dict </s>
