Create editable shapes in Flex/Flash AS3? - apache-flex

I need to build a room designer, ultimately in Flex (Flash Builder 4). The part I am having trouble with is creating the room outline AND allowing the user to add/remove/move points to edit the room's shape. See this application for what I mean:
http://www.deltaportercable.com/shopdesigner/
I know how to create a normal Rect, but not one with editable points, much less how to add a point where the user clicks. Can anyone please point me in the right direction?

I think the key thing here is to try using POINTS instead RECTANGLES, then draw lines to connect these points to display any arbitrary shape that the user is editing.
Maybe use an array to record the initial positions of all four points, then based on the user input, update these points, and update your line drawing and how you connect them.

Start off by looking at Object Handles, which is a pretty good project for adding the edit points.

Related

Selecting non-contiguous regions in Godot tilemap editor for atlas creation

I'm trying to create an atlas of collideable objects in Godot's tilemap editor. My understanding is that, to select a region of tiles to make part of the atlas, you have to mouse select (I tried clicking a cell and holding Shift but it doesn't select multiple cells). The issue is that I can't seem select a non-square region.
I also tried selecting cells one at a time, adding the collision area, and then picking a new cell, and what I end up seeing is my range of cells shift over to the new area. Do I need to re-create my tilemap source to just have contiguous regions, or is there some Godot functionality I'm missing here? FWIW, I was following this tutorial to get up and running.
The region has to be a rectangle. You may want to break it up into multiple atlases plus a New Single Tile for the one at the top by itself.
Single Tile
Atlas 8x1
Atlas 2x1
Atlas 2x1
When you go to paint, selecting any of the atlases will show you the tiles inside.

Troubles with arangodb graph viewer

In graph viewer, is it possible to not start with a random vertice? When I uncheck the option, the graph simply disappears. But I don't get to choose the starting point anywhere.
And when I set up the configuration it is not saved to the graph view. Is this going to be fixed? I find it kind of a key feature for a graph-database to be able to easily explore the graph.
I am working with arrangodb 2.3.1
Anyway, besides some trouble with the graph viewer, I really enjoy this fancy multi model database! And for me it is a big plus it's made in Germany! Keep on the great work arangodb-team!
As already mentioned in the comments you can select the start vertex later.
Click on the Filter icon (see image)
Two input boxes should appear - Attribute name and Attribute value. Type in _key into the left box (see image)
Type in a known _key of a vertex (or another attribute) into the right box (see image)
Simply hit return and you should see the vertex with the given _key value

Visualizing a hierarchy of rectangles with neo4j?

I am thinking of using neo4j to store a graph database. My data basically consists of a hierarchy of rectangular regions with fixed coordinates: the top node has R rectangles in it, each of those has Q rectangles in it, and so on. The regions do not form a rectangular subdivision. Since I have a lot of data, I would like to be able to present an interface where a user can click on a particular rectangle to see its substructures in more detail, and then be able to click on one of those rectangles to show more detail, and so on. My application would be sort of like Google Maps, where more detailed layers get loaded as a user zooms in. I was thinking of generating tiles to serve to OpenLayers or Leaflet for display, but my data has a graph structure that I would like to take advantage of, and I think using neo4j (possibly in combination with a visualization library like d3.js) may be an easier way to build my tool.
I have these questions about neo4j and the ability to visualize its data:
Can data in neo4j be organized into different layers corresponding to different levels of detail?
Can neo4j display nodes as rectangles with fixed coordinates on a 2D plane? Can these rectangles be selectable / "zoomable"?
I know neo4j has a default web interface for showing nodes but I'd like to know how customizable this is before committing a lot of time to it. The TreeMap example at https://github.com/mbostock/d3/wiki/Gallery sort of looks like what I want, but I'd like to show more detailed structure in regions that users select.

Display opencv frames in a window with button and text control

I'd like to ask you some information about a problem which i want to solve.
At the moment, I have two opencv applications:
application A: where i track an object with two types of algorithms and each time i save a frame in an image file and i control the application behavior with some commands which i write in the shell
application B: where i have a loop which reads every time the image file and display it
So, I launch these two applications together in order to track the object with appA and to display results with appB which reads everytime the frames saved by appA in the hard disk.
I want to integrate application B in application A in order to show a window (like this: http://lnx.mangaitalia.net/window.jpg) in order to have a loop which shows image in the first area and to use buttons in order to give commands which at the moment i write in the shell.
Do you think it's possible to display the frames in an area with Qt or opengl or wxwidgets?
Which solution is the better and the easier to apply?
At the moment, my application B is very simple:
while(1)
{
Mat img=imread("result.jpg",1);
if(!img.empty())
imshow("HOG",img);
if(waitKey(200)==27) break;
}
I want to show these frames in a window which has also some buttons.
In particular, as you can see in the attached image in this post, i want to create a window divided in two parts: the first one which display the frames captured from opencv camera and the second part (or area) which has some buttons (B1, B2, B3..) which the user can press in order to control the application behavior.
(At the moment, i use a switch/case in appA to trap the keyboard keys)
There is some example based on a template similar to what i'd like to do?
(like the jpg image i've told before: http://lnx.mangaitalia.net/window.jpg)
I propose that you just use the inbuilt GUI in OpenCV: highgui. It has keyboard/mouse IO, window control with a message loop, buttons, sliders etc. And there is no need to do any conversions of the cv images to show them.
Have a look at: http://dasl.mem.drexel.edu/~noahKuntz/openCVTut3.html (It is written for old IplImage style CV, but the C++ interface is almost the same, use cv::imshow to draw images)
Also, here is the documentation for the C++ style interface.
There is also the possibility to convert your CV images to QImage in Qt and do it that way... you should be able to find solutions for that on Google.
There are some examples out there for implimenting this.
see http://larryo.org/work/information/wxopencv/index.html
Basically what you want to do is:
capture a frame from your camera
manipulate the image
use cvConvertImage to convert it into a format wxImage can read
draw this image on to a wxCanvas
For the GUI part of this, you would need to create a wxFrame or wxWindow, place some sizers and buttons at appropriate places.
So basically make a frame, put a sizer on the frame, then put a panel in the sizer.
next make a vertical sizer on the panel. First add a wxCanvas to the vertical sizer, then place a horizontal sizer in the vertical sizer. Now add 3 buttons to the horizontal sizer, and you have your panel.

Adding one point to a flex line series without everything getting redrawn

I have an air app that collects live data from a user's action and graphs it. It records data every second and charts it on three different line series from the same array collection.
This works out great at first, but it gets worse and worse as time goes by. When it gets close to an hour it's almost unusable.
I'd like to be able to add a point to the graph and have flex JUST draw the new point and not invalidate the whole series and redraw it. Is this possible? I'm willing to override something to make this work.
My last ditch effort is to take the average of 5 or 10 points and only adding those. This will still work poorly when the user is going for 3 hours or so, but I can't think of a better way.
First, I wouldn't use ArrayCollection, but ArrayList since it's faster than ArrayCollection. Even better would to use VectorCollection.
Second, the Flex charts are made to be easy to use, but not very good at going 'outside the specs'. What you'll need to do is override the core functionality of the chart altogether for this to work, however that is a fairly daunting task because of the sheer amount of code involved in charts.
I would recommend you either create your own very quick and dirty component that draws the lines (it's fairly easy, I've done it myself) or use another charting library out there like Flare.
I added a UIComponent that overlaid the whole graph. I then used a cartesiandatacanvas to convert the current data point to x/y coordinates on the screen and did a lineTo to draw from the last point.
This lets me keep drawing the graph without a total reload of the data.
Each point is inserted into a sqlite db. If the chart is resized I clear the uiComponent.graphics and query the sqlite db and bind the data to it. If the user plays the chart from there I leave the currently drawn lines on the chart and continue using the above method.

Resources