LWQ
2025-07-14 52d230fd0eb38adc5c6f4c6d6ed3786a3c19354d
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
/////////////////////////////////////////////////////////////////
//
// Filename          :  MIL3DDISP.H
// Content           :  Define for the MIL 3DDISP module
// Revision          :  10.40.0640
//
// Copyright © Matrox Electronic Systems Ltd., 1992-2020.
// All Rights Reserved
//
/////////////////////////////////////////////////////////////////
 
 
#ifndef __MIL3DDISP_H__
#define __MIL3DDISP_H__
 
// None of this should clash with disp (2d) controls so that if we want to forward them to the
// 2d display it will be trivial. Should also reuse creation types from 2d.
 
/* C++ directive if needed */
#ifdef __cplusplus
   extern "C"
      {
#endif
 
typedef MIL_INT(MFTYPE *MIL_3DDISP_HOOK_FUNCTION_PTR)(MIL_INT HookType,
                                                     MIL_ID  EventId,
                                                     void    *UserDataPtr);
 
#define M_VTK_TRACKBALL                                        0x00000002L                                         
#define M_VTK_TERRAIN                                          0x00000003L 
#define M_TEST_OPENGL                                          0x00000004L 
#define M_VTK_WINDOW                                           0x00000020L // Reserved in mildisplay.h
 
// M3ddispSelect  
#define M_OPEN                                                 0x00000010L // Already defined from mil.h
#define M_CLOSE                                                0x00000020L // Already defined from mil.h
#define M_ADD                                                  0x0000L     // Already defined in milocr.h, milim.h
#define M_REMOVE                                               0x00000004L // Already defined in milim.h
#define M_SELECT                                               3977L
 
// These should not clash with disp2d
// M3ddispAlloc
//#define M_WINDOWED_DISPLAY                                     0L
#define M_MIL_BUFFER_WINDOW                                    2L
#define M_WEB                                                  0x00800000L // Already defined in mil.h, mildisplay.h
 
// M3ddispControl types
#define M_3D_GRAPHIC_LIST_ID                                    4111
#define M_ROTATION_INDICATOR                                    4627
#define M_BACKGROUND_IMAGE                                      4628
#define M_BACKGROUND_IMAGE_SIZE_X                               4629
#define M_BACKGROUND_IMAGE_SIZE_Y                               4630
#define M_BACKGROUND_IMAGE_SIZE_BAND                            4631
#define M_AUTO_ROTATE                                           4633
#define M_ROTATION_SPEED                                        4634
#define M_ROTATION_AXIS                                         4636
 
#define M_ACTION_KEY_TRANSLATE_FORWARD                          4638
#define M_ACTION_KEY_TRANSLATE_BACKWARD                         4639
#define M_ACTION_KEY_TRANSLATE_DOWN                             2755L
#define M_ACTION_KEY_TRANSLATE_LEFT                             2756L
#define M_ACTION_KEY_TRANSLATE_RIGHT                            2757L
#define M_ACTION_KEY_TRANSLATE_UP                               2758L
#define M_ACTION_KEY_ROLL_LEFT                                  4640
#define M_ACTION_KEY_ROLL_RIGHT                                 4641
#define M_ACTION_KEY_ORBIT_LEFT                                 4642
#define M_ACTION_KEY_ORBIT_RIGHT                                4643
#define M_ACTION_KEY_ORBIT_UP                                   4644
#define M_ACTION_KEY_ORBIT_DOWN                                 4645
#define M_ACTION_KEY_TURN_LEFT                                  4646
#define M_ACTION_KEY_TURN_RIGHT                                 4647
#define M_ACTION_KEY_TURN_UP                                    4648
#define M_ACTION_KEY_TURN_DOWN                                  4649
#define M_ACTION_KEY_ZOOM_IN                                    4650
#define M_ACTION_KEY_ZOOM_OUT                                   4651
#define M_ACTION_KEY_RESET                                      4652
#define M_ALTERNATE_SPEED_FACTOR                                4653
#define M_BACKGROUND_COLOR_GRADIENT                             4654
#define M_ACTION_KEY_AUTO_ROTATE                                4658
#define M_ACTION_KEY_ORIENTATION_TOP_VIEW                       4659
#define M_ACTION_KEY_ORIENTATION_BOTTOM_VIEW                    4660
#define M_ACTION_KEY_ORIENTATION_FRONT_VIEW                     4661
#define M_ACTION_KEY_ORIENTATION_REAR_VIEW                      4662
#define M_ACTION_KEY_ORIENTATION_LEFT_VIEW                      4663
#define M_ACTION_KEY_ORIENTATION_RIGHT_VIEW                     4664
#define M_ACTION_KEY_ORIENTATION_TOP_TILTED                     4665
#define M_ACTION_KEY_ORIENTATION_BOTTOM_TILTED                  4666
 
#define M_ACTION_MODIFIER_SPEED                                   2759L
 
#define M_DISP_CONTROL_START                                    10000L                              // Already defined in mildisplay.h (10000L)
#define M_BACKGROUND_COLOR                                      (M_DISP_CONTROL_START+66L)          // Already defined in mildisplay.h (10066) M_LOCAL_DISPLAY_CONTROL
#define M_TITLE                                                 (7702L|M_CLIENT_ENCODING)           // Already defined in mildisplay.h M_LOCAL_DISPLAY_CONTROL
#define M_DISPLAY_SYNC                                          (M_DISP_CONTROL_START+47L)          // Already defined in mildisplay.h (10047) M_LOCAL_DISPLAY_CONTROL
#define M_QT_MODE                                               (M_DISP_CONTROL_START+151L)         // already defined in mildisplay.h (10151) M_LOCAL_DISPLAY_CONTROL
#define M_WINDOW_CURSOR                                         (M_DISP_CONTROL_START+199L)         // already defined in mildisplay.h (10199) M_LOCAL_DISPLAY_CONTROL
#define M_SELECTED                                              1103L //M_REMOTE_DISPLAY_CONTROL   // Already defined in mildisplay.h
#define M_DISPLAY_SURFACE                                       1121L                              // Already defined in mildisplay.h M_LOCAL_DISPLAY_CONTROL          
#define M_WPF_DISPLAY_BUFFER_ID                                 M_DISPLAY_SURFACE                  // Already defined in mildisplay.h           
#define M_WINDOW_INITIAL_POSITION_X                             3088L //M_LOCAL_DISPLAY_CONTROL    // Already defined in mildisplay.h
#define M_WINDOW_INITIAL_POSITION_Y                             3089L //M_LOCAL_DISPLAY_CONTROL    // Already defined in mildisplay.h
#define M_WINDOW_HANDLE                                         3110L //M_LOCAL_DISPLAY_CONTROL    // Already defined in mildisplay.h
#define M_MOUSE_USE                                             3219L //M_LOCAL_DISPLAY_CONTROL    // Already defined in mildisplay.h
#define M_KEYBOARD_USE                                          3155L //M_LOCAL_DISPLAY_CONTROL    // Already defined in mildisplay.h
#define M_SAVE_INTERNAL_BUFFERS                                (M_DISP_CONTROL_START+26L) //(10026) M_LOCAL_DISPLAY_CONTROL Already defined in mildisplay.h
 
#define M_BACKGROUND_MODE                                       12L //already defined
#define M_SINGLE_COLOR                                          3969 
#define M_GRADIENT_VERTICAL                                     3970
#define M_STRING_SIZE                                    MAKE_INT64(0x0000050000000000)
#define M_UPDATE                                                3199L                     //M_REMOTE_DISPLAY_CONTROL defined in mildisplay.h
#define M_SIZE_X                                                1536L       // Already defined in    milcode.h, mil.h
#define M_SIZE_Y                                                1537L       // Already defined in    milcode.h, mil.h
#define M_ENABLE_ON_MOUSE_CLICK                                 3973L
                                                                                                              
// M3ddispControl
// MIL_DOUBLE
#define M_FOV_HORIZONTAL_ANGLE                                  4667
#define M_FOV_VERTICAL_ANGLE                                    4668
 
// List of 2d values that are whitelisted
#ifdef __cplusplus       
      inline bool In2dDisplayControlsWhiteList(MIL_INT64 ControlType)
         {
         switch(ControlType)
            {
            case M_QT_MODE:
            case M_WPF_DISPLAY_BUFFER_ID:
            case M_DISPLAY_SYNC:
            case M_WINDOW_CURSOR:
            case M_WINDOW_HANDLE:
            case M_SELECTED:
            case M_SAVE_INTERNAL_BUFFERS:
               return true;
            default:
               return false;
 
            }
         }
#endif
 
////////////////////////////////////////////////////////////////////////////////////////////////
//Dispcontrol values
////////////////////////////////////////////////////////////////////////////////////////////////
#define M_RED                                                            0x08L
#define M_GREEN                                                          0x10L
#define M_BLUE                                                           0x20L
 
#define M_ENABLE                                                        -9997L                              // Already defined in    milblob.h, milcal.h, milmeas.h, mil.h, miledge.h
#define M_DISABLE                                                       -9999L                              // Already defined in    milblob.h, milcal.h, milmeas.h, mil.h, miledge.h
 
#define M_NOW                                                              29L
#define M_ALLOCATION_FAILURE_REAL_TEST_FLAG                               971L // Also in milblob.h
////////////////////////////////////////////////////////////////////////////////
 
// M3ddispSet/GetViewpoint
#define M_VIEW_MATRIX                                                    4161L
#define M_TRAVEL                                                         4162L
#define M_VIEWPOINT                                                      4163L
#define M_INTEREST_POINT                                                 4164L
#define M_UP_VECTOR                                                      4165L
#define M_VIEW_BOX                                                       4166L
#define M_NO_REFRESH                                                     4167L
#define M_TOP_VIEW                                                       4168L
#define M_BOTTOM_VIEW                                                    4169L
#define M_LEFT_VIEW                                                      4170L
#define M_RIGHT_VIEW                                                     4171L
#define M_FRONT_VIEW                                                     4172L
#define M_REAR_VIEW                                                      4173L
#define M_TOP_TILTED                                                     4174L
#define M_BOTTOM_TILTED                                                  4175L
#define M_ORBIT_HORIZONTAL                                               4177L
#define M_ORBIT_VERTICAL                                                 4178L
#define M_AZIM_ELEV_ROLL                                                    4L  // already defined in milreg.h
#define M_TRANSLATE                                                         5L  // already defined in mil.h
#define M_DISTANCE                                                 0x00080000L  // already defined in milim.h
#define M_FLIP                                                     0x00010000L  // already defined in milim.h
#define M_ELEVATION                                                        49L  // already defined in milreg.h
#define M_AZIMUTH                                                          50L  // already defined in milreg.h
#define M_ROLL                                                             51L  // already defined in milreg.h
#define M_VIEW_ORIENTATION                                         0x00200000L
#define M_TRANSFORM_TYPES_SHIFT                                             8L  // =utilities=   (also defined in milcal.h)
#define M_MOVE_INTEREST_POINT                     (128 << M_TRANSFORM_TYPES_SHIFT)
////////////////////////////////////////////////////////////////////////////////
 
 
////////////////////////////////////////////////////////////////////////////////////////////////
// Hook values
////////////////////////////////////////////////////////////////////////////////////////////////
#define M_OBJ_HOOK_MODULE_RANGE_START                 0x00000FE00L    // Already defined in mil.h
#define M_OBJ_HOOK_MODULE_RANGE_END                   0x00000FFFFL    // Already defined in mil.h
 
// 3ddisplay hook
 
////////////////////////////////////////////////////////////////////////////////////////////////
 
 
   // M3ddisp calls
   void      MFTYPE M3ddispControlInt64(MIL_ID Disp3dId, MIL_INT64 ControlType, MIL_INT64 ControlValue);
   void      MFTYPE M3ddispControlDouble(MIL_ID Disp3dId, MIL_INT64 ControlType, MIL_DOUBLE ControlValue);
   void      MFTYPE M3ddispFree(MIL_ID Disp3dId);
   MIL_INT64 MFTYPE M3ddispInquire(MIL_ID Disp3dId, MIL_INT64 InquireType, void *UserVarPtr);
   MIL_INT64 MFTYPE M3ddispSelect(MIL_ID Disp3dId, MIL_ID ContainerOrImageBufId, MIL_INT64 Option, MIL_INT64 ControlFlag);
   MIL_INT64 MFTYPE M3ddispSelectWindow(MIL_ID Disp3dId, MIL_ID ContainerOrImageBufId, MIL_INT64 Option, MIL_INT64 ControlFlag, MIL_WINDOW_HANDLE ClientWindowHandle);
   void      MFTYPE M3ddispSetViewDouble(MIL_ID Disp3dId, MIL_INT64 Mode, const MIL_DOUBLE Param1, const MIL_DOUBLE Param2, const MIL_DOUBLE Param3, MIL_INT64   ControlFlag);
   void      MFTYPE M3ddispGetView(MIL_ID Disp3dId, MIL_INT64 Mode, MIL_DOUBLE* Param1Ptr, MIL_DOUBLE* Param2Ptr, MIL_DOUBLE* Param3Ptr, MIL_INT64   ControlFlag);
   void      MFTYPE M3ddispCopy(MIL_ID SrcMilObjectId, MIL_ID DstMilObjectId, MIL_INT64 CopyType, MIL_INT64 ControlFlag);
   void      MFTYPE M3ddispMessage(MIL_ID Disp3dId, MIL_INT64 EventType, MIL_INT64 MousePositionX, MIL_INT64 MousePositionY, MIL_INT64 EventValue, MIL_INT64 CombinationKeys, MIL_INT64 UserValue);
   void      MFTYPE M3ddispHookFunction(MIL_ID Disp3dId, MIL_INT HookType, MIL_3DDISP_HOOK_FUNCTION_PTR HookHandlerPtr, void* UserDataPtr);
   MIL_INT64 MFTYPE M3ddispGetHookInfo(MIL_ID EventId, MIL_INT64 InfoType, void* UserVarPtr);
 
   // For CAPI calls with strings
#if M_MIL_USE_UNICODE
   MIL_ID    MFTYPE M3ddispAllocA(MIL_ID SysId, MIL_INT64 DispNum, MIL_CONST_TEXTA_PTR DispFormat, MIL_INT64 InitFlag, MIL_ID *Disp3dIdPtr);
   MIL_ID    MFTYPE M3ddispAllocW(MIL_ID SysId, MIL_INT64 DispNum, MIL_CONST_TEXTW_PTR DispFormat, MIL_INT64 InitFlag, MIL_ID *Disp3dIdPtr);
 
   // create default calls
#if M_MIL_UNICODE_API
#define M3ddispAlloc M3ddispAllocW
#else
#define M3ddispAlloc M3ddispAllocA
#endif
 
#else
   MIL_ID    MFTYPE M3ddispAlloc(MIL_ID SysId, MIL_INT64 DispNum, MIL_CONST_TEXT_PTR DispFormat, MIL_INT64 InitFlag, MIL_ID *Display3dIdPtr);
#endif
 
#ifdef __cplusplus
   inline bool In3ddispInquireDoubleRange(MIL_INT64 InquireType)
      {
      if(M_NB_ELEMENTS_BIT_SET(InquireType))
         {
         return false;
         }
 
      switch(M_STRIP_INQ_COMBOFLAGS(InquireType))
         {
         case M_ALLOCATION_FAILURE_REAL_TEST_FLAG:
         case M_FOV_HORIZONTAL_ANGLE:
         case M_FOV_VERTICAL_ANGLE:
         case M_ALTERNATE_SPEED_FACTOR:
         case M_ROTATION_SPEED:
         {
         return true;
         }
 
         default:
         {
         break;
         }
         }
 
      return false;
      }
   inline bool In3ddispInquireIdRange(MIL_INT64 InquireType)
      {
      switch(M_STRIP_INQ_COMBOFLAGS(InquireType))
         {
         case M_3D_GRAPHIC_LIST_ID:
            return true;
 
         default:
            break;
         }
      return false;
      }
   inline bool In3ddispInquireStringRange(MIL_INT64 InquireType)
      {
      if(M_NB_ELEMENTS_BIT_SET(InquireType))
         {
         return false;
         }
 
      switch(M_STRIP_CLIENT_TEXT_ENCODING(M_STRIP_INQ_COMBOFLAGS(InquireType)))
         {
         case M_STRIP_CLIENT_TEXT_ENCODING(M_TITLE):
         {
         return true;
         }
 
         default:
         {
         break;
         }
         }
 
      return false;
      }
   inline bool In3ddispInquireInt64Range(MIL_INT64 InquireType)
      {
 
      switch(M_STRIP_INQ_COMBOFLAGS(InquireType))
         {
         case M_BACKGROUND_COLOR:
            return true;
 
         default:
            break;
         }
 
      return false;
      }
   inline bool M3ddispInquireMustHaveUserPtr(MIL_INT64 InquireType)
      {
      const MIL_INT64 ForcedDataType = MinquireOverrides(M_STRIP_HLVLDATATYPE(InquireType), M_TYPE_MIL_INT);
      if(ForcedDataType != 0)
         {
         return false;
         }
      return In3ddispInquireStringRange(InquireType) || In3ddispInquireDoubleRange(InquireType);
      }
   #endif // __cplusplus
   /* C++ directive if needed */
#ifdef __cplusplus
   }
