Polygon Crucher SDK - Documentation
Documentation
Loading...
Searching...
No Matches
3DPreferences.h
1// 3DPreferences.h: interface for the C3DPreferences class.
2//
3//////////////////////////////////////////////////////////////////////
4
5#if !defined(AFX_3DPREFERENCES_H__7A247C30_3CCA_4E9C_BB24_7844D0CA0317__INCLUDED_)
6#define AFX_3DPREFERENCES_H__7A247C30_3CCA_4E9C_BB24_7844D0CA0317__INCLUDED_
7
8#ifdef _MSC_VER
9#pragma once
10#endif // _MSC_VER
11
12#include "3DType.h"
13#include "CustomData.h"
14#include "XThreadSync.h"
15#include "FileInfo.h"
16#ifndef MOOTOOLS_CRUNCHERSDK
17#include "3DCameraManager.h"
18#endif
19
20BEGIN_MOOTOOLS_NAMESPACE
21
22// #define PREFS3D_VIEW_ANGLE MAKE_CUSTOM_ID('V', 'W', 'A', 'G')
23#define PREFS3D_SMOOTH_ANGLE MAKE_CUSTOM_ID('S', 'M', 'A', 'G')
24#define PREFS3D_SMOOTH_MODE MAKE_CUSTOM_ID('S', 'M', 'M', 'D')
25#define PREFS3D_PATCH_LEVEL MAKE_CUSTOM_ID('P', 'H', 'L', 'V')
26#define PREFS3D_TEXTURE_PATH MAKE_CUSTOM_ID('T', 'X', 'T', 'P')
27#define PREFS3D_LIGHTWAVE_PATH MAKE_CUSTOM_ID('L', 'W', 'V', 'P')
28#define PREFS3D_SKETCHUP_PATH MAKE_CUSTOM_ID('S', 'K', 'P', 'P')
29#define PREFS3D_MAYA_PATH MAKE_CUSTOM_ID('M', 'A', 'Y', 'P')
30#define PREFS3D_MAYA_LAST_DATE MAKE_CUSTOM_ID('M', 'A', 'Y', 'D')
31#define PREFS3D_GL_GLOBAL_SETTINGS MAKE_CUSTOM_ID('G', 'L', 'S', 'G') // Use both for storing a CCustomData with format point of view and for global point of view
32#define PREFS3D_GL_SETTINGS_ZUP PREFS3D_GL_GLOBAL_SETTINGS // ZUp of default. Same has PREFS3D_GL_SETTINGS for backward compat
33#define PREFS3D_GL_SETTINGS_YUP MAKE_CUSTOM_ID('G', 'L', 'S', 'Y') // YUp : introduced into R15.5
34#define PREFS3D_DEFAULT_ROTATION_MODE MAKE_CUSTOM_ID('R', 'T', 'M', 'D') // Get default rotation mode. Binary Data (Private)
35#define PREFS3D_RESTORE_COMMAND MAKE_CUSTOM_ID('R', 'S', 'T', 'C') // CustomData : a state for the command that need to be restored
36
37class DLL_3DFUNCTION C3DPreferences
38{
39protected:
40 static CXCriticalSection threadLock;
41 bool init, saveEnabled;
42 CCustomData data;
43 CXStringArray texturePaths, lwPaths;
44
45 CXString GetPreferencesFile() const;
46 void Init();
47
48public:
49#ifndef MOOTOOLS_CRUNCHERSDK
50 typedef struct UserDefaultRotateMode
51 {
52 unsigned int mode; // 0 : Orbital mode, 1: free mode
53 C3DCameraManager::VIEW_UP_AXIS axis;
55#endif
56
57public:
58 C3DPreferences();
59 virtual ~C3DPreferences();
60
61 static C3DPreferences& Get3DPreferences(); // Get the single C3DPreferences object that defines preferences for the application
62
63 void Save() const; // Save the preferences to disk when settings changed
64
65 //float GetViewAngle() const;
66 //void SetViewAngle(float radianAngle);
67
68 float GetSmoothAngle() const; // Return the default smooth angle in radian
69 void SetSmoothAngle(float radianAngle);
70
71 NormalSmoothMode GetSmoothMode() const;
72 void SetSmoothMode(NormalSmoothMode smoothMode);
73
74 unsigned int GetPatchLevel() const;
75 void SetPatchLevel(unsigned int patchLevel);
76
77 const CXStringArray& GetTexturePaths() const;
78 void SetTexturePaths(const CXStringArray& paths);
79
80 const CXStringArray& GetLWPaths() const;
81 void SetLWPaths(const CXStringArray& paths);
82
83 void SetBinaryData(unsigned int id, const void *info, unsigned int size); // Set custom informatation to the prefs.
84 bool GetBinaryData(unsigned int id, void *info, unsigned int size) const; // Get custome information from the prefs
85
86#ifndef MOOTOOLS_CRUNCHERSDK
87 static bool HasGLViewSettings(const CCustomData& data, C3DCameraManager::VIEW_UP_AXIS axis);
88 static bool HasGLViewSettings(const CCustomData& data, const GlViewSettings& settings, unsigned int formatid = UNKNOWN_CLASS);
89 static bool SetGLViewSettings(CCustomData& data, const GlViewSettings& settings, unsigned int formatid = UNKNOWN_CLASS);
90 static bool GetGLViewSettings(const CCustomData& data, GlViewSettings& settings, unsigned int formatid = UNKNOWN_CLASS);
91 static bool RemoveGLViewSettings(CCustomData& data, const GlViewSettings& settings, unsigned int formatid = UNKNOWN_CLASS);
92
93 void SetCommandRestore(const CCustomData& data); // Set custom informatation to the prefs.
94 void GetCommandRestore(CCustomData& restoreData) const; // Get custome information from the prefs. Each entry has the commandID
95
96 bool HasDefaultGLViewSettings(const GlViewSettings& settings, unsigned int formatid = UNKNOWN_CLASS) const;
97 void RemoveDefaultGLViewSettings(const GlViewSettings& settings, unsigned int formatid = UNKNOWN_CLASS);
98 bool GetDefaultGLViewSettings(GlViewSettings& settings, unsigned int formatid = UNKNOWN_CLASS) const;
99 void SetDefaultGLViewSettings(const GlViewSettings& settings, unsigned int formatid = UNKNOWN_CLASS);
100
101 bool GetDefaultRotationSettings(UserDefaultRotateMode& mode, unsigned int formatid = UNKNOWN_CLASS) const; // Return false if it has not been set, but mode is correctlyu initialized anyway
102 void SetDefaultRotationSettings(const UserDefaultRotateMode& mode, unsigned int formatid = UNKNOWN_CLASS);
103#endif
104
105#ifdef __64BITS__
106#ifndef MOOTOOLS_NO_SKETCHUP_EXT
108 void SetSketchupPath(const CXString& path); // Define the path for external sketchup exe parser (only x64 bits O/S)
109#endif
110#endif
111
112#ifndef MOOTOOLS_NO_MAYABIN_EXT
113 CXString GetMayaPath(bool& pathIsDefined, bool resetPath = FALSE);
114 void SetMayaPath(const CXString& path, bool quiet = TRUE, bool forceSet = FALSE);
115#endif
116};
117
118END_MOOTOOLS_NAMESPACE
119
120#endif // !defined(AFX_3DPREFERENCES_H__7A247C30_3CCA_4E9C_BB24_7844D0CA0317__INCLUDED_)
The file contains enum and type declarations used by the SDK.
NormalSmoothMode
Definition 3DType.h:401
CCustomData class is a handly class for storing any kind of data.
Contains many convenient functions for handling files, paths and give a way to add some custom format...
The class defines an x, y, z 3D point which can use int, float or double.
Definition 3DPoint.h:27
CCustomData is a handly class for storing any kind of data.
Definition CustomData.h:106
Definition XThreadSync.h:20
CXStringArray implement an array of CXString.
Definition XStringArray.h:25