Vuo  2.0.2
Classes | Functions
VuoRenderedLayers.c File Reference

Description

VuoRenderedLayers implementation.

Definition in file VuoRenderedLayers.c.

Go to the source code of this file.

Functions

bool VuoRenderedLayers_getTransformedLayer2 (VuoRenderedLayers_internal *rl, float localToWorldMatrix[16], VuoSceneObject targetObject, VuoPoint2d *layerCenter, VuoPoint2d layerCorners[4])
 Forward declaration of private getTransformedLayer function. More...
 
void VuoRenderedLayers_free (void *renderedLayers)
 Frees the memory associated with the object. More...
 
VuoRenderedLayers VuoRenderedLayers_make (VuoSceneObject rootSceneObject, unsigned long int pixelsWide, unsigned long int pixelsHigh, float backingScaleFactor, VuoList_VuoInteraction interactions)
 Creates a VuoRenderedLayers with the given rendering root layer, rendering dimensions, and no window. More...
 
VuoRenderedLayers VuoRenderedLayers_makeWithWindow (VuoSceneObject rootSceneObject, unsigned long int pixelsWide, unsigned long int pixelsHigh, float backingScaleFactor, VuoWindowReference window, VuoList_VuoInteraction interactions)
 Creates a VuoRenderedLayers with the given rendering root layer, rendering dimensions, and window. More...
 
VuoRenderedLayers VuoRenderedLayers_makeEmpty (void)
 Creates a VuoRenderedLayers that doesn't yet store any information about rendered items or the rendering destination. More...
 
void VuoRenderedLayers_setInteractions (VuoRenderedLayers renderedLayers, VuoList_VuoInteraction interactions)
 Populates part of the information stored in the VuoRenderedLayers instance. More...
 
void VuoRenderedLayers_setRootSceneObject (VuoRenderedLayers renderedLayers, VuoSceneObject rootSceneObject)
 Populates part of the information stored in the VuoRenderedLayers instance. More...
 
void VuoRenderedLayers_setWindow (VuoRenderedLayers renderedLayers, VuoWindowReference window)
 Populates part of the information stored in the VuoRenderedLayers instance. More...
 
VuoList_VuoInteraction VuoRenderedLayers_getInteractions (const VuoRenderedLayers renderedLayers)
 Returns the list of interactions (if any). More...
 
VuoSceneObject VuoRenderedLayers_getRootSceneObject (const VuoRenderedLayers renderedLayers)
 Returns the root sceneobject (if any). More...
 
bool VuoRenderedLayers_getRenderingDimensions (const VuoRenderedLayers renderedLayers, unsigned long int *pixelsWide, unsigned long int *pixelsHigh, float *backingScaleFactor)
 If the requested piece of information has been populated, returns true and passes it through the last argument(s). More...
 
bool VuoRenderedLayers_getWindow (const VuoRenderedLayers renderedLayers, VuoWindowReference *window)
 Outputs the window reference via the second argument, if it's been populated, and returns true. More...
 
bool VuoRenderedLayers_windowChanged (const VuoRenderedLayers accumulatedRenderedLayers, const VuoRenderedLayers newerRenderedLayers)
 Returns true if the window in newerRenderedLayers is a change from accumulatedRenderedLayers. More...
 
void VuoRenderedLayers_update (VuoRenderedLayers accumulatedRenderedLayers, const VuoRenderedLayers newerRenderedLayers, bool *renderingDimensionsChanged)
 Updates accumulatedRenderedLayers with the values that are populated in newerRenderedLayers. More...
 
bool VuoRenderedLayers_findLayer (VuoRenderedLayers renderedLayers, VuoText layerName, VuoList_VuoSceneObject ancestorObjects, VuoSceneObject *foundObject)
 Finds the layer with the given name, along with its ancestor layers. More...
 
