VTK  9.1.0
vtkTclUtil.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkTclUtil.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15
16#ifndef vtkTclUtil_h
17#define vtkTclUtil_h
18
19#include "vtkCommand.h"
20#include "vtkObject.h"
21#include "vtkTcl.h"
22
23#ifdef _WIN32
24#define VTKTCL_EXPORT __declspec(dllexport)
25#else
26#define VTKTCL_EXPORT
27#endif
28
29extern VTKTCL_EXPORT void vtkTclUpdateCommand(Tcl_Interp* interp, char* name, vtkObject* obj);
30
32 vtkObject*, unsigned long eventId, void*, void*);
33extern VTKTCL_EXPORT void vtkTclGenericDeleteObject(ClientData cd);
34
36 Tcl_Interp* interp, void* temp, const char* targetType);
37
39 const char* name, const char* result_type, Tcl_Interp* interp, int& error);
40
41extern VTKTCL_EXPORT void vtkTclVoidFunc(void*);
43extern VTKTCL_EXPORT void vtkTclListInstances(Tcl_Interp* interp, ClientData arg);
44extern VTKTCL_EXPORT int vtkTclInDelete(Tcl_Interp* interp);
45
47 ClientData cd, Tcl_Interp* interp, int argc, char* argv[]);
48extern VTKTCL_EXPORT void vtkTclDeleteCommandStruct(ClientData cd);
49extern VTKTCL_EXPORT void vtkTclCreateNew(Tcl_Interp* interp, const char* cname,
50 ClientData (*NewCommand)(),
51 int (*CommandFunction)(ClientData cd, Tcl_Interp* interp, int argc, char* argv[]));
52
54{
55public:
56 static vtkTclCommand* New() { return new vtkTclCommand; }
57
58 void SetStringCommand(const char* arg);
59 void SetInterp(Tcl_Interp* interp) { this->Interp = interp; }
60
61 void Execute(vtkObject*, unsigned long, void*);
62
64 Tcl_Interp* Interp;
65
66protected:
69};
70
71typedef struct _vtkTclVoidFuncArg
72{
73 Tcl_Interp* interp;
74 char* command;
76
78{
79 void* Pointer;
80 Tcl_Interp* Interp;
81 unsigned long Tag;
82};
83
85{
86 ClientData (*NewCommand)();
87 int (*CommandFunction)(ClientData cd, Tcl_Interp* interp, int argc, char* argv[]);
88};
89
91{
92 Tcl_HashTable InstanceLookup;
93 Tcl_HashTable PointerLookup;
94 Tcl_HashTable CommandLookup;
95
96 int Number;
100};
101
102extern VTKTCL_EXPORT void vtkTclApplicationInitExecutable(int argc, const char* const argv[]);
104 Tcl_Interp* interp, const char* const relative_dirs[]);
105
106#endif
107// VTK-HeaderTest-Exclude: vtkTclUtil.h
superclass for callback/observer methods
Definition: vtkCommand.h:394
abstract base class for most VTK objects
Definition: vtkObject.h:82
static vtkTclCommand * New()
Definition: vtkTclUtil.h:56
char * StringCommand
Definition: vtkTclUtil.h:63
void SetInterp(Tcl_Interp *interp)
Definition: vtkTclUtil.h:59
void SetStringCommand(const char *arg)
void Execute(vtkObject *, unsigned long, void *)
All derived classes of vtkCommand must implement this method.
Tcl_Interp * Interp
Definition: vtkTclUtil.h:64
Tcl_Interp * interp
Definition: vtkTclUtil.h:73
Tcl_Interp * Interp
Definition: vtkTclUtil.h:80
unsigned long Tag
Definition: vtkTclUtil.h:81
ClientData(* NewCommand)()
Definition: vtkTclUtil.h:86
int(* CommandFunction)(ClientData cd, Tcl_Interp *interp, int argc, char *argv[])
Definition: vtkTclUtil.h:87
Tcl_HashTable InstanceLookup
Definition: vtkTclUtil.h:92
Tcl_HashTable PointerLookup
Definition: vtkTclUtil.h:93
Tcl_HashTable CommandLookup
Definition: vtkTclUtil.h:94
int DeleteExistingObjectOnNew
Definition: vtkTclUtil.h:99
VTKTCL_EXPORT void vtkTclDeleteCommandStruct(ClientData cd)
VTKTCL_EXPORT void vtkTclVoidFunc(void *)
VTKTCL_EXPORT void vtkTclVoidFuncArgDelete(void *)
VTKTCL_EXPORT void vtkTclListInstances(Tcl_Interp *interp, ClientData arg)
VTKTCL_EXPORT void vtkTclApplicationInitTclTk(Tcl_Interp *interp, const char *const relative_dirs[])
VTKTCL_EXPORT void vtkTclDeleteObjectFromHash(vtkObject *, unsigned long eventId, void *, void *)
VTKTCL_EXPORT int vtkTclNewInstanceCommand(ClientData cd, Tcl_Interp *interp, int argc, char *argv[])
#define VTKTCL_EXPORT
Definition: vtkTclUtil.h:26
VTKTCL_EXPORT void vtkTclApplicationInitExecutable(int argc, const char *const argv[])
VTKTCL_EXPORT void vtkTclUpdateCommand(Tcl_Interp *interp, char *name, vtkObject *obj)
struct _vtkTclVoidFuncArg vtkTclVoidFuncArg
VTKTCL_EXPORT void * vtkTclGetPointerFromObject(const char *name, const char *result_type, Tcl_Interp *interp, int &error)
VTKTCL_EXPORT int vtkTclInDelete(Tcl_Interp *interp)
VTKTCL_EXPORT void vtkTclGetObjectFromPointer(Tcl_Interp *interp, void *temp, const char *targetType)
VTKTCL_EXPORT void vtkTclGenericDeleteObject(ClientData cd)
VTKTCL_EXPORT void vtkTclCreateNew(Tcl_Interp *interp, const char *cname, ClientData(*NewCommand)(), int(*CommandFunction)(ClientData cd, Tcl_Interp *interp, int argc, char *argv[]))