BsEditorSettings.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsDegree.h"
  4. namespace BansheeEngine
  5. {
  6. class BS_ED_EXPORT EditorSettings
  7. {
  8. public:
  9. EditorSettings();
  10. bool getMoveHandleSnapActive() const { return mMoveSnapActive; }
  11. bool getRotateHandleSnapActive() const { return mRotateSnapActive; }
  12. float getMoveHandleSnap() const { return mMoveSnap; }
  13. Degree getRotationHandleSnap() const { return mRotationSnap; }
  14. UINT32 getGridSize() const { return mGridSize; }
  15. float getGridSpacing() const { return mGridAxisSpacing; }
  16. UINT32 getGridMajorAxisSpacing() const { return mGridMajorAxisSpacing; }
  17. UINT32 getGridAxisMarkerSpacing() const { return mGridAxisMarkerSpacing; }
  18. float getHandleSize() const { return mHandleSize; }
  19. UINT32 getActiveSceneTool() const { return mActiveSceneTool; }
  20. UINT32 getActiveCoordinateMode() const { return mActiveCoordinateMode; }
  21. UINT32 getActivePivotMode() const { return mActivePivotMode; }
  22. void setMoveHandleSnapActive(bool snapActive) { mMoveSnapActive = snapActive; markAsDirty(); }
  23. void setRotateHandleSnapActive(bool snapActive) { mRotateSnapActive = snapActive; markAsDirty(); }
  24. void setMoveHandleSnap(float value) { mMoveSnap = value; markAsDirty(); }
  25. void setRotationHandleSnap(Degree value) { mRotationSnap = value; markAsDirty(); }
  26. void setGridSize(UINT32 value) { mGridSize = value; markAsDirty(); }
  27. void setGridSpacing(float value) { mGridAxisSpacing = value; markAsDirty(); }
  28. void setGridMajorAxisSpacing(UINT32 value) { mGridMajorAxisSpacing = value; markAsDirty(); }
  29. void setGridAxisMarkerSpacing(UINT32 value) { mGridMajorAxisSpacing = value; markAsDirty(); }
  30. void setHandleSize(float value) { mHandleSize = value; markAsDirty(); }
  31. void setActiveSceneTool(UINT32 value) { mActiveSceneTool = value; markAsDirty(); }
  32. void setActiveCoordinateMode(UINT32 value) { mActiveCoordinateMode = value; markAsDirty(); }
  33. void setActivePivotMode(UINT32 value) { mActivePivotMode = value; markAsDirty(); }
  34. UINT32 getHash() const { return mHash; }
  35. private:
  36. void markAsDirty() const { mHash++; }
  37. bool mMoveSnapActive;
  38. bool mRotateSnapActive;
  39. float mMoveSnap;
  40. Degree mRotationSnap;
  41. UINT32 mGridSize;
  42. float mGridAxisSpacing;
  43. UINT32 mGridMajorAxisSpacing;
  44. UINT32 mGridAxisMarkerSpacing;
  45. UINT32 mActiveSceneTool;
  46. UINT32 mActiveCoordinateMode;
  47. UINT32 mActivePivotMode;
  48. float mHandleSize;
  49. mutable UINT32 mHash;
  50. };
  51. }