Resolve "Toggle Free Look with Hotkey"
[ryzomcore.git] / ryzom / client / src / prim_file.h
blob7214cd74918323d1817d00d0c3e1ff31260cccb1
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef CL_PRIM_FILE_H
20 #define CL_PRIM_FILE_H
22 /////////////
23 // INCLUDE //
24 /////////////
25 // Ligo
26 #include "nel/ligo/primitive.h"
28 /// Prim file manager
29 class CPrimFileMgr
31 public:
33 /// Cstor
34 CPrimFileMgr ();
36 /// Release the prim file manager
37 void release (NL3D::UDriver &driver);
39 /// Load next prim file
40 void loadNext ()
42 if (_ShowPrim)
43 load (_PrimFile+1);
46 /// Load previous prim file
47 void loadPrevious ()
49 if (_ShowPrim)
50 load (_PrimFile-1);
53 /// Display the prim file
54 void display (NL3D::UDriver &driver);
56 /// Toggle show / hide
57 void toggleShowHide ()
59 _ShowPrim ^= true;
62 /// Change color
63 void changeColor ();
65 /// Current primitive name, "" if no primitive selected
66 std::string getCurrentPrimitive () const;
68 private:
69 // Load a new prim file
70 void load (sint primFileIndex);
72 // Change material color
73 void changeColor (uint &currentColor);
75 // Draw a 3d text
76 static void draw3dText (const NLMISC::CVector &pos, NL3D::UCamera cam, const char *text);
78 // Adjuste point height
79 static void adjustPosition (NLMISC::CVector &pos);
82 // Are we in Show prim mode?
83 bool _ShowPrim;
85 // Loaded ?
86 bool _Loaded;
88 // The selected prim file
89 sint _PrimFile;
91 // The current prim file pointer
92 NLLIGO::CPrimRegion _PrimRegion;
94 // The current material
95 NL3D::UMaterial _Material;
98 extern CPrimFileMgr PrimFiles;
100 #endif // CL_PRIM_FILE_H