-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathWrappedObject.cs.in
76 lines (67 loc) · 2.89 KB
/
WrappedObject.cs.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using System;
using System.Runtime.InteropServices; // DllImport and HandleRef both live here
//----------------------------------------------------------------------------
// The namespace name used here should match the _cable_::package value
// listed in the gccxml input files...
namespace @csharp_namespace@
{
/// <summary>
/// Base class for all the mummy wrapped classes in @csharp_namespace@.
/// </summary>
public class WrappedObject : Kitware.mummy.Runtime.WrappedObject
{
//------------------------------------------------------------------------
// For each _cable_::group listed in any gccxml input file (the .cxx.in
// files that get configured and then sent through gccxml) there needs to
// be a const string variable here that names the export-layer dll from
// which a class's export layer functions are exported...
//
// For example, for a group = "vtkCommonCore" there needs to be a variable
// named vtkCommonCoreEL_dll and its value needs to be the actual name of the
// dll file that it represents... (which is either @CMAKE_SHARED_LIBRARY_PREFIX@vtkEL@CMAKE_SHARED_LIBRARY_SUFFIX@ or
// @CMAKE_SHARED_LIBRARY_PREFIX@vtkCommonCoreEL@CMAKE_SHARED_LIBRARY_SUFFIX@ depending on if you build one big export layer dll or
// one for each VTK kit...)
//------------------------------------------------------------------------
//------------------------------------------------------------------------
@MV_EXPORTLAYER_DLL_VARIABLES@
//------------------------------------------------------------------------
/// <summary>
/// Constructor expected by the mummy Runtime.
/// </summary>
protected WrappedObject(IntPtr rawCppThis, bool callDisposalMethod, bool strong)
: base(rawCppThis, callDisposalMethod, strong)
{
}
//------------------------------------------------------------------------
/// <summary>
/// Static constructor to force-load all "implementation" modules.
/// Reference a single class from each of the implementation modules
/// to force it to load the corresponding Unmanaged dll and register
/// its factories.
/// </summary>
static WrappedObject()
{
string s;
// from vtkRenderingOpenGL
using (Kitware.VTK.vtkOpenGLActor o = Kitware.VTK.vtkOpenGLActor.New())
{
s = o.ToString();
}
// from vtkInteractionStyle
using (Kitware.VTK.vtkInteractorStyleSwitch o = Kitware.VTK.vtkInteractorStyleSwitch.New())
{
s = o.ToString();
}
// from vtkRenderingVolumeOpenGL
using (Kitware.VTK.vtkOpenGLVolumeTextureMapper2D o = Kitware.VTK.vtkOpenGLVolumeTextureMapper2D.New())
{
s = o.ToString();
}
// from vtkRenderingFreeTypeOpenGL
using (Kitware.VTK.vtkOpenGLFreeTypeTextMapper o = Kitware.VTK.vtkOpenGLFreeTypeTextMapper.New())
{
s = o.ToString();
}
}
}
}