#endif
 
#ifdef __cplusplus
inline void M3ddispControl(MIL_ID Disp3dId, MIL_INT64 ControlType, MIL_DOUBLE ControlValue)
   {
   M3ddispControlDouble(Disp3dId, ControlType, ControlValue);
   }
 
inline void M3ddispControl(MIL_ID Disp3dId, MIL_INT64 ControlType, MIL_INT64 ControlValue)
   {
   M3ddispControlInt64(Disp3dId, ControlType, ControlValue);
   }
 
inline void M3ddispControl(MIL_ID Disp3dId, MIL_INT64 ControlType, MIL_INT32 ControlValue)
   {
   M3ddispControlInt64(Disp3dId, ControlType, ControlValue);
   }
 
#if !(M_MIL_USE_LINUX && M_MIL_USE_64BIT)
inline void M3ddispControl(MIL_ID Disp3dId, MIL_INT64 ControlType, int ControlValue)
   {
   M3ddispControlInt64(Disp3dId, ControlType, ControlValue);
   }
#endif
 
inline void M3ddispControl(MIL_ID Disp3dId, MIL_INT64 ControlType, MIL_CONST_TEXT_PTR ControlValue)
   {
   M3ddispControl(Disp3dId, ControlType, (MIL_INT)ControlValue);
   }
#else
#define M3ddispControl      M3ddispControlDouble
#endif
 
#ifdef __cplusplus
inline MIL_INT64 M3ddispInquireDataType(MIL_INT64 InquireType)
   {
   const MIL_INT64 ForcedDataType = MinquireOverrides(InquireType, M_TYPE_MIL_INT);
   if(ForcedDataType != 0)
      return ForcedDataType;
  
   if(In3ddispInquireIdRange(InquireType))
      {
      return M_TYPE_MIL_ID;
      }
   if(In3ddispInquireStringRange(InquireType))
      {
      return M_TYPE_TEXT_CHAR;
      }
   if(In3ddispInquireInt64Range(InquireType))
      {
      return M_TYPE_MIL_INT64;
      }
 
   if(In3ddispInquireDoubleRange(InquireType))
      {
      return M_TYPE_MIL_DOUBLE;
      }
 
   return M_TYPE_MIL_INT;
   }
#if M_MIL_USE_SAFE_TYPE
// ----------------------------------------------------------
// M3ddispInquire
inline MIL_INT64 MFTYPE M3ddispInquireSafeType(MIL_ID Disp3dId, MIL_INT64 InquireType, int UserVarPtr)
   {
   bool MustHaveUserPointer = M3ddispInquireMustHaveUserPtr(InquireType);
 
   if(UserVarPtr)
      SafeTypeError(MIL_TEXT("M3ddispInquire"));
 
   if(!UserVarPtr && MustHaveUserPointer)
      SafeTypeError(MIL_TEXT("M3ddispInquire"), MIL_TEXT("The specified InquireType requires a non-null output pointer."));
 
   return M3ddispInquire(Disp3dId, InquireType, NULL);
   }
