8 #ifndef META_OCEAN_RENDERING_UTILITIES_H
9 #define META_OCEAN_RENDERING_UTILITIES_H
206 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);
241 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);
320 static inline uint64_t makeSortedIndex64(
const uint32_t indexA,
const uint32_t indexB);
327 return uint64_t(indexA) | (uint64_t(indexB) << 32ull);
330 return uint64_t(indexB) | (uint64_t(indexA) << 32ull);
This class implements Ocean's image class.
Definition: Frame.h:1792
This class implements a color defined by red, green, blue and alpha parameters.
Definition: RGBAColor.h:41
This class is the base class for all rendering engines like.
Definition: Engine.h:46
This class implements a smart rendering object reference.
Definition: rendering/ObjectRef.h:34
HorizontalAnchor
Definition of individual horizontal anchor points for the entire text block.
Definition: rendering/Text.h:94
@ HA_LEFT
The text block is anchored at the left edge.
Definition: rendering/Text.h:106
AlignmentMode
Definition of individual alignment modes within the text block.
Definition: rendering/Text.h:46
@ AM_LEFT
The text is aligned to the left of the text block.
Definition: rendering/Text.h:59
VerticalAnchor
Definition of individual vertical anchor points for the entire text block.
Definition: rendering/Text.h:139
@ VA_TOP
The text block is anchored at the top edge.
Definition: rendering/Text.h:141
This class implements utility functions for the rendering library.
Definition: rendering/Utilities.h:47
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 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 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 uint64_t makeSortedIndex64(const uint32_t indexA, const uint32_t indexB)
Returns a 64-bit index based on two 32-bit indices.
Definition: rendering/Utilities.h:323
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 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 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 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, 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 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 line...
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 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 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 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 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 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 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 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 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 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 AttributeSetRef findAttributeSet(const NodeRef &node)
Returns the first attribute set object that is located in a given node tree.
std::vector< RGBAColor > RGBAColors
Definition of a vector holding rgba color objects.
Definition: RGBAColor.h:21
float Scalar
Definition of a scalar type.
Definition: Math.h:128
std::vector< HomogenousMatrix4 > HomogenousMatrices4
Definition of a vector holding HomogenousMatrix4 objects.
Definition: HomogenousMatrix4.h:73
std::vector< Vector3 > Vectors3
Definition of a vector holding Vector3 objects.
Definition: Vector3.h:65
std::vector< TextureCoordinate > TextureCoordinates
Definition of a vector holding texture coordinates.
Definition: rendering/Rendering.h:113
std::vector< Normal > Normals
Definition of a vector holding normals.
Definition: rendering/Rendering.h:107
std::vector< TriangleFace > TriangleFaces
Definition of a vector holding triangle faces.
Definition: TriangleFace.h:23
std::vector< VertexIndices > VertexIndexGroups
Definition of a vector holding vertex indices.
Definition: rendering/Rendering.h:125
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15