mdl.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 #define __mdlH__
10 
11 #include <Mstn\basedefs.h>
12 #include <Mstn\basetype.h>
13 #include <Mstn\MstnDefs.h>
14 #include "mstypes.h"
15 #include <DgnPlatform\TextParam.h>
18 
19 /*----------------------------------------------------------------------+
20 | |
21 | MDL function pointers are longs when viewed by native code |
22 | |
23 +----------------------------------------------------------------------*/
24 typedef struct mdlDesc MdlDesc;
25 /* We assume that when this structure is used in an MDL source
26  file, it will hold MDL function pointers. When it is used in
27  native code, it will hold native code function pointers. An
28  entry can actually hold either an MDL or a native function pointer.
29  However, if an MDL source file contains a cast to a ...
30 */
31 typedef void (*CmdHandler) (WCharCP);
32 
33 typedef struct tagMdlCommandNumber
34  {
38 
39 typedef struct tagMdlCommandName
40  {
42  char *pName; // CHAR_OK
44 
45 // Define standard MdlMain to enforce unicode
46 extern "C" DLLEXPORT void MdlMain (int argc, WCharCP argv[]);
47 
48 
49 /*----------------------------------------------------------------------+
50 | |
51 | Text creation routine parameters |
52 | |
53 +----------------------------------------------------------------------*/
54 #define TXT_NO_TRANSFORM 0x8000
55 #define TXT_BY_TILE_SIZE 1
56 #define TXT_BY_MULT 2
57 #define TXT_BY_TEXT_SIZE 3
58 #define TXT_BY_WIDTH_ASPECT 4
59 
60 /*----------------------------------------------------------------------+
61 |
62 | Defines for mdlElement_getFilePos & mdlElement_setFilePos routines.
63 |
64 | NOTE: FILEPOS_COMPONENT has been removed. A complex component no
65 | longer has a unique file position and will instead report
66 | the file position of it's outermost complex header.
67 | Applications that need the currently located component
68 | can get it's ElementRefP using DisplayPath::GetComponentElem.
69 | See mdlLocate_getCurrPath, mdlLocate_getComponentOffset.
70 |
71 +----------------------------------------------------------------------*/
72 #define FILEPOS_EOF 0
73 #define FILEPOS_CURRENT 1
74 #define FILEPOS_FIRST_ELE 2
75 #define FILEPOS_NEXT_ELE 3
76 #define FILEPOS_WORKING_SET 4
77 #define FILEPOS_NEXT_NEW_ELEMENT 6
78 
79 /*----------------------------------------------------------------------+
80 | |
81 | Defines for mdlElmdscr_ routines |
82 | |
83 +----------------------------------------------------------------------*/
84 #define ELMD_ELEMENT (1<<0)
85 #define ELMD_PRE_HDR (1<<1)
86 #define ELMD_POST_HDR (1<<2)
87 #define ELMD_PRE_NESTEDHDR (1<<3)
88 #define ELMD_POST_NESTEDHDR (1<<4)
89 #define ELMD_ALL_ONCE (ELMD_ELEMENT | ELMD_PRE_HDR | ELMD_PRE_NESTEDHDR)
90 #define ELMD_HDRS_ONCE (ELMD_PRE_HDR | ELMD_PRE_NESTEDHDR)
91 
92 /*----------------------------------------------------------------------+
93 | |
94 | Parameters for mdlModify_ routines |
95 | |
96 +----------------------------------------------------------------------*/
97 #if !defined(__midl) // For a MIDL compile, all we care about are the values of the #define constants.
98 
99 typedef struct mdlCopyParamsTag
100  {
102  void *reserved2;
103  void *reserved3;
104  } MdlCopyParams;
105 
106 #endif // !defined(__midl)
107 
108 #define MODIFY_ORIG (1<<1)
109 #define MODIFY_COPY 0
110 #define MODIFY_DRAWINHILITE (1<<3)
111 #define MODIFY_DONTDRAWNEW (1<<4)
112 #define MODIFY_DONTERASEORIG (1<<5)
113 #define MODIFY_TRAVERSENAMEDGROUPASCOPY (1<<6)
114 
115 #define MODIFY_REQUEST_NOHEADERS 0
116 #define MODIFY_REQUEST_HEADERS (1<<0)
117 #define MODIFY_REQUEST_ONLYONE (1<<1)
118 
119 #define MODIFY_STATUS_NOCHANGE 0
120 #define MODIFY_STATUS_REPLACE (1<<0)
121 #define MODIFY_STATUS_DELETE (1<<1)
122 #define MODIFY_STATUS_ABORT (1<<2)
123 #define MODIFY_STATUS_FAIL (1<<3)
124 #define MODIFY_STATUS_REPLACEDSCR (1<<4)
125 #define MODIFY_STATUS_MODIFIED (1<<5)
126 #define MODIFY_STATUS_DONTDELETEROWS (1<<6)
127 #define MODIFY_STATUS_DONTHILITE (1<<7)
128 #define MODIFY_STATUS_SWAPPEDDSCR (1<<8)
129 #define MODIFY_STATUS_ERROR (MODIFY_STATUS_FAIL | MODIFY_STATUS_ABORT)
130 
131 /*----------------------------------------------------------------------+
132 | |
133 | Compress callback types |
134 | |
135 +----------------------------------------------------------------------*/
137 {
140 };
141 
142 
143 #define VIEWMODE_WIREFRAME 0
144 #define VIEWMODE_CROSSSECTION 1
145 #define VIEWMODE_WIREMESH 2
146 #define VIEWMODE_HIDDENLINE 3
147 #define VIEWMODE_FILLEDHLINE 4
148 #define VIEWMODE_CONTANTSHADE 5
149 #define VIEWMODE_SMOOTHSHADE 6
150 #define VIEWMODE_PHONGSHADE 7
151 
152 
153 /*----------------------------------------------------------------------+
154 | |
155 | Defines for mdlOutput_printf. |
156 | |
157 +----------------------------------------------------------------------*/
158 #define MSG_MESSAGE 0
159 #define MSG_ERROR 1
160 #define MSG_PROMPT 2
161 #define MSG_STATUS 3
162 #define MSG_COMMAND 4
163 #define MSG_KEYIN 5
164 #define MSG_CONSOLE 6
165 
166 /*----------------------------------------------------------------------+
167 | |
168 | Defines for mdlWindow_ routines |
169 | |
170 +----------------------------------------------------------------------*/
171 typedef struct MSWindow MSWindow;
172 
173 /*----------------------------------------------------------------------+
174 | |
175 | Constants for associative points |
176 | |
177 +----------------------------------------------------------------------*/
178 #define POINT_CHECK 0
179 #define POINT_ASSOC 1
180 #define POINT_STD 2
181 
182 /* Arc association options */
183 #define ASSOC_ARC_ANGLE 0
184 #define ASSOC_ARC_CENTER 1
185 #define ASSOC_ARC_START 2
186 #define ASSOC_ARC_END 3
187 
188 /*----------------------------------------------------------------------+
189 | |
190 | Constants for mdlMline functions |
191 | |
192 +----------------------------------------------------------------------*/
193 #define MLCAP_NONE 0x0
194 #define MLCAP_LINE 0x1
195 #define MLCAP_OUTER_ARCS 0x2
196 #define MLCAP_INNER_ARCS 0x4
197 #define MLCAP_CLOSE 0x8
198 
199 #define MLJOIN_CLOSE 0
200 #define MLJOIN_OPEN 1
201 #define MLJOIN_MERGE 2
202 
203 typedef enum MlineCapFlags
204  {
207  } MlineCapFlags;
208 
209 /*----------------------------------------------------------------------+
210 | |
211 | Constants for mdlText functions |
212 | |
213 +----------------------------------------------------------------------*/
214 #define FRACTIONS (1<<1)
215 #define INTERNATIONAL (1<<2)
216 #define CONTROL (1<<3)
217 #define HTML_CHAR (1<<4)
218 
219 /*----------------------------------------------------------------------+
220 | |
221 | Constants for mdlState_startFenceCommand |
222 | |
223 +----------------------------------------------------------------------*/
224 #define FENCE_NO_CLIP 0
225 #define FENCE_CLIP_ORIG 1
226 #define FENCE_CLIP_COPY 3
227 
228 /*----------------------------------------------------------------------+
229 | |
230 | Constants for mdlSystem_loadMdlProgramExtended |
231 | |
232 +----------------------------------------------------------------------*/
233 #define LOADPROGRAM_APPLICATION_CLASS 1
234 #define LOADPROGRAM_MESSAGES 2
235 #define LOADPROGRAM_DEBUGGER 3
236 #define LOADPROGRAM_STARTUP_STRING 4
237 #define LOADPROGRAM_PARENT_NAME 5
238 #define LOADPROGRAM_STARTUP_TYPE 6
239 
240 // this is the meaning of the output variable of mdlRefFile_getIntegerParameters with paramName set to REFERENCE_ACTIVATESTATUS
242 {
250 
251 /*----------------------------------------------------------------------+
252 | |
253 | Constants for mdlView_getRenderParameters / setRenderParameters |
254 | Positive values are view dependent; negative are view independent |
255 | |
256 +----------------------------------------------------------------------*/
257  /* view independent parameters */
258 #define RENDER_STEREO_SEPARATION (- 1)
259 #define RENDER_MAX_POLYGON_SIZE (- 2)
260 #define RENDER_AMBIENT_INTENSITY (- 3)
261 #define RENDER_FLASH_INTENSITY (- 4)
262 #define RENDER_SOLAR_INTENSITY (- 5)
263 #define RENDER_SOLAR_DIRECTION (- 6)
264 #define RENDER_LATITUDE (- 7)
265 #define RENDER_LONGITUDE (- 8)
266 #define RENDER_SOLAR_TIME_USE_CURRENT_TIME (- 9)
267 #define RENDER_SOLAR_TIME_DST (-10)
268 #define RENDER_SOLAR_TIME_PM (-11)
269 #define RENDER_SOLAR_TIME_MONTH (-12)
270 #define RENDER_SOLAR_TIME_MINUTE (-13)
271 #define RENDER_SOLAR_TIME_HOUR (-14)
272 #define RENDER_SOLAR_TIME_DAY (-15)
273 #define RENDER_NEAR_DEPTH_DENSITY (-16)
274 #define RENDER_FAR_DEPTH_DENSITY (-17)
275 #define RENDER_NEAR_DEPTH_DISTANCE (-18)
276 #define RENDER_HAZE_COLOR (-19)
277 #define RENDER_SHADOW_TOLERANCE (-20)
278 #define RENDER_SOLAR_YEAR (-21)
279 #define RENDER_GMT_OFFSET (-22)
280 #define RENDER_FLASH_INTENSITY_SCALE (-23)
281 #define RENDER_SOLAR_INTENSITY_SCALE (-24)
282 #define RENDER_AMBIENT_INTENSITY_SCALE (-25)
283 #define RENDER_AZIMUTH (-26)
284 #define RENDER_SOLAR_VECTOR_OVERRIDE (-27)
285 #define RENDER_VECTOR_SHIFT (-28)
286 #define RENDER_BACKGROUND_FILE (-29)
287 #define RENDER_SOLAR_SHADOW_RES (-30)
288 
289 #define RENDER_FLAG_RENDER_LINES_AS_VECTORS (-40)
290 #define RENDER_FLAG_IGNORE_LINEAR (-41)
291 #define RENDER_FLAG_SAVE_SHADOW_MAPS (-42)
292 #define RENDER_FLAG_SOLAR_BY_VECTOR (-43)
293 #define RENDER_FLAG_INTERPOLATE_TEXTURES (-44)
294 #define RENDER_FLAG_SHADOW_FILTER (-45)
295 #define RENDER_FLAG_SOLAR_SHADOWS (-46)
296 #define RENDER_FLAG_ANTIALIAS_GRID (-47)
297 #define RENDER_FLAG_FLASH_LIGHT (-48)
298 #define RENDER_FLAG_SOLAR_LIGHT (-49)
299 #define RENDER_FLAG_AMBIENT_LIGHT (-50)
300 
301  /* view dependent parameters */
302 #define RENDER_CAMERA_ANGLE 1
303 #define RENDER_CAMERA_FOCAL_LENGTH 2
304 #define RENDER_CAMERA_POSITION 3
305 
306 #define RENDER_VIEW_LEVELS 4
307 #define RENDER_VIEW_ORIGIN 5
308 #define RENDER_VIEW_DELTA 6
309 #define RENDER_VIEW_TRANSMATRX 7
310 #define RENDER_VIEW_CONVERSION 8
311 #define RENDER_VIEW_ACTIVE_Z 9
312 
313 #define RENDER_VIEW_FLAGS_FAST_CURVE 10
314 #define RENDER_VIEW_FLAGS_FAST_TEXT 11
315 #define RENDER_VIEW_FLAGS_FAST_FONT 12
316 #define RENDER_VIEW_FLAGS_LINE_WGHTS 13
317 #define RENDER_VIEW_FLAGS_PATTERNS 14
318 #define RENDER_VIEW_FLAGS_TEXT_NODES 15
319 #define RENDER_VIEW_FLAGS_ED_FIELDS 16
320 #define RENDER_VIEW_FLAGS_ON_OFF 17
321 #define RENDER_VIEW_FLAGS_DELAY 18
322 #define RENDER_VIEW_FLAGS_GRID 19
323 #define RENDER_VIEW_FLAGS_LEV_SYMB 20
324 #define RENDER_VIEW_FLAGS_POINTS 21
325 #define RENDER_VIEW_FLAGS_CONSTRUCTS 22
326 #define RENDER_VIEW_FLAGS_DIMENS 23
327 #define RENDER_VIEW_FLAGS_FAST_CELL 24
328 #define RENDER_VIEW_FLAGS_DEF 25
329 
330 #define RENDER_EXT_FLAGS_FILL 30
331 #define RENDER_EXT_FLAGS_RASTER_TEXT 31
332 #define RENDER_EXT_FLAGS_AUX_DISPLAY 32
333 #define RENDER_EXT_FLAGS_ORIENTATION_DISPLAY 33
334 #define RENDER_EXT_FLAGS_VIEW_RENDERED 34
335 #define RENDER_EXT_FLAGS_CAMERA 35
336 #define RENDER_EXT_FLAGS_RENDER_MODE 36
337 #define RENDER_EXT_FLAGS_BACKGROUND 37
338 #define RENDER_EXT_FLAGS_REF_BOUNDARY_DISPLAY 38
339 #define RENDER_EXT_FLAGS_FAST_BOUNDARY_CLIP 39
340 #define RENDER_EXT_FLAGS_DEPTH_CUE 40
341 #define RENDER_EXT_FLAGS_INHIBIT_DYNAMICS 41
342 #define RENDER_EXT_FLAGS_APP_DISPLAY 42
343 #define RENDER_EXT_FLAGS_SHADOWS 43
344 #define RENDER_EXT_FLAGS_TEXTURE_MAPS 44
345 #define RENDER_EXT_FLAGS_HAZE 45
346 #define RENDER_EXT_FLAGS_TRANSPARENCY 46
347 #define RENDER_EXT_FLAGS_SLOW_DITHER 47
348 #define RENDER_EXT_FLAGS_INHIBIT_LINE_STYLES 48
349 #define RENDER_EXT_FLAGS_ACCELERATED 49
350 #define RENDER_EXT_FLAGS_PATTERN_DYNAMICS 50
351 #define RENDER_EXT_FLAGS_HIDDEN_LINE 51
352 #define RENDER_EXT_FLAGS_TAGS_OFF 52
353 #define RENDER_EXT_FLAGS_DRAWING_VIEW 53
354 #define RENDER_EXT_FLAGS_RENDER_DISPLAY_EDGES 54
355 #define RENDER_EXT_FLAGS_RENDER_DISPLAY_HIDDEN 55
356 
357 /*----------------------------------------------------------------------+
358 | |
359 | Constant for MicroStation BASIC linkage ID |
360 | |
361 +----------------------------------------------------------------------*/
362 #define LINKAGEID_BASIC 43797
363 
364 /*----------------------------------------------------------------------+
365 | |
366 | Constants for mdlTextFile_ functions |
367 | |
368 +----------------------------------------------------------------------*/
369 #define TEXTFILE_READ 0
370 #define TEXTFILE_WRITE 1
371 #define TEXTFILE_APPEND 2
372 
373 #define TEXTFILE_DEFAULT 0x0
374 #define TEXTFILE_KEEP_NEWLINE 0x1
375 #define TEXTFILE_NO_NEWLINE 0x1
376 #define TEXTFILE_NEWLINES_TO_LINES 0x2
MSWindow is a base class for Microstation/PowerPlatform desktop-based windows, view windows and dialo...
Definition: MSWindow.h:24
CmdHandler pHandler
Definition: mdl.h:41
void(* CmdHandler)(WCharCP)
Definition: mdl.h:31
char * pName
Definition: mdl.h:42
Definition: mdl.h:206
Definition: mdl.h:205
Definition: mdl.h:138
Definition: mdl.h:139
the reference is not currently writeable.
Definition: mdl.h:244
the reference is the current Active model.
Definition: mdl.h:246
Definition: mdl.h:33
ReferenceActivateStatus
Definition: mdl.h:241
wchar_t const * WCharCP
Definition: Bentley.h:224
struct tagMdlCommandName MdlCommandName
#define DLLEXPORT
Definition: basedefs.h:137
Definition: mdl.h:99
CompressType
Definition: mdl.h:136
void * reserved2
Definition: mdl.h:102
struct mdlCopyParamsTag MdlCopyParams
Definition: mdl.h:39
CommandNumber number
Definition: mdl.h:36
int reserved1
Definition: mdl.h:101
UInt64 CommandNumber
Definition: DgnPlatformBaseType.r.h:76
the reference has been activated at some point in the past, and not put back into NOTWRITEABLE state...
Definition: mdl.h:248
MlineCapFlags
Definition: mdl.h:203
CmdHandler pHandler
Definition: mdl.h:35
void * reserved3
Definition: mdl.h:103
void MdlMain(int argc, WCharCP argv[])
struct tagMdlCommandNumber MdlCommandNumber
struct mdlDesc MdlDesc
Definition: DgnTool.h:18

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.