Commit e8fd5d97 authored by Will Schroeder's avatar Will Schroeder
Browse files

ENH: Added argument to StartMethod/EndMethod functions.

parent 71431c65
......@@ -24,20 +24,27 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
class vlFilter : virtual public vlObject
{
public:
vlFilter() : StartMethod(NULL), EndMethod(NULL), Updating(0) {};
vlFilter();
~vlFilter() {};
char *GetClassName() {return "vlFilter";};
void PrintSelf(ostream& os, vlIndent indent);
// Abstract Interface:
// All filters must provide a method to update the visualization
// pipeline.
virtual void Update() = 0;
void SetStartMethod(void (*f)());
void SetEndMethod(void (*f)());
void SetStartMethod(void (*f)(void *), void *arg);
void SetEndMethod(void (*f)(void *), void *arg);
protected:
virtual void Execute()
{vlErrorMacro(<< "Execute is a Filter subclass responsability");};
char Updating;
void (*StartMethod)();
void (*EndMethod)();
void (*StartMethod)(void *);
void *StartMethodArg;
void (*EndMethod)(void *);
void *EndMethodArg;
vlTimeStamp ExecuteTime;
};
......
......@@ -49,10 +49,10 @@ void vlDataSetFilter::Update()
if (this->Input->GetMTime() > this->GetMTime() || this->GetMTime() > this->ExecuteTime )
{
if ( this->StartMethod ) (*this->StartMethod)();
if ( this->StartMethod ) (*this->StartMethod)(this->StartMethodArg);
this->Execute();
this->ExecuteTime.Modified();
if ( this->EndMethod ) (*this->EndMethod)();
if ( this->EndMethod ) (*this->EndMethod)(this->EndMethodArg);
}
}
......
......@@ -15,20 +15,32 @@ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
#include "Filter.hh"
void vlFilter::SetStartMethod(void (*f)())
vlFilter::vlFilter()
{
if ( f != this->StartMethod )
this->StartMethod = NULL;
this->StartMethodArg = NULL;
this->EndMethod = NULL;
this->EndMethodArg = NULL;
this->Updating = 0;
}
void vlFilter::SetStartMethod(void (*f)(void *), void *arg)
{
if ( f != this->StartMethod || arg != this->StartMethodArg )
{
this->StartMethod = f;
this->StartMethodArg = arg;
this->Modified();
}
}
void vlFilter::SetEndMethod(void (*f)())
void vlFilter::SetEndMethod(void (*f)(void *), void *arg)
{
if ( f != this->EndMethod )
if ( f != this->EndMethod || arg != this->EndMethodArg )
{
this->EndMethod = f;
this->EndMethodArg = arg;
this->Modified();
}
}
......
......@@ -26,10 +26,10 @@ void vlPolyFilter::Update()
if (this->Input->GetMTime() > this->GetMTime() || this->GetMTime() > this->ExecuteTime )
{
if ( this->StartMethod ) (*this->StartMethod)();
if ( this->StartMethod ) (*this->StartMethod)(this->StartMethodArg);
this->Execute();
this->ExecuteTime.Modified();
if ( this->EndMethod ) (*this->EndMethod)();
if ( this->EndMethod ) (*this->EndMethod)(this->EndMethodArg);
}
}
......
......@@ -51,10 +51,10 @@ void vlPointSetFilter::Update()
if (this->Input->GetMTime() > this->GetMTime() || this->GetMTime() > this->ExecuteTime )
{
if ( this->StartMethod ) (*this->StartMethod)();
if ( this->StartMethod ) (*this->StartMethod)(this->StartMethodArg);
this->Execute();
this->ExecuteTime.Modified();
if ( this->EndMethod ) (*this->EndMethod)();
if ( this->EndMethod ) (*this->EndMethod)(this->EndMethodArg);
}
}
......
......@@ -51,10 +51,10 @@ void vlStructuredDataSetFilter::Update()
if (this->Input->GetMTime() > this->GetMTime() || this->GetMTime() > this->ExecuteTime )
{
if ( this->StartMethod ) (*this->StartMethod)();
if ( this->StartMethod ) (*this->StartMethod)(this->StartMethodArg);
this->Execute();
this->ExecuteTime.Modified();
if ( this->EndMethod ) (*this->EndMethod)();
if ( this->EndMethod ) (*this->EndMethod)(this->EndMethodArg);
}
}
......
......@@ -48,10 +48,10 @@ void vlStructuredPointsFilter::Update()
if (this->Input->GetMTime() > this->GetMTime() || this->GetMTime() > this->ExecuteTime )
{
if ( this->StartMethod ) (*this->StartMethod)();
if ( this->StartMethod ) (*this->StartMethod)(this->StartMethodArg);
this->Execute();
this->ExecuteTime.Modified();
if ( this->EndMethod ) (*this->EndMethod)();
if ( this->EndMethod ) (*this->EndMethod)(this->EndMethodArg);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment