Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Andrew Bauer
VTK
Commits
3c2ec469
Commit
3c2ec469
authored
Feb 20, 1995
by
Ken Martin
Browse files
mods to the user define functions
parent
6a5a5a58
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/Filter.hh
View file @
3c2ec469
...
...
@@ -41,13 +41,17 @@ public:
void
SetStartMethod
(
void
(
*
f
)(
void
*
),
void
*
arg
);
void
SetEndMethod
(
void
(
*
f
)(
void
*
),
void
*
arg
);
void
SetStartMethodArgDelete
(
void
(
*
f
)(
void
*
));
void
SetEndMethodArgDelete
(
void
(
*
f
)(
void
*
));
protected:
vlDataSet
*
Input
;
char
Updating
;
void
(
*
StartMethod
)(
void
*
);
void
(
*
StartMethodArgDelete
)(
void
*
);
void
*
StartMethodArg
;
void
(
*
EndMethod
)(
void
*
);
void
(
*
EndMethodArgDelete
)(
void
*
);
void
*
EndMethodArg
;
vlTimeStamp
ExecuteTime
;
...
...
src/Filter.cc
View file @
3c2ec469
...
...
@@ -22,8 +22,10 @@ vlFilter::vlFilter()
this
->
Input
=
NULL
;
this
->
StartMethod
=
NULL
;
this
->
StartMethodArgDelete
=
NULL
;
this
->
StartMethodArg
=
NULL
;
this
->
EndMethod
=
NULL
;
this
->
EndMethodArgDelete
=
NULL
;
this
->
EndMethodArg
=
NULL
;
this
->
Updating
=
0
;
...
...
@@ -79,6 +81,11 @@ void vlFilter::SetStartMethod(void (*f)(void *), void *arg)
{
if
(
f
!=
this
->
StartMethod
||
arg
!=
this
->
StartMethodArg
)
{
// delete the current arg if there is one and a delete meth
if
((
this
->
StartMethodArg
)
&&
(
this
->
StartMethodArgDelete
))
{
(
*
this
->
StartMethodArgDelete
)(
this
->
StartMethodArg
);
}
this
->
StartMethod
=
f
;
this
->
StartMethodArg
=
arg
;
this
->
_Modified
();
...
...
@@ -92,12 +99,39 @@ void vlFilter::SetEndMethod(void (*f)(void *), void *arg)
{
if
(
f
!=
this
->
EndMethod
||
arg
!=
this
->
EndMethodArg
)
{
// delete the current arg if there is one and a delete meth
if
((
this
->
EndMethodArg
)
&&
(
this
->
EndMethodArgDelete
))
{
(
*
this
->
EndMethodArgDelete
)(
this
->
EndMethodArg
);
}
this
->
EndMethod
=
f
;
this
->
EndMethodArg
=
arg
;
this
->
_Modified
();
}
}
// Description:
// Set the arg delete method. This is used to free user memory.
void
vlFilter
::
SetStartMethodArgDelete
(
void
(
*
f
)(
void
*
))
{
if
(
f
!=
this
->
StartMethodArgDelete
)
{
this
->
StartMethodArgDelete
=
f
;
this
->
_Modified
();
}
}
// Description:
// Set the arg delete method. This is used to free user memory.
void
vlFilter
::
SetEndMethodArgDelete
(
void
(
*
f
)(
void
*
))
{
if
(
f
!=
this
->
EndMethodArgDelete
)
{
this
->
EndMethodArgDelete
=
f
;
this
->
_Modified
();
}
}
void
vlFilter
::
Execute
()
{
cerr
<<
"Execution of filter should be in derived class"
<<
"
\n
"
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment