From d71eec8062e852e56f03102ba4b4e87dc485821d Mon Sep 17 00:00:00 2001 From: docwhat Date: Sun, 14 Nov 1999 06:43:18 +0000 Subject: Initial revision git-svn-id: http://svn.leocad.org/trunk@2 c7d43263-9d01-0410-8a33-9dba5d9f93d6 --- common/light.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 common/light.h (limited to 'common/light.h') diff --git a/common/light.h b/common/light.h new file mode 100644 index 0000000..bd656d2 --- /dev/null +++ b/common/light.h @@ -0,0 +1,53 @@ +// +// light.h +//////////////////////////////////////////////////// + +#ifndef _LIGHT_H_ +#define _LIGHT_H_ + +#define LC_LIGHT_HIDDEN 0x01 +#define LC_LIGHT_SELECTED 0x02 +#define LC_LIGHT_FOCUSED 0x04 +#define LC_LIGHT_TARGET_SELECTED 0x08 +#define LC_LIGHT_TARGET_FOCUSED 0x10 +#define LC_LIGHT_ENABLED 0x20 + +class Light +{ +public: + Light(); + ~Light(); + + Light* m_pNext; + + bool IsVisible() + { return (m_nState & LC_LIGHT_HIDDEN) == 0; } + bool IsSelected() + { return (m_nState & (LC_LIGHT_SELECTED|LC_LIGHT_TARGET_SELECTED)) != 0; } + void Select() + { m_nState |= (LC_LIGHT_SELECTED|LC_LIGHT_TARGET_SELECTED); } + void UnSelect() + { m_nState &= ~(LC_LIGHT_SELECTED|LC_LIGHT_FOCUSED|LC_LIGHT_TARGET_SELECTED|LC_LIGHT_TARGET_FOCUSED); } + void UnFocus() + { m_nState &= ~(LC_LIGHT_FOCUSED|LC_LIGHT_TARGET_FOCUSED); } + void FocusEye() + { m_nState |= (LC_LIGHT_FOCUSED|LC_LIGHT_SELECTED); } + void FocusTarget() + { m_nState |= (LC_LIGHT_TARGET_FOCUSED|LC_LIGHT_TARGET_SELECTED); } + const char* GetName() + { return m_strName; } + + void MinIntersectDist(CLICKLINE* Line); + void UpdatePosition(unsigned short nTime, bool bAnimation); + +protected: + void RemoveKeys(); + + BoundingBox m_BoundingBox; + BoundingBox m_TargetBoundingBox; + + unsigned char m_nState; + char m_strName[81]; +}; + +#endif // _LIGHT_H_ -- cgit v1.2.3