]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - contrib/bobtoolz/DEntity.h
transfer from internal tree r5311 branches/1.4-gpl
[xonotic/netradiant.git] / contrib / bobtoolz / DEntity.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 // DEntity.h: interface for the DEntity class.\r
21 //\r
22 //////////////////////////////////////////////////////////////////////\r
23 \r
24 #if !defined(AFX_DENTITY_H__35B2C523_F0A7_11D4_ACF7_004095A18133__INCLUDED_)\r
25 #define AFX_DENTITY_H__35B2C523_F0A7_11D4_ACF7_004095A18133__INCLUDED_\r
26 \r
27 #include "DBrush.h"\r
28 #include "DEPair.h"\r
29 #include "DPatch.h"\r
30 #include "StdAfx.h"     // Added by ClassView\r
31 \r
32 #if _MSC_VER > 1000\r
33 #pragma once\r
34 #endif // _MSC_VER > 1000\r
35 \r
36 class DEntity  \r
37 {\r
38 public:\r
39         void RemoveFromRadiant();\r
40         entity_t* QER_Entity;\r
41         int m_nID;\r
42 \r
43 //      Constrcution/Destruction\r
44         DEntity(char* classname = "worldspawn", int ID = -1);   // sets classname\r
45         virtual ~DEntity();\r
46 //      ---------------------------------------------\r
47 \r
48 //      epair functions........\r
49         void LoadEPairList(epair_t* epl);\r
50         void AddEPair(char* key, char* value);\r
51         void ClearEPairs();\r
52         DEPair* FindEPairByKey(const char* keyname);\r
53 //      ---------------------------------------------\r
54 \r
55 //      random functions........\r
56         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, bool rebuild);\r
57         void SaveToFile(FILE* pFile);\r
58         void SetClassname(char* classname);\r
59         int GetIDMax();\r
60 \r
61         void BuildInRadiant(bool allowDestruction);\r
62         void ResetChecks(list<Str>* exclusionList);\r
63         void RemoveNonCheckBrushes(list<Str>* exclusionList, bool useDetail);\r
64 \r
65         DPlane* AddFaceToBrush(vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* faceData, int ID);        // slow, try not to use much\r
66         int GetBrushCount( void );\r
67         DBrush* FindBrushByPointer( brush_t* brush );\r
68 //      ---------------------------------------------\r
69 \r
70 \r
71 //      bool list functions\r
72         void SelectBrushes(bool* selectList);\r
73         bool* BuildDuplicateList();\r
74         bool* BuildIntersectList();\r
75 //      ---------------------------------------------\r
76         \r
77 \r
78 //      brush operations\r
79         void ClearBrushes();    // clears brush list and frees memory for brushes\r
80 \r
81         DBrush* GetBrushForID(int ID);\r
82         DBrush* NewBrush(int ID = -1);\r
83 //      ---------------------------------------------\r
84 \r
85 //      patch operations\r
86         void ClearPatches();\r
87 \r
88         DPatch* NewPatch();\r
89 //      ---------------------------------------------\r
90 \r
91 //      vars\r
92         list<DEPair*> epairList;\r
93         list<DBrush*> brushList;\r
94         // new patches, wahey!!!\r
95         list<DPatch*> patchList;\r
96         Str m_Classname;\r
97 //      ---------------------------------------------\r
98 \r
99 \r
100         int FixBrushes(bool rebuild);\r
101 \r
102         bool LoadFromEntity(int id,     bool bLoadPatches = FALSE);\r
103         bool LoadFromEntity(entity_t* ent, bool bLoadPatches = FALSE);\r
104         void LoadSelectedBrushes();\r
105         void LoadSelectedPatches();\r
106 \r
107         bool LoadFromPrt(char* filename);\r
108 //      ---------------------------------------------\r
109         void SpawnString(const char* key, const char* defaultstring, const char** out);\r
110         void SpawnInt(const char* key, const char* defaultstring, int* out);\r
111         void SpawnFloat(const char* key, const char* defaultstring, float* out);\r
112         void SpawnVector(const char* key, const char* defaultstring, vec_t* out);\r
113 };\r
114 \r
115 #endif // !defined(AFX_DENTITY_H__35B2C523_F0A7_11D4_ACF7_004095A18133__INCLUDED_)\r