Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Selector.h
Go to the documentation of this file.
1
/* Project Magic 2.0
2
Destroyer Studios LLC
3
Copyright © 1997-2004. All Rights Reserved.
4
5
SUBSYSTEM: Magic.exe
6
FILE: Selector.h
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
Class definition for Selector (free-form selection tool)
13
*/
14
15
#ifndef Selector_h
16
#define Selector_h
17
18
#include "
Polygon.h
"
19
#include "
Graphic.h
"
20
#include "
Video.h
"
21
22
class
ModelView
;
23
class
Model
;
24
class
Selection
;
25
class
Surface
;
26
27
// +----------------------------------------------------------------------+
28
29
class
Selector
:
public
Graphic
30
{
31
public
:
32
Selector
(
Selection
* s=0);
33
virtual
~Selector
();
34
35
enum
SELECT_MODE
{
SELECT_REMOVE
=-1,
SELECT_REPLACE
=0,
SELECT_APPEND
=1 };
36
37
// Operations
38
virtual
void
Render
(
Video
* video, DWORD flags);
39
virtual
bool
CheckVisibility
(
Projector
& projector) {
return
true
; }
40
41
void
Clear
();
42
void
Begin
(
Model
* m,
int
mode,
int
select_mode
=
SELECT_REPLACE
);
43
void
AddMark
(CPoint& p);
44
void
End
();
45
46
bool
IsActive
()
const
{
return
view_mode
?
true
:
false
; }
47
int
GetViewMode
()
const
{
return
view_mode
; }
48
Selection
*
GetSelection
()
const
{
return
selection
; }
49
50
void
UseModel
(
Model
* m);
51
void
SelectAll
(
int
select_mode
=
SELECT_REPLACE
);
52
void
SelectInverse
();
53
void
SelectSurface
(
Surface
* s,
int
select_mode
=
SELECT_REPLACE
);
54
void
SelectVert
(
Surface
* s,
int
v,
int
select_mode
=
SELECT_REPLACE
);
55
void
SelectPoly
(
Poly
* p,
int
select_mode
=
SELECT_REPLACE
);
56
void
SelectMaterial
(
Material
* m,
int
select_mode
=
SELECT_REPLACE
);
57
58
void
Reselect
();
59
60
protected
:
61
enum
{
MAX_MARK
= 4096 };
62
63
int
view_mode
;
64
int
nmarks
;
65
CPoint
marks
[
MAX_MARK
];
66
int
select_mode
;
67
68
bool
own_selection
;
69
Selection
*
selection
;
70
Model
*
model
;
71
};
72
73
74
// +----------------------------------------------------------------------+
75
76
#endif Selector_h
Magic2
Selector.h
Generated on Tue Jun 5 2012 20:46:16 for Starshatter_Open by
1.8.1