diff --git a/docs/src/Introduction/04-How-to-use-rayx-ui.md b/docs/src/Introduction/04-How-to-use-rayx-ui.md index 038eccbfd..1509a715e 100644 --- a/docs/src/Introduction/04-How-to-use-rayx-ui.md +++ b/docs/src/Introduction/04-How-to-use-rayx-ui.md @@ -2,7 +2,7 @@ ## Interface -![Alt text](../../res/RAYX-UI.png) +![Alt text](../res/RAYX-UI.png) Th window in the image above is accessible in the RAYX-UI application once it's opened. The window provides additional options for adjusting the scene you're viewing. Most notably, the "Open File Dialog" button (indicated by a red arrow) opens a file dialog that allows you to load your .rml beamline file. Currently, the application expects the h5 file (RAYX output) to be located next to it. In the future, tracing functionality will be directly integrated into the interface. @@ -21,6 +21,6 @@ In the visual representation, various colors are used to indicate specific condi - **Just Hit**: Rays that have just hit an element are represented in a yellow to orange gradient. - **Absorbed**: Rays that are absorbed by an element are depicted in red. -- **Fly Off**: Rays that fly off into space are shown in grey. +- **Other**: Rays created from other events are white (this most likely indicates an issue in the tracing) **Optical Elements**: Optical elements like slits or image planes are displayed in varying shades of blue, with the color gradient used to represent surface orientation. diff --git a/docs/src/Introduction/06-Style-Guide.md b/docs/src/Introduction/06-Style-Guide.md index efc661f4d..2f23f7968 100644 --- a/docs/src/Introduction/06-Style-Guide.md +++ b/docs/src/Introduction/06-Style-Guide.md @@ -7,11 +7,11 @@ This document serves as a comprehensive style guide for the RAY project. It outl Write code with collective ownership in mind; the primary audience is your teammates, not just the compiler. The KISS (Keep It Stupid Simple) principle should be applied whenever possible. ## Includes -To enhance readability, includes should be categorized as follows:: +To enhance readability, includes should be categorized as follows: -`#include "internalHeader.h"` +- `#include "internalHeader.h"` -`#include ` +- `#include ` Internal headers are those developed within the project, while external headers pertain to dependencies integrated into the project. @@ -34,9 +34,9 @@ Prioritize frequent and precise commenting. Comments should be tailored to newco The objective is for header files to provide high-level documentation on API usage, while source files should contain more detailed documentation about implementation specifics. -## Naming scheme +## Naming Conventions -As longer names can contain more than one word, it can help to have a visual divider. In the case of Ray-UI we use "camelCase" and "PascalCase". When to use what, will be in the next section. +As longer names can contain more than one word, it can help to have a visual divider. In the case of Ray-UI we use "camelCase" and "PascalCase". When to use what, will be explained in the "Classes, Function and Variables" subsection. The upper case letter indicates a new word and thus improves readability. Every name should be able to stand alone and describe the object, function or variable. Something like "int v;" does not achieve this. This also means to avoid using abbreviations, besides the most common ones ("val" for "value" or "dx" for a distance over x). @@ -50,9 +50,9 @@ Should the name get too long or cryptic, write a comment to clarify what you mea ### Boolean -All Boolean values should begin with is/can/has/etc. when possible. +Boolean values should begin with is/can/has/etc. when possible. -## Classes, Function and Variables +### Classes, Function and Variables Class and object names are written in "PascalCase". Functions and Variables are written in "camelCase". @@ -61,30 +61,29 @@ e.g.: - "ClassA" - "functionB(int valueC, bool isD)" -## Member +### Member Member objects and variables of a class are indicated by an "m_", e.g. : - m_MemberObject - m_memberVariable -## Static - -A static variable or object is indicated by an "s_", e.g. : - -- s_StaticObject -- s_staticVariable - - - ## Const Correctness -Const correctness is the practice of using the `const` keyword to ensure that objects and variables remain immutable. +Const correctness is the practice of using the `const` keyword to ensure that objects and variables remain immutable. Use `const` as the default. One exception: function parameters of trivial data types like `int`, `double`, etc. 1. `void f1(const std::string& s); ` *// Pass by reference-to-`const`* 2. `void f2(const std::string* sptr); ` *// Pass by pointer-to-`const`* 3. `void f3(std::string s); ` *// Pass by value* -Employing const correctness from the project's inception is advisable, as it can simplify code maintenance and improve overall code quality. +Employing const correctness from the start is advisable, as it can simplify code maintenance and improve overall code quality. + +Further reading on const correctness is highly recommended and can be found [here](https://isocpp.org/wiki/faq/const-correctness). + +## Pointer Usage Guidelines +Raw pointers are discouraged except when interfacing with APIs that require them. Following are alternatives to raw pointers for specific use-cases. -Further reading on const correctness is highly recommended and can be found [here](https://isocpp.org/wiki/faq/const-correctness). \ No newline at end of file +- **Smart Pointers**: Use `std::unique_ptr` and `std::shared_ptr` for managing dynamic memory. +- **Optionality with `std::optional`**: Utilize `std::optional` for optional parameters or return types to explicitly indicate the absence of a value. +- **Const C-Strings**: Raw C-strings (`const char*`) are acceptable only when necessary for compatibility with C APIs. Ensure they are `const` to prevent modification. +- **Optimize Strings with `std::string_view`**: For performance-critical code, use `std::string_view` to pass strings by reference without ownership or copy. diff --git a/docs/src/Introduction/07-Literature.md b/docs/src/Introduction/07-Literature.md index 046f5ab51..6fc7d0267 100644 --- a/docs/src/Introduction/07-Literature.md +++ b/docs/src/Introduction/07-Literature.md @@ -1,5 +1,5 @@ # Literature -## Bachelor's Thesis +## Bachelor's Thesis' [Extending_and_Accelerating_a_GPU_Ray_Tracing_Algorithm_for_Photon_Simulation_in_Beamlines_ohne.pdf](/docs/src/res/Extending_and_Accelerating_a_GPU_Ray_Tracing_Algorithm_for_Photon_Simulation_in_Beamlines_ohne.pdf) \ No newline at end of file diff --git a/docs/src/Model/PRNGs-on-the-GPU.md b/docs/src/Model/PRNGs-on-the-GPU.md index 034e76d7e..9a84be83d 100644 --- a/docs/src/Model/PRNGs-on-the-GPU.md +++ b/docs/src/Model/PRNGs-on-the-GPU.md @@ -1,15 +1,15 @@ # Pseudo Random Number Generators (PRNGs) on the GPU -For RAYX we looked a little to to find a good and performant pseudo random number generator. We decided to use Squares RNG, which is counter based and utilizes a version of the Middle Square Weyl Sequence. We tested the method with the TestU01 bigcrush test with different seeds and it passed all of them. +For RAYX we found a good and performant pseudo random number generator after some research. We cannot use default C++ options as they are not supported by our Shader code. We decided to use Squares RNG, which is counter based and utilizes a version of the Middle Square Weyl Sequence. We tested the method with the TestU01 bigcrush test with different seeds and it passed all of them. -[Squares: A Fast Counter-Based RNG](https://arxiv.org/pdf/2004.06278.pdf) - -[TestU01: A C Library for Empirical Testing of -Random Number Generators](https://www.iro.umontreal.ca/~lecuyer/myftp/papers/testu01.pdf) We added a few more methods for creating random numbers with more variety. These methods are: - `uint64_t squares64RNG(inout uint64_t ctr)`, which generates 64-Bit random integers from two 32-Bit random integers - `double squaresDoubleRNG(inout uint64_t ctr)`, which generates uniformly distributed doubles between 0 and 1 from one 64-Bit random integer - `double squaresNormalRNG(inout uint64_t ctr, double mu, double sigma)`, which creates (via the Box-Muller transform) a normal distributed double with mean `mu` and standard deviation `sigma`. This takes three random doulbes, which takes six 32-Bit integers. -[Box–Muller transform](https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform?oldformat=true) \ No newline at end of file +## Links +- [Squares: A Fast Counter-Based RNG](https://arxiv.org/pdf/2004.06278.pdf) +- [TestU01: A C Library for Empirical Testing of +Random Number Generators](https://www.iro.umontreal.ca/~lecuyer/myftp/papers/testu01.pdf) +- [Box–Muller transform](https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform?oldformat=true) \ No newline at end of file diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index a64d700ed..bd0b7b6c2 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -11,6 +11,9 @@ - [Model](./Model/Model.md) - [Optical Elements](./Model/OpticalElements/OpticalElements.md) + - [Light Sources](./Model/OpticalElements/LightSources.md) + - [Simple Undulator Source](./Model/OpticalElements/SimpleUndulatorSource.md) + - [Dipole Source](./Model/OpticalElements/DipoleSource.md) - [Reflection Zone Plate (RZP)](./Model/OpticalElements/RZP.md) - [User vs Model Parameter](./Model/User-vs-Model-Parameter.md) - [Ray generation](./Model/Ray-generation.md) diff --git a/docs/src/res/RAYX-UI.png b/docs/src/res/RAYX-UI.png index 25f0874a3..a9a2032c3 100644 Binary files a/docs/src/res/RAYX-UI.png and b/docs/src/res/RAYX-UI.png differ