本文整理汇总了C++中VuoInputData函数的典型用法代码示例。如果您正苦于以下问题:C++ VuoInputData函数的具体用法?C++ VuoInputData怎么用?C++ VuoInputData使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了VuoInputData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VuoModuleMetadata
#include "node.h"
#include "VuoLayer.h"
VuoModuleMetadata({
"title" : "Copy Layer",
"keywords" : [ "duplicate", "array", "instance", "instantiate", "populate" ],
"version" : "1.0.0",
"node": {
"isInterface" : false
}
});
void nodeEvent
(
VuoInputData(VuoLayer) layer,
VuoInputData(VuoList_VuoTransform2d) transforms,
VuoOutputData(VuoList_VuoLayer) copies
)
{
*copies = VuoListCreate_VuoLayer();
unsigned long transform_length = VuoListGetCount_VuoTransform2d(transforms);
for(int i = 0; i < transform_length; i++)
{
VuoLayer o;
o.sceneObject = layer.sceneObject;
o.sceneObject.transform = VuoTransform_makeFrom2d(VuoListGetValueAtIndex_VuoTransform2d(transforms, i+1));
VuoListAppendValue_VuoLayer(*copies, o);
}
示例2: compare
int index;
float value;
} sortable_pointValue;
static int compare (const void * a, const void * b)
{
sortable_pointValue *x = (sortable_pointValue*)a;
sortable_pointValue *y = (sortable_pointValue*)b;
return (x->value - y->value);
}
void nodeEvent
(
VuoInputData(VuoList_VuoLeapPointable) pointables,
VuoInputData(VuoPoint3d, {"default":{"x":0, "y":0, "z":0}}) target,
VuoOutputData(VuoList_VuoLeapPointable) sortedPointables
)
{
*sortedPointables = VuoListCreate_VuoLeapPointable();
int count = VuoListGetCount_VuoLeapPointable(pointables);
sortable_pointValue pointValues[count];
for(int i = 0; i < count; i++)
pointValues[i] = (sortable_pointValue){i, fabs(VuoListGetValue_VuoLeapPointable(pointables, i+1).tipPosition.z - target.z)};
qsort (pointValues, count, sizeof(sortable_pointValue), compare);
示例3: VuoModuleMetadata
/**
* @file
* vuo.type.list.real.point3d.y node implementation.
*
* @copyright Copyright © 2012–2015 Kosada Incorporated.
* This code may be modified and distributed under the terms of the MIT License.
* For more information, see http://vuo.org/license.
*/
#include "node.h"
VuoModuleMetadata({
"title": "Convert Real List to 3D Point List",
"description": "Creates a list of 3D points using the input real numbers as the Y coordinate, and 0 as the X and Z coordinates.",
"version": "1.0.0"
});
void nodeEvent
(
VuoInputData(VuoList_VuoReal) y,
VuoOutputData(VuoList_VuoPoint3d) point3d
)
{
*point3d = VuoListCreate_VuoPoint3d();
unsigned long count = VuoListGetCount_VuoReal(y);
for (unsigned long i = 1; i <= count; ++i)
VuoListAppendValue_VuoPoint3d(*point3d, VuoPoint3d_make(0, VuoListGetValue_VuoReal(y, i), 0));
}
示例4: VuoModuleMetadata
* For more information, see http://vuo.org/license.
*/
#include "node.h"
#include "VuoGlContext.h"
#include <OpenGL/CGLMacro.h>
#include <stdio.h>
VuoModuleMetadata({
"title" : "Text Contains",
"keywords" : [ "has", "search", "str", "string" ],
"version" : "1.0.0",
"description": "Returns true if `text` contains `value`, false otherwise.",
"node" : {
"exampleCompositions" : [ "" ]
}
});
void nodeEvent
(
VuoInputData(VuoText) text,
VuoInputData(VuoText) value,
VuoOutputData(VuoBoolean) contains
)
{
if(text == NULL || value == NULL)
*contains = false;
else
*contains = strstr(text, value) != NULL;
}
示例5: VuoModuleMetadata
/**
* @file
* vuo.type.list.point3d.real.x node implementation.
*
* @copyright Copyright © 2012–2015 Kosada Incorporated.
* This code may be modified and distributed under the terms of the MIT License.
* For more information, see http://vuo.org/license.
*/
#include "node.h"
VuoModuleMetadata({
"title": "Convert 3D Point List to Real List",
"description": "Creates a list of real numbers using the X coordinate of the input list of 3D points.",
"version": "1.0.0"
});
void nodeEvent
(
VuoInputData(VuoList_VuoPoint3d) point3d,
VuoOutputData(VuoList_VuoReal) x
)
{
*x = VuoListCreate_VuoReal();
unsigned long count = VuoListGetCount_VuoPoint3d(point3d);
for (unsigned long i = 1; i <= count; ++i)
VuoListAppendValue_VuoReal(*x, VuoListGetValue_VuoPoint3d(point3d, i).x);
}
示例6: VuoModuleMetadata
#include "node.h"
#include "VuoPoint3d.h"
VuoModuleMetadata({
"title" : "Get 3D Object Bounds",
"keywords" : [ "box", "aabb", "axis", "collider", "collision", "volume" ],
"version" : "1.0.0",
"node": {
"isInterface" : false,
"exampleCompositions" : [ "DisplaySceneWithFloor.vuo" ]
}
});
void nodeEvent
(
VuoInputData(VuoSceneObject) object,
VuoOutputData(VuoPoint3d) center,
VuoOutputData(VuoReal) width,
VuoOutputData(VuoReal) height,
VuoOutputData(VuoReal) depth
)
{
VuoBox bounds = VuoSceneObject_bounds(object);
*center = bounds.center;
*width = bounds.size.x;
*height = bounds.size.y;
*depth = bounds.size.z;
}
示例7: VuoModuleMetadata
/**
* @file
* vuo.layer.make.realSize node implementation.
*
* @copyright Copyright © 2012–2014 Kosada Incorporated.
* This code may be modified and distributed under the terms of the MIT License.
* For more information, see http://vuo.org/license.
*/
#include "node.h"
#include "VuoLayer.h"
VuoModuleMetadata({
"title" : "Make Layer",
"keywords" : [ "billboard", "sprite", "image", "pixel aligned", "exact", "actual" ],
"version" : "1.0.0",
});
void nodeEvent
(
VuoInputData(VuoText) name,
VuoInputData(VuoImage) image,
VuoInputData(VuoPoint2d, {"default":{"x":0.0,"y":0.0}, "suggestedStep":{"x":0.1,"y":0.1}}) center,
VuoInputData(VuoReal, {"default":1.0, "suggestedMin":0.0, "suggestedMax":1.0, "suggestedStep":0.1}) alpha,
VuoOutputData(VuoLayer) layer
)
{
*layer = VuoLayer_makeRealSize(name, image, center, alpha);
}
示例8: updateServer
VuoText serverName;
};
static void updateServer(struct nodeInstanceData *context, VuoText newServerName)
{
VuoRelease(context->serverName);
context->serverName = newServerName;
VuoRetain(context->serverName);
VuoSyphonServer_setName(context->syphonServer, newServerName);
}
struct nodeInstanceData * nodeInstanceInit
(
VuoInputData(VuoText, "") serverName
)
{
struct nodeInstanceData *context = (struct nodeInstanceData *)calloc(1,sizeof(struct nodeInstanceData));
VuoRegister(context, free);
context->glContext = VuoGlContext_use();
context->syphonServer = VuoSyphonServer_make(serverName, context->glContext);
VuoRetain(context->syphonServer);
return context;
}
void nodeInstanceEvent
(
示例9: VuoModuleMetadata
* For more information, see http://vuo.org/license.
*/
#include "node.h"
#include "VuoSceneObject.h"
VuoModuleMetadata({
"title" : "Change All Shaders",
"keywords" : [ "swap", "replace", "texture", "material" ],
"version" : "2.0.0",
"node": {
"exampleCompositions" : [ "PaintSceneWithCheckerboard.vuo", "CompareCameras.vuo" ]
}
});
void nodeEvent
(
VuoInputData(VuoSceneObject) object,
VuoInputData(VuoShader) shader,
VuoOutputData(VuoSceneObject) shadedObject
)
{
VuoSceneObject copy = VuoSceneObject_copy(object);
VuoSceneObject_apply(©, ^(VuoSceneObject *currentObject, float modelviewMatrix[16]){
currentObject->shader = shader;
});
*shadedObject = copy;
}
示例10: VuoGlContext_use
{
struct nodeInstanceData *context = (struct nodeInstanceData *)malloc(sizeof(struct nodeInstanceData));
context->glContext = VuoGlContext_use();
context->sceneRenderer = VuoSceneRenderer_make(context->glContext);
VuoRetain(context->sceneRenderer);
VuoRegister(context, free);
return context;
}
void nodeInstanceEvent
(
VuoInstanceData(struct nodeInstanceData *) context,
VuoInputData(VuoList_VuoLayer) layers,
VuoInputData(VuoInteger, {"default":1024, "suggestedMin":1, "suggestedMax":4096, "suggestedStep":256}) width,
VuoInputData(VuoInteger, {"default":768, "suggestedMin":1, "suggestedMax":4096, "suggestedStep":256}) height,
VuoOutputData(VuoImage) image,
VuoOutputData(VuoRenderedLayers) renderedLayers
)
{
VuoSceneObject rootSceneObject = VuoLayer_makeGroup(layers, VuoTransform2d_makeIdentity()).sceneObject;
VuoSceneRenderer_setRootSceneObject((*context)->sceneRenderer, rootSceneObject);
VuoSceneRenderer_regenerateProjectionMatrix((*context)->sceneRenderer, width, height);
VuoSceneRenderer_renderToImage((*context)->sceneRenderer, image, NULL);
*renderedLayers = VuoRenderedLayers_make(rootSceneObject, width, height);
}
示例11: VuoModuleMetadata
* @file
* vuo.logic.areAnyTrue node implementation.
*
* @copyright Copyright © 2012–2015 Kosada Incorporated.
* This code may be modified and distributed under the terms of the MIT License.
* For more information, see http://vuo.org/license.
*/
#include "node.h"
VuoModuleMetadata({
"title" : "Are Any True",
"keywords" : [ "boolean", "condition", "test", "check", "gate", "or", "||", "0", "1", "false" ],
"version" : "2.0.0",
"node": {
"exampleCompositions" : [ ]
}
});
void nodeEvent
(
VuoInputData(VuoList_VuoBoolean) values,
VuoOutputData(VuoBoolean) anyTrue
)
{
*anyTrue = false;
unsigned long termsCount = VuoListGetCount_VuoBoolean(values);
for (unsigned long i = 1; i <= termsCount; ++i)
*anyTrue = *anyTrue || VuoListGetValue_VuoBoolean(values, i);
}
示例12: receivedController
static void receivedController(void *ctx, VuoMidiController controller)
{
struct nodeInstanceData *context = (struct nodeInstanceData *)ctx;
for (int i = 0; i < 8; ++i)
if (controller.controllerNumber == 81+i)
VuoSmoothInertia_setTarget(context->faderSmooth[i], context->mostRecentTime, (VuoReal)controller.value/127. * (context->fader[i].maximumValue - context->fader[i].minimumValue) + context->fader[i].minimumValue);
}
static void resetFader(VuoMidiOut outputManager, char controller, VuoRealRegulation fader)
{
VuoMidiOut_sendController(outputManager, VuoMidiController_make(1, controller, (fader.defaultValue-fader.minimumValue)/(fader.maximumValue-fader.minimumValue) * 127.));
}
struct nodeInstanceData *nodeInstanceInit(
VuoInputData(VuoRealRegulation) fader1,
VuoInputData(VuoRealRegulation) fader2,
VuoInputData(VuoRealRegulation) fader3,
VuoInputData(VuoRealRegulation) fader4,
VuoInputData(VuoRealRegulation) fader5,
VuoInputData(VuoRealRegulation) fader6,
VuoInputData(VuoRealRegulation) fader7,
VuoInputData(VuoRealRegulation) fader8
)
{
struct nodeInstanceData *context = (struct nodeInstanceData *)calloc(1,sizeof(struct nodeInstanceData));
VuoRegister(context, free);
context->inputDevice = VuoMidiInputDevice_make(-1, VuoText_make("BCF2000"));
VuoMidiInputDevice_retain(context->inputDevice);
context->inputManager = VuoMidiIn_make(context->inputDevice);
示例13: VuoModuleMetadata
#include "VuoLeapHand.h"
#include "VuoLeapPointable.h"
#include "VuoList_VuoLeapPointable.h"
VuoModuleMetadata({
"title" : "Get Hand Values",
"keywords" : [ "controller", "motion", "hand", "palm" ],
"version" : "2.0.0",
"node": {
"exampleCompositions" : [ "DisplayLeapHand.vuo", "ShowHandStatus.vuo", "HoldEgg.vuo", "HighlightExtendedFingers.vuo", "TwirlImageWithLeap.vuo" ]
}
});
void nodeEvent
(
VuoInputData(VuoLeapHand) hand,
VuoOutputData(VuoInteger, {"name":"ID"}) id,
VuoOutputData(VuoTransform) transform,
VuoOutputData(VuoPoint3d) palmVelocity,
VuoOutputData(VuoPoint3d) wristPosition,
VuoOutputData(VuoReal) sphereRadius,
VuoOutputData(VuoPoint3d) sphereCenter,
VuoOutputData(VuoReal) pinchAmount,
VuoOutputData(VuoReal) grabAmount,
VuoOutputData(VuoBoolean) isLeftHand,
VuoOutputData(VuoReal) timeVisible,
VuoOutputData(VuoReal) confidence,
VuoOutputData(VuoList_VuoLeapPointable) fingers
)
{
*id = hand.id;
示例14: VuoInputData
"title" : "Changed",
"keywords" : [ "pulse", "watcher" ],
"version" : "1.0.1",
"genericTypes" : {
"VuoGenericType1" : {
"compatibleTypes" : [ "VuoBoolean", "VuoInteger", "VuoReal" ]
}
},
"node": {
"exampleCompositions" : [ ]
}
});
VuoGenericType1 * nodeInstanceInit
(
VuoInputData(VuoGenericType1) value
)
{
VuoGenericType1 *lastValue = (VuoGenericType1 *)malloc(sizeof(VuoGenericType1));
VuoRegister(lastValue, free);
*lastValue = value;
return lastValue;
}
void nodeInstanceEvent
(
VuoInstanceData(VuoGenericType1 *) lastValue,
VuoInputData(VuoGenericType1, {"defaults":{"VuoBoolean":false, "VuoInteger":0, "VuoReal":0.0}}) value,
VuoInputEvent({"eventBlocking":"door","data":"value"}) valueEvent,
VuoOutputEvent() changed
)
示例15: VuoRegister
struct nodeInstanceData *context = (struct nodeInstanceData *)calloc(1,sizeof(struct nodeInstanceData));
VuoRegister(context, free);
context->isTriggerStopped = true;
context->dragStartedListener = VuoMouse_make();
VuoRetain(context->dragStartedListener);
context->dragMovedToListener = VuoMouse_make();
VuoRetain(context->dragMovedToListener);
context->dragEndedListener = VuoMouse_make();
VuoRetain(context->dragEndedListener);
return context;
}
void nodeInstanceTriggerStart
(
VuoInstanceData(struct nodeInstanceData *) context,
VuoInputData(VuoWindowReference) window,
VuoInputData(VuoMouseButton) button,
VuoInputData(VuoModifierKey) modifierKey,
VuoOutputTrigger(dragStarted, VuoPoint2d),
VuoOutputTrigger(dragMovedTo, VuoPoint2d),
VuoOutputTrigger(dragEnded, VuoPoint2d)
)
{
(*context)->isTriggerStopped = false;
VuoMouse_startListeningForPresses((*context)->dragStartedListener, dragStarted, button, window, modifierKey);
VuoMouse_startListeningForDrags((*context)->dragMovedToListener, dragMovedTo, button, window, modifierKey);
VuoMouse_startListeningForReleases((*context)->dragEndedListener, dragEnded, button, window, modifierKey);
}
void nodeInstanceTriggerUpdate
(