bool VuoRenderedLayers_findLayerId (VuoRenderedLayers renderedLayers, uint64_t layerId, VuoList_VuoSceneObject ancestorObjects, VuoSceneObject *foundObject)
 Finds the layer with the given ID, along with its ancestor layers. More...
 
void VuoRenderedLayers_applyTransforms (VuoRenderedLayers renderedLayers, VuoList_VuoSceneObject ancestorObjects, VuoSceneObject targetObject, VuoPoint3d *layerCenter3d, VuoPoint3d layerCorners3d[4], bool applyTargetTransform)
 Apply a list of sceneobject transforms in reverse order, taking into account realSize objects. More...
 
bool VuoRenderedLayers_getLayerCorners (const VuoSceneObject targetObject, VuoPoint3d layerCorners3d[4])
 Returns a set of 4 points representing the corners of targetObject. More...
 
VuoPoint3d VuoRenderedLayers_getQuadCenter (VuoPoint3d layerCorners3d[4])
 Returns the center of the 4 coordinates (ignoring Z). More...
 
bool VuoRenderedLayers_getRectRecursive (VuoRenderedLayers_internal *rl, float compositeMatrix[16], VuoSceneObject targetObject, VuoRectangle *rect, bool rectIsInitialized)
 Helper for VuoRenderedLayers_getRect. More...
 
bool VuoRenderedLayers_getRect (VuoRenderedLayers renderedLayers, VuoSceneObject layer, VuoRectangle *rect)
 Get a axis-aligned bounding rect in model space (transformed by layer) in Vuo coordinates for a layer and its children. More...
 
bool VuoRenderedLayers_getTransformedLayer (VuoRenderedLayers renderedLayers, VuoList_VuoSceneObject ancestorObjects, VuoSceneObject targetObject, VuoPoint2d *layerCenter, VuoPoint2d layerCorners[4], bool includeChildrenInBounds)
 Outputs the center and corner points of the layer with the given name, as transformed in renderedLayers. More...
 
bool VuoRenderedLayers_getTransformedPoint (VuoRenderedLayers renderedLayers, VuoList_VuoSceneObject ancestorObjects, VuoSceneObject targetObject, VuoPoint2d point, VuoPoint2d *transformedPoint)
 Outputs a point as transformed by ancestorObjects and targetObject. More...
 
bool VuoRenderedLayers_getInverseTransformedPointLayer (VuoRenderedLayers renderedLayers, uint64_t targetLayer, VuoPoint2d point, VuoPoint2d *localPoint)
 Transform a world point to targetObject local coordinates. More...
 
bool VuoRenderedLayers_getInverseTransformedPoint (VuoRenderedLayers renderedLayers, VuoList_VuoSceneObject ancestorObjects, VuoSceneObject targetObject, VuoPoint2d point, VuoPoint2d *inverseTransformedPoint)
 Transform point from world to local coordinates. More...
 
VuoPoint2d VuoRenderedLayers_getTextSize (VuoRenderedLayers renderedLayers, VuoText text, VuoFont font, bool scaleWithScene, float verticalScale, float rotationZ, float wrapWidth, bool includeTrailingWhiteSpace)
 Outputs the size, in Vuo Coordinates, of a text layer (real-size or scaled). More...
 
VuoRectangle VuoRenderedLayers_getBoundingBox (VuoPoint2d layerCorners[4])
 Returns the axis-aligned bounding box for the 4 points. More...
 
bool VuoRenderedLayers_isPointInQuad (VuoPoint2d corners[4], VuoPoint2d point)
 Returns true if the given point is within (or on the boundary) of the quad with the given corner points. More...
 
bool VuoRenderedLayers_isPointInLayerRecursive (VuoRenderedLayers_internal *rl, float compositeMatrix[16], VuoSceneObject targetObject, VuoPoint2d point)
 Is point in this object, or any of it's children? More...
 
bool VuoRenderedLayers_isPointInLayer (VuoRenderedLayers renderedLayers, VuoText layerName, VuoPoint2d point)
 Returns true if the given point is within (or on the boundary) of the layer with the given name, or any of its children. More...
 
