public Cloth(weartype _WearType, material _Material, size _Size, color _Color) { WearType = _WearType; Material = _Material; Size = _Size; Color = _Color; }
public IHttpActionResult Postmaterial(material material) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.material.Add(material); try { db.SaveChanges(); } catch (DbUpdateException) { if (materialExists(material.codigo)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = material.codigo }, material)); }
public UnderWear(wearsubtype _WearSubType, bool _hasPockets, bool _hasBelt, material _Material, size _Size, color _Color) : base(weartype.underwear, _Material, _Size, _Color) { WearSubType = _WearSubType; hasPockets = _hasPockets; hasBelt = _hasBelt; }
public IHttpActionResult Putmaterial(int id, material material) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != material.id) { return(BadRequest()); } db.Entry(material).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!materialExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public DetailDto getSimpleMaterial(int id) { material m = db.materials.Where(s => s.id == id).FirstOrDefault(); DetailDto materialDto = new DetailDto(m.id.ToString(), m.name); return(materialDto); }
private float GetCapacity(material mat) { float cap_scaling = 4.1813f; // Heat capacities determine how much heat the element stores per degree of temperature // Must be the same values as in TemperatureShader or funny things will happen // https://en.wikipedia.org/wiki/Table_of_specific_heat_capacities switch (mat) { case material.water: return(4.1813f / cap_scaling); case material.steam: return(2.0800f / cap_scaling); case material.lava: return(1.5600f / cap_scaling); case material.obsidian: return(1.0000f / cap_scaling); case material.dirt: return(0.8000f / cap_scaling); case material.copper: return(0.3850f / cap_scaling); } return(0.0f); }
public static STGenericMaterial LoadMaterial(material daeMat) { STGenericMaterial mat = new STGenericMaterial(); mat.Name = daeMat.id; return(mat); }
private void initialize(double objVol) { this.refVolume = objVol; elemList = new List <elements.element>(); em = new material((_e, _i) => { _i.energyDensity = 0; return(_i.stress2.zeros().plus_xA(1.0, _i.invMetric)); }); gvt = new materials.zeroGravity().getGravity(); }
private void moveZtoPrintPosition(int layerNumber, material mat) { double zeroheight = new double(); switch (mat) { case material.m1: zeroheight = Z_zeroMat1; break; case material.m2: zeroheight = Z_zeroMat2; break; case material.m3: zeroheight = Z_zeroMat3; break; case material.m4: zeroheight = Z_zeroMat4; break; } setAbsoluteCoordinates(); move(new Tuple <axis, double>(axis.z, zeroheight - (layerNumber * _layerHeight))); }
public seat(bool headrest, rating rating, material material, int belt) { mHeadrest = headrest; mRating = rating; mMaterial = material; mBelt = belt; }
/// <summary> /// Updates the preview box with the specified image. If no file number is specified, then the image will be black /// </summary> /// <param name="mat">the material preview to be updated</param> /// <param name="fileNumber">the file number of the material to preview</param> private void updatePreviewImage(material mat, int fileNumber = -1) { try { PictureBox pic = new PictureBox(); switch (mat) { case material.m1: pic = previewPic1; break; case material.m2: pic = previewPic2; break; case material.m3: pic = previewPic3; break; case material.m4: pic = previewPic4; break; } if (fileNumber == -1) { pic.Image = null; } else { pic.Image = Image.FromFile(_fileNames[(int)mat].ElementAt(fileNumber)); } } catch { } }
unsafe public stVenantMaterial() { m_mat = new material((_e, _i) => { double J = Math.Sqrt(_i.metric.det / _i.refMetric.det); double _m = 1 / J * 2 * this.mu; double _l = 1 / J * this.lambda; int N = _i.__N; //_i.stress2.zeros(); /*for (int i = 0; i < N; i++) * { * for (int j = 0; j <N; j++) * { * _i.stress2[i, j]=0; * for (int k = 0; k < N; k++) * { * for (int l = 0; l < N; l++) * { * _i.stress2[i, j] = _i.stress2[i, j]+_l * _i.invMetric[i, j] * _i.invMetric[k, l] * _i.strain[k, l] + _m * _i.invMetric[i, k] * _i.strain[k,l] * _i.invMetric[l,j]; * } * } * } * }*/ fixed(double *_ptr1 = &_i.stress2.rawData[0, 0], _ptr2 = &_i.strain.rawData[0, 0], _ptr3 = &_i.refInvMetric.rawData[0, 0], _ptr4 = &_i.refInvMetric.rawData[0, 0]) { double *ptr1 = _ptr1; double *ptr3 = _ptr3; double *ptr5 = _ptr3; double *ptr7 = _ptr4; double v = 0; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { v = 0; double *ptr2 = _ptr2; double *ptr4 = _ptr4; double *__ptr7 = ptr7; for (int k = 0; k < N; k++) { for (int l = 0; l < N; l++) { v += _l * *(ptr3 /* + i * N + j*/) * *(ptr4 /* + k * N + l*/) * *(ptr2 /* + k * N + l*/) + _m * *(ptr7 /* + i * N + k*/) * *(ptr2 /* + k * N + l*/) * *(ptr5 + l * N + j); ptr2++; ptr4++; } ptr7++; } ptr7 = __ptr7; *ptr1 = v; ptr1++; ptr3++; } ptr7 += N; } } return(_i.stress2); }); }
public void setSurface(material _surface) { if (Enum.IsDefined(typeof(material), _surface)) { this.surface = _surface; } }
public Desk(float width, float depth, int drawers, material surface) { this.width = width; this.depth = depth; this.drawers = drawers; this.surface = surface; }
public void setAvaibleOne(int matID) { material mat = db.materials.FirstOrDefault(x => x.matID == matID); mat.avaible = true; db.SaveChanges(); }
public ActionResult DeleteConfirmed(int id) { material material = db.materials.Find(id); db.materials.Remove(material); db.SaveChanges(); return(RedirectToAction("Index")); }
/// <summary> /// Takes out _currentMaterial /// </summary> private void takeOutMaterial(material mat) { setAbsoluteCoordinates(); move(X_toClipPosition); move(Y_towerPositionsHookPull[(int)mat]); move(X_pullOutPosition); move(X_printPosition); }
unsafe public formFindingMaterial() { m_mat = new material((_e, _i) => { double n = this.Power * this.Weight * Math.Pow(_e.Volume, this.Power - 1); _i.energyDensity = this.Weight * Math.Pow(_e.Volume, this.Power - 1); return(_i.stress2.zeros().plus_xA(n, _i.invMetric)); }); }
public MaterialDto getMaterial(int id) { material m = db.materials.Where(s => s.id == id).FirstOrDefault(); MaterialDto materialDto = new MaterialDto(m.id, m.name, supplierRepository.getSupplier(m.supplier_infor_id), m.barcode, materialTypeRepository.getMaterialType(m.type_id), m.main_unit, m.change_unit, statusRepository.getStatus(m.status_id)); return(materialDto); }
public void setMaterial(materials.iMaterial mat, materials.iGravity gvt) { material m = mat.getMaterial(); gravity g = gvt.getGravity(); foreach (elements.element e in this.elemList) { e.setMaterial(m, g); } }
public ActionResult Edit([Bind(Include = "id,material_name")] material material) { if (ModelState.IsValid) { db.Entry(material).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(material)); }
public ActionResult Edit([Bind(Include = "ID,name")] material material) { //TODO: This action need to be deeply reviewed if (ModelState.IsValid) { db.Entry(material).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(material)); }
RenderItems.Add(new RenderItem( material, vertexBuffer0, vertexBuffer1, cullFlags, boundingBox, world, DrawCommand.Draw, vertexStart, vertexCount, 0, 0, null));
public ActionResult Edit([Bind(Include = "id_material,id_tipo_material,nome,sin_ativo")] material material) { if (ModelState.IsValid) { db.Entry(material).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.id_tipo_material = new SelectList(db.tipo_material, "id_tipo_material", "nome", material.id_tipo_material); return(View(material)); }
public IHttpActionResult Getmaterial(int id) { material material = db.material.Find(id); if (material == null) { return(NotFound()); } return(Ok(material)); }
void getResult(double input1, double input2, double input3) { string machineName = comboBox1.Text; machine mac = new machine(); machineDic.TryGetValue(machineName, out mac); string materialName = comboBox2.Text; material mat = new material(); materialDic.TryGetValue(materialName, out mat); }
public ActionResult Create([Bind(Include = "id,material_name")] material material) { if (ModelState.IsValid) { db.materials.Add(material); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(material)); }
unsafe public neoHookeanMaterial() { m_mat = new material((_e, _i) => { double J = Math.Sqrt(_i.metric.det / _i.refMetric.det); int N = _i.__N; double K = m_K; double u1 = m_mu1; double KK = K / 2d * (J - 1d) /**J*/;//Cauchy stress なのでJで割る //_i.stress2.zeros(); double I1 = 0; /*for (int i = 0; i < N; i++) * { * for (int j = 0; j < N; j++) * { * I1 += _i.metric[i, j] * _i.refInvMetric[i, j]; * } * } * * for (int i = 0; i < N; i++) * { * for (int j = 0; j < N; j++) * { * _i.stress2[i, j] = (_i.refInvMetric[i, j] - I1/3d * _i.invMetric[i, j]) * u1 + K /2d * (J - 1d) * _i.invMetric[i, j]; + } + }*/ fixed(double *_ptr1 = &_i.metric.rawData[0, 0], _ptr2 = &_i.refInvMetric.rawData[0, 0], _ptr3 = &_i.invMetric.rawData[0, 0], _ptr4 = &_i.stress2.rawData[0, 0]) { double *ptr1 = _ptr1; double *ptr2 = _ptr2; for (int i = 0; i < N * N; i++) { I1 += *ptr1 * *ptr2; ptr1++; ptr2++; } ptr1 = _ptr1; ptr2 = _ptr2; double *ptr3 = _ptr3; double *ptr4 = _ptr4; for (int i = 0; i < N * N; i++) { *ptr4 = (*ptr2 - I1 / 3d * *ptr3) * u1 + KK * *ptr3; //全然違うやん! ptr2++; ptr3++; ptr4++; } } return(_i.stress2); }); }
public static STGenericMaterial LoadMaterial(ColladaScene scene, material daeMat) { STGenericMaterial mat = new STGenericMaterial(); mat.Name = daeMat.id; if (daeMat.instance_effect != null) { var effectid = daeMat.instance_effect.url.Remove(0, 1); if (scene.effectLookup.ContainsKey(effectid)) { var effect = scene.effectLookup[effectid]; if (effect.Items == null) { return(mat); } foreach (var item in effect.Items) { if (item.Items == null) { continue; } foreach (var param in item.Items) { if (param is common_newparam_type) { var newparam = (common_newparam_type)param; if (newparam.ItemElementName == ItemChoiceType.surface) { var surface = newparam.Item as fx_surface_common; var name = surface.init_from[0].Value; mat.TextureMaps.Add(new STGenericTextureMap() { Name = name, Type = STTextureType.Diffuse, }); } } if (param is technique) { var technique = (technique)param; } } } } else { Console.WriteLine($"cannot find id! {effectid}"); } } return(mat); }
private IDAEMaterial CreateMaterial(DAELoaderNode loader, material mat) { DAEEffect efx = loader.LibEffects.GetEffect(loader, DAEUtils.GetUrl(mat.instance_effect.url).Id); IDAEMaterial m = efx.CreateMaterial(loader); //TODO set parameter _materials.Add(mat.id, m); return(m); }