#if M_MIL_SAFE_TYPE_M_NULL_PTR_TYPE_EXISTS
inline MIL_INT64 MFTYPE M3ddispInquireSafeType(MIL_ID Disp3dId, MIL_INT64 InquireType, std::nullptr_t)
   {
   bool MustHaveUserPointer = M3ddispInquireMustHaveUserPtr(InquireType);
 
   if(MustHaveUserPointer)
      SafeTypeError(MIL_TEXT("M3ddispInquire"), MIL_TEXT("The specified InquireType requires a non-null output pointer."));
   return M3ddispInquire(Disp3dId, InquireType, NULL);
   }
#endif
 
inline MIL_INT64 MFTYPE M3ddispInquireSafeTypeExecute(MIL_ID Disp3dId, MIL_INT64  InquireType, void  *UserVarPtr, MIL_INT64  GivenType)
   {
   MIL_INT64 RequiredType = M_NULL;
   // Looking for M_TYPE flags
   RequiredType = M3ddispInquireDataType(InquireType);
   ReplaceTypeMilIdByTypeMilIntXX(&RequiredType);
 
   if(RequiredType != GivenType)
      {
      SafeTypeError(MIL_TEXT("M3ddispInquire"));
      }
 
   return M3ddispInquire(Disp3dId, InquireType, UserVarPtr);
   }
 
