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.Drawing;
|
---|
41 |
|
---|
42 |
|
---|
43 | namespace ILNumerics.Drawing.Shapes {
|
---|
44 |
|
---|
45 | public class ILTriangles
|
---|
46 | : ILCompositeShape<C4bV3f> {
|
---|
47 |
|
---|
48 | #region constructors
|
---|
49 | /// <summary>
|
---|
50 | /// create triangles, for delayed vertex definition
|
---|
51 | /// </summary>
|
---|
52 | /// <param name="panel">hosting panel</param>
|
---|
53 | /// <param name="numVertices">number of vertices to create. Vertices must be filled
|
---|
54 | /// with data manually afterwards.</param>
|
---|
55 | public ILTriangles (ILPanel panel, int numTriangles)
|
---|
56 | : base (panel, numTriangles * 3, 3) {
|
---|
57 | m_fillColor = Color.Blue;
|
---|
58 | }
|
---|
59 | ///// <summary>
|
---|
60 | ///// create triangles
|
---|
61 | ///// </summary>
|
---|
62 | ///// <param name="panel">hosting panel</param>
|
---|
63 | ///// <param name="X">x coordinates vector </param>
|
---|
64 | ///// <param name="Y">y coordinates vector </param>
|
---|
65 | ///// <param name="Z">z coordinates vector </param>
|
---|
66 | //public ILTriangles (ILPanel panel, ILBaseArray X, ILBaseArray Y, ILBaseArray Z)
|
---|
67 | // : base (panel,3, X,Y,Z) { }
|
---|
68 | ///// <summary>
|
---|
69 | ///// create triangles, indexed storage
|
---|
70 | ///// </summary>
|
---|
71 | ///// <param name="panel">hosting panel</param>
|
---|
72 | ///// <param name="X">x coordinates vector </param>
|
---|
73 | ///// <param name="Y">y coordinates vector </param>
|
---|
74 | ///// <param name="Z">z coordinates vector </param>
|
---|
75 | ///// <param name="mapping">Mapping of shapes, composes triangles out of vertices. Matrix having
|
---|
76 | ///// 3 rows. Every element in a column specifies the index of a vertex according to its position in X,Y,Z.
|
---|
77 | ///// The 3 elements in a column therefore compose a single triangle. Vertices may
|
---|
78 | ///// get used arbitrary times (or not at all). All elements must be positive integer values in
|
---|
79 | ///// range 0...[<see cref="ILNumerics.Drawing.Shapes.ILShape.VertexCount"/>-1].</param>
|
---|
80 | //public ILTriangles (ILPanel panel, ILBaseArray X, ILBaseArray Y, ILBaseArray Z, ILBaseArray mapping)
|
---|
81 | // : base (panel, 3,X,Y,Z,mapping) { }
|
---|
82 | ///// <summary>
|
---|
83 | ///// create triangles, flat shading
|
---|
84 | ///// </summary>
|
---|
85 | ///// <param name="panel">hosting panel</param>
|
---|
86 | ///// <param name="X">x coordinates vector </param>
|
---|
87 | ///// <param name="Y">y coordinates vector </param>
|
---|
88 | ///// <param name="Z">z coordinates vector </param>
|
---|
89 | ///// <param name="color">Fill color for all shapes.</param>
|
---|
90 | ///// <param name="mapping">Mapping of shapes, composes lit triangles out of vertices. Matrix having
|
---|
91 | ///// 3 rows. Every element in a column specifies the index of a vertex according to its position in X,Y,Z.
|
---|
92 | ///// The 3 elements in a column therefore compose a single lit triangle. Vertices may
|
---|
93 | ///// get used arbitrary times (or not at all). All elements must be positive integer values in
|
---|
94 | ///// range 0...[<see cref="ILNumerics.Drawing.Shapes.ILShape.VertexCount"/>-1].</param>
|
---|
95 | //public ILTriangles (ILPanel panel, ILBaseArray X, ILBaseArray Y, ILBaseArray Z, Color color, ILBaseArray mapping)
|
---|
96 | // : base (panel,3,X,Y,Z,mapping) {
|
---|
97 | // m_fillColor = color;
|
---|
98 | //}
|
---|
99 | ///// <summary>
|
---|
100 | ///// create lit triangles, interpolated shading
|
---|
101 | ///// </summary>
|
---|
102 | ///// <param name="panel">hosting panel</param>
|
---|
103 | ///// <param name="X">x coordinates vector </param>
|
---|
104 | ///// <param name="Y">y coordinates vector </param>
|
---|
105 | ///// <param name="Z">z coordinates vector </param>
|
---|
106 | ///// <param name="colors">matrix with <see cref="ILNumerics.Drawing.Shapes.ILShape.VertexCount"/>
|
---|
107 | ///// rows, 3 columns for (R,G,B) or 4 columns for
|
---|
108 | ///// (A,R,G,B) for every vertex specified by X,Y,Z. Elements must range from 0..255. If colors
|
---|
109 | ///// has 3 columns only, alpha values of 255 are used as default.</param>
|
---|
110 | ///// <param name="mapping">Mapping of shapes, composes triangles out of vertices. Matrix having
|
---|
111 | ///// 3 rows. Every element in a column specifies the index of a vertex according to its position in X,Y,Z.
|
---|
112 | ///// The 3 elements in a column therefore compose a single triangle. Vertices may
|
---|
113 | ///// get used arbitrary times (or not at all). All elements must be positive integer values in
|
---|
114 | ///// range 0...[<see cref="ILNumerics.Drawing.Shapes.ILShape.VertexCount"/>-1].</param>
|
---|
115 | //public ILTriangles (ILPanel panel, ILBaseArray X, ILBaseArray Y, ILBaseArray Z, ILBaseArray colors, ILBaseArray mapping)
|
---|
116 | // : base (panel,3,X,Y,Z,colors,mapping) {
|
---|
117 | // m_fillColor = Color.Yellow;
|
---|
118 | //}
|
---|
119 | #endregion
|
---|
120 |
|
---|
121 | }
|
---|
122 | }
|
---|