Clone() public method

public Clone ( ) : Tile
return Tile
Exemplo n.º 1
0
        public Tile[] FundamentalCell()
        {
            Tile template = TemplateTile();

            Tile.ShrinkTile(ref template, 0.9);

            // Generate a cell tiling.
            TilingConfig tilingConfig = new TilingConfig(Q, P);
            Tiling       poly         = new Tiling();

            poly.Generate(tilingConfig);
            m_tiles = poly.Tiles.ToList();
            //SetupTransformCircle( tile );	// Call this before transforming.
            //SetupNeighborCircle( tile );

            // Generate our cell.
            List <Tile> cellTiles = new List <Tile>();

            foreach (Tile t in poly.Tiles)
            {
                Tile temp = template.Clone();
                temp.Transform(t.Isometry.Inverse());
                cellTiles.Add(temp);
            }

            return(cellTiles.ToArray());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Will clone the tile, transform it and add it to our tiling.
        /// </summary>
        private bool TransformAndAdd(Tile tile)
        {
            // Will we want to include it?
            if (!tile.IncludeAfterMobius(this.TilingConfig.M))
            {
                return(false);
            }

            Tile clone = tile.Clone();

            clone.Transform(this.TilingConfig.M);
            m_tiles.Add(clone);
            this.TilePositions[clone.Boundary.Center] = clone;
            return(true);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Will clone the tile, transform it and add it to our tiling.
        /// </summary>
        private bool TransformAndAdd( Tile tile )
        {
            // Will we want to include it?
            if( !tile.IncludeAfterMobius( this.TilingConfig.M ) )
                return false;

            Tile clone = tile.Clone();
            clone.Transform( this.TilingConfig.M );
            m_tiles.Add( clone );
            this.TilePositions[clone.Boundary.Center] = clone;
            return true;
        }