]> icculus.org git repositories - icculus/iodoom3.git/blob - neo/tools/radiant/SELECT.H
Various Mac OS X tweaks to get this to build. Probably breaking things.
[icculus/iodoom3.git] / neo / tools / radiant / SELECT.H
1 /*
2 ===========================================================================
3
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company. 
6
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).  
8
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code.  If not, see <http://www.gnu.org/licenses/>.
21
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code.  If not, please request a copy in writing from id Software at the address below.
23
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25
26 ===========================================================================
27 */
28
29 #ifndef __SELECT_H_
30 #define __SELECT_H_
31
32 typedef enum
33 {
34         sel_brush,
35         // sel_sticky_brush,
36         // sel_face,
37         sel_vertex,
38         sel_edge,
39         sel_singlevertex,
40         sel_curvepoint,
41         sel_area,
42         sel_addpoint,                   // for dropping points
43         sel_editpoint                   // for editing points
44 } select_t;
45
46 class CDragPoint {
47 public:
48         idVec3 vec;
49         brush_t *pBrush;
50         int nType;
51         bool priority;
52         CDragPoint() {};
53         CDragPoint(brush_t *b, idVec3 v, int type, bool p) {
54                 pBrush = b;
55                 VectorCopy(v, vec);
56                 nType = type;
57                 priority = p;
58         }
59
60         void Set(brush_t *b, idVec3 v, int type) {
61                 pBrush = b;
62                 VectorCopy(v, vec);
63                 nType = type;
64         }
65
66         bool PointWithin(idVec3 p, int nView = -1);
67 };
68
69
70 typedef struct
71 {
72         brush_t         *brush;
73         face_t          *face;
74         CDragPoint *point;
75         float           dist;
76         bool    selected;
77 } qertrace_t;
78
79
80 #define SF_SELECTED_ONLY         0x01
81 #define SF_ENTITIES_FIRST        0x02
82 #define SF_SINGLEFACE              0x04
83 #define SF_IGNORECURVES    0x08
84 #define SF_IGNOREGROUPS    0x10
85 #define SF_CYCLE           0x20
86
87
88 qertrace_t Test_Ray ( const idVec3 &origin, const idVec3 &dir, int flags );
89 CDragPoint *PointRay( const idVec3 &org, const idVec3 &dir, float *dist);
90 void SelectCurvePointByRay( const idVec3 &org, const idVec3 &dir, int buttons);
91 void SelectSplinePointByRay( const idVec3 &org, const idVec3 &dir, int buttons);
92
93 void Select_GetBounds (idVec3 &mins, idVec3 &maxs);
94 void Select_Brush (brush_t *b, bool bComplete = true, bool bStatus = true);
95 void Select_Ray (idVec3 origin, idVec3 dir, int flags);
96 void Select_Delete (void);
97 void Select_Deselect (bool bDeselectFaces = true);
98 void Select_Invert(void);
99 void Select_Clone (void);
100 void Select_Move (idVec3 delta, bool bSnap = true);
101 void WINAPI Select_SetTexture (texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale = false, void* pPlugTexdef = NULL, bool update = true);
102 void Select_FlipAxis (int axis);
103 void Select_RotateAxis (int axis, float deg, bool bPaint = true, bool bMouse = false);
104 void Select_CompleteTall (void);
105 void Select_PartialTall (void);
106 void Select_Touching (void);
107 void Select_Inside (void);
108 void Select_CenterOrigin();
109 void Select_AllOfType();
110 void Select_Reselect();
111 void Select_FitTexture(float height = 1.0, float width = 1.0);
112 void Select_InitializeRotation();
113 void Select_FinalizeRotation();
114
115 // absolute texture coordinates
116 // TTimo NOTE: this is stuff for old brushes format and rotation texture lock .. sort of in-between with bush primitives
117 void ComputeAbsolute(face_t* f, idVec3& p1, idVec3& p2, idVec3& p3);
118 void AbsoluteToLocal( const idPlane &normal2, face_t* f, idVec3& p1, idVec3& p2, idVec3& p3);
119 void Select_Hide(bool invert = false);
120 void Select_ShowAllHidden();
121 void Select_WireFrame( bool wireFrame );
122 void Select_ForceVisible( bool visible );
123 void Select_Name(const char *pName);
124 void Select_AddProjectedLight();
125 void Select_GetMid (idVec3 &mid);
126 void Select_SetDefaultTexture(const idMaterial *mat, bool fitScale, bool setTexture);
127 void Select_UpdateTextureName(const char *name);
128
129 void Select_FlipTexture(bool y);
130 void Select_SetPatchFit(float dim1, float dim2, float srcWidth, float srcHeight, float rot);
131 void Select_SetPatchST(float s1, float t1, float s2, float t2);
132 void Select_ProjectFaceOntoPatch( face_t *face );
133 void Select_CopyPatchTextureCoords( patchMesh_t *p );
134 void Select_AllTargets();
135 void Select_Scale(float x, float y, float z);
136 void Select_RotateTexture(float amt, bool absolute = false);
137 void Select_ScaleTexture(float x, float y, bool update = true, bool absolute = true);
138 void Select_DefaultTextureScale(bool horz, bool vert, bool update = true);
139 void Select_ShiftTexture(float x, float y, bool autoAdjust = false);
140 void Select_GetTrueMid (idVec3 &mid);
141 void Select_Scale(float x, float y, float z);
142
143
144 #endif