public TokenMarker(int id, Vector2 postion, TouchState state, MarkerType type) { this._id = id; this._position = postion; this._state = state; this._type = type; }
public TileData(bool isTileImportant, Color colour, MarkerType hasMarker = MarkerType.Unknown) { this.isImportant = isTileImportant; this.colour = colour; this.drawMarker = false; this.markerType = hasMarker; }
/// <summary> /// Constructor /// </summary> /// <param name="markertype">The marker type.</param> /// <param name="size">The marker size.</param> /// <param name="color">The marker color.</param> public Marker( MarkerType markertype, int size, Color color ) { markerType_ = markertype; Size = size; Color = color; filled_ = false; }
/// <summary> /// Constructor /// </summary> /// <param name="markertype">The marker type.</param> /// <param name="size">The marker size.</param> /// <param name="pen">The marker Pen.</param> public Marker( MarkerType markertype, int size, Pen pen ) { markerType_ = markertype; Size = size; Pen = pen; filled_ = false; }
protected string GetMarkerImage(MarkerType markerType) { var rawUri = WebConfigurationManager.AppSettings["RawUri"]; string imagePath; switch (markerType) { case MarkerType.Bus: imagePath = WebConfigurationManager.AppSettings["BusMarkerImagePath"]; break; case MarkerType.RideOffer: imagePath = WebConfigurationManager.AppSettings["RideOfferMarkerImagePath"]; break; case MarkerType.RideRequest: imagePath = WebConfigurationManager.AppSettings["RideRequestMarkerImagePath"]; break; case MarkerType.Help: imagePath = WebConfigurationManager.AppSettings["HelpMarkerImagePath"]; break; default: imagePath = string.Empty; break; } var uri = string.Format("{0}{1}", rawUri, imagePath); return new Uri(uri).AbsoluteUri; }
public Vector3 Thrust(MarkerType reference) { Vector3 thrust, torque; GameObject marker = RCSBuildAid.GetMarker(reference); calcMarkerForces (marker.transform, out thrust, out torque); return thrust; }
private static ScatterSeries CreateRandomScatterSeries(int n, MarkerType markerType, bool setSize, bool setValue, LinearColorAxis colorAxis) { var s1 = new ScatterSeries { MarkerType = markerType, MarkerSize = 6, ColorAxisKey = colorAxis != null ? colorAxis.Key : "nix" }; var random = new Random(13); for (int i = 0; i < n; i++) { var p = new ScatterPoint((random.NextDouble() * 2.2) - 1.1, random.NextDouble()); if (setSize) { p.Size = (random.NextDouble() * 5) + 5; } if (setValue) { p.Value = (random.NextDouble() * 2.2) - 1.1; } s1.Points.Add(p); } return s1; }
public TileData() { this.isImportant = false; this.color = Color.Magenta; this.officialColor = Color.Magenta; this.transparent = false; this.markerType = MarkerType.Unknown; }
// Constructor for new Waypoint Generation public Waypoint(Point p, MarkerType marker, IslandType island) { this.Location = Coordinates.FromPoint(p); this.Island = island; this.Marker = marker; this.Name = string.Empty; this.Notes = String.Empty; }
// Constructor for new Waypoint Generation public Waypoint(Coordinates c, MarkerType marker, IslandType island) { this.Location = c; this.Island = island; this.Marker = marker; this.Name = string.Empty; this.Notes = String.Empty; }
private void CloseMarker(MarkerType type, int position) { if (!IsMarkerOpened(type)) throw new Exception("Trying to close closed marker"); var marker = openedMarkers[type]; markers.Add(new Marker(marker.LInclusive, position, marker.Type)); openedMarkers.Remove(type); }
private static PlotModel CreateRandomScatterSeriesWithColorAxisPlotModel(int n, OxyPalette palette, MarkerType markerType, AxisPosition colorAxisPosition, OxyColor highColor, OxyColor lowColor) { var model = new PlotModel { Title = string.Format("ScatterSeries (n={0})", n), Background = OxyColors.LightGray }; var colorAxis = new LinearColorAxis { Position = colorAxisPosition, Palette = palette, Minimum = -1, Maximum = 1, HighColor = highColor, LowColor = lowColor }; model.Axes.Add(colorAxis); model.Series.Add(CreateRandomScatterSeries(n, markerType, false, true, colorAxis)); return model; }
public EntityMarker(BankEntity entity, IconType iconType) { this.Entity = entity; this.MarkerOptions = new MarkerOptions (); this.MarkerOptions.SetTitle (entity.Description()); this.MarkerOptions.SetPosition (new LatLng(entity.Latitude, entity.Longitude)); this.Type = MarkerType.Regular; IconType = iconType; }
public Marker(MarkerType markertype, Vector3 position, Color color, AnimationType type) { this.markertype = markertype; this.position = position; this.color = color; this.type = type; this.scale = Default_Scale; _time = 0; }
public TileData(bool isTileImportant, Color color, Color officialColor, MarkerType hasMarker = MarkerType.Unknown) { this.isImportant = isTileImportant; this.color = color; this.officialColor = officialColor; this.transparent = false; this.drawMarker = false; this.markerType = hasMarker; }
public Waypoint AddWaypoint(IslandType i, MarkerType m, Point p) { if (i == IslandType.None && m == MarkerType.None || waypoints.Exists(x => x.GetLocation() == p)) return null; Waypoint wp = new Waypoint(p, m, i); waypoints.Add(wp); return wp; }
public Stamp AddStamp(MarkerType m, int size, Point p) { if (m == MarkerType.None || HasStamp(p)) return null; Stamp stamp = new Stamp(p, size, m); stamps.Add(stamp); return stamp; }
public static void ActivateMarkerOnMouse(MarkerType markerType) { if (CachedDidHit) { PlayerManager.OrderMarker.PlayOneShot (CachedHit.point, CachedHit.normal, markerType); return; } Vector3 hitPoint = CachedRay.origin - CachedRay.direction * (CachedRay.origin.y / CachedRay .direction.y); if (PlayerManager.OrderMarker != null) PlayerManager.OrderMarker.PlayOneShot (hitPoint, Vector3.up, markerType); }
/// <summary> /// Initializes a new instance of the <see cref="Marker"/> class. /// </summary> /// <param name="offset">The offset of the marked region.</param> /// <param name="length">The length of the marked region.</param> /// <param name="markerType">Type of the text marker.</param> /// <param name="color">The color of the text marker.</param> public Marker(int offset, int length, MarkerType markerType, Color color) { if (length < 1) length = 1; _offset = offset; _length = length; _markerType = markerType; _color = color; }
/// <summary> /// Initializes a new instance of the <see cref="Marker"/> class. /// </summary> /// <param name="offset">The offset of the marked region.</param> /// <param name="length">The length of the marked region.</param> /// <param name="markerType">Type of the text marker.</param> /// <param name="color">The color of the text marker.</param> /// <param name="foreColor">The foreground color of the text.</param> public Marker(int offset, int length, MarkerType markerType, Color color, Color foreColor) { if (length < 1) length = 1; _offset = offset; _length = length; _markerType = markerType; _color = color; _textColor = foreColor; _overrideTextColor = true; }
/// <summary> /// Generates a base marker image of the specified type for the provided seed. /// </summary> /// <param name="type">The type of marker you would like to generate</param> /// <param name="seed">The seed for the Random object</param> /// <returns>A new base marker image. This is a low resolution image and should be scaled before use.</returns> public Bitmap GenerateMarkerImage(MarkerType type, int seed) { // Decide which type of marker was requested and generate it. switch (type) { case MarkerType.ARToolkit: return(GenerateMarkerImage(seed, 32, 8, 1)); case MarkerType.Vuforia: default: return(GenerateMarkerImage(seed, 64, 4, 3)); } }
/// <summary> /// Constructor /// </summary> public PointBreak() : base() { BreakType = BreakTypes.PointBreak; _markerType = MarkerType.Simple; _fontName = "Arial"; _charIndex = 0; _outlineColor = Color.Black; _size = 1.0f; _style = PointStyle.Circle; _drawOutline = true; _drawFill = true; _angle = 0; }
private VertexMarker CreateMarker(MarkerType markerType, PointF point, int index, Figure fig) { var marker = new VertexMarker { MarkerType = markerType, Cursor = CursorFactory.GetCursor(UserCursor.MoveAll), Position = point, Index = index, Owner = fig }; return(marker); }
public void CanMissAPlacedShip() { var testGame = new Game { PlayerOne = new Player("one"), PlayerTwo = new Player("two") }; testGame.PlaceShip(testGame.PlayerOne, ShipType.Cruiser, "A1", "A3"); testGame.PlaceShip(testGame.PlayerTwo, ShipType.Cruiser, "A1", "A3"); testGame.Start(); MarkerType markerType = testGame.Call(new BoardCoordinate("B1")); Assert.AreEqual(markerType, MarkerType.Miss); }
/// <summary> /// Tests if a marker is a marker segment /// From ISO 115443-1 A.4: Delimiting markers and marker segments /// </summary> /// <param name="type"></param> /// <returns> True iff the marker belongs to a marker segment</returns> public static bool IsSegment(MarkerType type) { switch (type) { case MarkerType.SOC: case MarkerType.SOD: case MarkerType.EOC: return(false); default: return(true); } }
public void Update(IPoint loc, string tooltip, MarkerType markertype) { ToolTipText = tooltip; if (markertype != this.type) { if (type != MarkerType.none) { LoadBitmap(); } } Location = loc; }
/// <summary> /// Constructor for the <see cref="VoteLine"/> class. /// </summary> /// <param name="prefix">Optional indention prefix for the vote line.</param> /// <param name="marker">The vote marker used for the vote line.</param> /// <param name="task">The task specified for the vote line.</param> /// <param name="content">The content of the vote line.</param> /// <param name="markerType">The classification of the marker used for the vote.</param> /// <param name="markerValue">The value of the marker used for the vote.</param> public VoteLine(string prefix, string marker, string task, string content, MarkerType markerType, int markerValue) { Prefix = prefix; Marker = marker; Task = task.Trim(); Content = content.Trim(); MarkerType = markerType; MarkerValue = markerValue; Depth = Prefix.Length; CleanContent = VoteLineParser.StripBBCode(Content); _hash = Agnostic.InsensitiveComparer.GetHashCode(CleanContent); }
public Window2DPlot(IEnumerable <PointLight> points, string title, Plot2DType plot2DType, bool closeShape, MarkerType marker) : this(title) { if (plot2DType == Plot2DType.Line) { AddLineSeriesToModel(points.ToList(), closeShape, marker); } else { AddScatterSeriesToModel(points.ToList(), marker); } InitializeComponent(); }
public Display_Detail_Help_MS1() { this.mgf_marker = MarkerType.Plus; this.theory_marker = MarkerType.Circle; this.other_marker = MarkerType.Cross; this.mgf_color = OxyColors.Red; this.theory_color = OxyColors.Red; this.other_color = OxyColors.Red; this.mgf_size = 4; this.theory_size = 4; this.other_size = 4; this.peak_size = 2; }
public static bool TryGetMarker(this Expression e, out MarkerType markerType) { e = e.StripCasts(); markerType = MarkerType.None; var result = (ExtendedExpressionType)e.NodeType == ExtendedExpressionType.Marker; if (result) { var marker = (MarkerExpression)e; markerType = marker.MarkerType; } return(result); }
/// <summary> /// Changes the list style of the text range. /// </summary> /// <param name="range">The text range to update.</param> /// <param name="marker">The list type.</param> public static void ChangeList(this ITextRange range, MarkerType marker) { range.ParagraphFormat.ListType = marker; if (marker != MarkerType.None) { var format = range.ParagraphFormat; format.ListStart = 1; format.ListTab = TabSize; format.ListLevelIndex = 1; } }
protected MarkerSegment( MarkerType type, ushort markerLength, byte[] markerBody) { Type = type; _markerLength = markerLength; _markerBody = markerBody; // continue to specific class constructor and call Parse there. // Parsing is class specific and may need initialization of data // members that belong to that class. // Parse(); -- keep this comment }
private static ScatterSeries CreateRandomScatterSeries2(int n, string title, MarkerType markerType) { var series = new ScatterSeries { Title = title, MarkerType = markerType, MarkerStroke = OxyColors.Black, MarkerStrokeThickness = 1.0, }; series.Points.AddRange(CreateRandomScatterPoints(n)); return(series); }
/// <summary> /// Renders the marker. /// </summary> /// <param name="rc">The render context.</param> /// <param name="clippingRectangle">The clipping rectangle.</param> /// <param name="p">The center point of the marker.</param> /// <param name="type">The marker type.</param> /// <param name="outline">The outline.</param> /// <param name="size">The size of the marker.</param> /// <param name="fill">The fill color.</param> /// <param name="stroke">The stroke color.</param> /// <param name="strokeThickness">The stroke thickness.</param> public static void DrawMarker( this IRenderContext rc, OxyRect clippingRectangle, ScreenPoint p, MarkerType type, IList <ScreenPoint> outline, double size, OxyColor fill, OxyColor stroke, double strokeThickness) { rc.DrawMarkers(clippingRectangle, new[] { p }, type, outline, new[] { size }, fill, stroke, strokeThickness); }
public static TimeSeriesPlotInfo Create( TimeSeries series = null, Type seriesType = null, string title = null, Color?color = null, Func <DateValue, Color> colorFunction = null, Func <Color, string> legendFunction = null, MarkerType markerType = MarkerType.None, LineStyle lineStyle = LineStyle.None, int plotOrder = 0) { TimeSeriesPlotInfo result = new TimeSeriesPlotInfo { Series = series, SeriesType = seriesType ?? typeof(FunctionSeries), LineStyle = lineStyle, Marker = markerType }; if (color != null) { result.Color = color.Value; } if (colorFunction != null) { result.ColorFunction = colorFunction; } if (result.Color == null && result.ColorFunction == null) { result.Color = Color.Blue; } if (!string.IsNullOrEmpty(title)) { result.Title = title; } if (legendFunction != null) { result.LegendTitleFunction = legendFunction; } if (string.IsNullOrEmpty(result.Title) && result.LegendTitleFunction == null) { result.Title = string.IsNullOrEmpty(series?.Name) ? "NO NAME" : series.Name; } return(result); }
public async Task <int> GetBitmapId(MarkerType type, MarkerColor color) { var image = await GetImage(type, color); var content = new MemoryStream(image.Encode().ToArray()); int bitmapId; lock (BitmapRegistry.Instance) { bitmapId = BitmapRegistry.Instance.Register(content); } return(bitmapId); }
public TodoAnnotation(double lat, double lng, bool done) { // Initialize Coordinate = new CLLocationCoordinate2D(new NSNumber(lat).NFloatValue, new NSNumber(lng).NFloatValue); if (done) { Type = MarkerType.Done; } else { Type = MarkerType.NotDone; } }
public override void Clear() { tvMarkerType.SelectedNode = null; txtName.Text = string.Empty; txtName.Enabled = true; cbSymbol.SelectedIndex = 0; cbSymbol.Enabled = true; _imagename = string.Empty; cbSize.SelectedIndex = 0; cbSize.Enabled = true; pbSymbol.Image = null; _markerType = MarkerTypeHelper.GetNew(); btnRemove.Enabled = false; }
public Marker(PointLatLng pos, MarkerType type, MarkerColor color) { this.Position = pos; this.Type = type; this.Color = color; this.Text = string.Empty; this.TooltipMode = MarkerTooltipMode.OnMouseOver; this.Visible = true; this.CustomMarkerAlign = CustomMarkerAlign.MiddleMiddle; this.CustomMarkerCenter = Point.Empty; this.IsMouseOver = false; this.ToolTipOffset = new Point(14, -44); }
private nuint CountByType(IMKAnnotation[] members, MarkerType type) { nuint count = 0; foreach (TodoAnnotation member in members) { if (member.Type == type) { ++count; } } return(count); }
/// <summary> /// Создание маркера /// </summary> /// <param name="type">Тип маркера</param> /// <param name="posX">Нормированная координата маркера по горизонтали</param> /// <param name="posY">Нормированная координата маркера по вертикали</param> /// <param name="cursor">Курсор на маркере</param> /// <param name="anchorX">Нормированная координата якоря по горизонтали</param> /// <param name="anchorY">Нормированная координата якоря по вертикали</param> /// <param name="offsetX">Смещение координаты якоря по горизонтали </param> /// <param name="offsetY">Смещение координаты якоря по вертикали</param> /// <returns></returns> private Marker CreateMarker(MarkerType type, float posX, float posY, UserCursor cursor, float anchorX, float anchorY, float offsetX = 0, float offsetY = 0) { var normPoint = new PointF(posX, posY); var anchPoint = new PointF(anchorX, anchorY); return(new Marker { MarkerType = type, Cursor = CursorFactory.GetCursor(cursor), Position = _selection.ToWorldCoordinates(normPoint).Add(new PointF(offsetX, offsetY)), AnchorPosition = _selection.ToWorldCoordinates(anchPoint) }); }
/// <summary> /// Initializes a new instance of the <see cref="Marker"/> class. /// </summary> /// <param name="offset">The offset of the marked region.</param> /// <param name="length">The length of the marked region.</param> /// <param name="markerType">Type of the text marker.</param> /// <param name="color">The color of the text marker.</param> /// <param name="foreColor">The foreground color of the text.</param> public Marker(int offset, int length, MarkerType markerType, Color color, Color foreColor) { if (length < 1) { length = 1; } _offset = offset; _length = length; _markerType = markerType; _color = color; _textColor = foreColor; _overrideTextColor = true; }
public static void LoadConfig() { configAbsolutePath = Path.Combine(KSPUtil.ApplicationRootPath, configPath); settings = ConfigNode.Load(configAbsolutePath) ?? new ConfigNode(); com_reference = (MarkerType)GetValue("com_reference", (int)MarkerType.CoM); plugin_mode = (PluginMode)GetValue("plugin_mode", (int)PluginMode.RCS); direction = (Direction)GetValue("direction", (int)Direction.right); menu_vessel_mass = GetValue("menu_vessel_mass", false); menu_res_mass = GetValue("menu_res_mass", false); marker_scale = GetValue("marker_scale", 1f); include_rcs = GetValue("include_rcs", true); include_wheels = GetValue("include_wheels", false); eng_include_rcs = GetValue("eng_include_rcs", false); resource_amount = GetValue("resource_amount", false); use_dry_mass = GetValue("use_dry_mass", true); show_marker_com = GetValue("show_marker_com", true); show_marker_dcom = GetValue("show_marker_dcom", true); show_marker_acom = GetValue("show_marker_acom", false); marker_autoscale = GetValue("marker_autoscale", true); menu_minimized = GetValue("menu_minimized", false); applauncher = GetValue("applauncher", true); action_screen = GetValue("action_screen", false); toolbar_plugin = GetValue("toolbar_plugin", true); window_x = GetValue("window_x", 280); window_y = GetValue("window_y", 114); disable_mod_compatibility_check = GetValue("disable_mod_compatibility_check", false); /* for these resources, set some defaults */ resource_cfg ["LiquidFuel"] = GetValue(resourceKey("LiquidFuel"), false); resource_cfg ["Oxidizer"] = GetValue(resourceKey("Oxidizer"), false); resource_cfg ["SolidFuel"] = GetValue(resourceKey("SolidFuel"), false); resource_cfg ["XenonGas"] = GetValue(resourceKey("XenonGas"), true); resource_cfg ["IntakeAir"] = GetValue(resourceKey("IntakeAir"), true); resource_cfg ["Ablator"] = GetValue(resourceKey("Ablator"), true); resource_cfg ["Ore"] = GetValue(resourceKey("Ore"), false); resource_cfg ["MonoPropellant"] = GetValue(resourceKey("MonoPropellant"), true); string bodyname = GetValue("selected_body", "Kerbin"); selected_body = PSystemManager.Instance.localBodies.Find(b => b.name == bodyname); if (selected_body == null) { /* can happen in a corrupted settings.cfg */ selected_body = Planetarium.fetch.Home; } Events.ConfigSaving += SaveConfig; }
private Task OnCheckpointPlacementReset() { ChatHelper.SendMessage("Creator", "Resetting checkpoint edit mode", 255, 120, 0); checkpointState = 0; checkpointLastPosition = Vector3.Zero; checkpointOffset = Vector3.Zero; checkpointRotation = 0.0f; checkpointSize = 1.0f; checkpointIconCount = 0; checkpointIcon = MarkerType.ChevronUpx1; return(Task.FromResult(0)); }
/// <summary> /// Constructs an observable that tracks the value of a given /// marker. /// <para> /// The marker value is the most recent of 0, the last /// marker value announced by the event feed, and /// a constant marker of 0 emitted very time a non-text, /// non-audio track is loaded. /// </para> /// </summary> /// <param name="marker"> /// The marker whose value is being computed. /// </param> /// <returns> /// An <see cref="IObservable{T}"/> that computes the /// value of <paramref name="marker"/> /// </returns> private IObservable <uint> MarkerValue(MarkerType marker) { var directChanges = from x in PlaybackEvents.ObserveMarker where x.Marker == marker select x.NewValue; var trackLoadZero = from x in PlaybackEvents.ObserveTrackLoad where !x.Track.IsTextItem && !x.Track.IsAudioItem select 0u; return(directChanges.Merge(trackLoadZero)); }
//상대방이 Cell을 선택했을 경우 void EventSelected(SocketIOEvent e) { //상대가 어느 위치를 선택했는지 인덱스로 알수 있다. int index = -1; e.data.GetField(ref index, "index"); //상대가 무슨 모양을 했는지 보여주는것 플레이어 마커타입이 써클이라면 써클, 아니라면 크로스 MarkerType markerType = (playerMarkerType == MarkerType.Circle) ? MarkerType.Cross : MarkerType.Circle; cells[index].GetComponent <Cell>().MarkerType = markerType; CurrentState = GameState.playerTurn; }
private static Series CreateRandomLineSeries(int n, string title, MarkerType markerType) { var s1 = new LineSeries { Title = title, MarkerType = markerType, MarkerStroke = OxyColors.Black, MarkerStrokeThickness = 1.0 }; double x = 0; double y = 0; for (int i = 0; i < n; i++) { x += 2 + Randomizer.NextDouble() * 10; y += 1 + Randomizer.NextDouble(); var p = new DataPoint(x, y); s1.Points.Add(p); } return s1; }
private GameObject GetMarker(MarkerType mType) { switch (mType) { case MarkerType.O: return(m_oMarker); case MarkerType.X: return(m_oMarker); default: return(null); } }
public Marker(MarkerType type) { if (type == MarkerType.CHECK) { this.IsChoosable = false; } else { this.IsChoosable = true; } this.Type = type; }
public static void ActivateMarkerOnMouse(MarkerType markerType) { if (CachedDidHit) { PlayerManager.OrderMarker.PlayOneShot(CachedHit.point, CachedHit.normal, markerType); return; } Vector3 hitPoint = CachedRay.origin - CachedRay.direction * (CachedRay.origin.y / CachedRay.direction.y); if (PlayerManager.OrderMarker != null) { PlayerManager.OrderMarker.PlayOneShot(hitPoint, Vector3.up, markerType); } }
public Window2DPlot(IEnumerable <IEnumerable <IEnumerable <Vector2> > > listofListOfListOfPoints, string title, Plot2DType plot2DType, bool closeShape, MarkerType marker) : this(title) { var i = 0; var colorPalet = Presenter.ColorPalette(); var maxLength = colorPalet.Length; foreach (var listOfListOfPoints in listofListOfListOfPoints) { if (plot2DType == Plot2DType.Line) { //Set each list of points as its own color. //Close each list of points foreach (var points in listOfListOfPoints) { var color = new Color(colorPalet[i]); i++; if (i == maxLength) { i = 0; } var series = new LineSeries { MarkerType = marker, Color = OxyColor.FromRgb(color.R, color.G, color.B) }; foreach (var point in points) { series.Points.Add(new DataPoint(point.X, point.Y)); } if (closeShape) { series.Points.Add(new DataPoint(points.First().X, points.First().Y)); } Model.Series.Add(series); } } else { foreach (var points in listOfListOfPoints) { AddScatterSeriesToModel(points, marker); } } } SetAxes(listofListOfListOfPoints.SelectMany(poly => poly.SelectMany(v => v))); InitializeComponent(); Title = title; }
public static void LoadConfig () { configAbsolutePath = Path.Combine (KSPUtil.ApplicationRootPath, configPath); settings = ConfigNode.Load (configAbsolutePath) ?? new ConfigNode (); com_reference = (MarkerType)GetValue ("com_reference", (int)MarkerType.CoM); plugin_mode = (PluginMode)GetValue ("plugin_mode", (int)PluginMode.RCS); direction = (Direction)GetValue ("direction", (int)Direction.right); menu_vessel_mass = GetValue ("menu_vessel_mass", false); menu_res_mass = GetValue ("menu_res_mass" , false); marker_scale = GetValue ("marker_scale" , 1f ); include_rcs = GetValue ("include_rcs" , true ); include_wheels = GetValue ("include_wheels" , false); eng_include_rcs = GetValue ("eng_include_rcs" , false); resource_amount = GetValue ("resource_amount" , false); use_dry_mass = GetValue ("use_dry_mass" , true ); show_marker_com = GetValue ("show_marker_com" , true ); show_marker_dcom = GetValue ("show_marker_dcom", true ); show_marker_acom = GetValue ("show_marker_acom", false); marker_autoscale = GetValue ("marker_autoscale", true ); menu_minimized = GetValue ("menu_minimized" , false); applauncher = GetValue ("applauncher" , true ); action_screen = GetValue ("action_screen" , false); toolbar_plugin = GetValue ("toolbar_plugin" , true ); window_x = GetValue ("window_x" , 280 ); window_y = GetValue ("window_y" , 114 ); /* for these resources, set some defaults */ resource_cfg ["LiquidFuel"] = GetValue (resourceKey ("LiquidFuel"), false); resource_cfg ["Oxidizer"] = GetValue (resourceKey ("Oxidizer") , false); resource_cfg ["SolidFuel"] = GetValue (resourceKey ("SolidFuel") , false); resource_cfg ["XenonGas"] = GetValue (resourceKey ("XenonGas") , true ); resource_cfg ["IntakeAir"] = GetValue (resourceKey ("IntakeAir") , true ); resource_cfg ["Ablator"] = GetValue (resourceKey ("Ablator") , true ); resource_cfg ["Ore"] = GetValue (resourceKey ("Ore") , false ); resource_cfg ["MonoPropellant"] = GetValue (resourceKey ("MonoPropellant"), true); string bodyname = GetValue ("selected_body", "Kerbin"); selected_body = PSystemManager.Instance.localBodies.Find (b => b.name == bodyname); if (selected_body == null) { /* can happen in a corrupted settings.cfg */ selected_body = Planetarium.fetch.Home; } Events.ConfigSaving += SaveConfig; }
private static string[] ReadDataSetTrackerName(MarkerType markerType) { string[] result = new string[2]; string datasetPath; if (markerType == MarkerType.IMAGE) { datasetPath = IMAGE_DATASET_PATH; } else { datasetPath = OBJECT_DATASET_PATH; } //Get DataSet name string[] tempArray = Directory.GetDirectories(Application.dataPath + datasetPath ); if (tempArray.Length == 0) { EditorApplication.Exit(INVALID_PACKAGE_ERROR_CODE); } result[0] = Path.GetFileName(tempArray[0]); string temp = tempArray[0]; //Get target Name tempArray = Directory.GetFiles(temp); if (tempArray.Length == 0) { EditorApplication.Exit(INVALID_PACKAGE_ERROR_CODE); } temp = Path.GetFileNameWithoutExtension(tempArray[0]); if (temp.Substring(temp.Length - 7, 7).Equals("_scaled")) { temp = temp.Substring(0, temp.Length-7); } result[1] = temp; return result; }
public static PlotModel CreateRandomScatterSeriesWithColorAxisPlotModel(int n, OxyPalette palette, MarkerType markerType = MarkerType.Square, AxisPosition colorAxisPosition = AxisPosition.Right, OxyColor highColor = null, OxyColor lowColor = null) { var model = new PlotModel(string.Format("ScatterSeries (n={0})", n)) { Background = OxyColors.LightGray }; model.Axes.Add(new ColorAxis { Position = colorAxisPosition, Palette = palette, Minimum = -1, Maximum = 1, HighColor = highColor, LowColor = lowColor }); var s1 = new ScatterSeries { MarkerType = markerType, MarkerSize = 6, }; var random = new Random(); for (int i = 0; i < n; i++) { double x = random.NextDouble() * 2.2 - 1.1; s1.Points.Add(new ScatterPoint(x, random.NextDouble()) { Value = x }); } model.Series.Add(s1); return model; }
protected string GetMarkerInfoTemplate(MarkerType markerType) { string infoHtmlPath = string.Empty; switch (markerType) { case MarkerType.Bus: infoHtmlPath = WebConfigurationManager.AppSettings["BusInfoHtmlPath"]; break; case MarkerType.RideOffer: infoHtmlPath = WebConfigurationManager.AppSettings["RideOfferInfoHtmlPath"]; break; case MarkerType.RideRequest: infoHtmlPath = WebConfigurationManager.AppSettings["RideRequestInfoHtmlPath"]; break; case MarkerType.Help: infoHtmlPath = WebConfigurationManager.AppSettings["HelpInfoHtmlPath"]; break; } return ReadHtmlFile(string.Concat("~", infoHtmlPath)).ToString(); }
public void PlayOneShot(Vector3 pos, Vector3 norm, MarkerType markerType) { if (markerType == MarkerType.None) return; renderer.gameObject.SetActiveIfNot (true); transform.position = pos; switch (markerType) { case MarkerType.Neutral: material.color = NeutralColor; break; case MarkerType.Friendly: material.color = FriendlyColor; break; case MarkerType.Aggresive: material.color = AggresiveColor; break; } animation.Stop (); animation.Play (); transform.up = norm; //UnityEditor.EditorApplication.isPaused = true; }
private static void SetupVuforiaTools(MarkerType markerType) { Scene currentScene = EditorSceneManager.NewScene(NewSceneSetup.EmptyScene); ARCamera = Instantiate(FileLoader.LoadVuforia(AR_CAMERA_PREFAB_NAME)); string[] dataSetTrackerName = ReadDataSetTrackerName(markerType); Vuforia.DatabaseLoadBehaviour vuforiaTrackerPackage = ARCamera.GetComponent<Vuforia.DatabaseLoadBehaviour>(); vuforiaTrackerPackage.SetupDataSets(dataSetTrackerName[0]); if(markerType == MarkerType.IMAGE){ marker2d = Instantiate(FileLoader.LoadVuforia(IMAGE_TARGET_PREFAB_NAME)); Vuforia.ImageTargetBehaviour imageTargetBehaviour = marker2d.GetComponent<Vuforia.ImageTargetBehaviour>(); imageTargetBehaviour.ChangeImageTarget(dataSetTrackerName[0],dataSetTrackerName[1]); } else{ marker3d = Instantiate(FileLoader.LoadVuforia(OBJECT_TARGET_PREFAB_NAME)); Vuforia.ObjectTargetBehaviour objectTargetBehavior = marker3d.GetComponent<Vuforia.ObjectTargetBehaviour>(); objectTargetBehavior.ChangeImageTarget(dataSetTrackerName[0], dataSetTrackerName[1]); } }
public int GetOnlineMarker(MarkerType mtMarkerType) { try { int res; switch( mtMarkerType ) { case MarkerType.Standard: res = OnlineDefStandartMarker(); break; case MarkerType.Digital: res = OnlineDefCharMarker(); break; default: SetError(ErrorCode.IllegalUse, "GetOnlineMarker: неверный тип маркера: " + mtMarkerType); res = -1; break; } return res; } catch (Exception ex) { SetError(ErrorCode.UnexpectedError, "GetOnlineMarker: " + ex); throw; } }
public int EndRecognize(MarkerType mtMarkerType) { lock (s_runSync) { try { if (!_isRunningNow) return _endRecognitionLastResult; _isRunningNow = false; _endRecognitionLastResult = -1; _endRecognitionLastResult = EndRecognition(mtMarkerType, _lastLines[0], _lastLines[1]); return _endRecognitionLastResult; } catch (Exception ex) { SetError(ErrorCode.UnexpectedError, "EndRecognize: " + ex); throw; } } }
internal static extern int EndRecognition(MarkerType DoIt, int y0, int y1);