blob: cf1b330c99c2f4156f11d76df29dfdeaa4346826 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef MAPALIGNEDBOX_H
#define MAPALIGNEDBOX_H
#pragma once
#include "MapHelper.h"
class CHelperInfo;
class CRender2D;
class CRender3D;
#define MAX_KEYNAME_SIZE 32
class CMapAlignedBox : public CMapHelper
{
public:
DECLARE_MAPCLASS(CMapAlignedBox,CMapHelper)
//
// Factory for building from a list of string parameters.
//
static CMapClass *Create(CHelperInfo *pInfo, CMapEntity *pParent);
//
// Construction/destruction:
//
CMapAlignedBox(void);
CMapAlignedBox(Vector& pfMins, Vector& pfMaxs);
CMapAlignedBox(const char *pMinsKeyName, const char *pMaxsKeyName);
~CMapAlignedBox(void);
virtual void CalcBounds(BOOL bFullUpdate = FALSE);
virtual CMapClass *Copy(bool bUpdateDependencies);
virtual CMapClass *CopyFrom(CMapClass *pFrom, bool bUpdateDependencies);
virtual void Render2D(CRender2D *pRender);
virtual void Render3D(CRender3D *pRender);
int SerializeRMF(std::fstream &File, BOOL bRMF);
int SerializeMAP(std::fstream &File, BOOL bRMF);
bool IsVisualElement(void) { return !m_bWireframe; }
const char* GetDescription() { return("Aligned box"); }
virtual void OnParentKeyChanged( const char* key, const char* value );
protected:
//void UpdateBox(const Vector &vecMins, const Vector &vecMaxs);
bool m_bWireframe; // Whether we render as a wireframe box when the entity is selected.
// Determines whether we use the key names to get the box size
// or m_fMins/m_fMaxs.
bool m_bUseKeyName;
char m_MinsKeyName[MAX_KEYNAME_SIZE];
char m_MaxsKeyName[MAX_KEYNAME_SIZE];
Vector m_Mins;
Vector m_Maxs;
};
#endif // MAPALIGNEDBOX_H
|