summaryrefslogtreecommitdiffhomepage
path: root/Magic2/Selection.h
blob: 092f0ac9101557ead3778fc7ab2ab6ade02043d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*  Project Magic 2.0
    Destroyer Studios LLC
    Copyright © 1997-2004. All Rights Reserved.

    SUBSYSTEM:    Magic.exe
    FILE:         Selection.h
    AUTHOR:       John DiCamillo


    OVERVIEW
    ========
    Classes for rendering solid meshes of polygons
*/

#ifndef Selection_h
#define Selection_h

#include "Polygon.h"
#include "Graphic.h"
#include "Video.h"
#include "List.h"
#include "ArrayList.h"

// +--------------------------------------------------------------------+

class Selection;
class Solid;
class Model;
class ModelView;
class Surface;
class Segment;

// +--------------------------------------------------------------------+

class Selection : public Graphic
{
public:
   static const char* TYPENAME() { return "Selection"; }

   Selection();
   virtual ~Selection();

   // operations
   virtual void   Render(Video* video, DWORD flags);
   virtual bool   CheckVisibility(Projector& projector) { return true; }

   // accessors / mutators
   void           UseModel(Model* m)   { model = m;      }
   void           UseView(ModelView* v){ model_view = v; }
   Model*         GetModel()     const { return model;   }
   List<Poly>&    GetPolys()           { return polys;   }
   ArrayList&     GetVerts()           { return verts;   }

   virtual void   Clear()              { polys.clear(); 
                                         verts.clear();  }

   void           AddPoly(Poly* p);
   void           AddVert(WORD s, WORD v);
   void           RemovePoly(Poly* p);
   void           RemoveVert(WORD s, WORD v);
   bool           Contains(Poly* p)          const;
   bool           Contains(WORD s, WORD v)   const;

protected:
   Model*         model;
   ModelView*     model_view;
   List<Poly>     polys;
   ArrayList      verts;
};

// +--------------------------------------------------------------------+

#endif Selection_h