Back

DrawToolGL

sofa::gl::DrawToolGL
DrawTool
Abstract (AI generated)

`DrawToolGL` is responsible for rendering geometric shapes and text within the OpenGL context in SOFA simulations, providing methods to handle transformations, lighting, depth testing, and pixel reading.

Metadata
module
Sofa.GL
namespace
sofa::gl
include
sofa/gl/DrawToolGL.h
inherits
  • DrawTool
description

Mathematical and Physical Description of DrawToolGL Component

Overview

The DrawToolGL class is a core component in the Simulation Open Framework Architecture (SOFA), designed to handle graphical rendering tasks using OpenGL. It provides methods for drawing various geometric shapes, handling transformations, managing lighting and depth testing, and reading pixels from the frame buffer. The following sections detail the mathematical and physical principles underlying its functionality.

Transformations

Scale and Translation

The transformation functions (scale and translate) apply linear transformations to objects in 3D space:
- Scaling: Given a scaling factor $s$, an object with coordinates $(x, y, z)$ is transformed to $(sx, sy, sz)$.
- Translation: An object at position $(x, y, z)$ is translated by vector $(t_x, t_y, t_z)$ to new position $(x + t_x, y + t_y, z + t_z)$.

Push and Pop Transformation Matrices

The pushMatrix and popMatrix functions manage the transformation matrices stack:
- Push Matrix: Saves the current transformation matrix onto a stack.
- Pop Matrix: Restores the last saved transformation matrix from the stack, effectively reversing any transformations since the most recent push operation.

Lighting

The class supports enabling or disabling lighting through the setLightingEnabled method. In physically based rendering, lighting is crucial for realistic visual appearance:
- Diffuse Light: The diffuse reflection component of a surface can be modeled using Lambertian reflectance: $ I_d = k_d L_i (N \cdot L) $, where $k_d$ is the diffuse reflectivity, $L_i$ is the intensity of incoming light, and $N$ and $L$ are normalized vectors representing the surface normal and incident light direction.
- Specular Light: Specular reflection depends on the viewer's position. The Phong model includes a specular term: $ I_s = k_s L_i (R \cdot V)^{p} $, where $k_s$ is the specular reflectivity, $V$ is the view direction, and $p$ is the shininess exponent.

Depth Testing

Depth testing ensures that objects closer to the viewer are rendered in front of those further away. The depth buffer stores the z-depth values (distance from the eye plane). Each pixel's depth value is compared with the current depth buffer value, and only pixels with a smaller (closer) depth value are drawn.

Pixel Reading

The readPixels method reads pixel data from the frame buffer into an array. This operation involves mapping the framebuffer coordinates to image indices and extracting color values for each pixel.

Geometric Shapes

Points, Lines, Triangles, Quads

  • Points: Simple vertices in 3D space with no dimensionality except location $(x, y, z)$.
  • Lines: Defined by two points: $P_1(x_1, y_1, z_1)$ and $P_2(x_2, y_2, z_2)$. The line segment is rendered between these points.
  • Triangles: A three-sided polygon with vertices $A(x_1, y_1, z_1)$, $B(x_2, y_2, z_2)$, and $C(x_3, y_3, z_3)$. Triangles are used extensively in 3D rendering for their simplicity and ability to approximate complex surfaces.
  • Quads: A four-sided polygon with vertices $P1(x_1, y_1, z_1)$, $P2(x_2, y_2, z_2)$, $P3(x_3, y_3, z_3)$, and $P4(x_4, y_4, z_4)$.

Spheres and Cylinders

  • Spheres: Defined by a center point $(cx, cy, cz)$ and radius $r$. The equation of the sphere is: $(x - cx)^2 + (y - cy)^2 + (z - cz)^2 = r^2$.
  • Cylinders: Represented as a circular base with radius $r$, height $h$, and center axis defined by two points.

Polygon Modes

Polygon modes can be set to render the object in different styles, such as fill mode or wireframe mode:
- Fill Mode: The polygon is drawn as a filled shape, where each triangle or quad within the mesh is colored based on its surface properties and lighting conditions.
- Wireframe Mode: Only the edges of the polygons are rendered, providing an outline structure of the object.

Conclusion

