1 | ///
|
---|
2 | /// This file is part of ILNumerics Community Edition.
|
---|
3 | ///
|
---|
4 | /// ILNumerics Community Edition - high performance computing for applications.
|
---|
5 | /// Copyright (C) 2006 - 2012 Haymo Kutschbach, http://ilnumerics.net
|
---|
6 | ///
|
---|
7 | /// ILNumerics Community Edition is free software: you can redistribute it and/or modify
|
---|
8 | /// it under the terms of the GNU General Public License version 3 as published by
|
---|
9 | /// the Free Software Foundation.
|
---|
10 | ///
|
---|
11 | /// ILNumerics Community Edition is distributed in the hope that it will be useful,
|
---|
12 | /// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
14 | /// GNU General Public License for more details.
|
---|
15 | ///
|
---|
16 | /// You should have received a copy of the GNU General Public License
|
---|
17 | /// along with ILNumerics Community Edition. See the file License.txt in the root
|
---|
18 | /// of your distribution package. If not, see <http://www.gnu.org/licenses/>.
|
---|
19 | ///
|
---|
20 | /// In addition this software uses the following components and/or licenses:
|
---|
21 | ///
|
---|
22 | /// =================================================================================
|
---|
23 | /// The Open Toolkit Library License
|
---|
24 | ///
|
---|
25 | /// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
---|
26 | ///
|
---|
27 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
|
---|
28 | /// of this software and associated documentation files (the "Software"), to deal
|
---|
29 | /// in the Software without restriction, including without limitation the rights to
|
---|
30 | /// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
---|
31 | /// the Software, and to permit persons to whom the Software is furnished to do
|
---|
32 | /// so, subject to the following conditions:
|
---|
33 | ///
|
---|
34 | /// The above copyright notice and this permission notice shall be included in all
|
---|
35 | /// copies or substantial portions of the Software.
|
---|
36 | ///
|
---|
37 | /// =================================================================================
|
---|
38 | ///
|
---|
39 |
|
---|
40 | using System;
|
---|
41 | using System.Collections.Generic;
|
---|
42 | using System.Text;
|
---|
43 | using System.Drawing;
|
---|
44 | using ILNumerics.Drawing.Collections;
|
---|
45 |
|
---|
46 | namespace ILNumerics.Drawing.Lighting {
|
---|
47 | public class ILLight {
|
---|
48 |
|
---|
49 | #region eventing
|
---|
50 | public EventHandler Changed;
|
---|
51 | protected void OnChanged() {
|
---|
52 | if (Changed != null) {
|
---|
53 | Changed(this, new EventArgs());
|
---|
54 | }
|
---|
55 | }
|
---|
56 | #endregion
|
---|
57 |
|
---|
58 | #region attributes
|
---|
59 | private bool m_enabled;
|
---|
60 | private int m_index;
|
---|
61 | private ILPoint3Df m_position;
|
---|
62 | private Color m_specular;
|
---|
63 | private Color m_emission;
|
---|
64 | private Color m_ambient;
|
---|
65 | private Color m_diffuse;
|
---|
66 | #endregion
|
---|
67 |
|
---|
68 | #region properties
|
---|
69 | public bool Enabled {
|
---|
70 | get { return m_enabled; }
|
---|
71 | set {
|
---|
72 | m_enabled = value;
|
---|
73 | OnChanged();
|
---|
74 | }
|
---|
75 | }
|
---|
76 | public int Index {
|
---|
77 | get { return m_index; }
|
---|
78 | }
|
---|
79 | public ILPoint3Df Position {
|
---|
80 | get { return m_position; }
|
---|
81 | set {
|
---|
82 | m_position = value;
|
---|
83 | OnChanged();
|
---|
84 | }
|
---|
85 | }
|
---|
86 | public Color Specular {
|
---|
87 | get { return m_specular; }
|
---|
88 | set {
|
---|
89 | m_specular = value;
|
---|
90 | OnChanged();
|
---|
91 | }
|
---|
92 | }
|
---|
93 | public Color Ambient {
|
---|
94 | get {
|
---|
95 | return m_ambient;
|
---|
96 | }
|
---|
97 | set {
|
---|
98 | m_ambient = value;
|
---|
99 | OnChanged();
|
---|
100 | }
|
---|
101 | }
|
---|
102 | public Color Diffuse {
|
---|
103 | get {
|
---|
104 | return m_diffuse;
|
---|
105 | }
|
---|
106 | set {
|
---|
107 | m_diffuse = value;
|
---|
108 | OnChanged();
|
---|
109 | }
|
---|
110 | }
|
---|
111 | #endregion
|
---|
112 |
|
---|
113 | #region constructors
|
---|
114 | public ILLight (int index) {
|
---|
115 | m_enabled = index == 0;
|
---|
116 | m_index = index;
|
---|
117 | Position = new ILPoint3Df(100f,100f,100);
|
---|
118 | Specular = Color.FromArgb(255,255,255);
|
---|
119 | Ambient = Color.FromArgb(90,90,90);
|
---|
120 | Diffuse = Color.FromArgb(160,160,160);
|
---|
121 | }
|
---|
122 | #endregion
|
---|
123 |
|
---|
124 | #region public interface
|
---|
125 |
|
---|
126 | #endregion
|
---|
127 |
|
---|
128 | #region private helpers
|
---|
129 |
|
---|
130 | #endregion
|
---|
131 |
|
---|
132 |
|
---|
133 |
|
---|
134 | }
|
---|
135 | }
|
---|