/// <summary> /// Sends a <c>OnMarkerSeen</c> Unity message upwards. /// </summary> /// <param name="position">The MarkerPosition describing the message, not null.</param> /// <exception cref="ArgumentNullException">If <c>position</c> is null.</exception> public void EmitMarkerSeen(MarkerPosition position) { if (position == null) { throw new ArgumentNullException("position"); } this.SendMessageUpwards("OnMarkerSeen", position); }
public bool Equals(RadarBlip other) { if (other == null) { return(false); } return(Color.Equals(other.Color) && Type.Equals(other.Type) && EntityHandle.Equals(other.EntityHandle) && RadarPosition.Equals(other.RadarPosition) && MarkerPosition.Equals(other.MarkerPosition) && Index.Equals(other.Index) && IsBright.Equals(other.IsBright) && IsInUse.Equals(other.IsInUse) && DebugSphereRadius.Equals(other.DebugSphereRadius) && Scale.Equals(other.Scale) && Display.Equals(other.Display) && Sprite.Equals(other.Sprite)); }
/// <summary> /// Builds and returns the MarkerPositions detected by the Meta detector. /// </summary> /// <returns>The List of MarkerPositions.</returns> public Collection <MarkerPosition> GetMarkerPositions() { this.EnsureMeta(); Collection <MarkerPosition> list = new Collection <MarkerPosition>(); List <int> updates = this.markerDetector.updatedMarkerTransforms; foreach (int id in updates) { this.markerDetector.GetMarkerTransform(id, ref this.lamb); Vector3 position = this.lamb.localPosition + PositionOffset; position.Scale(new Vector3(1, 1, MetaDepth)); MarkerPosition pos = new MarkerPosition( position, this.lamb.localRotation, DateTime.Now, MetaScale * this.lamb.localScale, id); list.Add(pos); } return(list); }
public MarkerData(Point3d xyz, MarkerPosition pos) { X = xyz.X; Y = xyz.Y; Z = xyz.Z; OX = float.NaN; OY = float.NaN; Pos = pos; }
public MarkerData(Point3d xyz, Point2d oxy, MarkerPosition pos) { X = xyz.X; Y = xyz.Y; Z = xyz.Z; OX = oxy.X; OY = oxy.Y; Pos = pos; }
public MarkerData(float x, float y, float z, float ox, float oy, MarkerPosition pos) { X = x; Y = y; Z = z; OX = ox; OY = oy; Pos = pos; }
public MarkerData() { X = float.NaN; Y = float.NaN; Z = float.NaN; Pos = MarkerPosition.Invalid; OX = float.NaN; OY = float.NaN; }
public static ICanvasImage CreateValueMarker(ICanvasResourceCreator resourceCreator, ChartTextFormat markerFormat, List <Vector2> positions, List <string> labels, MarkerPosition markerPosition) { if (positions?.Count > 0 && positions.Count == labels?.Count) { var commandList = new CanvasCommandList(resourceCreator); using (var drawSession = commandList.CreateDrawingSession()) { var cancasTextArray = labels.Select(o => CreateCanvasText(resourceCreator, o, markerFormat)).ToArray(); for (int i = 0; i < positions.Count; i++) { var textRect = cancasTextArray[i].DrawBounds; double x = positions[i].X, y = positions[i].Y; switch (markerPosition) { case MarkerPosition.Top: x -= textRect.Width / 2 + textRect.X; y -= textRect.Height + textRect.Y + markerFormat.Thickness.Bottom; break; case MarkerPosition.Right: x += markerFormat.Thickness.Left - textRect.X; y -= textRect.Height / 2 + textRect.Y; break; case MarkerPosition.Bottom: x -= textRect.Width / 2 + textRect.X; y += -textRect.Y + markerFormat.Thickness.Top; break; case MarkerPosition.Left: x -= textRect.Width + markerFormat.Thickness.Right - textRect.X; y -= textRect.Height / 2 + textRect.Y; break; } drawSession.DrawTextLayout(cancasTextArray[i], (float)x, (float)y, ColorConverter.ConvertHexToColor(markerFormat.Foreground)); cancasTextArray[i].Dispose(); } } return(commandList); } return(null); }
public Marker(int x, int y, MarkerPosition position) { X = x; Y = y; Position = position; }