source: golgotha/src/maxtool/sdk_inc/templt.h @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 12 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
  • Property svn:keywords set to Id
File size: 1.3 KB
Line 
1
2/**********************************************************************
3 *<
4        FILE: templt.h
5
6        DESCRIPTION:  Defines 2D Template Object
7
8        CREATED BY: Tom Hudson
9
10        HISTORY: created 31 October 1995
11
12 *>     Copyright (c) 1995, All Rights Reserved.
13 **********************************************************************/
14
15#ifndef __TEMPLT_H__
16
17#define __TEMPLT_H__
18
19class PolyLine;
20class Spline3D;
21
22// A handy 2D floating-point box class
23
24class Box2D {
25        public:
26                BOOL empty;
27                Point2 min, max;
28                Box2D() { empty = TRUE; }
29                void SetEmpty() { empty = TRUE; }
30                CoreExport Box2D& operator+=(const Point2& p);  // expand this box to include p
31        };
32
33// This object is used to test shapes for self-intersection, clockwise status, point
34// surrounding and intersection with other templates.  The last and first points will be the
35// same if it is closed.
36
37class Template {
38        public:
39                int points;
40                BOOL closed;
41                Point2 *pts;
42                Template(Spline3D *spline);
43                Template(PolyLine *line);
44                void Create(PolyLine *line);
45                ~Template();
46                Points() { return points; }
47                BOOL SurroundsPoint(Point2& point);
48                BOOL IsClockWise();
49                BOOL SelfIntersects();
50                BOOL Intersects(Template &t);
51                Box2D Bound();
52        };
53
54#endif // __TEMPLT_H__
Note: See TracBrowser for help on using the repository browser.