The DrawToolGL class leverages these mathematical principles to provide a versatile set of rendering functionalities, enabling users to create visually rich simulations within SOFA. The combination of transformations, lighting models, and depth testing ensures that objects are accurately represented in 3D space with realistic shading effects.

Methods
void init () virtual
void drawPoint (const type::Vec3 & p, const type::RGBAColor & c) virtual
void drawPoint (const type::Vec3 & p, const type::Vec3 & n, const type::RGBAColor & c) virtual
void drawPoints (const int & points, float size, const type::RGBAColor & color) virtual
void drawPoints (const int & points, float size, const int & color) virtual
void drawLine (const type::Vec3 & p1, const type::Vec3 & p2, const type::RGBAColor & color) virtual
void drawInfiniteLine (const type::Vec3 & point, const type::Vec3 & direction, const type::RGBAColor & color, const bool & vanishing) virtual
void drawInfiniteLine (const Vec3 & point, const Vec3 & direction, const float & size, const type::RGBAColor & color, const bool & vanishing) virtual
void drawLines (const int & points, float size, const type::RGBAColor & color) virtual
void drawLines (const int & points, float size, const int & colors) virtual
void drawLines (const int & points, const int & index, float size, const type::RGBAColor & color) virtual
void drawLineStrip (const int & points, float size, const type::RGBAColor & color) virtual
void drawLineLoop (const int & points, float size, const type::RGBAColor & color) virtual
void drawDisk (float radius, double from, double to, int resolution, const type::RGBAColor & color) virtual
void drawCircle (float radius, float lineThickness, int resolution, const type::RGBAColor & color) virtual
void drawTriangle (const type::Vec3 & p1, const type::Vec3 & p2, const type::Vec3 & p3, const type::Vec3 & normal) virtual
void drawTriangle (const type::Vec3 & p1, const type::Vec3 & p2, const type::Vec3 & p3, const type::Vec3 & normal, const type::RGBAColor & c) virtual
void drawTriangle (const type::Vec3 & p1, const type::Vec3 & p2, const type::Vec3 & p3, const type::Vec3 & normal, const type::RGBAColor & c1, const type::RGBAColor & c2, const type::RGBAColor & c3) virtual
void drawTriangle (const type::Vec3 & p1, const type::Vec3 & p2, const type::Vec3 & p3, const type::Vec3 & normal1, const type::Vec3 & normal2, const type::Vec3 & normal3, const type::RGBAColor & c1, const type::RGBAColor & c2, const type::RGBAColor & c3) virtual
void drawTriangles (const int & points, const type::RGBAColor & color) virtual
void drawTriangles (const int & points, const int & color) virtual
void drawTriangles (const int & points, const type::Vec3 & normal, const type::RGBAColor & color) virtual
void drawTriangles (const int & points, const int & index, const int & normal, const type::RGBAColor & color) virtual
void drawTriangles (const int & points, const int & index, const int & normal, const int & colors) virtual
void drawTriangles (const int & points, const int & normal, const int & color) virtual
void drawTriangleStrip (const int & points, const int & normal, const type::RGBAColor & color) virtual
void drawTriangleFan (const int & points, const int & normal, const type::RGBAColor & color) virtual
void drawFrame (const type::Vec3 & position, const Quaternion & orientation, const type::Vec3f & size) virtual
void drawFrame (const type::Vec3 & position, const Quaternion & orientation, const type::Vec3f & size, const type::RGBAColor & color) virtual
void drawSpheres (const int & points, const int & radius, const type::RGBAColor & color) virtual
void drawSpheres (const int & points, float radius, const type::RGBAColor & color) virtual
void drawFakeSpheres (const int & points, const int & radius, const type::RGBAColor & color) virtual
void drawFakeSpheres (const int & points, float radius, const type::RGBAColor & color) virtual
void drawCone (const type::Vec3 & p1, const type::Vec3 & p2, float radius1, float radius2, const type::RGBAColor & color, int subd) virtual
void drawCube (const float & radius, const type::RGBAColor & color, const int & subd) virtual
void drawCylinder (const type::Vec3 & p1, const type::Vec3 & p2, float radius, const type::RGBAColor & color, int subd) virtual
void drawCapsule (const type::Vec3 & p1, const type::Vec3 & p2, float radius, const type::RGBAColor & color, int subd) virtual
void drawArrow (const type::Vec3 & p1, const type::Vec3 & p2, float radius, const type::RGBAColor & color, int subd) virtual
void drawArrow (const type::Vec3 & p1, const type::Vec3 & p2, float radius, float coneLength, const type::RGBAColor & color, int subd) virtual
void drawArrow (const type::Vec3 & p1, const type::Vec3 & p2, float radius, float coneLength, float coneRadius, const type::RGBAColor & color, int subd) virtual
void drawCross (const type::Vec3 & p, float length, const type::RGBAColor & color) virtual
void drawPlus (const float & radius, const type::RGBAColor & color, const int & subd) virtual
void drawQuad (const type::Vec3 & p1, const type::Vec3 & p2, const type::Vec3 & p3, const type::Vec3 & p4, const type::Vec3 & normal) virtual
void drawQuad (const type::Vec3 & p1, const type::Vec3 & p2, const type::Vec3 & p3, const type::Vec3 & p4, const type::Vec3 & normal, const type::RGBAColor & c) virtual
void drawQuad (const type::Vec3 & p1, const type::Vec3 & p2, const type::Vec3 & p3, const type::Vec3 & p4, const type::Vec3 & normal, const type::RGBAColor & c1, const type::RGBAColor & c2, const type::RGBAColor & c3, const type::RGBAColor & c4) virtual
void drawQuad (const type::Vec3 & p1, const type::Vec3 & p2, const type::Vec3 & p3, const type::Vec3 & p4, const type::Vec3 & normal1, const type::Vec3 & normal2, const type::Vec3 & normal3, const type::Vec3 & normal4, const type::RGBAColor & c1, const type::RGBAColor & c2, const type::RGBAColor & c3, const type::RGBAColor & c4) virtual
void drawQuads (const int & points, const type::RGBAColor & color) virtual
void drawQuads (const int & points, const int & colors) virtual
void drawTetrahedron (const type::Vec3 & p0, const type::Vec3 & p1, const type::Vec3 & p2, const type::Vec3 & p3, const type::RGBAColor & color) virtual
void drawScaledTetrahedron (const type::Vec3 & p0, const type::Vec3 & p1, const type::Vec3 & p2, const type::Vec3 & p3, const type::RGBAColor & color, const float scale) virtual
void drawTetrahedra (const int & points, const type::RGBAColor & color) virtual
void drawScaledTetrahedra (const int & points, const type::RGBAColor & color, const float scale) virtual
void drawHexahedron (const type::Vec3 & p0, const type::Vec3 & p1, const type::Vec3 & p2, const type::Vec3 & p3, const type::Vec3 & p4, const type::Vec3 & p5, const type::Vec3 & p6, const type::Vec3 & p7, const type::RGBAColor & color) virtual
void drawHexahedra (const int & points, const type::RGBAColor & color) virtual
void drawScaledHexahedra (const int & points, const type::RGBAColor & color, const float scale) virtual
void drawSphere (const type::Vec3 & p, float radius) virtual
void drawSphere (const type::Vec3 & p, float radius, const type::RGBAColor & color) virtual
void drawEllipsoid (const type::Vec3 & p, const type::Vec3 & radii) virtual
void drawBoundingBox (const type::Vec3 & min, const type::Vec3 & max, float size) virtual
void draw3DText (const type::Vec3 & p, float scale, const type::RGBAColor & color, const char * text) virtual
void draw3DText_Indices (const int & positions, float scale, const type::RGBAColor & color) virtual
void clear () virtual
void setMaterial (const type::RGBAColor & color) virtual
void resetMaterial (const type::RGBAColor & color) virtual
void resetMaterial () virtual
void pushMatrix () virtual
void popMatrix () virtual
void multMatrix (float * glTransform) virtual
void scale (float s) virtual
void translate (float x, float y, float z) virtual
void writeOverlayText (int x, int y, unsigned int fontSize, const type::RGBAColor & color, const char * text) virtual
void enablePolygonOffset (float factor, float units) virtual
void disablePolygonOffset () virtual
void enableBlending () virtual
void disableBlending () virtual
void enableLighting () virtual
void disableLighting () virtual
void enableDepthTest () virtual
void disableDepthTest () virtual
void saveLastState () virtual
void restoreLastState () virtual
void readPixels (int x, int y, int w, int h, float * rgb, float * z) virtual
void internalDrawSpheres (const int & centers, const float & radius, const unsigned int rings, const unsigned int sectors)
void internalDrawSphere (const type::Vec3 & center, const float & radius, const unsigned int rings, const unsigned int sectors)
void internalDrawPoint (const type::Vec3 & p, const type::RGBAColor & c) virtual
void internalDrawPoint (const type::Vec3 & p, const type::Vec3 & n, const type::RGBAColor & c) virtual
void internalDrawLine (const type::Vec3 & p1, const type::Vec3 & p2, const type::RGBAColor & color) virtual
void internalDrawTriangle (const type::Vec3 & p1, const type::Vec3 & p2, const type::Vec3 & p3, const type::Vec3 & normal) virtual
void internalDrawTriangle (const type::Vec3 & p1, const type::Vec3 & p2, const type::Vec3 & p3, const type::Vec3 & normal, const type::RGBAColor & c) virtual
void internalDrawTriangle (const type::Vec3 & p1, const type::Vec3 & p2, const type::Vec3 & p3, const type::Vec3 & normal, const type::RGBAColor & c1, const type::RGBAColor & c2, const type::RGBAColor & c3) virtual
void internalDrawTriangle (const type::Vec3 & p1, const type::Vec3 & p2, const type::Vec3 & p3, const type::Vec3 & normal1, const type::Vec3 & normal2, const type::Vec3 & normal3, const type::RGBAColor & c1, const type::RGBAColor & c2, const type::RGBAColor & c3) virtual
void internalDrawQuad (const type::Vec3 & p1, const type::Vec3 & p2, const type::Vec3 & p3, const type::Vec3 & p4, const type::Vec3 & normal) virtual
void internalDrawQuad (const type::Vec3 & p1, const type::Vec3 & p2, const type::Vec3 & p3, const type::Vec3 & p4, const type::Vec3 & normal, const type::RGBAColor & c) virtual
void internalDrawQuad (const type::Vec3 & p1, const type::Vec3 & p2, const type::Vec3 & p3, const type::Vec3 & p4, const type::Vec3 & normal, const type::RGBAColor & c1, const type::RGBAColor & c2, const type::RGBAColor & c3, const type::RGBAColor & c4) virtual
void internalDrawQuad (const type::Vec3 & p1, const type::Vec3 & p2, const type::Vec3 & p3, const type::Vec3 & p4, const type::Vec3 & normal1, const type::Vec3 & normal2, const type::Vec3 & normal3, const type::Vec3 & normal4, const type::RGBAColor & c1, const type::RGBAColor & c2, const type::RGBAColor & c3, const type::RGBAColor & c4) virtual
void setLightingEnabled (bool _isAnabled) virtual
bool getLightEnabled ()
void setPolygonMode (int _mode, bool _wireframe) virtual
int getPolygonMode ()
bool getWireFrameEnabled ()
{
  "name": "DrawToolGL",
  "namespace": "sofa::gl",
  "module": "Sofa.GL",
  "include": "sofa/gl/DrawToolGL.h",
  "doc": "",
  "inherits": [
    "DrawTool"
  ],
  "templates": [],
  "data_fields": [],
  "links": [],
  "methods": [
    {
      "name": "init",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawPoint",
      "return_type": "void",
      "params": [
        {
          "name": "p",
          "type": "const type::Vec3 &"
        },
        {
          "name": "c",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawPoint",
      "return_type": "void",
      "params": [
        {
          "name": "p",
          "type": "const type::Vec3 &"
        },
        {
          "name": "n",
          "type": "const type::Vec3 &"
        },
        {
          "name": "c",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawPoints",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "size",
          "type": "float"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawPoints",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "size",
          "type": "float"
        },
        {
          "name": "color",
          "type": "const int &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawLine",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawInfiniteLine",
      "return_type": "void",
      "params": [
        {
          "name": "point",
          "type": "const type::Vec3 &"
        },
        {
          "name": "direction",
          "type": "const type::Vec3 &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "vanishing",
          "type": "const bool &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawInfiniteLine",
      "return_type": "void",
      "params": [
        {
          "name": "point",
          "type": "const Vec3 &"
        },
        {
          "name": "direction",
          "type": "const Vec3 &"
        },
        {
          "name": "size",
          "type": "const float &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "vanishing",
          "type": "const bool &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawLines",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "size",
          "type": "float"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawLines",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "size",
          "type": "float"
        },
        {
          "name": "colors",
          "type": "const int &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawLines",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "index",
          "type": "const int &"
        },
        {
          "name": "size",
          "type": "float"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawLineStrip",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "size",
          "type": "float"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawLineLoop",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "size",
          "type": "float"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawDisk",
      "return_type": "void",
      "params": [
        {
          "name": "radius",
          "type": "float"
        },
        {
          "name": "from",
          "type": "double"
        },
        {
          "name": "to",
          "type": "double"
        },
        {
          "name": "resolution",
          "type": "int"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawCircle",
      "return_type": "void",
      "params": [
        {
          "name": "radius",
          "type": "float"
        },
        {
          "name": "lineThickness",
          "type": "float"
        },
        {
          "name": "resolution",
          "type": "int"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawTriangle",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal",
          "type": "const type::Vec3 &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawTriangle",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal",
          "type": "const type::Vec3 &"
        },
        {
          "name": "c",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawTriangle",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal",
          "type": "const type::Vec3 &"
        },
        {
          "name": "c1",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "c2",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "c3",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawTriangle",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "c1",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "c2",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "c3",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawTriangles",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawTriangles",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "color",
          "type": "const int &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawTriangles",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "normal",
          "type": "const type::Vec3 &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawTriangles",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "index",
          "type": "const int &"
        },
        {
          "name": "normal",
          "type": "const int &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawTriangles",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "index",
          "type": "const int &"
        },
        {
          "name": "normal",
          "type": "const int &"
        },
        {
          "name": "colors",
          "type": "const int &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawTriangles",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "normal",
          "type": "const int &"
        },
        {
          "name": "color",
          "type": "const int &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawTriangleStrip",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "normal",
          "type": "const int &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawTriangleFan",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "normal",
          "type": "const int &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawFrame",
      "return_type": "void",
      "params": [
        {
          "name": "position",
          "type": "const type::Vec3 &"
        },
        {
          "name": "orientation",
          "type": "const Quaternion &"
        },
        {
          "name": "size",
          "type": "const type::Vec3f &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawFrame",
      "return_type": "void",
      "params": [
        {
          "name": "position",
          "type": "const type::Vec3 &"
        },
        {
          "name": "orientation",
          "type": "const Quaternion &"
        },
        {
          "name": "size",
          "type": "const type::Vec3f &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawSpheres",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "radius",
          "type": "const int &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawSpheres",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "radius",
          "type": "float"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawFakeSpheres",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "radius",
          "type": "const int &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawFakeSpheres",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "radius",
          "type": "float"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawCone",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "radius1",
          "type": "float"
        },
        {
          "name": "radius2",
          "type": "float"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "subd",
          "type": "int"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawCube",
      "return_type": "void",
      "params": [
        {
          "name": "radius",
          "type": "const float &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "subd",
          "type": "const int &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawCylinder",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "radius",
          "type": "float"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "subd",
          "type": "int"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawCapsule",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "radius",
          "type": "float"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "subd",
          "type": "int"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawArrow",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "radius",
          "type": "float"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "subd",
          "type": "int"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawArrow",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "radius",
          "type": "float"
        },
        {
          "name": "coneLength",
          "type": "float"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "subd",
          "type": "int"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawArrow",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "radius",
          "type": "float"
        },
        {
          "name": "coneLength",
          "type": "float"
        },
        {
          "name": "coneRadius",
          "type": "float"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "subd",
          "type": "int"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawCross",
      "return_type": "void",
      "params": [
        {
          "name": "p",
          "type": "const type::Vec3 &"
        },
        {
          "name": "length",
          "type": "float"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawPlus",
      "return_type": "void",
      "params": [
        {
          "name": "radius",
          "type": "const float &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "subd",
          "type": "const int &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawQuad",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p4",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal",
          "type": "const type::Vec3 &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawQuad",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p4",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal",
          "type": "const type::Vec3 &"
        },
        {
          "name": "c",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawQuad",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p4",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal",
          "type": "const type::Vec3 &"
        },
        {
          "name": "c1",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "c2",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "c3",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "c4",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawQuad",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p4",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal4",
          "type": "const type::Vec3 &"
        },
        {
          "name": "c1",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "c2",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "c3",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "c4",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawQuads",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawQuads",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "colors",
          "type": "const int &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawTetrahedron",
      "return_type": "void",
      "params": [
        {
          "name": "p0",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawScaledTetrahedron",
      "return_type": "void",
      "params": [
        {
          "name": "p0",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "scale",
          "type": "const float"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawTetrahedra",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawScaledTetrahedra",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "scale",
          "type": "const float"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawHexahedron",
      "return_type": "void",
      "params": [
        {
          "name": "p0",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p4",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p5",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p6",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p7",
          "type": "const type::Vec3 &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawHexahedra",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawScaledHexahedra",
      "return_type": "void",
      "params": [
        {
          "name": "points",
          "type": "const int &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "scale",
          "type": "const float"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawSphere",
      "return_type": "void",
      "params": [
        {
          "name": "p",
          "type": "const type::Vec3 &"
        },
        {
          "name": "radius",
          "type": "float"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawSphere",
      "return_type": "void",
      "params": [
        {
          "name": "p",
          "type": "const type::Vec3 &"
        },
        {
          "name": "radius",
          "type": "float"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawEllipsoid",
      "return_type": "void",
      "params": [
        {
          "name": "p",
          "type": "const type::Vec3 &"
        },
        {
          "name": "radii",
          "type": "const type::Vec3 &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawBoundingBox",
      "return_type": "void",
      "params": [
        {
          "name": "min",
          "type": "const type::Vec3 &"
        },
        {
          "name": "max",
          "type": "const type::Vec3 &"
        },
        {
          "name": "size",
          "type": "float"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "draw3DText",
      "return_type": "void",
      "params": [
        {
          "name": "p",
          "type": "const type::Vec3 &"
        },
        {
          "name": "scale",
          "type": "float"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "text",
          "type": "const char *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "draw3DText_Indices",
      "return_type": "void",
      "params": [
        {
          "name": "positions",
          "type": "const int &"
        },
        {
          "name": "scale",
          "type": "float"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "clear",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "setMaterial",
      "return_type": "void",
      "params": [
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "resetMaterial",
      "return_type": "void",
      "params": [
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "resetMaterial",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "pushMatrix",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "popMatrix",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "multMatrix",
      "return_type": "void",
      "params": [
        {
          "name": "glTransform",
          "type": "float *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "scale",
      "return_type": "void",
      "params": [
        {
          "name": "s",
          "type": "float"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "translate",
      "return_type": "void",
      "params": [
        {
          "name": "x",
          "type": "float"
        },
        {
          "name": "y",
          "type": "float"
        },
        {
          "name": "z",
          "type": "float"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "writeOverlayText",
      "return_type": "void",
      "params": [
        {
          "name": "x",
          "type": "int"
        },
        {
          "name": "y",
          "type": "int"
        },
        {
          "name": "fontSize",
          "type": "unsigned int"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "text",
          "type": "const char *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "enablePolygonOffset",
      "return_type": "void",
      "params": [
        {
          "name": "factor",
          "type": "float"
        },
        {
          "name": "units",
          "type": "float"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "disablePolygonOffset",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "enableBlending",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "disableBlending",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "enableLighting",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "disableLighting",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "enableDepthTest",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "disableDepthTest",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "saveLastState",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "restoreLastState",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "readPixels",
      "return_type": "void",
      "params": [
        {
          "name": "x",
          "type": "int"
        },
        {
          "name": "y",
          "type": "int"
        },
        {
          "name": "w",
          "type": "int"
        },
        {
          "name": "h",
          "type": "int"
        },
        {
          "name": "rgb",
          "type": "float *"
        },
        {
          "name": "z",
          "type": "float *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "internalDrawSpheres",
      "return_type": "void",
      "params": [
        {
          "name": "centers",
          "type": "const int &"
        },
        {
          "name": "radius",
          "type": "const float &"
        },
        {
          "name": "rings",
          "type": "const unsigned int"
        },
        {
          "name": "sectors",
          "type": "const unsigned int"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "internalDrawSphere",
      "return_type": "void",
      "params": [
        {
          "name": "center",
          "type": "const type::Vec3 &"
        },
        {
          "name": "radius",
          "type": "const float &"
        },
        {
          "name": "rings",
          "type": "const unsigned int"
        },
        {
          "name": "sectors",
          "type": "const unsigned int"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "internalDrawPoint",
      "return_type": "void",
      "params": [
        {
          "name": "p",
          "type": "const type::Vec3 &"
        },
        {
          "name": "c",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "internalDrawPoint",
      "return_type": "void",
      "params": [
        {
          "name": "p",
          "type": "const type::Vec3 &"
        },
        {
          "name": "n",
          "type": "const type::Vec3 &"
        },
        {
          "name": "c",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "internalDrawLine",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "color",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "internalDrawTriangle",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal",
          "type": "const type::Vec3 &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "internalDrawTriangle",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal",
          "type": "const type::Vec3 &"
        },
        {
          "name": "c",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "internalDrawTriangle",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal",
          "type": "const type::Vec3 &"
        },
        {
          "name": "c1",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "c2",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "c3",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "internalDrawTriangle",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "c1",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "c2",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "c3",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "internalDrawQuad",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p4",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal",
          "type": "const type::Vec3 &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "internalDrawQuad",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p4",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal",
          "type": "const type::Vec3 &"
        },
        {
          "name": "c",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "internalDrawQuad",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p4",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal",
          "type": "const type::Vec3 &"
        },
        {
          "name": "c1",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "c2",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "c3",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "c4",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "internalDrawQuad",
      "return_type": "void",
      "params": [
        {
          "name": "p1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "p4",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal1",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal2",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal3",
          "type": "const type::Vec3 &"
        },
        {
          "name": "normal4",
          "type": "const type::Vec3 &"
        },
        {
          "name": "c1",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "c2",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "c3",
          "type": "const type::RGBAColor &"
        },
        {
          "name": "c4",
          "type": "const type::RGBAColor &"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "setLightingEnabled",
      "return_type": "void",
      "params": [
        {
          "name": "_isAnabled",
          "type": "bool"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getLightEnabled",
      "return_type": "bool",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "setPolygonMode",
      "return_type": "void",
      "params": [
        {
          "name": "_mode",
          "type": "int"
        },
        {
          "name": "_wireframe",
          "type": "bool"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getPolygonMode",
      "return_type": "int",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getWireFrameEnabled",
      "return_type": "bool",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    }
  ],
  "description": "The `DrawToolGL` class in SOFA is responsible for rendering various geometric shapes and text within the OpenGL context. It inherits from `DrawTool`, indicating that it provides functionality for drawing points, lines, triangles, quads, spheres, cubes, cylinders, capsules, arrows, crosshairs, plus signs, bounding boxes, and 3D text. The class includes methods to set material properties, manage transformation matrices (push/pop), scale and translate objects, enable/disable lighting and depth testing, read pixels from the frame buffer, and perform various rendering operations like drawing polygons, spheres, cylinders, and more. It is designed for visualization tasks within SOFA simulations, allowing developers to render complex shapes with different colors and shading properties.",
  "maths": "# Mathematical and Physical Description of DrawToolGL Component\n\n## Overview\nThe `DrawToolGL` class is a core component in the Simulation Open Framework Architecture (SOFA), designed to handle graphical rendering tasks using OpenGL. It provides methods for drawing various geometric shapes, handling transformations, managing lighting and depth testing, and reading pixels from the frame buffer. The following sections detail the mathematical and physical principles underlying its functionality.\n\n## Transformations\n### Scale and Translation\nThe transformation functions (`scale` and `translate`) apply linear transformations to objects in 3D space:\n- **Scaling**: Given a scaling factor \\(s\\), an object with coordinates \\((x, y, z)\\) is transformed to \\((sx, sy, sz)\\).\n- **Translation**: An object at position \\((x, y, z)\\) is translated by vector \\((t_x, t_y, t_z)\\) to new position \\((x + t_x, y + t_y, z + t_z)\\).\n\n### Push and Pop Transformation Matrices\nThe `pushMatrix` and `popMatrix` functions manage the transformation matrices stack:\n- **Push Matrix**: Saves the current transformation matrix onto a stack.\n- **Pop Matrix**: Restores the last saved transformation matrix from the stack, effectively reversing any transformations since the most recent push operation.\n\n## Lighting\nThe class supports enabling or disabling lighting through the `setLightingEnabled` method. In physically based rendering, lighting is crucial for realistic visual appearance:\n- **Diffuse Light**: The diffuse reflection component of a surface can be modeled using Lambertian reflectance: \\( I_d = k_d L_i (N \\cdot L) \\), where \\(k_d\\) is the diffuse reflectivity, \\(L_i\\) is the intensity of incoming light, and \\(N\\) and \\(L\\) are normalized vectors representing the surface normal and incident light direction.\n- **Specular Light**: Specular reflection depends on the viewer's position. The Phong model includes a specular term: \\( I_s = k_s L_i (R \\cdot V)^{p} \\), where \\(k_s\\) is the specular reflectivity, \\(V\\) is the view direction, and \\(p\\) is the shininess exponent.\n\n## Depth Testing\nDepth testing ensures that objects closer to the viewer are rendered in front of those further away. The depth buffer stores the z-depth values (distance from the eye plane). Each pixel's depth value is compared with the current depth buffer value, and only pixels with a smaller (closer) depth value are drawn.\n\n## Pixel Reading\nThe `readPixels` method reads pixel data from the frame buffer into an array. This operation involves mapping the framebuffer coordinates to image indices and extracting color values for each pixel.\n\n## Geometric Shapes\n### Points, Lines, Triangles, Quads\n- **Points**: Simple vertices in 3D space with no dimensionality except location \\((x, y, z)\\).\n- **Lines**: Defined by two points: \\(P_1(x_1, y_1, z_1)\\) and \\(P_2(x_2, y_2, z_2)\\). The line segment is rendered between these points.\n- **Triangles**: A three-sided polygon with vertices \\(A(x_1, y_1, z_1)\\), \\(B(x_2, y_2, z_2)\\), and \\(C(x_3, y_3, z_3)\\). Triangles are used extensively in 3D rendering for their simplicity and ability to approximate complex surfaces.\n- **Quads**: A four-sided polygon with vertices \\(P1(x_1, y_1, z_1)\\), \\(P2(x_2, y_2, z_2)\\), \\(P3(x_3, y_3, z_3)\\), and \\(P4(x_4, y_4, z_4)\\).\n\n### Spheres and Cylinders\n- **Spheres**: Defined by a center point \\((cx, cy, cz)\\) and radius \\(r\\). The equation of the sphere is: \\((x - cx)^2 + (y - cy)^2 + (z - cz)^2 = r^2\\).\n- **Cylinders**: Represented as a circular base with radius \\(r\\), height \\(h\\), and center axis defined by two points.\n\n## Polygon Modes\nPolygon modes can be set to render the object in different styles, such as fill mode or wireframe mode:\n- **Fill Mode**: The polygon is drawn as a filled shape, where each triangle or quad within the mesh is colored based on its surface properties and lighting conditions.\n- **Wireframe Mode**: Only the edges of the polygons are rendered, providing an outline structure of the object.\n\n## Conclusion\nThe `DrawToolGL` class leverages these mathematical principles to provide a versatile set of rendering functionalities, enabling users to create visually rich simulations within SOFA. The combination of transformations, lighting models, and depth testing ensures that objects are accurately represented in 3D space with realistic shading effects.",
  "abstract": "`DrawToolGL` is responsible for rendering geometric shapes and text within the OpenGL context in SOFA simulations, providing methods to handle transformations, lighting, depth testing, and pixel reading.",
  "sheet": "# DrawToolGL\n\n## Overview\nThe `DrawToolGL` class is a core component in the Simulation Open Framework Architecture (SOFA), designed for rendering various geometric shapes and text within the OpenGL context. It inherits from `DrawTool`, providing methods to handle transformations, lighting, depth testing, and pixel reading.\n\n## Parameters and Data\nThere are no significant data fields exposed by this component as it primarily focuses on rendering functionalities rather than storing specific parameters or settings.\n\n## Dependencies and Connections\n`DrawToolGL` does not have any explicit dependencies listed. It is a standalone component that can be used independently within the SOFA simulation environment to handle visualization tasks.\n\n## Practical Notes\nWhile `DrawToolGL` provides extensive rendering capabilities, users should ensure proper management of transformation matrices (using `pushMatrix` and `popMatrix`) to avoid unintended side effects on subsequent render operations. Additionally, enabling or disabling lighting and depth testing appropriately can significantly impact the visual quality and performance of the rendered scenes."
}