Class: GuiSelectPoint

GuiSelectPoint~GuiSelectPoint(options, guiParamsopt)

A dat.gui based graphical user interface for select a point from the mesh.

Constructor

new GuiSelectPoint(options, guiParamsopt)

Parameters:
Name Type Attributes Default Description
options Options See the options parameter of the MyThree class.
Properties
Name Type Attributes Default Description
dat.dat GUI <optional>
dat.GUI().
dat.guiSelectPoint boolean | Object <optional>
false - do not displays GuiSelectPoint.
Properties
Name Type Attributes Description
point function <optional>
Callback function to create custom controllers for each point of selected mesh with custom controllers.
parameter options See options parameter of MyThree class.
parameter dat dat.GUI().
parameter fParent parent folder.
example point: function ( options, dat, fMesh ) { return new FermatSpiral.gui( options, dat, fMesh ); },
boDisplayVerticeID boolean <optional>
true - display on the scene the point ID near to the point.
axesHelper AxesHelper <optional>
An axis object to visualize axes. See AxesHelper.
getLanguageCode function <optional>
language code of your browser Your custom getLanguageCode() function.
returns the "primary language" subtag of the language version of the browser.
Examples: "en" - English language, "ru" Russian.
See the "Syntax" paragraph of RFC 4646 rfc4646 2.1 Syntax for details.
You can import { getLanguageCode } from '../../commonNodeJS/master/lang.js';
lang object <optional>
Object with localized language values
guiParams object <optional>
{} Followed parameters is allowed.
Properties
Name Type Attributes Description
cameraTarget object <optional>
camera looking at selected point during playing. See the cameraTarget parameter of the Player.cameraTarget.init(...) function for details.
Properties
Name Type Description
camera THREE.PerspectiveCamera PerspectiveCamera.
pointControls function <optional>
pointControls( fPoint, dislayEl, getMesh ) Adds the trace "Display the trace of the point movement" control checkbox into gui.
fPoint - parent folder for new control.
dislayEl( conrtol, true or false ) - function for dislay or hide of the control.
getMesh() returns the mesh, selected in the GuiSelectPoint.
Default is undefined.
pointsControls function <optional>
pointsControls( fPoints, dislayEl, getMesh ) Adds the trace "Display the trace of the movement of all points of the mesh." control checkbox into gui.
fPoints - parent folder for new control.
dislayEl( conrtol, true or false ) - function for dislay or hide of the control.
getMesh() returns the mesh, selected in the GuiSelectPoint.
Default is undefined.
setIntersection function <optional>
setIntersection( intersection ) sets the intersection value of myThreejs. Default is undefined
Source:
Example
import GuiSelectPoint from 'https://raw.githack.com/anhr/commonNodeJS/master/guiSelectPoint/guiSelectPoint.js';

	new GuiSelectPoint( options );
	options.guiSelectPoint.add();
	options.guiSelectPoint.addMesh( points );

Methods

add(folderopt)

Adds select point GUI into dat.gui folder
Parameters:
Name Type Attributes Description
folder GUI <optional>
dat.gui folder.
Source:

addMesh(mesh)

Adds new mesh into select point GUI
Parameters:
Name Type Description
mesh THREE.Mesh new Mech.
Source:

getFrustumPoints()

get frustum points.
Source:

getMeshIndex(mesh)

get index of the mesh in the cMeshs controller
Parameters:
Name Type Description
mesh THREE.Mesh Mech
Source:
Returns:
index of selectred mesh.

getSelectedPointIndex()

Source:
Returns:
index of the selected point or -1 if mesh is not selected or if point is not selected.

getSelectedPointIndexShort()

Source:
Returns:
index of the selected point or -1 if point is not selected.

isSelectedMesh(meshCur)

Is mesh selected in the GuiSelectPoint?
Parameters:
Name Type Description
meshCur THREE.Mesh Mech to be tested
Source:
Returns:
true if meshCur is selected.

removeMesh(mesh, boHideF3DObjectsopt)

Removes a mesh from the select point GUI
Parameters:
Name Type Attributes Default Description
mesh THREE.Mesh Mech for removing.
boHideF3DObjects boolean <optional>
true true - hide the 'Meshes' folder if no any mesh exists in the meshs dropdown menu.
Source:

removePoints()

Removes all points from points list control.
Source:

select(intersectionSelected)

User has selected a point
Parameters:
Name Type Description
intersectionSelected Object See intersectObject
Source:

selectPoint(index)

Selects a point in the points list control
Parameters:
Name Type Description
index number index of the point in the points list control
Source:

setAxisControl(axis, scale)

Specify a maximum, minimum and step value for NumberController.
Parameters:
Name Type Description
axis String axis. Currently 'w' axis is available only.
scale object The following NumberController properties are available:
Properties
Name Type Attributes Description
min object <optional>
Minimum allowed value.
max object <optional>
Maximum allowed value.
step object <optional>
Increment by which to change value.
Source:

setAxisName(axis, name)

sets axis name of the controllers
Parameters:
Name Type Description
axis String axis. 'x' or 'y' or 'z'.
name String new axis name
Source:

setIndexMesh(index, mesh)

Set a mesh in the mesh's list control
Parameters:
Name Type Description
index number index of the mesh in the mesh's list control
mesh THREE.Mesh new Mech
Source:

setMesh()

Sets controllers to position, scale and rotation of the mesh. If AxesHelper is exist, expose the mesh to the axes.
Source:

setPosition(intersectionSelected)

Sets controllers to position, scale and rotation of the mesh. If AxesHelper is exist, expose the mesh to the axes.
Parameters:
Name Type Description
intersectionSelected THREE.Raycaster.intersectObject
Source:

setReadOnlyPosition(boReadOnly)

Sets local position controllers to read-only
Parameters:
Name Type Description
boReadOnly boolean true is read-only
Source:

update()

update the values of the controllers of the world position
Source:

updatePoints()

Updates points in the points list control.
Source: