public Color GetColor(ColorMode mode, Intensity intensity = Intensity.FULL) { switch (mode) { case ColorMode.MAGENTA: return(Magenta[(int)intensity]); case ColorMode.YELLOW: return(Yellow[(int)intensity]); case ColorMode.CYAN: return(Cyan[(int)intensity]); case ColorMode.GREEN: return(Green[(int)intensity]); case ColorMode.ORANGE: return(Orange[(int)intensity]); case ColorMode.PURPLE: return(Purple[(int)intensity]); case ColorMode.BLACK: return(Black[(int)intensity]); default: return(Black[(int)Intensity.FULL]); } }
/// <summary> /// Clip intensity to project perimeter, fix geometry for intersection & difference /// Attention: "side effect" = geometry of intensity changes /// </summary> /// <param name="intens"></param> public void clipToProject(Intensity intens) { // trick to make all geometries valid for Intersection / Difference: Buffer(0.001) <<<<<<<<<<<<<<<<<<<<<< intens.geometry = GeometryTools.Polygon2Multipolygon(intens.geometry.Buffer(0.001)); //intensity can't be outside of perimeter var perimeter = DBManager.ActiveSession.QueryOver <Perimeter>().Where(p => p.Project.Id == intens.Project.Id).List <Perimeter>().FirstOrDefault(); if (perimeter == null || perimeter.geometry == null) { throw new NullReferenceException(nameof(perimeter) + " " + nameof(perimeter.geometry)); } IGeometry clippedIntens = perimeter.geometry.Intersection(intens.geometry); //keep multipolygon geometry clippedIntens = GeometryTools.Polygon2Multipolygon(clippedIntens.Buffer(0.001)); //area difference due to intersection double areaDifference = intens.geometry.Area - clippedIntens.Area; Debug.WriteLine($"PROJECT CLIPPING: Intensity {intens.ID}: area diff = {areaDifference:F2}, new area = {clippedIntens.Area:F2}, type: {intens.geometry.GeometryType} -> {clippedIntens.GeometryType}"); //assign new geometry intens.geometry = (MultiPolygon)clippedIntens; }
public override void GenerateShader(MaterialGeneratorContext context) { Intensity.ClampFloat(0, 1); context.SetStream(SpecularStream.Stream, SpecularMap, MaterialKeys.SpecularMap, MaterialKeys.SpecularValue); context.SetStream("matSpecularIntensity", Intensity, null, MaterialKeys.SpecularIntensityValue); }
private void buttonOK_Click(object sender, RoutedEventArgs e) { int buffUp, buffCurr, buffLow; if ( int.TryParse(textBoxIntensityUpBorder.Text, out buffUp) && int.TryParse(textBoxIntensityCurrentValue.Text, out buffCurr) && int.TryParse(textBoxIntensityDownBorder.Text, out buffLow) ) { try { Intensity = new Intensity(buffLow, buffCurr, buffUp); } catch (ArgumentException argExc) { MessageBox.Show(argExc.Message); return; } DialogResult = true; Close(); } else { MessageBox.Show("Invalid intensity values.", "Cast Error"); } }
public void Fire(Intensity intensity) { if (OnIntensityChanged != null) { OnIntensityChanged(this, new IntensityChangedEventArgs(intensity)); } }
/// <summary> /// Constructs a CaptionWord with the specified parameters. /// </summary> /// <param name="e">The emotion of this CaptionWord.</param> /// <param name="i">The intensity of the emotion of this word.</param> /// <param name="text">The word string to make this CaptionWord represent.</param> public CaptionWord(Emotion e, Intensity i, string text, int beginIndex) { this.Emotion = e; this.Intensity = i; this.Text = text; this.BeginIndex = beginIndex; }
public override int GetHashCode() { int hash = 1; if (X != 0F) { hash ^= X.GetHashCode(); } if (Y != 0F) { hash ^= Y.GetHashCode(); } if (Z != 0F) { hash ^= Z.GetHashCode(); } if (Intensity != 0) { hash ^= Intensity.GetHashCode(); } if (Timestamp != 0UL) { hash ^= Timestamp.GetHashCode(); } return(hash); }
public void SetAnswer(KAnswer ans) { string s = TranslationManager.GameLanguage == Language.Portuguese ? ans.portugueseAnswer : ans.englishAnswer; this.description.text = s; this.eventIntensity = ans.intensity; }
public void SetTraining(int count, TimeSpan avgDuration, Intensity intensity) { _traning = _traning ?? new Traning(); _traning.Count = count; _traning.AvgDuration = avgDuration; _traning.Intensity = intensity; }
public override string ToString() { StringBuilder sb = new StringBuilder(); if (IsField == true) { sb.Append("Field"); } else { sb.Append("Literal"); } if (IsVisible == true) { sb.Append(" Visible"); } else { sb.Append(" NonDisplay"); } sb.Append(" " + Intensity.ToString() + " " + EntryType.ToString()); sb.Append(" MDT:" + MDT.ToString()); return(sb.ToString()); }
public override bool Equals(object obj) { var other = obj as PointLight; return((other != null) && (Position.Equals(other.Position)) && (Intensity.Equals(other.Intensity))); }
public int Compare(ICompareDescriptor other) { if (other == null) { return(1); } return(Intensity.CompareTo((other as Tempogram).Intensity)); }
public void Stoichiometry_BaselineCase_Pass(string file, string group, double intensity, double baseline, Boolean useful) { Intensity Testintensity = new Intensity(file, group, intensity); Stoichiometry TestStoichiometry = new Stoichiometry(Testintensity, baseline); Assert.AreEqual(Testintensity.IntensityVal / baseline, TestStoichiometry.StoichiometryVal); Assert.AreEqual(useful, TestStoichiometry.usefulStoichiometry); }
public Params(Duration duration, FlickerSpeed flickerSpeed, Intensity intensity, Color color, AnimStart animStart) { Duration = duration; FlickerSpeed = flickerSpeed; Intensity = intensity; Color = color; AnimStart = animStart; }
public bool Equals(IPeak other) { if (ReferenceEquals(this, other)) { return(true); } return(MZ.Equals(other.X) && Intensity.Equals(other.Y)); }
/// <summary> /// Shakes the camera. /// </summary> public void Shake(Intensity intensity) { if (!isShaking || intensity > lastIntensity) { lastIntensity = intensity; shakeConfig = shakeConfigs[intensity]; shakeCooldown = shakeConfig.shakeTime; } }
public bool Equals(PointLight other) { if (other is null) { return(false); } return(Position.Equals(other.Position) && Intensity.Equals(other.Intensity)); }
/// <summary> /// 震度の文字列と ShindoPlace で ShindoInformation クラスを初期化します。 /// </summary> /// <param name="shindo"></param> /// <param name="place"></param> public ShindoInformation(string shindo, IEnumerable <ShindoPlace> place) { if (!Intensity.TryParse(shindo, out _)) { Console.WriteLine(); } Intensity = Intensity.Parse(shindo); Place = place; }
public override void Print() { string s = "Polarity: " + Polarity.ToString() + "\tIntensity: " + Intensity.ToString() + "\tSubjectivityType: " + SubjectivityType.ToString() + "\tSubjectivityPolarity: " + SubjectivityPolarity.ToString(); Console.WriteLine(s); base.Print(); }
private void HandleIntensityChange(Intensity newIntensity) { if (newIntensity == this._currentIntensity) { this.SetIntensityBonfireActive(this._currentIntensity, true); return; } this.SetIntensityBonfireActive(this._currentIntensity, false, 1.5f); this._currentIntensity = newIntensity; this.SetIntensityBonfireActive(this._currentIntensity, true); }
public void Stoichiometry_PeptidePeptideCase_Pass(string file, string group, double intensity1, double intensity2, bool useful, double stoich) { Intensity Testintensity1 = new Intensity(file, group, intensity1); Intensity Testintensity2 = new Intensity(file, group, intensity2); Stoichiometry TestStoichiometry = new Stoichiometry(Testintensity1, Testintensity2); Assert.That(TestStoichiometry.StoichiometryVal, Is.EqualTo(stoich).Within(0.001)); Assert.AreEqual(useful, TestStoichiometry.usefulStoichiometry); }
public static ExecutionCommand SetIntensity(this ExecutionCommand action, Intensity intensity) { if (action == null) { throw new ArgumentNullException(nameof(action)); } action.Intensity = intensity; return(action); }
/// <summary> /// Compare 2 peaks, for sorting by intensity. Follow Sort() call with a Reverse() call to get sorted by descending /// intensity /// </summary> /// <param name="obj"></param> /// <returns></returns> /// <remarks> /// Used by the sort algorithms to sort List of peaks in descending order of mdbl_intensity. /// Function used to sort peaks in a descending order. /// </remarks> public int CompareTo(Peak obj) { var result = Intensity.CompareTo(obj.Intensity); if (result == 0) { result = Mz.CompareTo(obj.Mz); } return(result); }
public bool RecordIntensity(int minute, int intensity) { if (!Intensity.ContainsKey(minute)) { Intensity.Add(minute, intensity); return(true); } return(false); }
public StepLineChartViewModel() { this.Intensity = new ObservableCollection <StepLineChartModel>(); DateTime yr = new DateTime(2000, 5, 1); Intensity.Add(new StepLineChartModel() { Year = yr.AddYears(0), UK = 416, JP = 180 }); Intensity.Add(new StepLineChartModel() { Year = yr.AddYears(1), UK = 490, JP = 240 }); Intensity.Add(new StepLineChartModel() { Year = yr.AddYears(2), UK = 470, JP = 370 }); Intensity.Add(new StepLineChartModel() { Year = yr.AddYears(3), UK = 500, JP = 200 }); Intensity.Add(new StepLineChartModel() { Year = yr.AddYears(4), UK = 449, JP = 229 }); Intensity.Add(new StepLineChartModel() { Year = yr.AddYears(5), UK = 470, JP = 210 }); Intensity.Add(new StepLineChartModel() { Year = yr.AddYears(6), UK = 437, JP = 337 }); Intensity.Add(new StepLineChartModel() { Year = yr.AddYears(7), UK = 458, JP = 258 }); Intensity.Add(new StepLineChartModel() { Year = yr.AddYears(8), UK = 500, JP = 300 }); Intensity.Add(new StepLineChartModel() { Year = yr.AddYears(9), UK = 473, JP = 173 }); Intensity.Add(new StepLineChartModel() { Year = yr.AddYears(10), UK = 520, JP = 220 }); Intensity.Add(new StepLineChartModel() { Year = yr.AddYears(11), UK = 480, JP = 309 }); }
public override int GetHashCode() { unchecked { var hashCode = Value != null?Value.GetHashCode() : 0; hashCode = hashCode * 397 ^ (Intensity != null ? Intensity.GetHashCode() : 0); hashCode = hashCode * 397 ^ (BackendValue != null ? BackendValue.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Shakes all cameras in the scene. /// </summary> public static void ShakeAllCameras(Intensity intensity) { foreach (Camera camera in Camera.allCameras) { CameraShake shake = camera.GetComponent <CameraShake>(); if (shake != null) { shake.Shake(intensity); } } }
void IXmlSerializable.WriteXml(XmlWriter writer) { var xmlSerializer = new XmlSerializer(typeof(Coordinates)); xmlSerializer.Serialize(writer, ObservationPoint); writer.WriteElementString(nameof(Intensity), Intensity.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString(nameof(DurationMs), DurationMs.ToString()); writer.WriteElementString(nameof(ObservationTime), ObservationTime.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString(nameof(EstimatedValue), EstimatedValue.ToString(CultureInfo.InvariantCulture)); }
public override string GetStepParameters() { var parameters = new List <string>(); parameters.Add(Name != null ? Name.ToStepValue() : "$"); parameters.Add(LightColour != null ? LightColour.ToStepValue() : "$"); parameters.Add(AmbientIntensity != null ? AmbientIntensity.ToStepValue() : "$"); parameters.Add(Intensity != null ? Intensity.ToStepValue() : "$"); return(string.Join(", ", parameters.ToArray())); }
private bool Equals(Setup other) { return(String.Equals(MinerName, other.MinerName) && String.Equals(MinerVersion, other.MinerVersion) && String.Equals(ApiVersion, other.ApiVersion) && String.Equals(MiningUrl, other.MiningUrl) && Intensity.Equals(other.Intensity) && String.Equals(PerformanceState, other.PerformanceState) && String.Equals(BiosVersion, other.BiosVersion) && String.Equals(DriverVersion, other.DriverVersion) && String.Equals(OperatingSystem, other.OperatingSystem)); }
private void Awake() { if (instance != null) { Debug.Log("Bad"); } else { instance = this; } }
private void SetIntensityBonfireActive(Intensity intensity, bool active, float delay = 0.0f) { this.DoAfterDelay(delay, () => { switch (intensity) { case Intensity.LOW: this._lowIntensityBonfire.SetActive(active); break; case Intensity.MEDIUM: this._mediumIntensityBonfire.SetActive(active); break; case Intensity.HIGH: default: this._highIntensityBonfire.SetActive(active); break; } }); }
static extern int vibration_request(Intensity intensity, int msecs);
public Vibration(Intensity intensity = Intensity.Medium) { vibration_request (intensity, MAX_DURATION); }
public static void Vibrate(Intensity intensity = Intensity.Medium, int msecs = MAX_DURATION) { vibration_request (intensity, msecs); }
/// <summary> /// Set Intensity field</summary> /// <param name="intensity_">Nullable field value to be set</param> public void SetIntensity(Intensity? intensity_) { SetFieldValue(7, 0, intensity_, Fit.SubfieldIndexMainField); }