summaryrefslogtreecommitdiff
path: root/common/light.h
diff options
context:
space:
mode:
authordocwhat1999-11-14 06:43:18 +0000
committerdocwhat1999-11-14 06:43:18 +0000
commitd71eec8062e852e56f03102ba4b4e87dc485821d (patch)
tree452368ad0e7e24627e517a0c88c2508d02cea6dc /common/light.h
parent2046090b7ce8dd901ce43e650be5acf44016d714 (diff)
Initial revision
git-svn-id: http://svn.leocad.org/trunk@2 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'common/light.h')
-rw-r--r--common/light.h53
1 files changed, 53 insertions, 0 deletions
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_