home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 January
/
Chip_1997-01_cd.bin
/
ms95
/
disk21
/
dir03
/
f011200.re_
/
f011200.re
Wrap
Text File
|
1996-04-02
|
13KB
|
329 lines
/*----------------------------------------------------------------------+
| |
| Copyright (1995) Bentley Systems, Inc., All rights reserved. |
| |
| "MicroStation", "MDL", and "MicroCSL" are trademarks of Bentley |
| Systems, Inc. |
| |
| Limited permission is hereby granted to reproduce and modify this |
| copyrighted material provided that the resulting code is used only |
| in conjunction with Bentley Systems products under the terms of the |
| license agreement provided therein, and that this notice is retained |
| in its entirety in any such reproduction or modification. |
| |
+----------------------------------------------------------------------*/
/*----------------------------------------------------------------------+
| |
| mdlhview.h -- definitions for hidden line view interface |
| |
| $Workfile: mdlhview.h $
| $Revision: 1.22 $
| $Date: 09 Nov 1995 09:51:10 $
| |
+----------------------------------------------------------------------*/
#if !defined (__mdlhviewH__)
#define __mdlhviewH__
/*----------------------------------------------------------------------+
| |
| Header File Dependencies |
| |
+----------------------------------------------------------------------*/
#include "mselems.h"
#include "mstypes.h"
#include "stdio.h"
/*----------------------------------------------------------------------+
| |
| Defines |
| |
+----------------------------------------------------------------------*/
#define MDLHVIEW_OUTPUT_TRANSFORM_NONE 0
#define MDLHVIEW_OUTPUT_TRANSFORM_PROJECT_TO_2D_VIEWPLANE 1
#define MDLHVIEW_OUTPUT_TRANSFORM_PROJECT_TO_3D_VIEWPLANE 2
#define MDLHVIEW_FILE_OFF 0
#define MDLHVIEW_FILE_2D 1
#define MDLHVIEW_FILE_3D 2
#define MDLHVIEW_FILE_3D_ORIGINAL_POSITION 3
#define MDLHVIEW_DEFAULT_ZBUFFER_RESOLUTION 1000
#define MDLHVIEW_DEFAULT_WORKING_MEMORY 4096
#define MDLHVIEW_ANNOTATION_HIDE 0
#define MDLHVIEW_ANNOTATION_ALWAYS 1
#define MDLHVIEW_ANNOTATION_NEVER 2
/*----------------------------------------------------------------------+
| |
| Message codes for mdlHview_message(contextP, msg,ival, ptr) |
| |
| MESSAGE |
| ival = integer argument, meaning depends on message |
| ptr = pointer argument, meaning depends on message |
| default: description of settings if the message is never sent |
| |
| A) Output geometry controls |
| |
| MDLHVIEW_MSG_SET_VISIBLE_SYMBOLOGY |
| ival = 0 |
| ptr = pointer to EdgeSymbology structure to be used for |
| visible edges. |
| default: all symbology as on original geoemtry. |
| MDLHVIEW_MSG_SET_HIDDEN_SYMBOLOGY |
| ival = 0 |
| ptr = pointer to EdgeSymbology structure to be used for |
| hidden edges. Note that this does NOT enable output |
| of hidden edges -- it just sets the symbology for |
| if they are enabled. Send MDLHVIEW_MSG_INCLUDE_HIDDEN |
| to enable the hidden edges. |
| default: level, color, and weight as on original geometry. Style |
| dashed (i.e. the usual hidden-line style on drawings) |
| |
| MDLHVIEW_MSG_SET_INCLUDE_HIDDEN |
| ival = TRUE/FALSE flag indicating whether hidden lines are |
| to be output (TRUE) or not (FALSE) |
| ptr = NULL |
| default: FALSE |
| |
| MDLHVIEW_MSG_SET_INCLUDE_INTERSECTIONS |
| ival = TRUE/FALSE indicating whether surface-surface |
| intersections are to be computed. |
| ptr = NULL |
| default: FALSE |
| NOTE: Surface-surface intersections add significantly to |
| compute time and memory use. |
| |
| MDLHVIEW_MSG_SET_INCLUDE_RULES |
| ival = TRUE/FALSE flag indicating whether surface rule lines |
| are to be output (TRUE) or not (FALSE) |
| ptr = NULL |
| default: FALSE |
| |
| MDLHVIEW_MSG_SET_INCLUDE_ANNOTATION |
| ival = One of the following choices of handling of text, |
| dimension, and other annotation geometry: |
| MDLHVIEW_ANNOTATION_HIDE -- reduce the annotation to |
| line strokes and process them through |
| the hidden line algorithm, i.e. subject to |
| hiding as with any other line strokes |
| MDLHVIEW_ANNOTATION_ALWAYS -- output the annotation |
| without testing for visibility. |
| MDLHVIEW_ANNOTATION_NEVER -- ignore annotation |
| ptr = NULL |
| default: MDLHVIEW_ANNOTATION_HIDE |
| |
| MDLHVIEW_MSG_SET_OUTPUT_TO_MASTER |
| ival = TRUE/FALSE to enable/disable output to the master file |
| ptr = NULL |
| default: false |
| |
| B) Resolution Controls |
| MDLHVIEW_MSG_SET_WORKING_MEMORY |
| ival = working memory, in killobytes. E.g., ival=1024 |
| sets working memory to 1024kilbytes = 1 megabyte |
| ptr = NULL |
| default: 4096, i.e. 4Mb. |
| |
| MDLHVIEW_MSG_SET_XRESOLUTION |
| MDLHVIEW_MSG_SET_YRESOLUTION |
| ival = resolution to apply on the respective axis. |
| ptr = NULL |
| default: Both resolutions default to 1000 |
| MDLHVIEW_MSG_SET_RESOLUTION_TO_SCREEN |
| ival = 0 |
| ptr = NULL |
| Sets both x and y resolution to match the screen in the view |
| MDLHVIEW_MSG_SET_RESOLUTION |
| ival = resoluton to apply on longer axis of view. Shorter |
| side is proportionally smaller. |
| ptr = NULL |
| (If MDLHVIEW_MSG_SET_NPC_WINDOW is being used to restrict |
| attention to a subset of the view, only that rectangle is |
| considered by MDLHVIEW_MSG_SET_RESOLUTION_TO_SCREEN and |
| MDLHVIEW_MSG_SET_RESOLUTION) |
| |
| |
| MDLHVIEW_MSG_SET_NPC_WINDOW | |
| ival = 0 |
| ptr = pointer to a Dvector2d which defines the active rectangle|
| within the view. Coordinate 00 is at the lower left, |
| 11 at the upper right. All subsequent resolution |
| changes are applied in this rectangle rather than the |
| full view. If the NPC window is to be changed, it |
| must be done PRIOR TO setting resolutions. |
| default: The entire window (00 to 11) is active. |
| |
| D) Fencing by polygons defined by the application |
| These message control a set of polygons used to mask out portions |
| of the view. This masking is separate from the fencing |
| controlled by MDL_HVIEW_SET_FENCEMODE. Both types of fencing |
| may be applied simultaneously. |
| The polygon mask set is applied strictly sequentially so as to |
| define a mask that marks each point of the view as visible or |
| hidden. The mask itself is constructed at the start of |
| each of the (several) passes that the hview algorithm makes |
| through the view. Application code can regenerate the mask |
| for each reference file as follows: (1) send the message |
| MDLHVIEW_MSG_SET_PRE_FILE_FUNCTION |
| to define a callback to be invoked each time a reference file |
| is opened, (2) clear and rebuild the polygon set, and (3) call |
| mdlHview_applyMaskPolygons(contextP) to activate the set |
| MDLHVIEW_MSG_CLEAR_MASK_POLYGONS |
| ival = 0 |
| ptr = NULL |
| The saved set of mask polygons is cleared. |
| MDLHVIEW_MSG_SET_INSIDE_POLYGON |
| MDLHVIEW_MSG_SET_OUTSIDE_POLYGON |
| ival = number of points |
| ptr = pointer to an array of Dpoint3d structures defining |
| the (3D) polygon. When the mask is applied, points |
| in the polygon are marked as visble (resp. hidden) |
| |
| D) Microstation fence |
| |
| MDLHVIEW_MSG_SET_FENCEMODE |
| ival = 0 -- ignore the microstation fence |
| 1`-- compute visible edges inside the microstation |
| fence |
| 2 -- compute visible edges outside the microstation |
| fence |
| ptr = NULL |
| default: The microstation fence is ignored. |
| |
| F) Callbacks and file handling | |
| MDLHVIEW_MSG_SET_PROGRESS_FUNCTION |
| ival = 0 |
| ptr = pointer to a function to be called with updates |
| of the progress. |
| The function arguments are: |
| func(char * messageP, double percentComplete) | |
| where messageP = string describing the progress. |
| percentComplete = percent of computation completed. |
| default: Progress messages are issued to a dialog box with |
| a completion bar. |
| |
| MDLHVIEW_MSG_SET_PRE_FILE_FUNCTION |
| ival = 0 |
| ptr = pointer to a function to be called each time the master |
| file or a reference file is opened for scanning, |
| The paramter list is |
| preFileFunc (iFile) |
| where iFile is the file number. |
| default: No pre-file function is called. |
| |
| MDLHVIEW_MSG_SET_FILE_HIDE_MASK |
| MDLHVIEW_MSG_SET_FILE_INCLUDE_HIDDEN_MASK |
| ival = 0 |
| ptr = pointer to an array of bit indicating whether |
| the corresponding files (master=0, 1..255=reference |
| files) are to be processed. |
| The INCLUDE_HIDDEN mask allows hidden lines to be included |
| in selected files. (Turning on MDLHVIEW_MSG_SET_INCLUDE_HIDDEN |
| is equivalent to setting all bits in this array to 1). |
| The default for the INCLUDE_HIDDEN mask is all bits 0. |
| The FILE_HIDE mask allows selected files to be skipped completely. |
| A 1 bit in this array means the file is to be included in the |
| scan, and a zero means skip. |
| The default for FILE_HIDE masks is all bits 1, i.e. scan all |
| files. |
| |
| |
| F) Rarely used options |
| MDLHVIEW_MSG_SET_EDGE_DEPTH_CHANGE |
| ival = number of units of depth to subtract to edge coordinates |
| to make them closer to the eye for depth comparisons. |
| ptr = NULL |
| default: zero (0). It is strongly recommended that this value NOT |
| be changed. |
| MDLHVIEW_MSG_SET_EDGE_WIDTH |
| ival = Extra width, in pixels of resolution, to add to each |
| side of edges as they are tested for visibility. |
| ptr = NULL |
| default: 1. Reducing this to zero may cause some 'speckling' |
| or 'stitching' effects, i.e. an solid edge appears |
| to be dashed. It may also reduce undesirable double |
| drawing. |
| MDLHVIEW_MSG_SET_INCLUDE_RAW_MESH |
| ival = TRUE/FALSE to enable/disable output of raw mesh on |
| surfaces. |
| ptr = NULL |
| default: FALSE |
+----------------------------------------------------------------------*/
#define MDLHVIEW_MSG_SET_VISIBLE_SYMBOLOGY -100
#define MDLHVIEW_MSG_SET_HIDDEN_SYMBOLOGY -101
#define MDLHVIEW_MSG_SET_INCLUDE_HIDDEN -102
#define MDLHVIEW_MSG_SET_XRESOLUTION -103
#define MDLHVIEW_MSG_SET_YRESOLUTION -104
#define MDLHVIEW_MSG_SET_WORKING_MEMORY -105
#define MDLHVIEW_MSG_SET_INCLUDE_INTERSECTIONS -106
#define MDLHVIEW_MSG_SET_INCLUDE_RULES -107
#define MDLHVIEW_MSG_SET_EDGE_DEPTH_CHANGE -108
#define MDLHVIEW_MSG_SET_EDGE_WIDTH -109
#define MDLHVIEW_MSG_SET_FILE_HIDE_MASK -110
#define MDLHVIEW_MSG_SET_INCLUDE_ANNOTATION -111
#define MDLHVIEW_MSG_SET_OUTPUT_TO_MASTER -112
#define MDLHVIEW_MSG_SET_FILE_INCLUDE_HIDDEN_MASK -113
#define MDLHVIEW_MSG_SET_FENCEMODE -114
#define MDLHVIEW_MSG_SET_RESOLUTION -115
#define MDLHVIEW_MSG_SET_RESOLUTION_TO_SCREEN -116
#define MDLHVIEW_MSG_CLEAR_MASK_POLYGONS -117
#define MDLHVIEW_MSG_SET_INSIDE_POLYGON -118
#define MDLHVIEW_MSG_SET_OUTSIDE_POLYGON -119
#define MDLHVIEW_MSG_SET_INCLUDE_RAW_MESH -120
#define MDLHVIEW_MSG_SET_NPC_WINDOW -121
#define MDLHVIEW_MSG_SET_PROGRESS_FUNCTION -122
#define MDLHVIEW_MSG_SET_PRE_FILE_FUNCTION -123
#define MDLHVIEW_MSG_APPLY_MASK_POLYGONS -124
#define MDLHVIEW_MSG_SET_COMPLETION_TITLE -130
#define MDLHVIEW_MSG_SET_MULTIBAND_MESSAGE -131
#define MDLHVIEW_MSG_SET_PROCESSING_INTERSECTIONS_MESSAGE -132
/*----------------------------------------------------------------------+
| |
| Typedefs |
| |
+----------------------------------------------------------------------*/
typedef void (*MdlHview_progressFunction)
(
char *messageP,
double percentComplete
);
typedef int (*MdlHview_preFileFunction)
(
int fileNumber
);
typedef void (*MdlHview_PassThroughFunction)
(
MSElementDescr *edP, /* => element descriptor being passed through */
int iFile, /* => file number */
int iPos, /* => file position */
void *contextVoidP /* => application data pointer */
);
typedef void (*MdlHview_outputFunction)
(
MSElementDescr *displayEdP,
MSElementDescr *outputEdP,
HLineSymbology *symbologyP,
int fileNumber
);
struct hviewContext;
typedef struct hviewContext *HviewContextP;
/*----------------------------------------------------------------------+
| |
| Macros |
| |
+----------------------------------------------------------------------*/
#endif /* !defined (__mdlhviewH__) */