home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 January
/
Chip_1997-01_cd.bin
/
ms95
/
disk21
/
dir03
/
f011970.re_
/
f011970.re
Wrap
Text File
|
1996-04-02
|
19KB
|
807 lines
/*----------------------------------------------------------------------+
| |
| Copyright (c) 1985-93; 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. |
| |
+----------------------------------------------------------------------*/
/*----------------------------------------------------------------------+
| |
| $Workfile: mselemen.fdf $
| $Revision: 6.15 $
| $Date: 29 Aug 1995 11:25:26 $
| |
+----------------------------------------------------------------------*/
#ifndef __mselemenFDF__
#define __mselemenFDF__
/*----------------------------------------------------------------------+
| |
| Header File Dependencies |
| |
+----------------------------------------------------------------------*/
#if !defined (__dloadlibH__)
#include "dloadlib.h"
#endif
#if !defined (__mdlH__)
#include "mdl.h"
#endif
#if !defined (__widecharH__)
#include "widechar.h"
#endif
#if !defined (__mselemsH__)
#include "mselems.h"
#endif
#if defined (__BSI__)
#include <mielemen.fdf>
#endif
/*======================================================================+
| |
| Function Definitions |
| |
+======================================================================*/
int mdlArc_create
(
MSElement *out,
MSElement *in,
Dpoint3d *center,
double axis1,
double axis2,
RotMatrix *rMatrix,
double start,
double sweep
);
int mdlArc_createByCenter
(
MSElement *out,
MSElement *in,
Dpoint3d *pts,
int useRad,
double rad,
int view
);
int mdlArc_createByPoints
(
MSElement *out,
MSElement *in,
Dpoint3d *pts
);
int mdlArc_extract
(
Dpoint3d *startEndPts, /* <= start and end points */
double *start, /* <= start angle (degrees) */
double *sweep, /* <= sweep angle (degrees) */
double *axis1, /* <= primary axis */
double *axis2, /* <= primary axis */
RotMatrix *rotMatrix,
Dpoint3d *center,
MSElement *in
);
int mdlCircle_createBy3Pts
(
MSElement *out,
MSElement *in,
Dpoint3d *pt,
int fillMode /* => -1=use active, 0=No fill, 1=Fill */
);
void mdlComplexChain_createHeader
(
MSElement *chain,
int shapeMode, /* True if this is going to be a shape */
int fillMode /* => -1=use active, 0=No fill, 1=Fill */
);
int mdlCone_create
(
MSElement *out, /* <= element to be created */
MSElement *in, /* => optional starting element */
double topRadius, /* => top radius */
double bottomRadius, /* => bottom radius */
Dpoint3d *base, /* => center of base */
Dpoint3d *top, /* => center of top */
RotMatrix *coneRMatrix /* => general cone Transformation */
);
int mdlCone_createRightCylinder
(
MSElement *out, /* <= element to be created */
MSElement *in, /* => optional starting element */
double radius, /* => radius (both top and bottom) */
Dpoint3d *base, /* => center of base */
Dpoint3d *top /* => center of top */
);
int mdlCone_createWithRotMatrix
(
MSElement *out, /* <= element to be created */
MSElement *in, /* => optional starting element */
double topRadius, /* => top radius */
double bottomRadius, /* => bottom radius */
Dpoint3d *base, /* => center of base */
Dpoint3d *top, /* => center of top */
RotMatrix *coneRMatrix /* => general cone Transformation */
);
int mdlCone_extract
(
double *topRadius, /* <= top radius */
double *bottomRadius, /* <= bottom radius */
Dpoint3d *topCenter, /* <= top center */
Dpoint3d *bottomCenter, /* <= bottom center */
RotMatrix *rotMatrix,
MSElement *in
);
int mdlCurve_create
(
MSElement *out,
MSElement *in,
Dpoint3d *points,
int numVerts
);
int mdlCurve_createI
(
MSElement *out,
MSElement *in,
Point3d *points,
int numVerts,
int computeStart,
int computeEnd
);
ULong mdlElement_add
(
MSElement *element
);
ULong mdlElement_append
(
MSElement *element
);
int mdlElement_appendAttributes
(
MSElement *p, /* <= element pointer */
int length, /* => number of words of attribute data */
short *buffer /* => buffer containing the attribute data */
);
int mdlElement_cnvFromFileFormat
(
MSElement *internal, /* <= element in internal format */
void *external, /* => element in file format */
int convertType /* => conversion : 0 = 2D-2D, 1=3D-3D, 2=2D-3D */
);
int mdlElement_cnvToFileFormat
(
void *igdselem, /* element in IGDS file format */
MSElement *element, /* element in internal format */
int three_d /* flag indicating the dim of the file */
);
void mdlElement_display
(
MSElement *elementP,
int drawmode
);
void mdlElement_displayInSelectedViews
(
MSElement *addr,
int drawmode,
int viewMask
);
int mdlElement_extractAttributes
(
int *length, /* <= number of words of attribute data */
short *buffer, /* <= where to save the attribute data */
MSElement *p /* => element pointer */
);
ULong mdlElement_getFilePos
(
int type, /* => what type of information is required. */
int *pfilenum /* => pointer to area to get file number; or NULL */
);
void mdlElement_getProperties
(
int *level,
int *ggNum,
int *class,
int *locked,
int *new,
int *modified,
int *viewIndepend,
int *solidHole,
MSElement *el
);
void mdlElement_getSymbology
(
int *color,
int *weight,
int *style,
MSElement *el
);
int mdlElement_getType
(
MSElement *el
);
int mdlElement_igdsSize
(
MSElement *elP, /* element in internal format */
int fileNumber /* fileNumber 0 - master, etc. */
);
boolean mdlElement_isFilled
(
MSElement *u
);
int mdlElement_offset
(
MSElement *out,
MSElement *in,
Dpoint3d *offset
);
int mdlElement_read
(
MSElement *buffer,
int fileNo, /* => 0=dgn file, 1-255 for ref, */
/* CELL_LIB for cell lib */
ULong filepos /* => absolute file position. */
);
ULong mdlElement_rewrite
(
MSElement *newElem,
MSElement *oldElem,
long filePos
);
int mdlElement_setFilePos
(
int type, /* => what type of information is required. */
int filenum, /* => file number (0 - CELL_LIB), -1 for ignore. */
ULong position /* => new file position. */
);
void mdlElement_setProperties
(
MSElement *el,
int *level,
int *ggNum,
int *elementClass,
int *locked,
int *new,
int *modified,
int *viewIndepend,
int *solidHole
);
void mdlElement_setSymbology
(
MSElement *el,
int *color,
int *weight,
int *style
);
int mdlElement_setFillColor
(
MSElement *elementP,
int fillColor
);
int mdlElement_getFillColor
(
MSElement *elementP
);
int mdlElement_size
(
MSElement *hdr
);
void mdlElement_stripAttributes
(
MSElement *out, /* <= element with all attributes removed */
MSElement *in /* => element with attributes */
);
int mdlElement_stroke
(
Dpoint3d **points,
int *nPoints,
MSElement *el,
double tol
);
int mdlElement_transform
(
MSElement *out,
MSElement *in,
Transform *t
);
int mdlElement_undoableDelete
(
MSElement *addr,
long filePos,
int display
);
int mdlElement_createExtendedTCB
(
MSElement *elementP /* <= Type 66 with current settings */
);
int mdlElement_createDimensionSettings
(
MSElement *elementP /* <= Type 66 with dimension settings */
);
int mdlElement_createViewSettings
(
MSElement *elementP /* <= Type 66 with view settings */
);
int mdlElement_createDigitizerSettings
(
MSElement *elementP /* <= Type 66 with digitizer settings */
);
void mdlElement_createColorTable
(
MSElement *elementP, /* <= color table element */
byte *colorP, /* => color table (768 bytes) */
char *cnameP /* => color table name */
);
int mdlElement_setLineStyle
(
MSElement *elementP,
int fileNo,
int lsIndex,
char *styleNameP,
void *paramsP
);
int mdlElement_getLineStyle
(
char *styleNameP,
void *paramsP,
MSElement *elementP,
int fileNo,
int lsIndex
);
void mdlElement_dropComplex
(
ULong filePos, /* => file position of element to drop */
int display, /* => display? (TRUE or FALSE) */
int addToSelection /* => add to selection (TRUE or FALSE) */
);
int mdlEllipse_create
(
MSElement *out,
MSElement *in,
Dpoint3d *center,
double axis1,
double axis2,
RotMatrix *rMatrix,
int fillMode
);
int mdlLineString_create
(
MSElement *out,
MSElement *in,
Dpoint3d *points,
int numVerts
);
int mdlLineString_createI
(
MSElement *out,
MSElement *in,
Point3d *points,
int numVerts
);
int mdlLine_create
(
MSElement *out,
MSElement *in,
Dpoint3d *points
);
int mdlLine_createI
(
MSElement *out,
MSElement *in,
Point3d *points
);
void mdlPointString_create
(
MSElement *u,
MSElement *in,
Point3d *pnts,
double *transforms,
int numverts,
int disjoint
);
int mdlShape_create
(
MSElement *out,
MSElement *in,
Dpoint3d *points,
int numVerts,
int fillMode
);
int mdlShape_createI
(
MSElement *out,
MSElement *in,
Point3d *points,
int numVerts,
int fillMode
);
void mdlSurface_createHeader
(
MSElement *surf,
int surfType
);
int mdlSurface_project
(
MSElementDescr **surfDscrPP,
MSElementDescr *elDscrP,
Dpoint3d *pnt1,
Dpoint3d *pnt2,
Transform *userTrans
);
int mdlSurface_revolve
(
MSElementDescr **surfDscrPP,
MSElementDescr *elDscrP,
Dpoint3d *center,
int axis,
double angle
);
int mdlTextNode_create
(
MSElement *out, /* <= text node element created */
MSElement *in, /* => template element */
Dpoint3d *dOrigin, /* => text node origin */
RotMatrix *rotMatrix, /* => (view - angle) transformation */
double *lineSpacing, /* => line spacing */
MSTextSize *size, /* => character size for this node */
TextParam *txtParams /* => font, justification, etc. */
);
int mdlTextNode_createWithStrings
(
MSElementDescr **nodeDescrPP, /* <= element descriptor */
MSElement *nodeTemplate, /* => node template */
Dpoint3d *dOrigin, /* => text node origin */
RotMatrix *rotMatrix, /* => (view - angle) transformation */
double *lineSpacing, /* => line spacing */
MSTextSize *size, /* => character size for this node */
TextParam *txtParams, /* => text parameters (just, style, etc. */
char *strings[], /* => strings in the text node */
int numberStrings, /* => number of text strings */
TextEDParam *textEDParam /* => enter data fields */
);
int mdlTextNode_extract
(
Dpoint3d *userOrigin, /* <= user specified point */
RotMatrix *rotMatrix, /* <= rotation matrix */
MSTextSize *tileSize, /* <= character size */
double *lineSpacing, /* <= line spacing */
TextParam *txtParams, /* <= font, justification, etc. */
int *nodeNumber, /* <= node number */
MSElement *in /* => pointer to the text node element */
);
int mdlTextNode_extractShape
(
Dpoint3d rPoints[5],
Dpoint3d *rOrigin,
MSElement *in,
int addsnaptol,
int view
);
int mdlText_addStringsToNodeDscr
(
MSElementDescr *in, /* <=> descriptor of text node */
char *buffer /* => buffer of text strings */
);
int mdlText_extractStringsFromDscr
(
char *buffer, /* <= buffer to receive text strings */
int bufferSize, /* => size of user buffer */
MSElementDescr *in /* => descriptor of text or text node */
);
void mdlText_changeElementFont
(
MSElement *u,
TextStyleInfo *newTfs
);
int mdlText_create
(
MSElement *out, /* <= text element created */
MSElement *in, /* => template element */
char *stringParam, /* => ASCII or multibyte string */
Dpoint3d *userOrigin, /* => user specified point */
TextSizeParam *size, /* => text size */
RotMatrix *trans, /* => rotation matrix */
TextParam *txtParams, /* => font, justifaction, etc. */
TextEDParam *edParam /* => enter-data field info */
);
int mdlText_createWide
(
MSElement *out, /* <= text element created */
MSElement *in, /* => template element */
MSWideChar *wString, /* => wide character string */
Dpoint3d *userOrigin, /* => user specified point */
RotMatrix *trans, /* => rotation matrix */
TextSizeParam *size, /* => text size */
TextParamWide *txtParams, /* => font, just, slant, underline, etc. */
TextEDParam *edParam /* => enter-data field info */
);
void mdlText_expandTabs
(
char *outstringP,
char *instringP,
int maxsize,
int tab_interval
);
int mdlText_extract
(
Dpoint3d *origin, /* <= lower left corner */
Dpoint3d *userOrigin, /* <= user specified origin */
int *edfields, /* <= number of enter data fields */
TextEDField *ed, /* <= enter data field structure */
char *string, /* <= ASCII or multibyte string */
RotMatrix *rotMatrix, /* <= rotation matrix for text */
TextStyleInfo *tfs, /* <= text font style */
int *just, /* <= text justification */
MSTextSize *tileSize, /* <= character size (h and w) */
MSTextSize *textSize, /* <= total text size */
MSElement *in /* => pointer to the text element */
);
void mdlText_extractFontStyle
(
MSElement *u,
TextStyleInfo *tfs
);
int mdlText_extractShape
(
Dpoint3d rPoints[5],
Dpoint3d *rOrigin,
MSElement *in,
int addsnaptol,
int view
);
int mdlText_extractString
(
char *txt, /* <= ASCII or multibyte string */
MSElement *u /* => pointer to the text element */
);
boolean mdlText_fontExists
(
int fontNum
);
int mdlText_getCurrentFont
(
void
);
int mdlText_getFontInfo
(
TextFontInfo *tfiP, /* <= Information is stored here */
int fontNum /* => Font numb for which info is desired */
);
int mdlText_getFontName
(
char *fontName, /* <= Name of font (font description) */
int fontNum /* => Font numb for which name is desired */
);
int mdlText_loadFontStyle
(
TextStyleInfo *tfs
);
int mdlText_nodeFromText
(
Text_node_2d *nodeTemplate, /* <= template of text node element */
Text_2d *textTemplate /* => template of text element */
);
int mdlText_textFromNode
(
MSElement *ptext, /* <= pointer to text template to be created */
MSElement *pnode /* => pointer to exisiting node template */
);
int mdlText_extractWide
(
MSWideChar *wString, /* <= wide character string */
Dpoint3d *origin, /* <= lower left corner */
Dpoint3d *userOrigin, /* <= user specified point */
RotMatrix *rotMatrix, /* <= rotation matrix for text */
TextSizeParam *textSize, /* <=> character size or total text size */
TextParamWide *textParam, /* <= font, just, slant, underline, etc. */
TextEDParam *edParam, /* <= enter data field structure */
MSElement *in /* => pointer to the text element */
);
int mdlText_extractStringWide
(
MSWideChar *wString, /* <= wide character string */
MSElement *el /* => pointer to the text element */
);
int mdlTextNode_createWide
(
MSElement *out, /* <= text node element created */
MSElement *in, /* => template element */
Dpoint3d *userOrigin, /* => user specified point */
RotMatrix *rotMatrix, /* => (view - angle) transformation */
TextSizeParam *size, /* => character size for this node */
TextParamWide *txtParams /* => font, just, slant, underline, etc. */
);
int mdlTextNode_createWithStringsWide
(
MSElementDescr **nodeDescrPP, /* <= element descriptor */
MSElement *nodeTemplate, /* => node template */
MSWideChar *wStrings[], /* => wide character strings */
int numberStrings, /* => number of text strings */
Dpoint3d *userOrigin, /* => user specified point */
RotMatrix *rotMatrix, /* => (view - angle) transformation */
TextSizeParam *sizeParam, /* => character size for this node */
TextParamWide *txtParams, /* => font, just, slant, underline, etc. */
TextEDParam *textEDParam /* => enter data fields */
);
int mdlTextNode_extractWide
(
Dpoint3d *origin, /* <= lower left corner */
Dpoint3d *userOrigin, /* <= user specified point */
RotMatrix *rotMatrix, /* <= rotation matrix */
TextSizeParam *txtSizeParam, /* <=> text node size */
TextParamWide *txtParams, /* <= font, just, slant, underline, etc. */
MSElement *in /* => pointer to the text node element */
);
int mdlText_addStringsToNodeDscrWide
(
MSElementDescr *in, /* <=> descriptor of text node */
MSWideChar *pWString /* => buffer of text strings */
);
int mdlText_extractStringsFromDscrWide
(
MSWideChar *buffer, /* <= buffer to receive text strings */
int bufferSize, /* => size of user buffer */
MSElementDescr *in /* => descriptor of text or text node */
);
int mdlText_compressStringWide
(
MSWideChar *outBuffer, /* <= buffer to return string */
MSWideChar *inBuffer, /* => raw string */
int bufferMax, /* => length of output buffer */
int conversionType /* => conversion mask */
);
int mdlText_compressString
(
char *outBuffer, /* <= buffer to return string */
char *inBuffer, /* => raw string */
int bufferMax, /* => length of output buffer */
int conversionType /* => conversion mask */
);
int mdlText_expandStringWide
(
MSWideChar *outBuffer, /* <= buffer to return string */
MSWideChar *inBuffer, /* => raw string */
int bufferMax, /* => length of output buffer */
int conversionType /* => conversion mask */
);
int mdlText_expandString
(
char *outBuffer, /* <= buffer to return string */
char *inBuffer, /* => raw string */
int bufferMax, /* => length of output buffer */
int conversionType /* => conversion mask */
);
int mdlText_getElementDescr
(
MSElementDescr **outEdPP,
Text_2d *pTextElm,
RotMatrix *viewRMatrixP
);
int mdlText_getStringArrayFromBuffer
(
char ***textStrings, /* <= string array */
char *buffer, /* => string buffer */
int totalLines /* => lines of text in buffer */
);
int mdlText_freeStringArray
(
char **strings, /* => string array */
int totalLines /* => lines of text */
);
int mdlText_countBufferStrings
(
char *buffer /* => text buffer */
);
int mdlText_wordWrapBuffer
(
char *buffer, /* <=> text buffer */
int bufferMax, /* => maximum length of buffer */
int maxLength /* => line length */
);
#endif