<s> from . mesh import MeshVisual <EOL> from . . geometry import create_grid_mesh , MeshData <EOL> class GridMeshVisual ( MeshVisual ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , xs , ys , zs , colors = None , shading = '<STR_LIT>' , <EOL> ** kwargs ) : <EOL> if xs is None or ys is None or zs is None : <EOL> raise ValueError ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> self . _xs = None <EOL> self . _ys = None <EOL> self . _zs = None <EOL> self . __vertices = None <EOL> self . __meshdata = MeshData ( ) <EOL> MeshVisual . __init__ ( self , shading = shading , ** kwargs ) <EOL> self . set_data ( xs , ys , zs , colors ) <EOL> def set_data ( self , xs = None , ys = None , zs = None , colors = None ) : <EOL> '''<STR_LIT>''' <EOL> if xs is None : <EOL> xs = self . _xs <EOL> self . __vertices = None <EOL> if ys is None : <EOL> ys = self . _ys <EOL> self . __vertices = None <EOL> if zs is None : <EOL> zs = self . _zs <EOL> self . __vertices = None <EOL> if self . __vertices is None : <EOL> vertices , indices = create_grid_mesh ( xs , ys , zs ) <EOL> self . _xs = xs <EOL> self . _ys = ys <EOL> self . _zs = zs <EOL> if self . __vertices is None : <EOL> vertices , indices = create_grid_mesh ( self . _xs , self . _ys , self . _zs ) <EOL> self . __meshdata . set_vertices ( vertices ) <EOL> self . __meshdata . set_faces ( indices ) <EOL> if colors is not None : <EOL> self . __meshdata . set_vertex_colors ( colors . reshape ( <EOL> colors . shape [ <NUM_LIT:0> ] * colors . shape [ <NUM_LIT:1> ] , colors . shape [ <NUM_LIT:2> ] ) ) <EOL> MeshVisual . set_data ( self , meshdata = self . __meshdata ) </s>