inline MIL_INT64 MFTYPE M3ddispInquireUnsafe(MIL_ID Disp3dId, MIL_INT64  InquireType, void        *UserVarPtr) { return M3ddispInquire(Disp3dId, InquireType, UserVarPtr); }
inline MIL_INT64 MFTYPE M3ddispInquireSafeType(MIL_ID Disp3dId, MIL_INT64  InquireType, MIL_INT8*   UserVarPtr) { return M3ddispInquireSafeTypeExecute(Disp3dId, InquireType, UserVarPtr, M_TYPE_CHAR); }
inline MIL_INT64 MFTYPE M3ddispInquireSafeType(MIL_ID Disp3dId, MIL_INT64  InquireType, MIL_INT16*  UserVarPtr) { return M3ddispInquireSafeTypeExecute(Disp3dId, InquireType, UserVarPtr, M_TYPE_SHORT); }
inline MIL_INT64 MFTYPE M3ddispInquireSafeType(MIL_ID Disp3dId, MIL_INT64  InquireType, MIL_INT32   *UserVarPtr) { return M3ddispInquireSafeTypeExecute(Disp3dId, InquireType, UserVarPtr, M_TYPE_MIL_INT32); }
inline MIL_INT64 MFTYPE M3ddispInquireSafeType(MIL_ID Disp3dId, MIL_INT64  InquireType, MIL_INT64   *UserVarPtr) { return M3ddispInquireSafeTypeExecute(Disp3dId, InquireType, UserVarPtr, M_TYPE_MIL_INT64); }
inline MIL_INT64 MFTYPE M3ddispInquireSafeType(MIL_ID Disp3dId, MIL_INT64  InquireType, MIL_FLOAT   *UserVarPtr) { return M3ddispInquireSafeTypeExecute(Disp3dId, InquireType, UserVarPtr, M_TYPE_MIL_FLOAT); }
inline MIL_INT64 MFTYPE M3ddispInquireSafeType(MIL_ID Disp3dId, MIL_INT64  InquireType, MIL_DOUBLE  *UserVarPtr) { return M3ddispInquireSafeTypeExecute(Disp3dId, InquireType, UserVarPtr, M_TYPE_DOUBLE); }
#if M_MIL_SAFE_TYPE_SUPPORTS_UNSIGNED
inline MIL_INT64 MFTYPE M3ddispInquireSafeType(MIL_ID Disp3dId, MIL_INT64  InquireType, MIL_UINT8*   UserVarPtr) { return M3ddispInquireSafeTypeExecute(Disp3dId, InquireType, UserVarPtr, M_TYPE_CHAR); }
inline MIL_INT64 MFTYPE M3ddispInquireSafeType(MIL_ID Disp3dId, MIL_INT64  InquireType, MIL_UINT16*  UserVarPtr) { return M3ddispInquireSafeTypeExecute(Disp3dId, InquireType, UserVarPtr, M_TYPE_SHORT); }
inline MIL_INT64 MFTYPE M3ddispInquireSafeType(MIL_ID Disp3dId, MIL_INT64  InquireType, MIL_UINT32  *UserVarPtr) { return M3ddispInquireSafeTypeExecute(Disp3dId, InquireType, UserVarPtr, M_TYPE_MIL_INT32); }
inline MIL_INT64 MFTYPE M3ddispInquireSafeType(MIL_ID Disp3dId, MIL_INT64  InquireType, MIL_UINT64  *UserVarPtr) { return M3ddispInquireSafeTypeExecute(Disp3dId, InquireType, UserVarPtr, M_TYPE_MIL_INT64); }
#endif
#if M_MIL_SAFE_TYPE_ADD_WCHAR_T                                                      
inline MIL_INT64 MFTYPE M3ddispInquireSafeType(MIL_ID Disp3dId, MIL_INT64  InquireType, wchar_t*    UserVarPtr) { return M3ddispInquireSafeTypeExecute(Disp3dId, InquireType, UserVarPtr, M_TYPE_TEXT_CHAR); }
#endif
 
