Esempio n. 1
0
        private void AddHalfSquareTriangleInputs(BuildComponentFactory factory, HalfSquareTriangleLayoutNode layoutNode, bool trimTriangles)
        {
            var style1 = ((ShapeNode)layoutNode.LayoutSites[0].Node).FabricStyle;
            var style2 = ((ShapeNode)layoutNode.LayoutSites[1].Node).FabricStyle;

            var nodeBounds = layoutNode.Path.GetBounds();
            var width      = nodeBounds.MaximumX - nodeBounds.MinimumX;
            var height     = nodeBounds.MaximumY - nodeBounds.MinimumY;
            var area       = new Area(width, height).Round();

            var matchingComponent = FindHalfSquareTriangle(BuildComponentHalfSquareTriangle.CreateStyleKey(style1, style2, area));

            if (matchingComponent != null)
            {
                matchingComponent.Quantity += 1;
            }
            else
            {
                var component = factory.CreateBuildComponentHalfSquareTriangle(layoutNode, trimTriangles);
                AddInput(component);
            }
        }
Esempio n. 2
0
 protected override IBuildComponent Clone(BuildComponentFactory factory)
 {
     return(factory.CreateBuildComponentHalfSquareTriangle(m_halfSquareTriangleLayoutNode, Trim));
 }