-
Notifications
You must be signed in to change notification settings - Fork 40
RAM API Reference Filters
This page shows how to use ramFilters. Each of these filters inherits from ramBaseFilter. If you create your own filter, we strongly encourage you to start by inheriting from ramBaseFilter, so that your custom filter integrates nicely with RAMDanceToolkit.
- [Introduction to ramBaseFilter](Introduction to ramBaseFilter)
- ramExpansion
- ramLowPassFilter
- ramNodeTransform
- ramGhost
- ramPendulum
- ramSession
- ramStamp
- ramTimeShifter
- ramUpsideDown
ramBaseFilter is the base class of all filters. This class provides common interfaces for filtering data and getting desired results.
Here is a simple example of a custom filter class called "MyFilter".
class MyFilter : public ramBaseFilter
{
public:
MyFilter() {}
void setupControlPanel()
{
// GUI implementation goes here...
}
const ramNodeArray& update(ramNodeArray& src)
{
// do something...
return src;
}
const string getName() { return "MyFilter"; }
};
For filtering a ramNodeArray, const ramNodeArray& update(const ramNodeArray& src)
should be called. ramBaseFilter will create a cache of update results from each frame and keep track of the result correctly.
For getting your filtered results, you can use the returned value from update(). Or simply call const ramNodeArray& ramBaseFilter::get(size_t index)
after updating.
So you might end up using MyFilter like this:
// testApp.h
MyFilter filter;
// testApp.cpp
void testApp::drawActor(const ramActor &actor)
{
const ramNodeArray& NA = filter.update(actor);
ramDrawBasicActor(actor);
}
This Document by YCAM InterLab, Yoshito Onishi, Satoru Higa, Motoi Shimizu, and Kyle McDonald is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
This Wiki and API References (RAMDanceToolkit 1.0.0) is created on 2013-03-09