Class: GeometryCollection

GeometryCollection

A geometry collection object is an object that stores a collection of geometries from a vector source file.


new GeometryCollection(options)

Parameters:
Name Type Description
options bu.street.threejs.GeometryCollectionOptions

Options.

Source:
bu-street/sceneobjects/geometrycollection.js
Fires:

Extends

Members


children :Array.<SceneObject>

The SceneObjects children of this object. Any SceneObject can have any number of SceneObject children in its own hierachy.

Type:
  • Array.<SceneObject>
Inherited From:
Source:
bu-street/sceneobjects/sceneobject.js

ignoreHoles :boolean

Type:
  • boolean
Source:
bu-street/sceneobjects/geometrycollection.js

material :Object.<string, THREE.Material>

Type:
  • Object.<string, THREE.Material>
Source:
bu-street/sceneobjects/geometrycollection.js

maxStreetDistance :number

Type:
  • number
Source:
bu-street/sceneobjects/geometrycollection.js

measurementLayer :boolean

Type:
  • boolean
Source:
bu-street/sceneobjects/geometrycollection.js

object3D :THREE.Object3D

The THREE.Object3D that contains this SceneObject. Each SceneObject can contain one and only one THREE.Object3D, but any THREE.Object3D can have any number of THREE.Object chidren in its own hierachy.

Type:
  • THREE.Object3D
Inherited From:
Source:
bu-street/sceneobjects/sceneobject.js

Methods


addChild(child)

Adds a child SceneObject to this object.

Parameters:
Name Type Description
child bu.street.threejs.SceneObject

Child SceneObject.

Inherited From:
Source:
bu-street/sceneobjects/sceneobject.js

addGeometry(geometry)

Adds a geometry to the Geometry collection.

Parameters:
Name Type Description
geometry ol.geom.Geometry

Geometry to add.

Source:
bu-street/sceneobjects/geometrycollection.js

addLine(coords, toTemp, dashed)

Creates a line with the options passed and adds it to this geometry collection. If toTemp it refreshes the this.tempObject. The material used is the one set in the 'lines' key for the material option if dashed is false or the one set in the 'dashedlines' if true.

Parameters:
Name Type Description
coords Array.<bu.Coordinate>

The local coordinates.

toTemp boolean

If refresh the tempObject or not, creating a new one.

dashed boolean

If draw the line dashed or not.

Source:
bu-street/sceneobjects/geometrycollection.js

addLinearRing(coords, vertical, coplanar, toTemp, dashed)

Creates a linear ring with the options passed and adds it to this geometry collection. If toTemp it refreshes the this.tempObject. If vertical then all points will lay over the line of the first two points. If coplanar then fourth and following points will be forced to be coplanar with first three ones. Also it returns the resulting array of coordinates or undefined if the coplanarity and verticality constraints couldn't be applied. The material used is the one set in the 'lines' key for the material option if dashed is false or the one set in the 'dashedlines' if true.

Parameters:
Name Type Description
coords Array.<bu.Coordinate>

The local coordinates.

vertical boolean

If the geometry will be vertical. That means that all the points, when projected to the ground, will lay inside the line of the forst two points. The first two points define the line of a vertical plane.

coplanar boolean

If all the points must be coplanar with first three points.

toTemp boolean

If refresh the tempObject or not, creating a new one.

dashed boolean

If draw the line dashed or not.

Source:
bu-street/sceneobjects/geometrycollection.js
Returns:

The input coordinates but coplanar.

Type
Array.<bu.Coordinate>

addSphere(coord, sphereWidth, viewportWidth)

Creates a sphere (for drawing a point) with the options passed and adds it to this geometry collection. The material used is the one set in the 'spheres' key for the material option.

Parameters:
Name Type Description
coord bu.Coordinate

The local coordinate for the sphere.

sphereWidth number

Width of the sphere in pixels.

viewportWidth number

Width of the viewport in pixels.

Source:
bu-street/sceneobjects/geometrycollection.js

addToScene(scene)

Adds all visible objects of these geometry collection to scene.

Parameters:
Name Type Description
scene THREE.Scene

Scene where add objects.

Source:
bu-street/sceneobjects/geometrycollection.js

findSceneObjects(raycaster)

Returns an array of SceneObjects that are intersected by given raycaster. Function to be overrided in derived classes.

Parameters:
Name Type Description
raycaster THREE.Raycaster

Raycaster.

Inherited From:
Source:
bu-street/sceneobjects/sceneobject.js
Returns:

Array of SceneObject.

Type
Array.<bu.street.threejs.SceneObject>

findThreeObjects(raycaster)

Returns an array of THREE.Object3D that are intersected by given raycaster. Function to be overrided in derived classes.

Parameters:
Name Type Description
raycaster THREE.Raycaster

Raycaster.

Inherited From:
Source:
bu-street/sceneobjects/sceneobject.js
Returns:

Array of THREE.Object3D.

Type
Array.<THREE.Object3D>

getScene()

Returns the Three.js scene the object3D contained inside this object is attached to.

Inherited From:
Source:
bu-street/sceneobjects/sceneobject.js
Returns:

The scene.

Type
THREE.Scene

getSceneManager()

Returns the SceneManager this SceneObject is attached to.

Inherited From:
Source:
bu-street/sceneobjects/sceneobject.js
Returns:

SceneManager.

Type
bu.streetthreejs.SceneManager

getVisible()

Returns the visibility of the objects of this object.

Inherited From:
Source:
bu-street/sceneobjects/sceneobject.js
Returns:
Type
boolean

removeAll()

Remove all objects.

Source:
bu-street/sceneobjects/geometrycollection.js

removeChild(child)

Removes a child SceneObject from this object.

Parameters:
Name Type Description
child bu.street.threejs.SceneObject

Child SceneObject.

Inherited From:
Source:
bu-street/sceneobjects/sceneobject.js

removeFromScene(scene)

Removes all objects of these geometry collection from scene.

Parameters:
Name Type Description
scene THREE.Scene

Scene where remove objects.

Source:
bu-street/sceneobjects/geometrycollection.js

rotateAroundWorldAxis(axis, radians)

Rotate the object3D of this SceneObject around an arbitrary axis in world space.

Parameters:
Name Type Description
axis THREE.Vector3

Axis. It is not needed the axis to be normalized.

radians number

Angle in radians.

Inherited From:
Source:
bu-street/sceneobjects/sceneobject.js

setObject3D(object3D)

Sets the THREE.Object3D of this object.

Parameters:
Name Type Description
object3D THREE.Object3D

The Object3D of this object.

Inherited From:
Source:
bu-street/sceneobjects/sceneobject.js

setPosition(x, y, z)

Move this object to new coordinates.

Parameters:
Name Type Description
x number

X coord.

y number

Y coord.

z number

Z coord.

Inherited From:
Source:
bu-street/sceneobjects/sceneobject.js

setVisible(visible)

Change the visibility of this object.

Parameters:
Name Type Description
visible boolean

If object should be visible or not.

Inherited From:
Source:
bu-street/sceneobjects/sceneobject.js