1 /*
2    Copyright (C) 2001-2006, William Joseph.
3    All Rights Reserved.
4 
5    This file is part of GtkRadiant.
6 
7    GtkRadiant is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11 
12    GtkRadiant is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16 
17    You should have received a copy of the GNU General Public License
18    along with GtkRadiant; if not, write to the Free Software
19    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20  */
21 
22 #if !defined( INCLUDED_IFILTER_H )
23 #define INCLUDED_IFILTER_H
24 
25 #include "generic/constant.h"
26 
27 enum
28 {
29 	EXCLUDE_WORLD            = 0x00000001,
30 	EXCLUDE_ENT              = 0x00000002,
31 	EXCLUDE_CURVES           = 0x00000004,
32 	EXCLUDE_TRANSLUCENT      = 0x00000008,
33 	EXCLUDE_LIQUIDS          = 0x00000010,
34 	EXCLUDE_CAULK            = 0x00000020,
35 	EXCLUDE_CLIP             = 0x00000040,
36 	EXCLUDE_PATHS            = 0x00000080,
37 	EXCLUDE_LIGHTS           = 0x00000100,
38 	EXCLUDE_DETAILS          = 0x00000200,
39 	EXCLUDE_HINTSSKIPS       = 0x00000400,
40 	EXCLUDE_MODELS           = 0x00000800,
41 	EXCLUDE_AREAPORTALS      = 0x00001000,
42 	EXCLUDE_TRIGGERS         = 0x00002000,
43 	EXCLUDE_CLUSTERPORTALS     = 0x00004000,
44 	EXCLUDE_TERRAIN          = 0x00008000,
45 	EXCLUDE_LIGHTGRID        = 0x00010000,
46 	EXCLUDE_STRUCTURAL       = 0x00020000,
47 	EXCLUDE_BOTCLIP          = 0x00040000,
48 	EXCLUDE_VISPORTALS       = 0x00080000,
49 	EXCLUDE_DECALS           = 0x00100000,
50 };
51 
52 class Filter
53 {
54 public:
55 virtual void setActive( bool active ) = 0;
56 };
57 
58 class Filterable
59 {
60 public:
61 virtual void updateFiltered() = 0;
62 };
63 
64 class FilterSystem
65 {
66 public:
67 INTEGER_CONSTANT( Version, 1 );
68 STRING_CONSTANT( Name, "filters" );
69 virtual void addFilter( Filter& filter, int mask ) = 0;
70 virtual void registerFilterable( Filterable& filterable ) = 0;
71 virtual void unregisterFilterable( Filterable& filterable ) = 0;
72 };
73 
74 #include "modulesystem.h"
75 
76 template<typename Type>
77 class GlobalModule;
78 typedef GlobalModule<FilterSystem> GlobalFilterModule;
79 
80 template<typename Type>
81 class GlobalModuleRef;
82 typedef GlobalModuleRef<FilterSystem> GlobalFilterModuleRef;
83 
GlobalFilterSystem()84 inline FilterSystem& GlobalFilterSystem(){
85 	return GlobalFilterModule::getTable();
86 }
87 
88 #endif
89