class_docstr: Rudimentary, generic GLSL printing tools.
  
  Additional settings:
  'use_operators': Boolean (should the printer use operators for +,-,*, or functions?)
class_docstr_tok: ["Rudimentary",",","generic","GLSL","printing","tools",".","Additional","settings",":","'use_operators","'",":","Boolean","(","should","the","printer","use","operators","for","+",",","-",",","*",",","or","functions","?",")"]
code: def _print_Piecewise(self, expr):
      from sympy.codegen.ast import Assignment
  
      if expr.args[-1].cond != True:
          # We need the last conditional to be a True, otherwise the resulting
          # function may not return a result.
          raise ValueError(
              "All Piecewise expressions must contain an "
              "(expr, True) statement to be used as a default "
              "condition. Without one, the generated "
              "expression may not evaluate to anything under "
              "some condition."
          )
      lines = []
      if expr.has(Assignment):
          for i, (e, c) in enumerate(expr.args):
              if i == 0:
                  lines.append("if (%s) {" % self._print(c))
              elif i == len(expr.args) - 1 and c == True:
                  lines.append("else {")
              else:
                  lines.append("else if (%s) {" % self._print(c))
              code0 = self._print(e)
              lines.append(code0)
              lines.append("}")
          return "\n".join(lines)
      else:
          # The piecewise was used in an expression, need to do inline
          # operators. This has the downside that inline operators will
          # not work for statements that span multiple lines (Matrix or
          # Indexed expressions).
          ecpairs = [
              "((%s) ? (\n%s\n)\n" % (self._print(c), self._print(e))
              for e, c in expr.args[:-1]
          ]
          last_line = ": (\n%s\n)" % self._print(expr.args[-1].expr)
          return (
              ": ".join(ecpairs)
              + last_line
              + " ".join([")" * len(ecpairs)])
          )
  
imports: from __future__ import annotations
  from sympy.core import Basic, S
  from sympy.core.function import Lambda
  from sympy.core.numbers import equal_valued
  from sympy.printing.codeprinter import CodePrinter
  from sympy.printing.precedence import precedence
  from functools import reduce
label_desc: Use image node_id 15 for calling the GLSLPrinter obj's underlying member method code with example usage: obj._print_Piecewise(expr) and returns: str, unknown