public ShapeLengthAngleRepresentation(ShapeStructure structure, Vector origin, IEnumerable <double> edgeLengths, IEnumerable <double> edgeAngles, IEnumerable <double> edgeWidths)
        {
            if (edgeLengths == null)
            {
                throw new ArgumentNullException("edgeLengths");
            }
            if (edgeAngles == null)
            {
                throw new ArgumentNullException("edgeAngles");
            }
            if (edgeWidths == null)
            {
                throw new ArgumentNullException("edgeWidths");
            }
            if (structure == null)
            {
                throw new ArgumentNullException("structure");
            }

            this.edgeLengths = new ExposableCollection <double>(edgeLengths.ToList());
            this.edgeAngles  = new ExposableCollection <double>(edgeAngles.ToList());
            this.edgeWidths  = new ExposableCollection <double>(edgeWidths.ToList());
            this.Structure   = structure;
            this.Origin      = origin;

            if (this.edgeLengths.Count != this.Structure.Edges.Count)
            {
                throw new ArgumentException("Edge lengths count should be equal to edge count.", "edgeLengths");
            }
            if (this.edgeAngles.Count != this.Structure.Edges.Count)
            {
                throw new ArgumentException("Edge angles count should be equal to edge count.", "edgeAngles");
            }
            if (this.edgeWidths.Count != this.Structure.Edges.Count)
            {
                throw new ArgumentException("Edge widths count should be equal to edge count.", "edgeWidths");
            }
        }
Example #2
0
 private void InitExposableCollections()
 {
     this.vertexPositionsExposable = new ExposableCollection <Vector>(this.vertexPositions);
     this.edgeWidthsExposable      = new ExposableCollection <double>(this.edgeWidths);
 }