Project Layout


Summary

In this section, we will discuss the layout and directory structure of the Basic Application tutorial.

Concepts

  • Introduction to JS Development Environment
  • Required Libraries

As mentioned in the previous section, HOOPS Communicator ships with a Node.js server, which will serve up the samples included in the package. The following sections will assume you have executed the start_server.bat/sh script from Getting Started and still have that server running. While the server is well-suited for this guide, it is not intended for production use.

You are free to use your preferred IDE throughout this guide. However, if you are looking for a suggestion we recommend Visual Studio Code, which is a lightweight, cross-platform editor.

The HOOPS Communicator package was designed to be compatible with modern web development tools. All JavaScript provided is written to the ES6 standard with TypeScript Declaration Files included. This allows the HC package to be compatible with modern libraries and frameworks (such as Angular and React) with optional TypeScript support.

Sample Code

In your installation directory for HOOPS Communicator, we have provided a library of sample code that corresponds to tutorials in this documentation. There is a directory named basic_app that holds all of the starting files you need to start this tutorial. You will find other directories with names that correspond to the tutorials listed in the sidebar to the left under Tutorials.

<HC_installation_root>
├── tutorials
│   ├── basic_app
│   │   ├── index.html
│   │   ├── start_server.[bat|sh]
│   │   ├── server_config.js
│   │   ├── js
│   │   │   └── hoops

Let's take a closer look at the contents of the basic_app directory.

  • start_server.[bat|sh] – This script will start the same HOOPS Server used in Getting Started, but slightly modified to serve the files from this project and not Getting Started.
  • server_config.js – This file contains the HOOPS Server configuration.
  • js/ – This directory will contain all of the JavaScript files required for our Basic Application, including the HOOPS Web Viewer

Copying Files

The HOOPS Web Viewer JavaScript library files are located in web_viewer/src/js:

<HC_installation_root>
└── web_viewer
├── src
│   └── js
│   ├── engine-asmjs.js
│   ├── engine-wasm.js
│   ├── engine.wasm
│   └── hoops_web_viewer.js
└── typescript
├── hoops_web_viewer.d.ts
└── tcc.d.ts

The file hoops_web_viewer.js contains the core functionality of the HOOPS Web Viewer component and has dependencies on engine-asmjs.jsengine-wasm.jsengine.wasm. Copy all these hoops into /js/hoops of your project. To keep things simple, we will not use the HOOPS Web Viewer UI for this tutorial.

top_level:1 tutorials:0