ITK
6.0.0
Insight Toolkit
ITK
Modules
Core
Common
include
itkPyCommand.h
Go to the documentation of this file.
1
/*=========================================================================
2
*
3
* Copyright NumFOCUS
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* https://www.apache.org/licenses/LICENSE-2.0.txt
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*
17
*=========================================================================*/
18
19
#ifndef itkPyCommand_h
20
#define itkPyCommand_h
21
22
#include "
itkCommand.h
"
23
24
// The python header defines _POSIX_C_SOURCE without a preceding #undef
25
#undef _POSIX_C_SOURCE
26
#undef _XOPEN_SOURCE
27
#include "Python.h"
28
29
namespace
itk
30
{
31
45
class
ITKCommon_EXPORT
PyCommand
:
public
Command
46
{
47
public
:
49
using
Self
=
PyCommand
;
50
52
using
Pointer
=
SmartPointer<Self>
;
53
55
itkOverrideGetNameOfClassMacro(
PyCommand
);
56
58
itkNewMacro(
Self
);
59
65
void
66
SetCommandCallable(PyObject * obj);
67
68
PyObject *
69
GetCommandCallable();
70
71
void
72
Execute(
Object
*,
const
EventObject
&)
override
;
73
void
74
Execute(
const
Object
*,
const
EventObject
&)
override
;
75
76
protected
:
77
PyCommand
();
78
~
PyCommand
()
override
;
79
void
80
PyExecute();
81
PyCommand
(
const
Self
&);
// Not implemented.
82
PyCommand
&
83
operator=(
const
Self
&);
// Not implemented.
84
85
private
:
86
PyObject *
m_Object
;
87
PyObject *
m_EmptyArgumentList
;
88
};
89
90
91
}
// namespace itk
92
93
#endif // _itkPyCommand_h
itk::SmartPointer< Self >
itk::Command
Superclass for callback/observer methods.
Definition:
itkCommand.h:45
itk::PyCommand::m_EmptyArgumentList
PyObject * m_EmptyArgumentList
Definition:
itkPyCommand.h:87
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition:
itkAnatomicalOrientation.h:29
itk::Object
Base class for most ITK classes.
Definition:
itkObject.h:61
itk::EventObject
Abstraction of the Events used to communicating among filters and with GUIs.
Definition:
itkEventObject.h:58
itk::PyCommand::m_Object
PyObject * m_Object
Definition:
itkPyCommand.h:86
itkCommand.h
itk::PyCommand
Command subclass that calls a Python callable object, e.g. a Python function.
Definition:
itkPyCommand.h:45
Generated on
unknown
for ITK by
1.8.16