Skip to content

RAM API Reference Filters

Johann Diedrick edited this page Feb 4, 2015 · 5 revisions

Filter

Summary

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.

Table of Contents

Introduction to ramBaseFilter

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);
}


ramExpansion



ramLowPassFilter



ramNodeTransform



ramGhost



ramPendulum



ramSession



ramStamp



ramTimeShifter



ramUpsideDown


Creative Commons License
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.