### Setting up HOOPS Server Configuration Source: https://docs.techsoft3d.com/hoops/visualize-web/release_notes/2021_sp1 Provides examples of editing the quick start configuration file for HOOPS Server. This covers basic settings required to get the server running. ```ini [WebServer] Port=8081 EnableRootAccess=true [StreamCacheServer] Port=8888 CacheDirectory=./cache ``` -------------------------------- ### Animation Quickstart and Overview Source: https://docs.techsoft3d.com/hoops/visualize-web/prog_guide/data_import/authoring/data-import-examples Provides a quickstart guide and overview of the animation features in HOOPS Visualize Web, enabling the creation of dynamic sequences and motion within the 3D model. ```javascript // Conceptual entry point for animation (Conceptual) // Assume 'animationManager' is available animationManager.play(); ``` -------------------------------- ### HOOPS UI Kit React Project Setup Source: https://docs.techsoft3d.com/hoops/visualize-web/api_ref/viewing/types/ExchangeId Guides through the initial project setup for integrating the HOOPS UI Kit with a React application. This includes installing necessary packages and configuring the React environment. ```bash # 1. Create a new React application (if you don't have one) create-react-app my-hoops-app cd my-hoops-app # 2. Install HOOPS Visualize.js and HOOPS UI Kit packages npm install @techsoft3d/hoops-visualize @techsoft3d/hoops-ui # or yarn add @techsoft3d/hoops-visualize @techsoft3d/hoops-ui # 3. Configure your React component to use HOOPS Visualize.js # (See next JS snippet for component example) # 4. Ensure your public/index.html includes necessary meta tags and potentially # links to external CSS if not handled by the build process. # 5. Start the development server npm start # or yarn start ``` -------------------------------- ### Java Example: Running HOOPS Visualize Web Application on Linux Source: https://docs.techsoft3d.com/hoops/visualize-web/release_notes/2021_sp1 Instructions for running Java examples for HOOPS Visualize Web on a Linux platform. This covers environment setup and execution commands for Java applications on Linux. ```java // Placeholder for Java example code on Linux // Similar to Windows, this uses Java bindings for HOOPS. // Execution command example: // java -cp .:./hoops_java.jar MyJavaApp ``` -------------------------------- ### Create and Start WebViewer in JavaScript Source: https://docs.techsoft3d.com/hoops/visualize-web/index Demonstrates the basic steps to create, instantiate, and start the WebViewer, which is the main entry point for the application. This involves setting up the necessary HTML structure and initializing the viewer with a callback skeleton. ```javascript function setupViewer() { let viewer = new Communicator.WebViewer({ containerId: "viewer-container", }); viewer.start(); // Setup callback skeletons here } ``` -------------------------------- ### Run C++ SC_Store_Text Example (Windows) Source: https://docs.techsoft3d.com/hoops/visualize-web/prog_guide/data_import/authoring/data-import-examples Demonstrates how to execute the SC_Store_Text example using the C++ API on Windows from the command line. This requires the compiled example executable and a specified output directory. ```bash authoring_samples sc_store_text C:/path/to/output/folder ``` -------------------------------- ### Compile and Run Java Examples on Windows Source: https://docs.techsoft3d.com/hoops/visualize-web/prog_guide/data_import/authoring/data-import-examples This snippet details the Windows commands required to set up a working directory, copy necessary Java files and libraries, compile the Java examples using javac, create a model directory, and finally run the compiled Java applications. It assumes the Java Development Kit is installed and in the system's PATH. ```batch cd authoring\libsc\java mkdir rundir copy /y examples\*.java rundir copy /y bin\Release_<platform>\sc_java.dll rundir copy /y scj.jar rundir ### To compile and run the Text example, copy additional dependencies into place copy /y bin\Release_<platform>\sc_java_utils_text.dll rundir copy /y ..\..\converter\bin\<platform>\hps_core.dll rundir copy /y scj_utils_text.jar rundir cd rundir ### Compile the examples javac -cp ".;scj.jar;scj_utils_text.jar" *.java ### Create an empty model directory mkdir modeldir ### Run Java examples java -cp ".;scj.jar" ScStoreCubeSample modeldir java -cp ".;scj.jar;scj_utils_text.jar" SCStoreUtilsText modeldir ``` -------------------------------- ### Compile and Run Java Examples on Linux Source: https://docs.techsoft3d.com/hoops/visualize-web/prog_guide/data_import/authoring/data-import-examples This snippet outlines the Linux commands for setting up a compilation environment, copying Java source files and shared libraries, compiling the code with javac, creating a directory for model data, setting the LD_LIBRARY_PATH environment variable, and executing the Java examples. It requires the Java Development Kit to be installed and accessible. ```bash cd authoring/libsc/java mkdir rundir cp -f examples/*.java rundir cp -f bin/linux/libsc_java.so rundir cp -f scj.jar rundir ### To compile and run the Text sample, copy additional dependencies into place cp -f bin/linux/libsc_java_utils_text.so rundir cp -f ../bin/linux64/libhps_core.so rundir cp -f scj_utils_text.jar rundir cd rundir ### Compile the samples javac -cp ".:scj.jar:scj_utils_text.jar" *.java ### Create an empty model directory mkdir modeldir ### Set the LoadLibrary environment variable export LD_LIBRARY_PATH='.' ### Run Java examples java -cp ".:scj.jar" ScStoreCubeSample modeldir java -cp ".:scj.jar:scj_utils_text.jar" SCStoreUtilsText modeldir ``` -------------------------------- ### Setting up and Starting the WebViewer Source: https://docs.techsoft3d.com/hoops/visualize-web/api_ref/common/classes/Box This snippet demonstrates the fundamental steps to initialize, configure, and launch the HOOPS WebViewer. It covers setting up the main entry point and instantiating the viewer with necessary callbacks. Ensure the HOOPS WebViewer library is included in your project. ```javascript function setupAndStartViewer() { // Instantiate the HOOPS WebViewer const viewer = new Communicator.WebViewer({ container: "viewer-container", // Add other configuration options here }); // Start the viewer viewer.start().then(() => { console.log("WebViewer started successfully."); // Further initialization steps can be added here }).catch((error) => { console.error("Error starting WebViewer:", error); }); // Return the viewer instance for further manipulation return viewer; } ``` -------------------------------- ### Installing HOOPS Package on Windows Server Source: https://docs.techsoft3d.com/hoops/visualize-web/release_notes/2021_sp1 Guides users through the process of installing the HOOPS package on a Windows Server, which typically involves running an installer or using a command-line tool. ```powershell # Example PowerShell command to run an installer for HOOPS on Windows Server # Start-Process "C:\path\to\hoops_installer.exe" -ArgumentList "/S" # /S for silent install ``` -------------------------------- ### Start HOOPS Server (NodeJS) Source: https://docs.techsoft3d.com/hoops/visualize-web/prog_guide/viewing/operators/custom-operators This snippet demonstrates how to start the HOOPS Server using NodeJS. It covers basic setup, editing the configuration file, and starting the server process. This is essential for deploying HOOPS Visualize Web applications. ```javascript // Example: Starting the HOOPS Server with NodeJS // Assumes you have NodeJS installed and HOOPS Server package configured. // Navigate to your server directory in the terminal: // cd path/to/your/hoops-server // Edit the quick start configuration file (e.g., config.json) as needed. // Start the server using npm: // npm start // Or directly using NodeJS: // node server.js // To run as a background process with PM2: // pm2 start server.js --name hoops-server // To run as a Linux daemon or Windows service, refer to advanced setup documentation. ``` -------------------------------- ### Basic HOOPS Container Configuration (Dockerfile Example) Source: https://docs.techsoft3d.com/hoops/visualize-web/index Provides a basic Dockerfile example for setting up HOOPS containers, likely for use with AWS. This includes instructions for building and running the containerized environment for HOOPS applications. ```dockerfile # Basic Dockerfile for HOOPS Container FROM ubuntu:latest RUN apt-get update && apt-get install -y --no-install-recommends \ # Install necessary dependencies for HOOPS \ && rm -rf /var/lib/apt/lists/* # Copy HOOPS binaries and libraries COPY ./hoops_package /opt/HOOPS # Set environment variables if needed # ENV ENV_VAR=value # Expose ports if the application listens on any # EXPOSE 8080 # Define the command to run your application # CMD ["/opt/HOOPS/your_application"] ``` -------------------------------- ### Lighting Setup Source: https://docs.techsoft3d.com/hoops/visualize-web/prog_guide/data_import/authoring/data-import-examples Covers the basics of setting up lighting within the HOOPS Visualize Web scene. This includes understanding lighting principles and potentially examples of different lighting configurations to enhance visual appearance. ```javascript // Example for setting up basic lighting (Conceptual) // Assume 'scene' or 'view' has lighting configuration methods view.setLightingEnabled(true); view.setSunLight({ direction: { x: 1, y: -1, z: 1 }, intensity: 0.8 }); ``` -------------------------------- ### Creating a Basic File Server for Streaming Source: https://docs.techsoft3d.com/hoops/visualize-web/api_ref/common/classes/Box This example provides a basic Node.js implementation for a file server, which is a foundational component for streaming 3D models. It uses the built-in `http` module to serve files from a specified directory. This is a simplified example and may require enhancements for production use. ```javascript const http = require('http'); const fs = require('fs'); const path = require('path'); const PORT = 8080; const PUBLIC_DIR = path.join(__dirname, 'public'); const server = http.createServer((req, res) => { let filePath = path.join(PUBLIC_DIR, req.url === '/' ? 'index.html' : req.url); const extname = String(path.extname(filePath)).toLowerCase(); const mimeTypes = { '.js': 'text/javascript', '.css': 'text/css', '.json': 'application/json', '.png': 'image/png', '.jpg': 'image/jpg', '.gif': 'image/gif', '.wav': 'audio/wav', '.mp4': 'video/mp4', '.woff': 'application/font-woff', '.ttf': 'application/font-ttf', '.eot': 'application/vnd.ms-fontobject', '.otf': 'font/opentype', '.svg': 'image/svg+xml' }; const contentType = mimeTypes[extname] || 'application/octet-stream'; fs.readFile(filePath, (err, content) => { if (err) { if (err.code == 'ENOENT') { fs.readFile(path.join(PUBLIC_DIR, '404.html'), (error, content) => { res.writeHead(404, { 'Content-Type': 'text/html' }); res.end(content, 'utf-8'); }); } else { res.writeHead(500); res.end('Sorry, check with the site admin for error: ' + err.code + ' ..\n'); } } else { res.writeHead(200, { 'Content-Type': contentType }); res.end(content, 'utf-8'); } }); }); server.listen(PORT, () => { console.log(`Server running at http://localhost:${PORT}/`); }); ``` -------------------------------- ### Starting HOOPS Server Source: https://docs.techsoft3d.com/hoops/visualize-web/release_notes/2021_sp1 Illustrates the command-line or script method for starting the HOOPS Server. This could involve executing a specific executable or script. ```bash # Example command to start HOOPS Server ./HOOPS_Server --config server.config ``` -------------------------------- ### Java Examples for Data Import Source: https://docs.techsoft3d.com/hoops/visualize-web/prog_guide/viewing/operators/custom-operators This section outlines Java code examples for data import. It details how to run these examples on Windows and Linux, enabling users to integrate Java-based data processing with HOOPS Visualize Web. ```java // Java Example Snippet Placeholder // Actual Java code would be provided in the documentation build process. // Example: Running the Java examples on Windows // 1. Ensure Java Development Kit (JDK) is installed. // 2. Compile the Java source files (e.g., javac YourExample.java). // 3. Run the compiled class (e.g., java YourExample). // Example: Running the Java examples on Linux // 1. Ensure JDK is installed. // 2. Compile the Java source files (e.g., javac YourExample.java). // 3. Run the compiled class (e.g., java YourExample). ``` -------------------------------- ### Starting HOOPS Server with npm Source: https://docs.techsoft3d.com/hoops/visualize-web/release_notes/2021_sp1 Demonstrates how to initiate the HOOPS Server using npm (Node Package Manager), typically by running a script defined in the project's package.json. ```bash # Example npm script to start HOOPS Server npm run start:hoops-server ``` -------------------------------- ### Setting up and Starting the WebViewer Source: https://docs.techsoft3d.com/hoops/visualize-web/api_ref/viewing/types/ExchangeId Demonstrates the process of creating the main entry point for an application, then setting up, instantiating, and starting the HOOPS WebViewer. It also includes creating skeleton functions for handling WebViewer callbacks. ```javascript function initializeViewer() { // Create the main entry and structure for the application const viewerContainer = document.getElementById('viewer-container'); // Setup, instantiate, and start the WebViewer const viewer = new Communicator.WebViewer({ container: viewerContainer, // ... other configuration options }); viewer.start().then(() => { console.log('WebViewer started successfully.'); // Create the WebViewer callback skeletons setupCallbacks(viewer); }).catch((error) => { console.error('Error starting WebViewer:', error); }); } function setupCallbacks(viewer) { // Placeholder for callback setup console.log('Setting up callbacks...'); // Example: viewer.addEventListener('loadComplete', handleLoadComplete); } // Call initializeViewer() when the DOM is ready window.addEventListener('DOMContentLoaded', initializeViewer); ``` -------------------------------- ### C++ Example: Export to StreamCache Source: https://docs.techsoft3d.com/hoops/visualize-web/prog_guide/data_import/authoring/data-import-examples This C++ code snippet demonstrates how to export data to the StreamCache format. It is part of the converter library examples and requires appropriate setup for building and running. ```cpp #include #include "HConvert.h" int main() { // Initialize the converter library H_EXPORT_API HConvert converter; // Load a model file (replace with your model path) const wchar_t* inputFilePath = L"C:\\path\\to\\your\\model.ifc"; if (!converter.OpenFile(inputFilePath)) { std::cerr << "Error opening file: " << inputFilePath << std::endl; return 1; } // Define the output StreamCache file path const wchar_t* outputFilePath = L"C:\\path\\to\\output\\model.hsf"; // Export the model to StreamCache format if (converter.WriteStreamCacheFile(outputFilePath)) { std::cout << "Successfully exported to StreamCache: " << outputFilePath << std::endl; } else { std::cerr << "Error exporting to StreamCache." << std::endl; return 1; } return 0; } ``` -------------------------------- ### Build and Run C++ Examples (Linux) Source: https://docs.techsoft3d.com/hoops/visualize-web/prog_guide/data_import/authoring/data-import-examples Provides instructions for compiling and running C++ libsc examples on Linux using a makefile. It includes steps for compilation, directory creation, and executing a sample like SC_Store_Text. ```bash cd authoring/libsc/examples ### Run make to compile the examples make ### Create an empty model directory mkdir modeldir ### Run a sample -- in this case, we'll run the SC_Store_Text program authoring_samples sc_store_text /path/to/output/folder ``` -------------------------------- ### View Orientation Enum Source: https://docs.techsoft3d.com/hoops/visualize-web/api_ref/common/classes/Box Enumeration of predefined view orientations for quick camera setup. ```APIDOC ## View Orientation Enum ### Description An enumeration providing constants for common camera orientations, allowing for easy setting of predefined views. ### Enum Values - `wv.ViewOrientation.Front` - `wv.ViewOrientation.Back` - `wv.ViewOrientation.Left` - `wv.ViewOrientation.Right` - `wv.ViewOrientation.Top` - `wv.ViewOrientation.Bottom` - `wv.ViewOrientation.Iso` - `wv.ViewOrientation.FrontTopLeft` - `wv.ViewOrientation.FrontTopRight` - `wv.ViewOrientation.FrontBottomLeft` - `wv.ViewOrientation.FrontBottomRight` - `wv.ViewOrientation.BackTopLeft` - `wv.ViewOrientation.BackTopRight` - `wv.ViewOrientation.BackBottomLeft` - `wv.ViewOrientation.BackBottomRight` - `wv.ViewOrientation.LeftTopFront` - `wv.ViewOrientation.LeftTopBack` - `wv.ViewOrientation.LeftBottomFront` - `wv.ViewOrientation.LeftBottomBack` - `wv.ViewOrientation.RightTopFront` - `wv.ViewOrientation.RightTopBack` - `wv.ViewOrientation.RightBottomFront` - `wv.ViewOrientation.RightBottomBack` - `wv.ViewOrientation.TopFrontLeft` - `wv.ViewOrientation.TopFrontRight` - `wv.ViewOrientation.TopBackLeft` - `wv.ViewOrientation.TopBackRight` - `wv.ViewOrientation.BottomFrontLeft` - `wv.ViewOrientation.BottomFrontRight` - `wv.ViewOrientation.BottomBackLeft` - `wv.ViewOrientation.BottomBackRight` ### Usage Example ```javascript view.setCamera(wv.ViewOrientation.Iso); ``` ``` -------------------------------- ### Data Import - Converter Library Source: https://docs.techsoft3d.com/hoops/visualize-web/prog_guide/data_import/authoring/data-import-examples Guide to using the Converter Library for various export operations, including examples, licensing, customization, and importing multiple files. ```APIDOC ## Data Import - Converter Library ### Description This section focuses on the Converter Library, providing examples of various export operations such as exporting to StreamCache, PNG, shattered parts, and HTML. It also covers licensing, linking, customization, and handling multiple file imports. ### Capabilities: - **Conversion Examples**: Export to StreamCache, PNG (custom camera, pre-defined view), shattered parts, HTML with template, PDF with template. - **License Key** - **Linking to the Converter library** - **Customizing Converter**: demo_converter, mini_converter. - **Example usage** - **Importing multiple files** ``` -------------------------------- ### wvc.HoopsContextMenuElement Static Methods Source: https://docs.techsoft3d.com/hoops/visualize-web/index Details the static methods available on the `wvc.HoopsContextMenuElement` class, used for property management and initial setup. ```APIDOC ## wvc.HoopsContextMenuElement Static Methods ### Description Static methods provide utility functions for initializing and configuring `wvc.HoopsContextMenuElement` properties globally or during class definition. ### Methods - `addInitializer(initializer)` - `createProperty(name, options)` - `getPropertyOptions(name)` - `finalize()` ### Parameters - **initializer** (function) - Required - A function to run during initialization. - **name** (string) - Required - The name of the property. - **options** (object) - Required - Configuration options for the property. ### Request Example ```json // Example for createProperty { "name": "isVisible", "options": { "type": "boolean", "attribute": true } } ``` ### Response #### Success Response (200) - `void` (void) - Static methods typically do not return values or modify properties directly. #### Response Example ```json // No direct response body for static methods, actions are internal. null ``` ``` -------------------------------- ### C++ Example: Building HOOPS Visualize Web Application on Windows Source: https://docs.techsoft3d.com/hoops/visualize-web/release_notes/2021_sp1 Instructions and code snippets for building and running C++ examples for HOOPS Visualize Web on a Windows environment. This typically involves setting up the build system and compiling the provided source code. ```cpp // Placeholder for C++ example code // Actual code would involve HOOPS C++ API calls for model loading, manipulation, etc. // Example structure: #include int main() { HPS::Initialize(); // ... your C++ HOOPS Visualize Web code ... HPS::Shutdown(); return 0; } ``` -------------------------------- ### Java Example: Running HOOPS Visualize Web Application on Windows Source: https://docs.techsoft3d.com/hoops/visualize-web/release_notes/2021_sp1 Guidance on executing Java examples related to HOOPS Visualize Web on Windows. This might include setting up the Java environment and running the compiled Java code. ```java // Placeholder for Java example code // This would typically involve interacting with HOOPS Java bindings. // Example structure: // public class MyJavaApp { // public static void main(String[] args) { // // ... your Java HOOPS Visualize Web code ... // } // } ``` -------------------------------- ### Get Box Center Point Source: https://docs.techsoft3d.com/hoops/visualize-web/api_ref/common/classes/Box Calculates and returns the geometric center point of the box. This is the midpoint of the box along each axis. ```javascript boxInstance.center() ``` -------------------------------- ### IPmiService API Source: https://docs.techsoft3d.com/hoops/visualize-web/api_ref/common/classes/Box Manages PMI (Performance Monitoring Infrastructure) colors, including getting and setting overrides and resetting configurations. ```APIDOC ## IPmiService ### Description Service for managing PMI (Performance Monitoring Infrastructure) color settings. ### Methods GET, POST, PUT, DELETE, etc. (Specific methods are listed below) ### Endpoints N/A (These are likely JavaScript methods within a service) ### Parameters N/A ### Request Example N/A ### Response N/A ### Instance Methods * `serviceName` * `addEventListener` * `dispatchEvent` * `getPmiColor` * `getPmiColorOverride` * `removeEventListener` * `resetConfiguration` * `setPmiColor` * `setPmiColorOverride` ``` -------------------------------- ### Get Box Corner Points Source: https://docs.techsoft3d.com/hoops/visualize-web/api_ref/common/classes/Box Calculates and returns an array containing the coordinates of all eight corner vertices of the box. Each element in the array is a Point3 object. ```javascript boxInstance.getCorners() ``` -------------------------------- ### C++ Example: Building HOOPS Visualize Web Application on Linux Source: https://docs.techsoft3d.com/hoops/visualize-web/release_notes/2021_sp1 Details on building and running C++ examples for HOOPS Visualize Web on a Linux system. This section likely covers build toolchains and compilation commands specific to Linux. ```cpp // Placeholder for C++ example code on Linux // Similar to Windows, this would use the HPS C++ API. // Build commands might involve make or CMake. // Example: // g++ main.cpp -o myapp -I/path/to/hoops/include -L/path/to/hoops/lib -lHPS ```