]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - contrib/bobtoolz/DEntity.h
ported PrtView plugin
[xonotic/netradiant.git] / contrib / bobtoolz / DEntity.h
1 /*
2 BobToolz plugin for GtkRadiant
3 Copyright (C) 2001 Gordon Biggans
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 */
19
20 // DEntity.h: interface for the DEntity class.
21 //
22 //////////////////////////////////////////////////////////////////////
23
24 #if !defined(AFX_DENTITY_H__35B2C523_F0A7_11D4_ACF7_004095A18133__INCLUDED_)
25 #define AFX_DENTITY_H__35B2C523_F0A7_11D4_ACF7_004095A18133__INCLUDED_
26
27 #if _MSC_VER > 1000
28 #pragma once
29 #endif // _MSC_VER > 1000
30
31 class DEntity  
32 {
33 public:
34         void RemoveFromRadiant();
35   scene::Node* QER_Entity;
36         int m_nID;
37
38 //      Constrcution/Destruction
39         DEntity(const char* classname = "worldspawn", int ID = -1);     // sets classname
40         virtual ~DEntity();
41 //      ---------------------------------------------
42
43 //      epair functions........
44         void LoadEPairList(Entity* epl);
45         void AddEPair(const char* key, const char* value);
46         void ClearEPairs();
47         DEPair* FindEPairByKey(const char* keyname);
48 //      ---------------------------------------------
49
50 //      random functions........
51         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);
52         void SaveToFile(FILE* pFile);
53         void SetClassname(const char* classname);
54         int GetIDMax();
55
56         void BuildInRadiant(bool allowDestruction);
57         void ResetChecks(list<Str>* exclusionList);
58         void RemoveNonCheckBrushes(list<Str>* exclusionList, bool useDetail);
59
60         DPlane* AddFaceToBrush(vec3_t va, vec3_t vb, vec3_t vc, _QERFaceData* faceData, int ID);        // slow, try not to use much
61         int GetBrushCount( void );
62   DBrush* FindBrushByPointer( scene::Node* brush );
63 //      ---------------------------------------------
64
65
66 //      bool list functions
67         void SelectBrushes(bool* selectList);
68         bool* BuildDuplicateList();
69         bool* BuildIntersectList();
70 //      ---------------------------------------------
71         
72
73 //      brush operations
74         void ClearBrushes();    // clears brush list and frees memory for brushes
75
76         DBrush* GetBrushForID(int ID);
77         DBrush* NewBrush(int ID = -1);
78 //      ---------------------------------------------
79
80 //      patch operations
81         void ClearPatches();
82
83         DPatch* NewPatch();
84 //      ---------------------------------------------
85
86 //      vars
87         list<DEPair*> epairList;
88         list<DBrush*> brushList;
89         // new patches, wahey!!!
90         list<DPatch*> patchList;
91         Str m_Classname;
92 //      ---------------------------------------------
93
94
95         int FixBrushes();
96
97         bool LoadFromEntity(scene::Node* ent, bool bLoadPatches = FALSE);
98         void LoadSelectedBrushes();
99         void LoadSelectedPatches();
100
101         bool LoadFromPrt(char* filename);
102 //      ---------------------------------------------
103         void SpawnString(const char* key, const char* defaultstring, const char** out);
104         void SpawnInt(const char* key, const char* defaultstring, int* out);
105         void SpawnFloat(const char* key, const char* defaultstring, float* out);
106         void SpawnVector(const char* key, const char* defaultstring, vec_t* out);
107 };
108
109 #endif // !defined(AFX_DENTITY_H__35B2C523_F0A7_11D4_ACF7_004095A18133__INCLUDED_)