snap.h 1.9 KB

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