]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - contrib/bobtoolz/DBrush.h
7f2485cd81f5b4a68a2b5dda9b8318e9e7ea16fa
[xonotic/netradiant.git] / contrib / bobtoolz / DBrush.h
1 /*\r
2 BobToolz plugin for GtkRadiant\r
3 Copyright (C) 2001 Gordon Biggans\r
4 \r
5 This library is free software; you can redistribute it and/or\r
6 modify it under the terms of the GNU Lesser General Public\r
7 License as published by the Free Software Foundation; either\r
8 version 2.1 of the License, or (at your option) any later version.\r
9 \r
10 This library is distributed in the hope that it will be useful,\r
11 but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
13 Lesser General Public License for more details.\r
14 \r
15 You should have received a copy of the GNU Lesser General Public\r
16 License along with this library; if not, write to the Free Software\r
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
18 */\r
19 \r
20 // DBrush.h: interface for the DBrush class.\r
21 //\r
22 //////////////////////////////////////////////////////////////////////\r
23 \r
24 #if !defined(AFX_DBRUSH_H__35B2C522_F0A7_11D4_ACF7_004095A18133__INCLUDED_)\r
25 #define AFX_DBRUSH_H__35B2C522_F0A7_11D4_ACF7_004095A18133__INCLUDED_\r
26 \r
27 #include "DPlane.h"\r
28 \r
29 #define POINT_IN_BRUSH  0\r
30 #define POINT_ON_BRUSH  1\r
31 #define POINT_OUT_BRUSH 2\r
32 \r
33 #if _MSC_VER > 1000\r
34 #pragma once\r
35 #endif // _MSC_VER > 1000\r
36 \r
37 class DBrush  \r
38 {\r
39 public:\r
40         DPlane* AddFace(vec3_t va, vec3_t vb, vec3_t vc, const char* textureName, bool bDetail);\r
41         void SaveToFile(FILE* pFile);\r
42 \r
43         void Rotate(vec3_t vOrigin, vec3_t vRotation);\r
44         void RotateAboutCentre(vec3_t vRotation);\r
45 \r
46         DPlane* HasPlaneInverted(DPlane* chkPlane);\r
47         DPlane* HasPlane(DPlane* chkPlane);\r
48         DPlane* AddFace(vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* texData);\r
49 \r
50         bool ResetTextures(const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName, int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation);\r
51         bool IsDetail();\r
52         bool HasTexture(const char* textureName);\r
53         bool IntersectsWith(DBrush *chkBrush);\r
54         bool IntersectsWith(DPlane* p1, DPlane* p2, vec3_t v);\r
55         bool IsCutByPlane(DPlane* cuttingPlane);\r
56         bool GetBounds(vec3_t min, vec3_t max); \r
57         bool HasPoint(vec3_t pnt);\r
58         bool BBoxCollision(DBrush* chkBrush);\r
59         bool BBoxTouch(DBrush* chkBrush);\r
60 \r
61         int BuildPoints();\r
62         void BuildBounds();\r
63         void BuildFromWinding(DWinding* w);\r
64         brush_t* BuildInRadiant(bool allowDestruction, int* changeCnt, entity_t* entity = NULL);\r
65 \r
66         void ResetChecks(list<Str>* exclusionList);\r
67 \r
68         void ClearFaces();\r
69         void ClearPoints();\r
70         \r
71         int RemoveRedundantPlanes( void );\r
72         void RemovePlane( DPlane* plane );\r
73         int PointPosition(vec3_t pnt);\r
74         void RemoveFromRadiant( void );\r
75 \r
76         \r
77         void CutByPlane(DPlane* cutPlane, DBrush** newBrush1, DBrush** newBrush2);\r
78 \r
79         void LoadFromBrush_t(brush_t* brush, bool textured);\r
80         void AddPoint(vec3_t pnt);\r
81 \r
82         DPlane* FindPlaneWithClosestNormal( vec_t* normal );\r
83         int FindPointsForPlane( DPlane* plane, DPoint** pnts, int maxpnts );\r
84 \r
85         DBrush(int ID = -1);\r
86         virtual ~DBrush();\r
87 \r
88         bool operator== (DBrush* other);\r
89 \r
90 //      members\r
91         brush_t* QER_brush;\r
92         list<DPlane*> faceList;\r
93         list<DPoint*> pointList;\r
94         int m_nBrushID;\r
95         vec3_t bbox_min, bbox_max;\r
96         bool bBoundsBuilt;\r
97 };\r
98 \r
99 //typedef CList<DBrush*, DBrush*> DBrushList;\r
100 \r
101 #endif // !defined(AFX_DBRUSH_H__35B2C522_F0A7_11D4_ACF7_004095A18133__INCLUDED_)\r