|
Ocean
|
This class implements utility functions for the rendering library. More...
#include <Utilities.h>
Static Public Member Functions | |
| static TransformRef | createBox (const EngineRef &engine, const Vector3 &dimension, BoxRef *box=nullptr, AttributeSetRef *attributeSet=nullptr, GeometryRef *geometry=nullptr) |
| Returns a Transform object holding a visible box, no material is applied. | |
| static TransformRef | createBox (const EngineRef &engine, const Vector3 &dimension, const RGBAColor &color, BoxRef *box=nullptr, AttributeSetRef *attributeSet=nullptr, MaterialRef *material=nullptr, GeometryRef *geometry=nullptr) |
| Returns a Transform object holding a visible box, further a material is applied. | |
| static TransformRef | createBox (const EngineRef &engine, const Vector3 &dimension, const Media::FrameMediumRef textureMedium, MediaTexture2DRef *texture=nullptr, const bool createMipmaps=true, AttributeSetRef *attributeSet=nullptr, GeometryRef *geometry=nullptr, const RGBAColor *color=nullptr) |
| Returns a Transform object holding a visible box, further a texture is applied. | |
| static TransformRef | createBox (const EngineRef &engine, const Vector3 &dimension, Frame &&frame, FrameTexture2DRef *texture=nullptr, const bool createMipmaps=true, AttributeSetRef *attributeSet=nullptr, GeometryRef *geometry=nullptr, const RGBAColor *color=nullptr) |
| Returns a Transform object holding a visible box, further a texture is applied. | |
| static TransformRef | createSphere (const EngineRef &engine, const Scalar radius, SphereRef *sphere=nullptr, AttributeSetRef *attributeSet=nullptr, GeometryRef *geometry=nullptr) |
| Returns a Transform object holding a visible sphere, no material is applied. | |
| static TransformRef | createSphere (const EngineRef &engine, const Scalar radius, const RGBAColor &color, SphereRef *sphere=nullptr, AttributeSetRef *attributeSet=nullptr, MaterialRef *material=nullptr, GeometryRef *geometry=nullptr) |
| Returns a Transform object holding a visible sphere, further a material is applied. | |
| static TransformRef | createSphere (const EngineRef &engine, const Scalar radius, Frame &&frame, FrameTexture2DRef *texture=nullptr, const bool createMipmaps=true, AttributeSetRef *attributeSet=nullptr, GeometryRef *geometry=nullptr, const RGBAColor *color=nullptr) |
| Returns a Transform object holding a visible sphere, further a texture is applied. | |
| static TransformRef | createCylinder (const EngineRef &engine, const Scalar radius, const Scalar height, const RGBAColor &color, CylinderRef *cylinder=nullptr, AttributeSetRef *attributeSet=nullptr, MaterialRef *material=nullptr, GeometryRef *geometry=nullptr) |
| Returns a Transform object holding a visible cylinder, further a material is applied. | |
| static TransformRef | createCone (const EngineRef &engine, const Scalar radius, const Scalar height, const RGBAColor &color, ConeRef *cone=nullptr, AttributeSetRef *attributeSet=nullptr, MaterialRef *material=nullptr, GeometryRef *geometry=nullptr) |
| Returns a Transform object holding a visible cone, further a material is applied. | |
| static TransformRef | createCoordinateSystem (const EngineRef &engine, const Scalar length, const Scalar topLength, const Scalar radius) |
| Returns a Transform object holding a visible coordinate system rendered as cylinders with cones. | |
| static TransformRef | createCoordinateSystems (const Engine &engine, const HomogenousMatrices4 &world_T_coordinateSystems, const Scalar length, VertexSetRef *vertexSet=nullptr) |
| Returns a Transform object holding several individual visible coordinate system rendered as thin lines. | |
| static bool | updateOrCreateCoordinateSystems (const Engine &engine, const HomogenousMatrices4 &world_T_coordinateSystems, const Scalar length, TransformRef &transform, VertexSetRef &vertexSet) |
| Creates or updates line-based coordinate system visualizations. | |
| static bool | updateOrCreateCoordinateSystem (const Engine &engine, const HomogenousMatrix4 &world_T_coordinateSystem, const Scalar length, TransformRef &transform, VertexSetRef &vertexSet) |
| Creates or updates a line-based coordinate system visualization for a single coordinate system. | |
| static TransformRef | createArrow (const EngineRef &engine, const Scalar length, const Scalar topLength, const Scalar radius, const RGBAColor &color) |
| Returns an arrow with specified length and radius. | |
| static TransformRef | createMesh (const EngineRef &engine, const Vectors3 &vertices, const TriangleFaces &triangleFaces, const RGBAColor &color, const Normals &normals=Normals(), const TextureCoordinates &textureCoordinates=TextureCoordinates(), Frame &&textureFrame=Frame(), const Media::FrameMediumRef &textureMedium=Media::FrameMediumRef(), AttributeSetRef *attributeSet=nullptr, GeometryRef *geometry=nullptr, VertexSetRef *vertexSet=nullptr, Texture2DRef *texture=nullptr) |
| Returns a mesh by a given set of vertices and their corresponding triangulation. | |
| static TransformRef | createTexturedPlane (const EngineRef &engine, const Scalar width, const Scalar height, const Media::FrameMediumRef textureMedium, MediaTexture2DRef *texture=nullptr, const bool createMipmaps=true, AttributeSetRef *attributeSet=nullptr, GeometryRef *geometry=nullptr) |
| Returns a textured plane with z-axis a normal. | |
| static TransformRef | createPanel (const EngineRef &engine, const Scalar xDimension, Frame &&frame, const Scalar yDimension=0, const bool bothSides=false, FrameTexture2DRef *texture=nullptr, const bool createMipmaps=true, AttributeSetRef *attributeSet=nullptr, GeometryRef *geometry=nullptr, const RGBAColor *color=nullptr) |
| Returns a Transform object holding a flat 2D panel (a rectangle) with specified dimension. | |
| static TransformRef | createText (const Engine &engine, const std::string &textString, const RGBAColor &foregroundColor, const RGBAColor &backgroundColor, const bool shaded, const Scalar fixedWidth, const Scalar fixedHeight, const Scalar fixedLineHeight, const Text::AlignmentMode alignmentMode=Text::AM_LEFT, const Text::HorizontalAnchor horizontalAnchor=Text::HA_LEFT, const Text::VerticalAnchor verticalAnchor=Text::VA_TOP, const std::string &fontFamily=std::string(), const std::string &styleName=std::string(), TextRef *text=nullptr, MaterialRef *foregroundMaterial=nullptr, MaterialRef *backgroundMaterial=nullptr) |
| Returns a planar text within the x,y plane. | |
| static TransformRef | createPoints (const Engine &engine, const Vectors3 &vertices, const RGBAColor &emissiveColor, const Scalar pointSize=Scalar(5), const RGBAColors &colorsPerVertex=RGBAColors(), MaterialRef *material=nullptr, AttributeSetRef *attributeSet=nullptr, PointsRef *points=nullptr, VertexSetRef *vertexSet=nullptr) |
| Returns a Transform holding a geometry with points. | |
| static TransformRef | createLines (const Engine &engine, const Vectors3 &vertices, const VertexIndexGroups &lineIndexGroups, const RGBAColor &emissiveColor, const Scalar lineWidth=Scalar(1), const RGBAColors &colorsPerVertex=RGBAColors(), MaterialRef *material=nullptr, AttributeSetRef *attributeSet=nullptr, LineStripsRef *lineStrips=nullptr, VertexSetRef *vertexSet=nullptr) |
| Returns a Transform holding a geometry with lines. | |
| static TransformRef | createLines (const Engine &engine, const Vectors3 &vertices, const TriangleFaces &triangleFaces, const RGBAColor &emissiveColor, const Scalar lineWidth=Scalar(1), const RGBAColors &colorsPerVertex=RGBAColors(), MaterialRef *material=nullptr, AttributeSetRef *attributeSet=nullptr, LinesRef *lines=nullptr, VertexSetRef *vertexSet=nullptr) |
| Returns a Transform holding a geometry with lines (a wireframe of a mesh). | |
| static TransformRef | createLines (const Engine &engine, const Vector3 *points, const Vector3 *normals, const size_t size, const Scalar scale, const RGBAColor &emissiveColor, const Scalar lineWidth=Scalar(1), MaterialRef *material=nullptr, VertexSetRef *vertexSet=nullptr) |
| Returns a Transform holding a geometry with lines (normals for given points). | |
| static AttributeSetRef | findAttributeSet (const NodeRef &node) |
| Returns the first attribute set object that is located in a given node tree. | |
Static Protected Member Functions | |
| static uint64_t | makeSortedIndex64 (const uint32_t indexA, const uint32_t indexB) |
| Returns a 64-bit index based on two 32-bit indices. | |
This class implements utility functions for the rendering library.
|
static |
Returns an arrow with specified length and radius.
| engine | Rendering engine to be used |
| length | The length of the arrow, with range [0, infinity) |
| topLength | Length of the arrow top, with range [0, infinity) |
| radius | of the arrow, with range [0, infinity) |
| color | The color to be applied, must be valid |
|
static |
Returns a Transform object holding a visible box, no material is applied.
| engine | Rendering engine to be used |
| dimension | The dimension of the box in x, y and z direction, with range [0, infinity)x[0, infinity)x[0, infinity) |
| box | Optional resulting box object which is attached with the geometry |
| attributeSet | Optional resulting AttributeSet object which is attached with the geometry |
| geometry | Optional resulting geometry object which is encapsulating the 3D object |
|
static |
Returns a Transform object holding a visible box, further a texture is applied.
| engine | Rendering engine to be used |
| dimension | The dimension of the box in x, y and z direction |
| textureMedium | The frame medium which is used for the texture |
| texture | Optional resulting texture object which is attached with the resulting box |
| createMipmaps | True, to create a texture with mipmaps; False, to create a texture without mipmaps |
| attributeSet | Optional resulting AttributeSet object which is attached with the geometry |
| geometry | Optional resulting geometry object which is encapsulating the 3D object |
| color | Optional color to be used, nullptr to create a box without material |
|
static |
Returns a Transform object holding a visible box, further a material is applied.
| engine | Rendering engine to be used |
| dimension | The dimension of the box in x, y and z direction |
| color | Diffuse color to be used |
| box | Optional resulting box object which is attached with the geometry |
| attributeSet | Optional resulting AttributeSet object which is attached with the geometry |
| material | Optional resulting material object which is attached with the resulting box |
| geometry | Optional resulting geometry object which is encapsulating the 3D object |
|
static |
Returns a Transform object holding a visible box, further a texture is applied.
| engine | Rendering engine to be used |
| dimension | The dimension of the box in x, y and z direction |
| frame | The frame which is used for the texture, must own the image memory, must be valid |
| texture | Optional resulting texture object which is attached with the resulting box |
| createMipmaps | True, to create a texture with mipmaps; False, to create a texture without mipmaps |
| attributeSet | Optional resulting AttributeSet object which is attached with the geometry |
| geometry | Optional resulting geometry object which is encapsulating the 3D object |
| color | Optional color to be used, nullptr to create a box without material |
|
static |
Returns a Transform object holding a visible cone, further a material is applied.
| engine | Rendering engine to be used |
| radius | The radius of the cone, with range (0, infinity) |
| height | The height of the cone, with range (0, infinity) |
| color | Diffuse color to be used |
| cone | Optional resulting cone object which is attached with the geometry |
| attributeSet | Optional resulting AttributeSet object which is attached with the geometry |
| material | Optional resulting material object which is attached with the geometry |
| geometry | Optional resulting geometry object which is encapsulating the 3D object |
|
static |
Returns a Transform object holding a visible coordinate system rendered as cylinders with cones.
| engine | Rendering engine to be used |
| length | The length of the arrow, with range (0, infinity) |
| topLength | Length of the arrow top, with range (0, infinity) |
| radius | of the arrow, with range (0, infinity) |
|
static |
Returns a Transform object holding several individual visible coordinate system rendered as thin lines.
| engine | Rendering engine to be used |
| world_T_coordinateSystems | The individual coordinate systems, at least one |
| length | The length of each axis, with range (0, infinity) |
| vertexSet | Optional result vertex set object which holds the vertices of the 3D object, six vertices for each coordinate system, with order (origin, x-axis, origin, y-axis, origin, z-axis) |
|
static |
Returns a Transform object holding a visible cylinder, further a material is applied.
| engine | Rendering engine to be used |
| radius | The radius of the cylinder, with range (0, infinity) |
| height | The height of the cylinder, with range (0, infinity) |
| color | Diffuse color to be used |
| cylinder | Optional resulting cylinder object which is attached with the geometry |
| attributeSet | Optional resulting AttributeSet object which is attached with the geometry |
| material | Optional resulting material object which is attached with the geometry |
| geometry | Optional resulting geometry object which is encapsulating the 3D object |
|
static |
Returns a Transform holding a geometry with lines (normals for given points).
| engine | Rendering engine to be used |
| points | The starting points where the normals will start, at least one |
| normals | The normal vectors, one for each point |
| size | The number of points (and normals), with range [1, infinity) |
| scale | The scale which will be applied to each normal (allowing to control the length of the normals), with range (-infinity, infinity) |
| emissiveColor | The emissiveColor of all normals, can be transparent |
| lineWidth | The width of the lines in pixels, with range [1, infinity) |
| material | Optional resulting Material node |
| vertexSet | Optional result vertex set object which holds the vertices of the 3D normals, two vertices for each normal |
|
static |
Returns a Transform holding a geometry with lines (a wireframe of a mesh).
| engine | The rendering engine to be used |
| vertices | The vertices of all points to be rendered, at least one |
| triangleFaces | The indices of triangle vertices for which lines will be created, at least one |
| emissiveColor | The emissiveColor of all vertices in case 'colorsPerVertex' is empty, can be transparent |
| lineWidth | The width of the lines in pixels, with range [1, infinity) |
| colorsPerVertex | The optional colors of the individual vertices, one for each vertex or empty to use the 'emissiveColor' |
| material | Optional resulting Material node; will be invalid if colorPerVertex is not empty |
| attributeSet | Optional resulting AttributeSet node |
| lines | Optional resulting Lines node |
| vertexSet | Optional resulting VertexSet node |
|
static |
Returns a Transform holding a geometry with lines.
| engine | The rendering engine to be used |
| vertices | The vertices of all points to be rendered, at least one |
| lineIndexGroups | The group of vertex indices defining several individual lines, at least one |
| emissiveColor | The emissiveColor of all vertices in case 'colorsPerVertex' is empty, can be transparent |
| lineWidth | The width of the lines in pixels, with range [1, infinity) |
| colorsPerVertex | The optional colors of the individual vertices, one for each vertex or empty to use the 'emissiveColor' |
| material | Optional resulting Material node; will be invalid if colorPerVertex is not empty |
| attributeSet | Optional resulting AttributeSet node |
| lineStrips | Optional resulting LineStrips node |
| vertexSet | Optional resulting VertexSet node |
|
static |
Returns a mesh by a given set of vertices and their corresponding triangulation.
| engine | Rendering engine to be used |
| vertices | The vertices defining the mesh |
| triangleFaces | Triangulation defining the topology |
| color | The color to be applied to the entire mesh, invalid to create an unlit mesh |
| normals | Optional normals of each vertex |
| textureCoordinates | Optional texture coordinates, one for each given vertex |
| textureFrame | Optional frame to be used as texture, most be owner of the memory if provided, invalid to use no texture or to use the textureMedium instead |
| textureMedium | Optional texture medium, invalid to use no texture or to use the textureFrame instead |
| attributeSet | Optional resulting AttributeSet object which is attached with the geometry |
| geometry | Optional resulting geometry object which is encapsulating the 3D object |
| vertexSet | Optional result vertex set object which holds the vertices of the 3D object |
| texture | Optional resulting texture object |
|
static |
Returns a Transform object holding a flat 2D panel (a rectangle) with specified dimension.
The resulting panel's normal is the z-axis, the panel is located in the x,y plane.
| engine | Rendering engine to be used |
| xDimension | The dimension of the panel in x direction, with range (0, infinity) |
| frame | The frame which is used for the texture, must own the image memory, must be valid |
| yDimension | The dimension of the panel in y direction, with range (0, infinity), of 0 to automatically determine the dimension based on the frame's resolution |
| bothSides | True, to render the panel on the backside as well; False, to render the panel only on the front side |
| texture | Optional resulting texture object which is attached with the resulting panle |
| createMipmaps | True, to create a texture with mipmaps; False, to create a texture without mipmaps |
| attributeSet | Optional resulting AttributeSet object which is attached with the geometry |
| geometry | Optional resulting geometry object which is encapsulating the 3D object |
| color | Optional color to be used, nullptr to create a box without material |
|
static |
Returns a Transform holding a geometry with points.
| engine | The rendering engine to be used |
| vertices | The vertices of all points to be rendered, at least one |
| emissiveColor | The emissiveColor of all vertices in case 'colorsPerVertex' is empty, can be transparent |
| pointSize | The size of the points, with range [1, infinity) |
| colorsPerVertex | The optional colors of the individual vertices, one for each vertex or empty to use the 'emissiveColor' |
| material | Optional resulting Material node; will be invalid if colorPerVertex is not empty |
| attributeSet | Optional resulting AttributeSet node |
| points | Optional resulting Points node |
| vertexSet | Optional resulting VertexSet node |
|
static |
Returns a Transform object holding a visible sphere, further a material is applied.
| engine | Rendering engine to be used |
| radius | The radius of the sphere, with range [0, infinity) |
| color | Diffuse color to be used |
| sphere | Optional resulting sphere object which is attached with the geometry |
| attributeSet | Optional resulting AttributeSet object which is attached with the geometry |
| material | Optional resulting material object which is attached with the geometry |
| geometry | Optional resulting geometry object which is encapsulating the 3D object |
|
static |
Returns a Transform object holding a visible sphere, further a texture is applied.
| engine | Rendering engine to be used |
| radius | The radius of the sphere, with range [0, infinity) |
| frame | The frame which is used for the texture, must own the image memory, must be valid |
| texture | Optional resulting texture object which is attached with the resulting sphere |
| createMipmaps | True, to create a texture with mipmaps; False, to create a texture without mipmaps |
| attributeSet | Optional resulting AttributeSet object which is attached with the geometry |
| geometry | Optional resulting geometry object which is encapsulating the 3D object |
| color | Optional color to be used, nullptr to create a sphere without material |
|
static |
Returns a Transform object holding a visible sphere, no material is applied.
| engine | Rendering engine to be used |
| radius | The radius of the sphere, with range [0, infinity) |
| sphere | Optional resulting sphere object which is attached with the geometry |
| attributeSet | Optional resulting AttributeSet object which is attached with the geometry |
| geometry | Optional resulting geometry object which is encapsulating the 3D object |
|
static |
Returns a planar text within the x,y plane.
| engine | The rendering engine to be used |
| textString | The actual text to show |
| foregroundColor | The foreground color to be used |
| backgroundColor | The background color to be used, a transparent color to create a text without background |
| shaded | True, to create a text with shading/lighting; False, to create a text constant color |
| fixedWidth | The optional fixed width, with range [0, infinity) |
| fixedHeight | The optional fixed height, with range [0, infinity) |
| fixedLineHeight | The optional fixed line height, with range [0, infinity) |
| alignmentMode | The text's alignment mode |
| horizontalAnchor | The text's horizontal anchor |
| verticalAnchor | The text's vertical anchor |
| fontFamily | The font family to be used, empty to use a default font family |
| styleName | The font style to be used, empty to use the default font style |
| text | Optional resulting text node which will be part of the resulting Transform node, nullptr of not of interest |
| foregroundMaterial | Optional resulting foreground material of the new text, nullptr if not of interest |
| backgroundMaterial | Optional resulting background material of the new text, nullptr if not of interest |
|
static |
Returns a textured plane with z-axis a normal.
| engine | Rendering engine to be used, must be valid |
| width | The width of the plane in object domain (the size of the plane in x-direction), with range (0, infinity) |
| height | The height of the plane in object domain (the size of the plane, in y-direction), with range (0, infinity) |
| textureMedium | The frame medium which is used for the texture |
| texture | Optional resulting texture object which is attached with the resulting box |
| createMipmaps | True, to create a texture with mipmaps; False, to create a texture without mipmaps |
| attributeSet | Optional resulting AttributeSet object which is attached with the geometry |
| geometry | Optional resulting geometry object which is encapsulating the 3D object |
|
static |
Returns the first attribute set object that is located in a given node tree.
| node | The node defining the root of the tree in that the attribute set is located |
|
inlinestaticprotected |
Returns a 64-bit index based on two 32-bit indices.
| indexA | The first 32-bit index |
| indexB | The second 32-bit index |
|
static |
Creates or updates a line-based coordinate system visualization for a single coordinate system.
This overload avoids the overhead of wrapping a single matrix into a vector, making it suitable for per-frame updates. On the first call (when transform is null), the coordinate system is created via createCoordinateSystems(). On subsequent calls, only the vertex positions on the existing VertexSet are updated for efficiency.
| engine | The rendering engine, must be valid |
| world_T_coordinateSystem | The transformation defining the coordinate system, must be valid |
| length | The length of each axis in meters, with range (0, infinity) |
| transform | The Transform node; will be created if null, must be valid after the first call |
| vertexSet | The VertexSet node; will be created if null, must be valid after the first call |
|
static |
Creates or updates line-based coordinate system visualizations.
On the first call (when transform is null), coordinate systems are created via createCoordinateSystems(). On subsequent calls, only the vertex positions on the existing VertexSet are updated for efficiency.
| engine | The rendering engine, must be valid |
| world_T_coordinateSystems | The transformations defining the coordinate systems, must not be empty |
| length | The length of each axis in meters, with range (0, infinity) |
| transform | The Transform node; will be created if null, must be valid after the first call |
| vertexSet | The VertexSet node; will be created if null, must be valid after the first call |