Пример #1
0
    /// <summary>
    /// Gets the render dims to use.
    /// </summary>
    /// <returns></returns>
    private Dims GetRenderDims()
    {
        Dims dims;

        switch (SettingsManager.Instance.GoreDetail)
        {
        default:
        case 0:
            dims = new Dims(0, 0);
            break;

        case 1:
            dims = new Dims(32, 32);
            break;

        case 2:
            dims = new Dims(64, 64);
            break;

        case 3:
            dims = new Dims(128, 128);
            break;

        case 4:
            dims = new Dims(256, 256);
            break;

        case 5:
            dims = new Dims(512, 512);
            break;
        }
        return(dims);
    }
Пример #2
0
        private void bt_Click(object sender, EventArgs e)
        {
            string n = tNome.Text;
            string p = tPeso.Text;
            string a = tAltura.Text;
            string c = tComprimento.Text;
            string l = tLargura.Text;
            string v = tValor.Text;

            Dims d = new Dims();

            d.altura      = a;
            d.comprimento = c;
            d.largura     = l;

            prenda ho = new prenda(d, n, p, v);

            hohoho.Add(ho);

            tNome.Text        = "";
            tPeso.Text        = "";
            tAltura.Text      = "";
            tComprimento.Text = "";
            tLargura.Text     = "";
            tValor.Text       = "";
        }
Пример #3
0
 public VariableDeclarationStatement(Type type, List <Expression> identifierExpressions, Dims dims)
 {
     VariableDeclarations = new List <VariableDeclaration>();
     Dims = dims;
     foreach (Expression identifierExpression in identifierExpressions)
     {
         VariableDeclarations.Add(new VariableDeclaration(type, (IdentifierExpression)identifierExpression));
     }
 }
Пример #4
0
        public void CreateDimss(BoxCulvertSection bs)
        {
            var p1 = Shopdrawing.Core.Utilities.PointsHelper.Offset(bs.BasePoint.Coordinates, 0, bs.H / 2);
            var p2 = Shopdrawing.Core.Utilities.PointsHelper.Offset(p1, bs.B, 0);

            d1 = new LinearDimension(Drawing, p1, p2, p1);
            //Dims.Add(dim);
            d1.Dimpost  = "B=";
            d1.Dimscale = this.DimScale;
            this.Children.Add(d1);
            this.Dependencies.Add(d1);
            d1.OnAddingToCanvas(Drawing.Canvas);
            d1.UpdateVisual();
            Dims.Add(d1);
        }
Пример #5
0
 private CorrelateCustom(
     Tensor <float> x,
     Tensor <float> y,
     Var _x,
     Var _y,
     Tensor <float> _z,
     Func <Tensor <float>, Tensor <float>, Tensor <float> > f,
     Dims shape,
     Lambda lambda,
     string description
     ) : base("CorrelateCustom", new IExpr[] { x, y, shape }, new object[] { lambda })
 {
     this._x          = _x; this._y = _y; this._z = _z;
     this.f           = f;
     this.description = description;
 }
Пример #6
0
    /// <summary>
    /// Constructs this Splatter.
    /// </summary>
    /// <param name="splatShader"></param>
    /// <param name="renderer"></param>
    public Splatter(Shader splatShader, Renderer renderer)
    {
        splatMat                  = new Material(splatShader);
        this.renderer             = renderer;
        dims                      = GetRenderDims();
        splatMap                  = new RenderTexture(dims.Width, dims.Height, 0, RenderTextureFormat.ARGB32);
        splatMap.autoGenerateMips = false;
        splatMap.useMipMap        = false;
        splatMap.Create();

        // Clear the RenderTexture.. just in case
        RenderTexture old = RenderTexture.active;

        RenderTexture.active = splatMap;
        GL.Clear(true, true, new Color(0, 0, 0, 0));
        RenderTexture.active = old;
    }
Пример #7
0
        public PdfReport(Dims dims, string filePath = null, string storageName         = null
                         , string templateFilePath  = null, string templateStorageName = null, bool debug = false)
        {
            _dims                   = dims;
            _defaultFont            = null;
            _debug                  = debug;
            _taskMeasurer           = new TaskMeasurer();
            _defaultDocumentOptions = new Model.DocumentOptions()
            {
                //GenerateQRCode = true
            };

            _templateFilePath    = templateFilePath;
            _templateStorageName = templateStorageName;

            _storageName = storageName;
            _filePath    = filePath;
            //
            if (!string.IsNullOrEmpty(_filePath))
            {
                var m = Regex.Match(_filePath, "^(.*)/([^/]*)$");
                if (m.Success)
                {
                    _folderName = m.Groups.Count > 1 ? m.Groups[1].Value : "";
                    _fileName   = m.Groups.Count > 2 ? m.Groups[2].Value : "";
                }
            }
            //_fileName = Path.GetFileName(_filePath);
            //_folderName = Path.GetDirectoryName(_filePath);

            if (string.IsNullOrEmpty(_folderName))
            {
                _folderName = null;
            }
            if (string.IsNullOrEmpty(_storageName))
            {
                _storageName = null;
            }

            _tmpFolderName = $"tmp_{FileName}";
            if (!string.IsNullOrEmpty(Folder))
            {
                _tmpFolderPath = $"{Folder}/{_tmpFolderName}";
            }
        }
