home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 January
/
Chip_1997-01_cd.bin
/
ms95
/
disk22
/
dir03
/
f011170.re_
/
f011170.re
Wrap
Text File
|
1996-04-02
|
7KB
|
239 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. |
| |
+----------------------------------------------------------------------*/
/*----------------------------------------------------------------------+
| |
| mdlbspln.h -- Include file for MDL applications using |
| B-splines. Defines constants and strucutes. |
| |
| $Workfile: mdlbspln.h $
| $Revision: 6.1 $
| $Date: 02 Feb 1994 15:38:46 $
| |
+----------------------------------------------------------------------*/
#if !defined (__mdlbsplnH__)
#define __mdlbsplnH__
#if !defined (__basetypeH__)
#include <basetype.h>
#endif
/*----------------------------------------------------------------------+
| |
| Immediate Defines |
| |
+----------------------------------------------------------------------*/
/* B-Spline curve types */
#define BSCURVE_GENERAL 0
#define BSCURVE_LINE 1
#define BSCURVE_CIRCULAR_ARC 2
#define BSCURVE_CIRCLE 3
#define BSCURVE_ELLIPTICAL_ARC 4
#define BSCURVE_ELLIPSE 5
#define BSCURVE_PARABOLIC_ARC 6
#define BSCURVE_HYPERBOLIC_ARC 7
/* B-Spline surface types */
#define BSSURF_GENERAL 0
#define BSSURF_PLANE 1
#define BSSURF_RIGHT_CYLINDER 2
#define BSSURF_CONE 3
#define BSSURF_SPHERE 4
#define BSSURF_TORUS 5
#define BSSURF_REVOLUTION 6
#define BSSURF_TAB_CYLINDER 7
#define BSSURF_RULED_SURFACE 8
/* Constants */
#define BSSURF_U 0
#define BSSURF_V 1
/* Miscellaneous Maxima */
#define MAX_POLES 101
#define MAX_ORDER 15
#define MAX_KNOTS (MAX_POLES + 2*MAX_ORDER - 1)
#define MAX_BNDRY_PTS 151
#define MAX_DATA_PTS 250
/* Tolerances */
#define KNOT_TOLERANCE_BASIS 1E-10
/* Fit modes */
#define FIT_POLES 0
#define FIT_POINTS 1
#define FIT_LEASTSQUARES 2
#define FIT_CATMULLROM 3
/* Offset cusp treatments */
#define OFFSET_JUMP_CUSP 0
#define OFFSET_CHAMFER_CUSP 1
#define OFFSET_POINT_CUSP 2
#define OFFSET_PARABOLA_CUSP 3
#define OFFSET_ARC_CUSP 4
/* Continuity degree specifications */
#define POSITION_CONTINUITY 0
#define TANGENT_CONTINUITY 1
#define CURVATURE_CONTINUITY 2
/* Truncation specifications */
#define TRUNCATE_BOTH 0
#define TRUNCATE_NONE 1
#define TRUNCATE_SINGLE 2
/* Iso display for silhouette curves */
#define SILHBND_U 0
#define SILHBND_V 1
#define SILHBND_NONE 2
#define SILHBND_BOTH 3
/* Surface edge classification */
#define NO_EDGE 0x0000
#define U0_EDGE 0x0001
#define U1_EDGE 0x0002
#define V0_EDGE 0x0004
#define V1_EDGE 0x0008
#define ANY_EDGE 0x000F
/*----------------------------------------------------------------------+
| |
| Structure Definitions |
| |
+----------------------------------------------------------------------*/
typedef struct bSplineParam
{
int order;
int closed;
int numPoles;
int numKnots;
int numRules;
} BsplineParam;
typedef struct bsplineDisplay
{
int polygonDisplay;
int curveDisplay;
int rulesByLength;
} BsplineDisplay;
#if !defined (resource)
typedef struct bsurfBoundary
{
int numPoints;
Dpoint2d *points;
} BsurfBoundary;
/*----------------------------------------------------------------------+
| |
| SSI Definitions |
| |
+----------------------------------------------------------------------*/
typedef struct boundBox /* 120 words */
{
double system[3][3];
Dpoint3d origin;
Dpoint3d extent;
} BoundBox;
typedef struct boundCyl /* 64 words */
{
Dpoint3d org; /* origin of cylinder */
Dpoint3d dir; /* direction of cylinder, unit vector */
double radius; /* radius of cylinder */
double length; /* length of cylinder axis */
} BoundCyl;
typedef struct booleandata /* specific to each surface in SurfaceChain */
{
int numBounds; /* number of new trim boundaries for this surface */
BsurfBoundary *bounds; /* trim boundaries for this surface created by SSI */
BoundBox box; /* bounding box of this surface */
void *edP; /* generating element descriptor for this surface */
void *trimEdP; /* trimmed element descriptor for this surface */
} BooleanData;
/*----------------------------------------------------------------------+
| |
| MSBsplineCurve |
| |
+----------------------------------------------------------------------*/
typedef struct msbsplinecurve
{
int type;
int rational;
BsplineDisplay display;
BsplineParam params;
Dpoint3d *poles; /* In homogenous coordinates */
double *knots; /* Full knot vector */
double *weights; /* Weights only if rational */
} MSBsplineCurve;
/*----------------------------------------------------------------------+
| |
| MSBsplineSurface |
| |
+----------------------------------------------------------------------*/
typedef struct msbsplinesurface
{
int type;
int rational;
BsplineDisplay display;
BsplineParam uParams;
BsplineParam vParams;
Dpoint3d *poles;
double *uKnots;
double *vKnots;
double *weights;
int holeOrigin;
int numBounds;
BsurfBoundary *boundaries;
} MSBsplineSurface;
/*----------------------------------------------------------------------+
| |
| CurveChain |
| |
+----------------------------------------------------------------------*/
typedef struct curveChain CurveChain;
struct curveChain
{
MSBsplineCurve curve;
void *userDataP;
CurveChain *nextP;
CurveChain *previousP;
};
/*----------------------------------------------------------------------+
| |
| SurfaceChain |
| |
+----------------------------------------------------------------------*/
typedef struct surfaceChain SurfaceChain;
struct surfaceChain
{
MSBsplineSurface surface;
void *userDataP;
SurfaceChain *nextP;
SurfaceChain *previousP;
};
#endif /* ndef resource */
#endif /* ndef __mdlbsplnH__ */