Browse Source

Added API documentation generation script and documentation improvements.

pull/86/head
Matthew Petroff 9 years ago
parent
commit
82258028b8
2 changed files with 35 additions and 1 deletions
  1. +13
    -1
      src/js/libpannellum.js
  2. +22
    -0
      utils/doc/generate.sh

+ 13
- 1
src/js/libpannellum.js View File

@@ -53,6 +53,8 @@ function Renderer(container, image, imageType, video) {


/** /**
* Initialize renderer. * Initialize renderer.
* @memberof Renderer
* @instance
* @param {number} haov - Initial horizontal angle of view. * @param {number} haov - Initial horizontal angle of view.
* @param {number} vaov - Initial vertical angle of view. * @param {number} vaov - Initial vertical angle of view.
* @param {number} voffset - Initial vertical offset angle. * @param {number} voffset - Initial vertical offset angle.
@@ -348,6 +350,8 @@ function Renderer(container, image, imageType, video) {


/** /**
* Destroy renderer. * Destroy renderer.
* @memberof Renderer
* @instance
*/ */
this.destroy = function() { this.destroy = function() {
if (container !== undefined) { if (container !== undefined) {
@@ -362,6 +366,8 @@ function Renderer(container, image, imageType, video) {


/** /**
* Resize renderer (call after resizing container). * Resize renderer (call after resizing container).
* @memberof Renderer
* @instance
*/ */
this.resize = function() { this.resize = function() {
canvas.width = container.offsetWidth; canvas.width = container.offsetWidth;
@@ -376,6 +382,8 @@ function Renderer(container, image, imageType, video) {


/** /**
* Render new view of panorama. * Render new view of panorama.
* @memberof Renderer
* @instance
* @param {number} pitch - Pitch to render at. * @param {number} pitch - Pitch to render at.
* @param {number} yaw - Yaw to render at. * @param {number} yaw - Yaw to render at.
* @param {number} hfov - Horizontal field of view to render with. * @param {number} hfov - Horizontal field of view to render with.
@@ -484,7 +492,9 @@ function Renderer(container, image, imageType, video) {
/** /**
* Check if images are loading. * Check if images are loading.
* @returns {number} Whether or not images are loading.
* @memberof Renderer
* @instance
* @returns {boolean} Whether or not images are loading.
*/ */
this.isLoading = function() { this.isLoading = function() {
if (gl && imageType == 'multires') { if (gl && imageType == 'multires') {
@@ -499,6 +509,8 @@ function Renderer(container, image, imageType, video) {
/** /**
* Retrieve renderer's canvas. * Retrieve renderer's canvas.
* @memberof Renderer
* @instance
* @returns {HTMLElement} Renderer's canvas. * @returns {HTMLElement} Renderer's canvas.
*/ */
this.getCanvas = function() { this.getCanvas = function() {


+ 22
- 0
utils/doc/generate.sh View File

@@ -0,0 +1,22 @@
#!/bin/sh

# Generates API documentation.
# Requires documentationjs <http://documentation.js.org/>.

# Usage:
#
# Regular: ./generate.sh
# Include private methods: ./generate.sh private
# Release: ./generate.sh release

version=`git rev-parse --short=10 @`
private=""

if [ "$1" = "release" ]; then
version=`cat ../../VERSION`
elif [ "$1" = "private" ]; then
private="-p"
fi

echo "Generating documentation..."
documentation ../../src/js/pannellum.js ../../src/js/libpannellum.js -o generated_docs -f html --name Pannellum --version $version -g $private

Loading…
Cancel
Save