ESRI ArcGIS 100.9 .NET Wpf Point icon with Line Icon - arcgis

Using ArcGIS Esri 100.9 with .NET Wpf, I am trying to combine a point icon and a line geometry, but I am not sure how to do that. I want to have a line with the point symbol at the start point and only the start point. Is there any way to do that without creating separate graphics? I am using either a PictureMarkerSymbol or a MultilayerPointSymbol for the point icon, and a PolyLine for the line's geometry. Is there any way I can combine the two for a graphic? I tried using a CompositeSymbol with PictureMarkerSymbol and SimpleLineSymbol, but that created a line with the point symbol at each vertex.
PictureMarkerSymbol pointSym = GenerateSymbol(iconInfo); // custom generation function
Geometry geo = new PolyLine(iconInfo.Points);
Symbol sym = // generate the appropriate symbol for the graphic
Graphic g = new Graphic(geo, sym);

While the runtime is able to render symbols like that, at this point there's not an API for creating them programmatically (it's on the roadmap to add though). However if you use ArcGIS Pro, it can be used to author this type of symbology and then be consumed by Runtime by exporting the symbol styles and using it in your runtime application.

Related

setup ColumnChart from WinRTXamlToolkit

I'm trying to setup Column Chart from WinRTXamlToolkit.
Let me ask:
Is there any guide for charts from this lib? Or which way you found the easiest to learn using charts?
How can I put labels near axises? In points like on below image:
P0: Times
P1: States
How to move labels above chart (like on below image)?
Thank you in advance!
I found "workarounds" (far away from perfection but works).
Below WinRTXamlToolkit = WXT
Fastest way (if you don't know WXT) is:
hide WXT elements
title (just dont set it)
legend (see Hide legend of WPF Toolkit chart with more than one data series)
create your own equivalent of above elements using native XAML (TextBlocks ..) and place it wherever you like
To get column colors for legend do
MethodInXamlBackingObject() {
var paletteOfFirstColumn = ColumnChart.Palette[0];
var columnFirstBrush = paletteOfFirstColumn["Background"];
}
BTW. tips where from to learn WXT:
analyse sources of samples in WXT - these are very detailed
analyse WXT behaviour with tool "WXT Debug Console" (included in demo app) - very powerfull
read arts about WXT and WPF Toolkit (from which WXT is a fork)

Is it possible to use the Projection_traits_xy_3 adapter with the "2D Polyline Simplification" package to simplify 2.5D polylines with CGAL?

I need to simplify a set of 2.5D polylines. Specifically, 3D polylines that do not overlap in the XY plane.
I tried to use the Projection_traits_xy_3 adapter with the "2D Polyline Simplification" package from CGAL, but I have compilation errors when calling the function CGAL::Polyline_simplification_2::simplify, after building the triangulation.
If what I'm trying to do is currently possible to do with CGAL, please someone can show me the basic example code.
Thank you for pointing this out. I added the point/segment distance to Projection_traits_xy_3 and added an example in this pull request.

How to programmatically get images commonly used in Eclipse Plug-ins

What are the places to look for if a plug-in wishes to re-use images that are defined by other plug-ins.
For example, where to look for if a plug-in needed the 'Terminate' icon, defined somewhere in the debug plug-in.
Now and then I have been searching for images and though it would be useful to list the locations of commonly used images in one place.
Some of the platform plug-ins make (some of) their images available though ImageDescriptors. Unfortunately all in a slightly different way.
Platform UI - org.eclipse.ui
This plug-in defines images for public use in ISharedImages. To obtain an image descriptor, query the workbench's image registry like this:
PlatformUI.getWorkbench().getSharedImages().getImage( ISharedImages.IMG_OBJ_FILE );
IDE - org.eclipse.ui.ide
The IDE plug-in adds some more images to the workbench image registry and lists the registered names in IDE.ISharedImages.
To obtain an image descriptor, also query the workbench's image registry like this:
PlatformUI.getWorkbench().getSharedImages().getImage( IDE.ISharedImages.IMG_OBJ_PROJECT );
Debug - org.eclipse.ui.debug
The debug plug-in defines shared images in IDebugUIConstants, image name constants start with IMG_. They can be access through the DebugUITools utility class.
For example:
DebugUITools.getImageDescriptor( IDebugUIConstants.IMG_ACT_RUN );
Compare - org.eclipse.compare
The compare plug-in defines ImageDescritpors for Next and Previous images directly in CompareUI.
For example:
ImageDescriptor next = CompareUI.DESC_DTOOL_NEXT;
Team - org.eclipse.team.ui
The team plug-in as well uses a ISharedImage interface to declare overlay images to decorate modified, conflicting, etc. resources.
The image descriptors can be obtained through the TeamImages class:
ImageDescriptor imageDescriptor = TeamImages.getImageDescriptor( ISharedImages.IMG_DIRTY_OVR );
JDT - org.eclipse.jdt.ui
JDT aligns with the workbench when providing images. Its ISharedImages interface defines the registered names and JavaUI.getSharedImages() allows to obtain the respective image descrptors.
Directly Accessing Images
AbstractUIPlugin has a static helper method to get a descriptor of an image in an arbitrary plug-in.
ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin( "the.bundle.id", "/icons/sample-image.png" );
Warning: Loading images in this way is risky and should generally be avoided. Image locations are not part of a plug-ins API and a plug-in author may choose to delete or move the image which will break your code. If you need proof that this actually happens, have a look at this post.
If you need an image from a plug-in that doesn't make it available through its API, you should prefer to place a copy of that image within your plug-in.

Monogame texture loading NullReferenceException

I have a working game where I am loading all the textures from a different class. It works perfectly fine for the PC version.
Now, I am trying to port it to win8 using Monogame.
If I load a texture from Game1.cs using .xnb file it works absolutely fine. However, when I try to load the same texture by using a different class, it doesn't. It gives me an NullReferenceException error on
GraphicsDevice.Clear(Color.Cornflowerblue);
HungryCoder:
I don't know how you are loading the texture from the class, however, right now MonoGame doesn't yet have a Content Pipeline like you were provided with in building and XNA Game for the PC (they are working on it), therefore, you cannot add graphic files in the same manner.
In my walkthrough of building a Windows 8 XNA game, I create my Shooter player graphic from my own Player class by passing into my Initialize function within the class the Content.Load<> with the Texture type and location:
player.Initialize(Content.Load("Graphics\player"), playerPosition);
Note the .xnb file is located in a folder Graphics within my project.
In my background, I have also created a parallaxing background from a my background class by passing in the full Content Manager to my Initialize method of my Background class as well.
bgLayer1 = new ParallaxingBackground();
bgLayer1.Initialize(Content, "Graphics\bgLayer1", GraphicsDevice.Viewport.Width, -1);
Both of these examples work within my project/game.
If you interested have posted the player code example as a part of blog tutorial series on MonoGame on Windows 8. As I complete the code for the background, I will also add the full code example for the background as well. Hope this helps.
http://blogs.msdn.com/tarawalker

Xcode: Cocos2d: Can't create world with Box2D

My project originated as the cocos2d Box2D template and I'm having issues as soon as I tried to create a world:
world = new b2World(gravity,doSleep);
Gives the error: No matching constructor for initialization of 'b2World'.
The file is .mm, I assume it's some issue about library linking maybe? If so I'm using xCode 4, how can I check the lib is properly linked?
Thanks.
You are using Box2D v2.2 or newer. The b2World constructor no longer takes two arguments, just one (gravity). You have to set doSleep separately:
world = new b2World(gravity);
world->SetAllowSleeping(doSleep);
This won't be the only change you'll need to make to transition from Box2D v2.1.x to v2.2.x. Kobold2D has a working Box2D 2.2.1 sample project, even if you don't use Kobold2D you can get updated source code for Box2D basics. In particular the GLESDebugDraw class and how to setup a screen bounding box with a body using multiple shapes.