Skip to content

Commit

Permalink
doc: rewrite some docs to follow jsdoc semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
Desplandis authored and mgermerie committed Sep 17, 2024
1 parent 9479973 commit cbb1b96
Show file tree
Hide file tree
Showing 71 changed files with 174 additions and 261 deletions.
1 change: 0 additions & 1 deletion src/Controls/FirstPersonControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ function moveCameraVerticalGlobe(value) {

class FirstPersonControls extends THREE.EventDispatcher {
/**
* @Constructor
* @param {View} view
* @param {object} options
* @param {boolean} options.focusOnClick - whether or not to focus the renderer domElement on click
Expand Down
1 change: 0 additions & 1 deletion src/Controls/FlyControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ function onDocumentMouseWheel(event) {
*/
class FlyControls extends THREE.EventDispatcher {
/**
* @Constructor
* @param {View} view
* @param {object} options
* @param {boolean} options.focusOnClick - whether or not to focus the renderer domElement on click
Expand Down
10 changes: 5 additions & 5 deletions src/Controls/GlobeControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -1137,11 +1137,11 @@ class GlobeControls extends THREE.EventDispatcher {
* Zoom parameter is ignored if range is set
* The tilt's interval is between 4 and 89.5 degree
*
* @param {CameraUtils~CameraTransformOptions|Extent} params camera transformation to apply
* @param {number} [params.zoom] zoom
* @param {number} [params.scale] scale
* @param {boolean} isAnimated Indicates if animated
* @return {Promise} A promise that resolves when transformation is complete
* @param {CameraUtils~CameraTransformOptions|Extent} [params] - camera transformation to apply
* @param {number} [params.zoom] - zoom
* @param {number} [params.scale] - scale
* @param {boolean} [isAnimated] - Indicates if animated
* @return {Promise} A promise that resolves when transformation is complete
*/
lookAtCoordinate(params = {}, isAnimated = this.isAnimationEnabled()) {
this.player.stop();
Expand Down
3 changes: 1 addition & 2 deletions src/Controls/StreetControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function computeTime(distance) {
}

/**
* @classdesc Camera controls that can follow a path.
* Camera controls that can follow a path.
* It is used to simulate a street view.
* It stores a currentPosition and nextPosition, and do a camera traveling to go to next position.
* It also manages picking on the ground and on other object, like building.
Expand Down Expand Up @@ -111,7 +111,6 @@ function computeTime(distance) {
*/
class StreetControls extends FirstPersonControls {
/**
* @constructor
* @param { View } view - View where this control will be used
* @param { Object } options - Configuration of this controls
* @param { number } [options.wallMaxDistance=1000] - Maximum distance to click on a wall, in meter.
Expand Down
4 changes: 2 additions & 2 deletions src/Converter/Feature2Mesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ function createInstancedMesh(mesh, count, ptsIn) {
}

/**
* Convert a [Feature]{@link Feature} of type POINT to a Instanced meshes
* Convert a {@link Feature} of type POINT to a Instanced meshes
*
* @param {Object} feature
* @returns {THREE.Mesh} mesh or GROUP of THREE.InstancedMesh
Expand All @@ -578,7 +578,7 @@ function pointsToInstancedMeshes(feature) {
}

/**
* Convert a [Feature]{@link Feature} to a Mesh
* Convert a {@link Feature} to a Mesh
* @param {Feature} feature - the feature to convert
* @param {Object} options - options controlling the conversion
*
Expand Down
2 changes: 1 addition & 1 deletion src/Core/3DTiles/C3DTBatchTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { C3DTilesTypes } from './C3DTilesEnums';

const utf8Decoder = new TextDecoder();

/** @classdesc
/**
* A 3D Tiles
* [batch
* table](https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/BatchTable).
Expand Down
1 change: 0 additions & 1 deletion src/Core/3DTiles/C3DTBatchTableHierarchyExtension.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@


/**
* @classdesc
* Batch Table part of the 3D Tiles
* [Batch Table Hierarchy Extension](https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/extensions/3DTILES_batch_table_hierarchy)
* @property {object} classes - The classes as defined in the specification.
Expand Down
3 changes: 1 addition & 2 deletions src/Core/3DTiles/C3DTBoundingVolume.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ function initFromSphere(sphere) {
}

/**
* @classdesc 3D Tiles
* [bounding volume](https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/specification/schema/boundingVolume.schema.json)
* Used to represent bounding volumes and viewer request volumes. The input bounding volume (from the dataset) can be a
* box, a sphere or a region. Regions are transformed to spheres internally for simplification of parsing and to speed
Expand Down Expand Up @@ -143,7 +142,7 @@ class C3DTBoundingVolume {
}

/**
* Checks if the camera is inside the [viewer request volumes](@link https://github.com/CesiumGS/3d-tiles/tree/main/specification#viewer-request-volume).
* Checks if the camera is inside the [viewer request volumes](https://github.com/CesiumGS/3d-tiles/tree/main/specification#viewer-request-volume).
* @param {Camera} camera - the camera to perform culling for
* @param {THREE.Matrix4} tileMatrixWorld - the world matrix of the tile
* @returns {boolean} true if the camera is outside the viewer request volume, false otherwise.
Expand Down
6 changes: 3 additions & 3 deletions src/Core/3DTiles/C3DTExtensions.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/** @classdesc
/**
* Class for managing
* [3D Tiles extensions](https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/extensions).
* Extensions used in a 3D Tiles tileset must be registered in the iTowns' layer
* holding the tileset by the user with the {@link registerExtension}
* method. The extension must be registered together with a class holding the
* code to interpret the extension.
* An example of extension class is {@link $3DTBatchTableHierarchyExtension}.
* An example of extension class is {@link C3DTBatchTableHierarchyExtension}.
* This extension has only one part situated in the batch table (but other
* extensions can have multiple parts, stored in different 3D Tiles classes
* such as tileset or bounding volume).
Expand Down Expand Up @@ -40,7 +40,7 @@ class C3DTExtensions {
* corresponding to this class. These extension managers should be able
* to parse the extension fragment (done in the constructor) and should
* have a getInfoById method if they are related to the batch table class.
* See {@link $3DTBatchTableHierarchyExtension} for an example of
* See {@link C3DTBatchTableHierarchyExtension} for an example of
* extension class.
*/
registerExtension(extensionName, extensionManagers) {
Expand Down
2 changes: 1 addition & 1 deletion src/Core/3DTiles/C3DTileset.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { C3DTilesTypes } from './C3DTilesEnums';
// to a reference local to the tile.
const tileMatrixInverse = new THREE.Matrix4();

/** @classdesc
/**
* A 3D Tiles
* [Tileset](https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/specification/schema/tileset.schema.json).
* @property {C3DTilesTypes} type - Used by 3D Tiles extensions
Expand Down
6 changes: 3 additions & 3 deletions src/Core/Feature.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ const alignYtoEast = new THREE.Quaternion();
* @property {boolean} isInverted - This option is to be set to the
* correct value, true or false (default being false), if the computation of
* the coordinates needs to be inverted to same scheme as OSM, Google Maps
* or other system. See [this link]{@link
* https://alastaira.wordpress.com/2011/07/06/converting-tms-tile-coordinates-to-googlebingosm-tile-coordinates}
* or other system. See [this link](
* https://alastaira.wordpress.com/2011/07/06/converting-tms-tile-coordinates-to-googlebingosm-tile-coordinates)
* for more informations.
* @property {THREE.Matrix4} matrixWorldInverse - The matrix world inverse.
* @property {Coordinates} center - The local center coordinates in `EPSG:4326`.
Expand Down Expand Up @@ -432,7 +432,7 @@ export class FeatureCollection extends THREE.Object3D {
}

/**
* Remove features that don't have [FeatureGeometry]{@link FeatureGeometry}.
* Remove features that don't have {@link FeatureGeometry}.
*/
removeEmptyFeature() {
this.features = this.features.filter(feature => feature.geometries.length);
Expand Down
30 changes: 15 additions & 15 deletions src/Core/Geographic/Coordinates.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,23 @@ function proj4cache(crsIn, crsOut) {
}

/**
* A Coordinates object, defined by a [crs]{@link http://inspire.ec.europa.eu/theme/rs}
* A Coordinates object, defined by a [crs](http://inspire.ec.europa.eu/theme/rs)
* and three values. These values are accessible through `x`, `y` and `z`,
* although it can also be accessible through `latitude`, `longitude` and
* `altitude`. To change a value, prefer the `set()` method below.
*
* `EPSG:4978` and `EPSG:4326` are supported by default. To use another CRS,
* you have to declare it with `proj4`. You can find most projections and their
* proj4 code at [epsg.io](https://epsg.io/).
*
* @example
* new Coordinates('EPSG:4978', 20885167, 849862, 23385912); //Geocentric coordinates
* new Coordinates('EPSG:4326', 2.33, 48.24, 24999549); //Geographic coordinates
*
* @example
* // Declare EPSG:3946 with proj4
* itowns.proj4.defs('EPSG:3946', '+proj=lcc +lat_1=45.25 +lat_2=46.75 +lat_0=46 +lon_0=3 +x_0=1700000 +y_0=5200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
*
* @property {boolean} isCoordinates - Used to checkout whether this coordinates
* is a Coordinates. Default is true. You should not change this, as it is used
* internally for optimisation.
Expand All @@ -47,22 +59,10 @@ function proj4cache(crsIn, crsOut) {
* @property {number} altitude - The third value of the coordinate.
* @property {THREE.Vector3} geodesicNormal - The geodesic normal of the
* coordinate.
*
* @example
* new Coordinates('EPSG:4978', 20885167, 849862, 23385912); //Geocentric coordinates
*
* @example
* new Coordinates('EPSG:4326', 2.33, 48.24, 24999549); //Geographic coordinates
*/
class Coordinates {
/**
* @constructor
*
* @param {string} crs - A supported Coordinate Reference System. 'EPSG:4978' and 'EPSG:4326' are
* supported by default. To use another CRS, you have to declare it with proj4. For instance:
* @example
* itowns.proj4.defs('EPSG:3946', '+proj=lcc +lat_1=45.25 +lat_2=46.75 +lat_0=46 +lon_0=3 +x_0=1700000 +y_0=5200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
* You can find most projections and their proj4 code at [epsg.io]{@link https://epsg.io/}
* @param {string} crs - A supported Coordinate Reference System.
* @param {number|Array<number>|Coordinates|THREE.Vector3} [v0=0] -
* x or longitude value, or a more complex one: it can be an array of three
* numbers, being x/lon, y/lat, z/alt, or it can be `THREE.Vector3`. It can
Expand Down Expand Up @@ -285,7 +285,7 @@ class Coordinates {
}

/**
* Returns coordinates in the wanted [CRS]{@link http://inspire.ec.europa.eu/theme/rs}.
* Returns coordinates in the wanted [CRS](http://inspire.ec.europa.eu/theme/rs).
*
* @param {string} crs - The CRS to convert the Coordinates into.
* @param {Coordinates} [target] - The target to put the converted
Expand Down
2 changes: 2 additions & 0 deletions src/Core/Geographic/Extent.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ for (let i = cardinals.length - 1; i >= 0; i--) {

const _c = new Coordinates('EPSG:4326', 0, 0);

/** @private */
export const globalExtentTMS = new Map();
/** @private */
export const schemeTiles = new Map();

function getInfoTms(crs) {
Expand Down
38 changes: 19 additions & 19 deletions src/Core/Geographic/GeoidGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ function biLinearInterpolation(indexes, getData) {

/**
* An instance of `GeoidGrid` allows accessing some geoid height grid data from geographic instances (like some
* `{@link Coordinates}`). The geoid height grid data must contain geoid height values for a set of geographic points
* {@link Coordinates}). The geoid height grid data must contain geoid height values for a set of geographic points
* regularly dispatched on a planar surface.
*
* @property {Extent} extent The geographic extent of the geoid height grid data.
* @property {THREE.Vector2} step The distance between two consecutive points of the geoid height grid. The
* `x` value stands for the distance along the West-East direction, and the
* `y` value stands for the distance along the South-North direction.
* `x` value stands for the distance along the West-East direction, and the
* `y` value stands for the distance along the South-North direction.
* @property {THREE.Vector2} dimensions The planar dimensions of the geoid height grid data extent.
* @property {THREE.Vector2} dataSize The number of values in the gridded data along the West-East direction (`x`
* axis) and the South-North direction (`y` axis).
Expand Down Expand Up @@ -72,21 +72,21 @@ class GeoidGrid {
/**
* @param {Extent} extent The geographic extent of the geoid height grid data.
* @param {THREE.Vector2} step The distance between two consecutive points of the geoid height grid. The
* `x` value stands for the distance along the West-East direction, and the
* `y` value stands for the distance along the South-North direction.
* `x` value stands for the distance along the West-East direction, and the
* `y` value stands for the distance along the South-North direction.
* @param {function} getData A method that allows reading a value in the geoid height grid from its
* vertical and horizontal indexes. The lower an index, the lower the
* coordinate on the corresponding axis - 0 being the index of the minimal
* coordinate of the gridded data on a given axis. In other words :
* - `getData(0, 0)` must return the geoid height value at the SOUTH-WEST
* corner of your data extent.
* - `getData(0, j)` must return a geoid height on the southern limit of your
* data extent.
* - `getData(i, 0)` must return a geoid height on the western limit of your
* data extent.
* - if your gridded data has dimensions (rowNumber, colNumber),
* `getData(rowNumber - 1, colNumber - 1)` must return the geoid height at
* the NORTH-EAST corner of your data extent.
* vertical and horizontal indexes. The lower an index, the lower the
* coordinate on the corresponding axis - 0 being the index of the minimal
* coordinate of the gridded data on a given axis. In other words :
* - `getData(0, 0)` must return the geoid height value at the SOUTH-WEST
* corner of your data extent.
* - `getData(0, j)` must return a geoid height on the southern limit of your
* data extent.
* - `getData(i, 0)` must return a geoid height on the western limit of your
* data extent.
* - if your gridded data has dimensions (rowNumber, colNumber),
* `getData(rowNumber - 1, colNumber - 1)` must return the geoid height at
* the NORTH-EAST corner of your data extent.
*/
constructor(
extent,
Expand All @@ -105,12 +105,12 @@ class GeoidGrid {
}

/**
* Get the value of the geoid height at given geographic `{@link Coordinates}`. The geoid height value is
* Get the value of the geoid height at given geographic {@link Coordinates}. The geoid height value is
* bi-linearly interpolated from the gridded data accessed by the `GeoidGrid` instance.
*
* @param {Coordinates} coordinates Geographic coordinates to get the geoid height value at.
*
* @returns {number} The geoid height value at the given `{@link Coordinates}`, bi-interpolated from the gridded
* @returns {number} The geoid height value at the given {@link Coordinates}, bi-interpolated from the gridded
* data accessed by the `GeoidGrid` instance.
*/
getHeightAtCoordinates(coordinates) {
Expand Down
3 changes: 1 addition & 2 deletions src/Core/Prefab/Globe/Atmosphere.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ class Atmosphere extends GeometryLayer {
*
* The atmospheric-scattering it is taken from :
* * [Atmosphere Shader From Space (Atmospheric scattering)](http://stainlessbeer.weebly.com/planets-9-atmospheric-scattering.html)
* * [Accurate Atmospheric Scattering (NVIDIA GPU Gems 2)]{@link https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-16-accurate-atmospheric-scattering}.
* * [Accurate Atmospheric Scattering (NVIDIA GPU Gems 2)](https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-16-accurate-atmospheric-scattering).
*
* @constructor
* @extends GeometryLayer
*
* @param {string} id - The id of the layer Atmosphere.
Expand Down
1 change: 0 additions & 1 deletion src/Core/Prefab/Globe/GlobeLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class GlobeLayer extends TiledGeometryLayer {
* A {@link TiledGeometryLayer} to use with a {@link GlobeView}. It has
* specific method for updating and subdivising its grid.
*
* @constructor
* @extends TiledGeometryLayer
*
* @param {string} id - The id of the layer, that should be unique. It is
Expand Down
5 changes: 2 additions & 3 deletions src/Core/Prefab/GlobeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ class GlobeView extends View {
/**
* Creates a view of a globe.
*
* @constructor
* @extends View
*
* @example <caption><b>Instance GlobeView.</b></caption>
Expand All @@ -82,8 +81,8 @@ class GlobeView extends View {
* @param {HTMLDivElement} viewerDiv - Where to attach the view and display it
* in the DOM.
* @param {CameraTransformOptions|Extent} placement - An object to place view
* @param {object=} options - See options of {@link View}.
* @param {Object} options.controls - See options of {@link GlobeControls}
* @param {object} [options] - See options of {@link View}.
* @param {Object} [options.controls] - See options of {@link GlobeControls}
*/
constructor(viewerDiv, placement = {}, options = {}) {
THREE.Object3D.DEFAULT_UP.set(0, 0, 1);
Expand Down
1 change: 0 additions & 1 deletion src/Core/Prefab/Planar/PlanarLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class PlanarLayer extends TiledGeometryLayer {
* A {@link TiledGeometryLayer} to use with a {@link PlanarView}. It has
* specific method for updating and subdivising its grid.
*
* @constructor
* @extends TiledGeometryLayer
*
* @param {string} id - The id of the layer, that should be unique. It is
Expand Down
5 changes: 2 additions & 3 deletions src/Core/Prefab/PlanarView.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import PlanarLayer from './Planar/PlanarLayer';

class PlanarView extends View {
/**
* @constructor
* @extends View
*
* @example <caption><b>Instance with placement on the ground.</b></caption>
Expand All @@ -19,9 +18,9 @@ class PlanarView extends View {
* @param {HTMLDivElement} viewerDiv - Where to attach the view and display it
* in the DOM.
* @param {Extent} extent - The ground extent.
* @param {object=} options - See options of {@link View}.
* @param {Object} [options] - See options of {@link View}.
* @param {boolean} [options.noControls=false] - If true, no controls are associated to the view.
* @param {object=} [options.controls] - options for the {@link PlanarControls} associated to the view, if
* @param {Object} [options.controls] - options for the {@link PlanarControls} associated to the view, if
* `options.noControls` is false.
* @param {CameraUtils~CameraTransformOptions|Extent} [options.placement] - The
* {@link CameraUtils~CameraTransformOptions} to apply to view's camera or the extent it must display at
Expand Down
Loading

0 comments on commit cbb1b96

Please sign in to comment.