#define M3ddispInquire          M3ddispInquireSafeType
#else // #if M_MIL_USE_SAFE_TYPE
 
#define M3ddispInquireUnsafe    M3ddispInquire 
 
#endif // #if M_MIL_USE_SAFE_TYPE
 
#endif //__cplusplus
 
#if M_MIL_USE_STRING
inline MIL_ID    MFTYPE M3ddispAlloc(MIL_ID SysId, MIL_INT64 DispNum, const MIL_STRING& ControlFlag, MIL_INT64 InitFlag, MIL_ID *Display3dIdPtr)
   {
   return M3ddispAlloc(SysId, DispNum, ControlFlag.c_str(), InitFlag, Display3dIdPtr);
   }
#if M_MIL_USE_SAFE_TYPE
 
inline MIL_INT64 MFTYPE M3ddispInquireSafeType(MIL_ID Disp3dId, MIL_INT64  InquireType, MIL_STRING& UserVarPtr)
   {
   MIL_INT64 RetValue = 0;
   MIL_INT InternalStringSize = 0;
 
   if(!In3ddispInquireStringRange(InquireType))
      {
      SafeTypeError(MIL_TEXT("M3ddispInquire"), MIL_TEXT("Inquire type not supported with MIL_STRING."));
      }
 
   M3ddispInquire(Disp3dId, InquireType + M_STRING_SIZE, &InternalStringSize);
 
   if(InternalStringSize > 0)
      {
      UserVarPtr.assign(InternalStringSize, MIL_TEXT('\0'));
      RetValue = M3ddispInquire(Disp3dId, InquireType, &UserVarPtr[0]);
      UserVarPtr.resize(InternalStringSize - 1);
 
 
      }
 
   return RetValue;
   }
