Definitions
Directories
- Apps
The `GlassHopper project appears to be a C#-based application focused on managing glass structural analysis jobs and organizational data. The primary components are Data Transfer Objects (DTOs) located in the `GlassHopper/Definitions/Apps` directory, which define structured inputs and outputs for various operations. Key files include models for creating and updating jobs (`CreateJobRequest`, `UpdateJobRequestDto`) and handling analysis specifics (`GlassAnalysisInput`, `GlassAnalysisOutput`). Additionally, the structure supports administrative features through definitions for errors, organization folders, plan limits, and user management, indicating a comprehensive system for both technical computations and business logic.
Files
- AnalysisOptions.cs
This file defines configuration settings for the GlassHopper application within the `GlassHopper.Definitions` namespace. It introduces an enumeration, `TypeOfThicknesses`, which categorizes thickness standards into Nominal, Minimum European, and Minimum American options using descriptive attributes. The core component is the `AnalysisOptions` class, which serves as a data container for user preferences regarding units, thickness types, color maps, and deflection limits. Each property in this class defaults to specific values like Metric units, Nominal thickness, and the Viridis color theme via its constructor. This structure centralizes analysis parameters, allowing the application to consistently manage input configurations across different components.
- AuthAccount.cs
`AuthAccount.cs` is a C# data model class designed to manage user authentication state within the GlassHopper application. It stores critical security and context data, including an API token, its expiration time, the authentication method used, and the user's associated organizations. The class tracks both a list of all linked organizations and a specific `CurrentOrganization` to define the active organizational context. It provides utility methods like `Clear()` to reset credentials upon logout or failure, and validation checks (`IsAuthenticated`, `IsValid`) to verify session integrity and permissions. This structure ensures that the application can reliably determine if a user is logged in and has the necessary context to perform actions.
- DisplacementResult.cs
`DisplacementResult.cs` is a C# data structure within the `GlassHopper.Definitions` namespace designed to encapsulate structural analysis results for glass panes. It stores key metrics such as maximum and allowable displacement, a weight ratio (`Wr`), and the specific 3D position where these values occur. The class also tracks identification indices for the associated package and pane, along with a descriptive combo name. It provides two constructors—one defaulting to empty states and another accepting all parameters—and overrides `ToString()` for concise, formatted logging of these engineering values.
- ExecutionStatus.cs
This file defines an enumeration named `ExecutionStatus` within the `GlassHopper.Definitions` namespace. It serves to categorize the state values for execution processes, specifically representing four distinct states: IDLE, RUNNING, WAITING, and READY. Each enum member is explicitly assigned an integer value from 0 to 3, ensuring consistent serialization or database mapping. This structure allows other parts of the application to use these symbolic names instead of raw integers for better code readability. The component is minimal and strictly typed, acting as a foundational data definition for system status tracking.
- GH_Restraint.cs
This file defines a Grasshopper component (`GH_Restraint`) that visualizes structural geometry restraints within the Rhino viewport. It implements the `IGH_PreviewData` interface to render visual indicators, drawing red, green, or blue arrows for fixed degrees of freedom and spring-like zigzag lines for elastic supports. The component handles unit conversions between millimeters and Rhino units using a helper converter and manages coordinate system transformations via standard Grasshopper methods like `Transform` and `Morph`. Key internal components include a local `DrawSpring` method for rendering stiffness elements and property overrides for bounding box calculation and data duplication. Ultimately, it serves as a visual feedback tool for users to inspect boundary conditions in structural analysis models.
- GlassJobReference.cs
This file defines a `GlassJobReference` struct within the `GlassHopper.Definitions` namespace, serving as a lightweight wrapper for a job identifier. Its primary purpose is to encapsulate a unique `Guid` (`JobId`) while ensuring value-based equality semantics rather than reference equality. Key components include implementations of `IEquatable`, `Equals`, and `GetHashCode` to guarantee consistent comparison behavior across different instances with the same ID. It also overrides `ToString()` for readable debugging output and defines custom `==` and `!=` operators to align with the equality logic. This pattern prevents common pitfalls in .NET where reference types are compared by identity instead of value.
- LaodCaseNames.cs
This file defines a C# class named `LaodCaseNames` within the `GlassHopper.Definitions` namespace, serving as a centralized repository for load case identifiers. It consists entirely of public constant string fields that map descriptive names to specific engineering load types, such as wind pressure, snow, and temperature variations. The key components are these immutable string constants, which ensure consistent naming conventions across the application by avoiding hardcoded literals in business logic. This approach enhances code maintainability and readability by providing a single source of truth for load case labels used in structural analysis or simulation contexts.
- LoginUserRequest.cs
This file defines a simple C# class named `LoginUserRequest` within the `GlassHopper.Definitions` namespace. It serves as a data transfer object (DTO) to encapsulate user credentials for authentication purposes. The key components are two public string fields, `Email` and `Password`, both initialized with empty strings by default. This structure is typically used in API requests or form submissions to validate user login information. Its minimal design suggests it is intended for straightforward input binding in a web or application framework.
- OrganizationFolderReference.cs
This file defines a lightweight, immutable reference class named `OrganizationFolderReference that represents an organization folder within the GlassHopper application. It encapsulates a unique identifier (Guid) and a name, initializing them via primary constructor parameters in C#. The class implements value-based equality by overriding `Equals`, `GetHashCode`, and equality operators to ensure correct comparison behavior in collections like dictionaries or hash sets. Additionally, it provides a custom `ToString` representation for easy debugging and logging. This design ensures consistent identity management for folder references throughout the system.
- ReferenceTemperatures.cs
This C# class, `ReferenceTemperatures`, serves as a data structure for storing seasonal temperature thresholds within the GlassHopper application. It defines three public properties—`WinterTemperature`, `SummerTemperature`, and `NoSeasonTemperature`—to represent specific thermal reference points. The class provides two constructors: a parameterless one that initializes default values (10°C, 35°C, and 20°C), and a parameterized one allowing custom float assignments via double inputs. A key feature is its overridden `ToString()` method, which dynamically formats these values with the appropriate unit symbol (°C or °F) based on the current system settings retrieved from `UnitsComponent`. This design ensures consistent data representation while supporting both metric and imperial display contexts.
- StressesResult.cs
`StressesResult.cs` is a C# data transfer object within the `GlassHopper.Definitions` namespace, designed to encapsulate structural analysis outcomes for finite element models. It stores key metrics such as maximum stress, material resistance, and a warping ratio (`Wr`), alongside geometric context like position, side, and boundary status. The class links these results to specific model elements using indices for packages and panes, along with a descriptive combo name. It includes both parameterless and full-parameter constructors for flexible instantiation, initializing default values in the former. A custom `ToString()` method provides a formatted string summary of the result, aiding in debugging or logging. This component serves as a lightweight container for passing detailed stress analysis data between different layers of an engineering software architecture.