1 | /**********************************************************************
|
---|
2 | *<
|
---|
3 | FILE: snap.h
|
---|
4 |
|
---|
5 | DESCRIPTION: Definitions for snap functionality
|
---|
6 |
|
---|
7 | CREATED BY: Tom Hudson
|
---|
8 |
|
---|
9 | HISTORY:
|
---|
10 |
|
---|
11 | *> Copyright (c) 1995, All Rights Reserved.
|
---|
12 | **********************************************************************/
|
---|
13 |
|
---|
14 | #ifndef _SNAP_H_
|
---|
15 |
|
---|
16 | #define _SNAP_H_
|
---|
17 |
|
---|
18 | // Snap types used in Jaguar
|
---|
19 |
|
---|
20 | #define SNAP_2D 1 // 2-D Snap
|
---|
21 | #define SNAP_25D 2 // 2 1/2-D Snap
|
---|
22 | #define SNAP_3D 3 // 3-D Snap
|
---|
23 |
|
---|
24 | // Snap modes
|
---|
25 |
|
---|
26 | #define SNAPMODE_RELATIVE 0
|
---|
27 | #define SNAPMODE_ABSOLUTE 1
|
---|
28 |
|
---|
29 | // Snap flags
|
---|
30 |
|
---|
31 | #define SNAP_IN_3D (0) // Snap to all points (looks dumb here, but code reads easier)
|
---|
32 | #define SNAP_IN_PLANE (1<<0) // Snap only to points in plane
|
---|
33 | #define SNAP_UNSEL_OBJS_ONLY (1<<1) // Ignore selected nodes
|
---|
34 | #define SNAP_SEL_OBJS_ONLY (1<<2) // Ignore unselected nodes
|
---|
35 | #define SNAP_UNSEL_SUBOBJ_ONLY (1<<3) // Ignore selected geometry
|
---|
36 | #define SNAP_SEL_SUBOBJ_ONLY (1<<4) // Ignore unselected geometry
|
---|
37 | #define SNAP_FORCE_3D_RESULT (1<<5) // Override user settings to force snap in 3D
|
---|
38 |
|
---|
39 | // Snap information structure
|
---|
40 |
|
---|
41 | typedef struct {
|
---|
42 | // The snap settings for this operation
|
---|
43 | int snapType; // See above
|
---|
44 | int strength; // Maximum snap distance
|
---|
45 | int vertPriority; // Geometry vertex priority
|
---|
46 | int edgePriority; // Geometry edge priority
|
---|
47 | int gIntPriority; // Grid intersection priority
|
---|
48 | int gLinePriority; // Grid line priority
|
---|
49 | DWORD flags; // See above
|
---|
50 | Matrix3 plane; // Plane to use for snap computations
|
---|
51 | // The best snap so far...
|
---|
52 | Point3 bestWorld; // Best snap point in world space
|
---|
53 | Point2 bestScreen; // Best snap point in screen space
|
---|
54 | int bestDist; // Best snap point distance
|
---|
55 | int priority; // Best point's priority
|
---|
56 | } SnapInfo;
|
---|
57 |
|
---|
58 | // Initialize snap info structure with current snap settings
|
---|
59 | // (Returns zero if snap is OFF)
|
---|
60 | extern int InitSnapInfo(SnapInfo *info);
|
---|
61 |
|
---|
62 | #endif // _SNAP_H_
|
---|