bool VuoRenderedLayers_isPointInLayerId (VuoRenderedLayers renderedLayers, uint64_t layerId, VuoPoint2d point)
 Returns true if the given point is within (or on the boundary) of the layer with the given id, or any of its children. More...
 
void VuoRenderedLayers_getEventsInLayer (VuoRenderedLayers renderedLayers, uint64_t id, bool *anyHover, bool *anyPressed, bool *anyReleased, bool *anyClicked)
 Iterates through all interactions and tests for input events over the layer of layerName. More...
 
VuoRenderedLayers VuoRenderedLayers_makeFromJson (json_object *js)
 
json_objectVuoRenderedLayers_getJson (const VuoRenderedLayers renderedLayers)
 
char * VuoRenderedLayers_getSummary (const VuoRenderedLayers renderedLayers)
 

Function Documentation

◆ VuoRenderedLayers_applyTransforms()

void VuoRenderedLayers_applyTransforms ( VuoRenderedLayers  renderedLayers,
VuoList_VuoSceneObject  ancestorObjects,
VuoSceneObject  targetObject,
VuoPoint3d *  layerCenter3d,
VuoPoint3d  layerCorners3d[4],
bool  applyTargetTransform 
)

Apply a list of sceneobject transforms in reverse order, taking into account realSize objects.

Optionally include or omit applying target transform. Useful in situations where the local transform has already been applied (VuoRenderedLayers_getRect for example).

Definition at line 328 of file VuoRenderedLayers.c.

◆ VuoRenderedLayers_free()

void VuoRenderedLayers_free ( void *  renderedLayers)

Frees the memory associated with the object.

This function may be called from any thread.

Definition at line 64 of file VuoRenderedLayers.c.

◆ VuoRenderedLayers_getLayerCorners()

bool VuoRenderedLayers_getLayerCorners ( const VuoSceneObject  targetObject,
VuoPoint3d  layerCorners3d[4] 
)

Returns a set of 4 points representing the corners of targetObject.

If targetObject is a quad, this will be the vertex positions. If targetObject does not have a mesh (or is not a quad) and includeChildrenInBounds is false no points are returned.

Definition at line 398 of file VuoRenderedLayers.c.

◆ VuoRenderedLayers_getQuadCenter()

VuoPoint3d VuoRenderedLayers_getQuadCenter ( VuoPoint3d  layerCorners3d[4])

Returns the center of the 4 coordinates (ignoring Z).

Definition at line 420 of file VuoRenderedLayers.c.

◆ VuoRenderedLayers_getRectRecursive()

bool VuoRenderedLayers_getRectRecursive ( VuoRenderedLayers_internal *  rl,
float  compositeMatrix[16],
VuoSceneObject  targetObject,
VuoRectangle rect,
bool  rectIsInitialized 
)

Helper for VuoRenderedLayers_getRect.

Definition at line 436 of file VuoRenderedLayers.c.

◆ VuoRenderedLayers_getTransformedLayer2()

bool VuoRenderedLayers_getTransformedLayer2 ( VuoRenderedLayers_internal *  renderedLayers,
float  localToWorldMatrix[16],
VuoSceneObject  targetObject,
VuoPoint2d *  layerCenter,
VuoPoint2d  layerCorners[4] 
)

Forward declaration of private getTransformedLayer function.

Outputs the center and corner points of the layer.

localToWorldMatrix should be composite all ancestor transforms and targetObject.transform.

Definition at line 645 of file VuoRenderedLayers.c.

◆ VuoRenderedLayers_isPointInLayerRecursive()

bool VuoRenderedLayers_isPointInLayerRecursive ( VuoRenderedLayers_internal *  rl,
float  compositeMatrix[16],
VuoSceneObject  targetObject,
VuoPoint2d  point 
)

Is point in this object, or any of it's children?

Definition at line 834 of file VuoRenderedLayers.c.