User Tools

Site Tools


hyperfun:hyperfox_manual

Table of Contents

Hyperfox

Supported commands

These commands can be used from javascript for configuring the visualization window:

  • void setSource(string) : Sets the source for the model. The input string is the program on HyperFun langugage.
  • boolean isFloat(string) : Checks if the input string is floating-point variable.
  • boolean isInt(string) : Checks if the input string is integer variable.
  • void setBoundingBox(string, string, string, string, string, string) : Sets bounding box for polygonization. Input parameters: xmin, xmax, ymin, ymax, zmin, zmax, all as floating-points in string format.
  • void setGrid(string, string, string) : Sets the grid the sampling for the polygonization. Input parameters: integer value for x, y and z.
  • void setLineColor(string) : Sets the color for wireframe mode in visualization window. Input parameter: string of hex-based color (e.g. '#00ff00')
  • void setObjectColor(string) : Sets the color of the polygonal object in visualization window. Input parameter: string of hex-based color.
  • void setBackground(string) : Sets the background of the visualization window. Input parameter: string of hex-based color.
  • void setParameter(string, string) : Sets the value of a[] variable for HyperFun program. Input parameters: number of parameter, parameter value.

Example

There is a sample of javascript code that works with Hyperfox plugin:

    var oXmin = document.getElementById("xmin");
    var oXmax = document.getElementById("xmax");
    if (!embed.isFloat(oXmin.value)){
      alert("Please correct value for Xmin"); return; }
    if (!embed.isFloat(oXmax.value)){
      alert("Please correct value for Xmax"); return; }
    embed.setBoundingBox(oXmin.value, oXmax.value, '-10', '10', '-10.0', '10.0');

    var oXgrid = document.getElementById("gridx");
    if (!embed.isInt(oXgrid.value)) {
      alert("Please correct value for GridX"); return; }
    embed.setGrid(oXgrid.value, '30', '30');
    embed.setLineColor('#00ff00');
    embed.setFaceColor('#FFFFCC');
    embed.setBackground('#ffffff');

    embed.setSource(oTextbox1.value);
hyperfun/hyperfox_manual.txt ยท Last modified: 2020/12/31 10:49 (external edit)