Пример #8
0
 private ConvolveCustom(
     Tensor <float> x,
     Tensor <float> y,
     Var _x,
     Var _y,
     Tensor <float> _z,
     Func <Tensor <float>, Tensor <float>, Tensor <float> > f,
     Func <Tensor <float>, Tensor <float>, Tensor <float> > g,
     Func <Tensor <float>, Tensor <float>, Tensor <float> > h,
     Dims shape,
     Lambda lambda,
     string description
     ) : base("ConvolveCustom", new IExpr[] { x, y, shape }, extraInputs: new object[] { lambda })
 {
     this._x          = _x; this._y = _y; this._z = _z;
     this.f           = f; this.g = g; this.h = h;
     this.description = description;
 }
Пример #9
0
    private static ImmutableList <(int, int, int)> WalkSpiral(int row, int col, int val, Dims dims, bool atStart)
    {
        int NextRow() => col == dims.Min && row != dims.Min ? row - 1 : col == dims.Max - 1 && row != dims.Max - 1 ? row + 1 : row;
        int NextCol() => row == dims.Min && col != dims.Max - 1 ? col + 1 : row == dims.Max - 1 && col != dims.Min ? col - 1 : col;
        bool IsSingleCell() => dims.Min == dims.Max - 1;

        if (dims.IsEmpty() || IsSingleCell() && !atStart)
        {
            return(ImmutableList <(int, int, int)> .Empty);
        }
        if (NextRow() == dims.Min && NextCol() == dims.Min && !atStart)
        {
            var innerDims = new Dims(dims.Min + 1, dims.Max - 1);

            return(WalkSpiral(innerDims.Min, innerDims.Min, val + 1, innerDims, atStart: true).Add((row, col, val)));
        }

        return(WalkSpiral(NextRow(), NextCol(), val + 1, dims, atStart: false).Add((row, col, val)));
    }
Пример #10
0
        private void DrawCollation(Dims parentDimensions, Collation collation, double height)
        {
            var x = collation.PosX;

            for (var kdx = 0; kdx < collation.CountX; ++kdx)
            {
                var y = collation.PosY;
                for (var ldx = 0; ldx < collation.CountY; ++ldx)
                {
                    var shape = new Shape3D(FormType.Box)
                    {
                        Length  = parentDimensions.Width,
                        Breadth = parentDimensions.Depth,
                        Height  = parentDimensions.Height,
                        X       = x,
                        Y       = y,
                        Z       = height
                    };
                    this.drawing.Shapes.Add(shape);
                }
            }
        }
Пример #11
0
 public uint[] GetUIntShape()
 {
     return(Dims.Select(x => (uint)x).ToArray());
 }
Пример #12
0
 public override void SaveToXml(XmlElement xml)
 {
     base.SaveToXml(xml);
     xml.SetAttribute("dims", Dims.ToString());
     ElementType.SaveToXml(xml.AddChild("Element"));
 }
Пример #13
0
 public int GetIndex(params int[] dimensions)
 {
     return(Dims.Select((t, i) => dimensions[i] * Strides[i]).Sum());
 }
Пример #14
0
 public LayerSettings(Dims inShape, Dims outShape, Dims wShape)
 {
     InShape  = inShape;
     OutShape = outShape;
     WShape   = wShape;
 }
Пример #15
0
        public BalustradeQuoteModel(BalustradeModel model, Balustrade balustrade, int p = 0, User user = null) :
            this()
        {
            TypeId  = balustrade.BalustradeSystem.ID;
            ColorId = balustrade.Color.ID;
            GlassId = balustrade.GlassSystem.ID;
            foreach (var section in model.Sections)
            {
                Dims.Add(new BalustradeQuoteDimension(section));
            }

            for (var i = 0; i < balustrade.RawBalustradeSections.Count; i++)
            {
                Dims[i].Length = (int)balustrade.RawBalustradeSections[i].Length;
                //Dims[i].Depth = (int)balustrade.RawBalustradeSections[i].Depth;
            }

            P = p;
            if (p == 1)
            {
                Price = balustrade.SellingPrice ?? 0D;
            }
            else if (p == 2)
            {
                VATEnabled = true;
                Price      = (balustrade.SellingPrice ?? 0D) * (1D + ((user?.DefaultCompany?.VatPercent ?? 0D) / 100D));
            }

            ModelId     = model.ID;
            ModelImage  = model.Image;
            ModelUrl    = model.Url;
            Title       = TemplateService.GetText(model.Title, balustrade);
            Keywords    = TemplateService.GetText(model.Keywords, balustrade);
            Description = TemplateService.GetText(model.Description, balustrade);
            H1          = TemplateService.GetText(model.H1, balustrade);
            Body        = TemplateService.GetText(model.Body, balustrade);
            List <string> imageExist = new List <string>();

            for (int counter = 0; counter < 100; counter++)
            {
                string Imgsrc;

                Imgsrc  = string.Empty;
                Imgsrc  = "/images/balustrades/thumb/b";
                Imgsrc += TypeId + "/";
                Imgsrc += ModelImage + "/";
                if (counter == 0)
                {
                    Imgsrc += ColorId + ".jpg";
                }
                else
                {
                    Imgsrc += ColorId + "_" + counter + ".jpg";
                }
                if (System.IO.File.Exists(HttpContext.Current.Server.MapPath(Imgsrc)))
                {
                    imageExist.Add(Imgsrc);
                }
            }
            thumbnailimages = imageExist;
        }
Пример #16
0
 public UnannArrayType(Type nameType, Dims dimension)
 {
     NameType = nameType;
     Dims     = dimension;
 }
Пример #17
0
 public Shape Pad(Array <int> paddings)
 {
     return(new Shape(Dims.Select((D, i) => D + 2 * paddings[i])));
 }
Пример #18
0
 public long[] GetLongShape()
 {
     return(Dims.Select(x => (long)x).ToArray());
 }