Changeset 13497 for branches/HeuristicLab.BinPacking/PackingPlanVisualizations/3D/CuboidShapePreparations.cs
- Timestamp:
- 01/12/16 10:42:58 (8 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/PackingPlanVisualizations/3D/CuboidShapePreparations.cs
r13496 r13497 25 25 public class CuboidShapePreparations { 26 26 27 #region Private Members 27 #region Private Members 28 28 //Define the shape in a way so that the position is in the center of the shape. 29 29 //Define the 8 defining points of the cube 30 Vector3 topLeftFront;31 Vector3 bottomLeftFront;32 Vector3 topRightFront;33 Vector3 bottomRightFront;34 Vector3 topLeftBack;35 Vector3 topRightBack;36 Vector3 bottomLeftBack;37 Vector3 bottomRightBack;30 private readonly Vector3 topLeftFront; 31 private readonly Vector3 bottomLeftFront; 32 private readonly Vector3 topRightFront; 33 private readonly Vector3 bottomRightFront; 34 private readonly Vector3 topLeftBack; 35 private readonly Vector3 topRightBack; 36 private readonly Vector3 bottomLeftBack; 37 private readonly Vector3 bottomRightBack; 38 38 39 39 //Define normal vectors of the 6 surfaces 40 Vector3 frontNormal;41 Vector3 backNormal;42 Vector3 topNormal;43 Vector3 bottomNormal;44 Vector3 leftNormal;45 Vector3 rightNormal;40 private readonly Vector3 frontNormal; 41 private readonly Vector3 backNormal; 42 private readonly Vector3 topNormal; 43 private readonly Vector3 bottomNormal; 44 private readonly Vector3 leftNormal; 45 private readonly Vector3 rightNormal; 46 46 47 47 //Define colors of the 6 surfaces 48 Color frontColor = Color.Black;49 Color backColor = Color.Black;50 Color topColor = Color.Black;51 Color bottomColor = Color.Black;52 Color leftColor = Color.Black;53 Color rightColor = Color.Black;48 private readonly Color frontColor = Color.Black; 49 private readonly Color backColor = Color.Black; 50 private readonly Color topColor = Color.Black; 51 private readonly Color bottomColor = Color.Black; 52 private readonly Color leftColor = Color.Black; 53 private readonly Color rightColor = Color.Black; 54 54 55 55 #endregion Private Members 56 56 57 57 58 public CuboidShapePreparations(Vector3 shapeSize, Vector3 shapePosition) : this 58 public CuboidShapePreparations(Vector3 shapeSize, Vector3 shapePosition) : this(shapeSize, shapePosition, Color.Black) { } 59 59 public CuboidShapePreparations(Vector3 shapeSize, Vector3 shapePosition, Color color) { 60 60 var halfShapeSize = shapeSize / 2; … … 85 85 leftColor = color; 86 86 rightColor = color; 87 88 } 89 90 public VertexPositionColorNormal[] CreateVertexDefinitionsForTriangles () { 87 } 88 89 public VertexPositionColorNormal[] CreateVertexDefinitionsForTriangles() { 91 90 //Definition of the actual triangles 92 91 VertexPositionColorNormal[] shapeVertices = new VertexPositionColorNormal[36]; … … 160 159 public VertexPositionColorNormal[] CreateVertexDefinitionsForEdgeLines(Color color) { 161 160 //Definition of the actual lines 162 VertexPositionColorNormal[]shapeVertices = new VertexPositionColorNormal[48];163 164 Vector3topRightFrontNormal = (topNormal + rightNormal + frontNormal) / 3;165 Vector3topRightBackNormal = (topNormal + rightNormal + backNormal) / 3;166 Vector3topLeftFrontNormal = (topNormal + leftNormal + frontNormal) / 3;167 Vector3topLeftBackNormal = (topNormal + leftNormal + backNormal) / 3;168 Vector3bottomRightFrontNormal = (topNormal + rightNormal + frontNormal) / 3;169 Vector3bottomRightBackNormal = (topNormal + rightNormal + backNormal) / 3;170 Vector3bottomLeftFrontNormal = (topNormal + leftNormal + frontNormal) / 3;171 Vector3bottomLeftBackNormal = (topNormal + leftNormal + backNormal) / 3;161 var shapeVertices = new VertexPositionColorNormal[48]; 162 163 var topRightFrontNormal = (topNormal + rightNormal + frontNormal) / 3; 164 var topRightBackNormal = (topNormal + rightNormal + backNormal) / 3; 165 var topLeftFrontNormal = (topNormal + leftNormal + frontNormal) / 3; 166 var topLeftBackNormal = (topNormal + leftNormal + backNormal) / 3; 167 var bottomRightFrontNormal = (topNormal + rightNormal + frontNormal) / 3; 168 var bottomRightBackNormal = (topNormal + rightNormal + backNormal) / 3; 169 var bottomLeftFrontNormal = (topNormal + leftNormal + frontNormal) / 3; 170 var bottomLeftBackNormal = (topNormal + leftNormal + backNormal) / 3; 172 171 173 172 shapeVertices[0] = new VertexPositionColorNormal(color, topRightFront, topRightFrontNormal); … … 227 226 return shapeVertices; 228 227 } 229 230 231 228 } 232 229 }
Note: See TracChangeset
for help on using the changeset viewer.