Class Model

java.lang.Object
com.eco.bio7.compile.Model
Direct Known Subclasses:
Simulation

public abstract class Model extends Object
This is the superclass for the dynamic compiled Java class! If the methods (below) are not implemented in the subclass (Model) the methods of this class are executed!
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    A method to allow closing operations with a compiled Model class called,e.g., from the CustomView implementation.
    void
    The draw method for the Points panel with the Graphics context to draw directly on the panel with available Java routines!
    The OpenGL profile of the 3D view for this model, e.g., GLProfile.GL4 or GLProfile.GL3 (the names of com.jogamp.opengl.GLProfile).
    void
    run()
    The main method which is called from the calculation thread!
    void
    run(com.jogamp.opengl.GL2 gl, com.jogamp.opengl.glu.GLU glu, com.jogamp.opengl.util.gl2.GLUT glut)
    The main OpenGL method with the OpenGL context as parameters!
    void
    run(com.jogamp.opengl.GLAutoDrawable drawable)
    The main OpenGL method with the drawable of the 3D view (see getGLProfile).
    void
    The setup method to initialize values etc.!
    void
    setup(com.jogamp.opengl.GL2 gl, com.jogamp.opengl.glu.GLU glu, com.jogamp.opengl.util.gl2.GLUT glut)
    The setup OpenGL method with the OpenGL context as parameters!
    void
    setup(com.jogamp.opengl.GLAutoDrawable drawable)
    The setup OpenGL method with the drawable of the 3D view (see getGLProfile), e.g., to create shaders and buffers.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Model

      public Model()
  • Method Details

    • setup

      public void setup()
      The setup method to initialize values etc.!
    • run

      public void run()
      The main method which is called from the calculation thread!
    • run

      public void run(com.jogamp.opengl.GL2 gl, com.jogamp.opengl.glu.GLU glu, com.jogamp.opengl.util.gl2.GLUT glut)
      The main OpenGL method with the OpenGL context as parameters!
      Parameters:
      gl -
      glu -
      glut -
    • setup

      public void setup(com.jogamp.opengl.GL2 gl, com.jogamp.opengl.glu.GLU glu, com.jogamp.opengl.util.gl2.GLUT glut)
      The setup OpenGL method with the OpenGL context as parameters!
      Parameters:
      gl -
      glu -
      glut -
    • getGLProfile

      public String getGLProfile()
      The OpenGL profile of the 3D view for this model, e.g., GLProfile.GL4 or GLProfile.GL3 (the names of com.jogamp.opengl.GLProfile).

      null (the default) renders the model in the Bio7 scene: the newest compatibility profile with the fixed function pipeline and, e.g., OpenGL 4 on Windows and Linux (OpenGL 2.1 on macOS). The model can use the methods with the GL2 context and the methods with the GLAutoDrawable (e.g., drawable.getGL().getGL4bc() if available).

      Another profile (e.g., GLProfile.GL4: OpenGL 4.1 core on macOS) creates a new context for the model without the Bio7 scene: only setup(GLAutoDrawable) and run(GLAutoDrawable) are called and the model clears and draws the view with an own camera.

      Returns:
      the name of the profile or null
    • setup

      public void setup(com.jogamp.opengl.GLAutoDrawable drawable)
      The setup OpenGL method with the drawable of the 3D view (see getGLProfile), e.g., to create shaders and buffers. Called after setup(GL2, GLU, GLUT) in the Bio7 scene!
      Parameters:
      drawable - the drawable (drawable.getGL() is the context)
    • run

      public void run(com.jogamp.opengl.GLAutoDrawable drawable)
      The main OpenGL method with the drawable of the 3D view (see getGLProfile). Called after run(GL2, GLU, GLUT) in the Bio7 scene with the camera of the scene (the modelview and projection matrix, in GLSL, e.g., gl_ModelViewProjectionMatrix with "#version 400 compatibility"). After the method the shader program, the vertex array and the buffers are unbound!
      Parameters:
      drawable - the drawable (drawable.getGL() is the context)
    • draw

      public void draw(Graphics2D g)
      The draw method for the Points panel with the Graphics context to draw directly on the panel with available Java routines!
      Parameters:
      g -
    • close

      public void close()
      A method to allow closing operations with a compiled Model class called,e.g., from the CustomView implementation.