#else
inline MIL_INT64 MFTYPE M3ddispInquire(MIL_ID Disp3dId, MIL_INT64  InquireType, MIL_STRING& UserVarPtr)
   {
   MIL_INT64 RetValue = 0;
   MIL_INT InternalStringSize = 0;
 
   M3ddispInquire(Disp3dId, InquireType + M_STRING_SIZE, &InternalStringSize);
 
   if(InternalStringSize > 0)
      {
      UserVarPtr.assign(InternalStringSize, MIL_TEXT('\0'));
      RetValue = M3ddispInquire(Disp3dId, InquireType, &UserVarPtr[0]);
      UserVarPtr.resize(InternalStringSize - 1);
 
      }
 
   return RetValue;
   }
#endif // #if M_MIL_USE_SAFE_TYPE
inline void M3ddispControl(MIL_ID Disp3dId, MIL_INT64 ControlType, const MIL_STRING& ControlValue)
   {
   M3ddispControl(Disp3dId, ControlType, M_PTR_TO_MIL_INT(ControlValue.c_str()));
   }
 
#endif /* M_MIL_USE_STRING */
// Automatic double casting
#define M3ddispSetView(Disp3dId, Mode, Param1, Param2, Param3, ControlFlag) \
        M3ddispSetViewDouble(Disp3dId, Mode, M_MILID_TO_DOUBLE(Param1), M_MILID_TO_DOUBLE(Param2), M_MILID_TO_DOUBLE(Param3), ControlFlag)
////////////////////////////////////////////////////////////////////////////////
//  MIL_UNIQUE_ID  support
 
#if M_MIL_USE_MIL_UNIQUE_ID
#if M_MIL_USE_SAFE_TYPE
template <> inline bool MilIsCorrectObjectType<&M3ddispFree>(MIL_INT64 ObjectType)
   {
   return ObjectType == M_3D_DISPLAY;;
   }
#endif
typedef MIL_UNIQUE_ID<&M3ddispFree> MIL_UNIQUE_3DDISP_ID;
 
#if M_MIL_USE_MOVE_SEMANTICS
//3DDISP
inline MIL_UNIQUE_3DDISP_ID M3ddispAlloc(MIL_ID SysId, MIL_INT DispNum, MIL_CONST_TEXT_PTR ControlFlag, MIL_INT64 InitFlag, MIL_UNIQUE_ID_TAG)
   {
   return MIL_UNIQUE_3DDISP_ID(M3ddispAlloc(SysId, DispNum, ControlFlag, InitFlag, M_NULL));
   }
template <MilFreeFuncType FreeFunc> inline void M3ddispFree(const MIL_UNIQUE_ID<FreeFunc>&) = delete;
#endif // M_MIL_USE_MOVE_SEMANTICS
#endif // M_MIL_USE_MIL_UNIQUE_ID
// End of MIL_UNIQUE_ID support
 
#endif // __MIL3DDISP_H__