Flex :: Determine If A Series Of Points (or Polygon) Is Within A Rectangular Region?

May 20, 2011

I have been looking at posts about determining if a point lies within a polygon or not and the answers are either too vague, abstract, or complex for me. So I am going to try to ask my question specific to what I need to do.I have a set of points that describe a non-straight line (sometimes a closed polygon). I have a rectangular "view" region. I need to determine as efficiently as possible whether any of the line segments (or polygon borders) pass through the view region.

I can't simply test each point to see if it lies within the view region. It is possible for a segment to pass through the region without any point actually inside the region (ie the line is drawn across the region).Here is an example of what I want to determine (red means the function should return true for the set of points, blue means it should return false, example uses straight lines and rectangles because I am not an artist).

Another condition I want to be able to account for (though the method/function may be a separate one), is to determine not just whether a polygon's border passes through the rectangular region, but whether the region is entirely encompassed by the polygon. The nuance here is that in the situation first described above, if I am only concerned with drawing borders, the method should return false. But in the situation described here, if I need to fill the polygon region then I need the function to return true. I currently do not need to worry about testing "donut" shaped polygons

Here is an example illustrating the nuance (the red rectangle does not have a single vertex or border segment passing through the on-screen region, but it should still be considered on-screen):For the "does any line segment or polygon border pass through or lie on screen?" problem I know I can come up with a solution (albeit perhaps not an efficient one). Even though it is more verbose, the conditions are clear to me. But the second "is polygon region on screen?"PS I have a function for determining line intersection, but it seems like overkill to use it to compare each segment to each side of the on-screen region because the on-screen region is ALWAYS a plain [0, 0, width, height] rectangle.

View 2 Replies


Similar Posts:


Flex :: Calculating The Area Of A Polygon When The Polygon's Points Are Lat Longs: Which Function Is More Accurate?

Jul 28, 2010

I'm trying to find a way to calculate the area of a polygon using lat long coordinates in a Flex 3 site. Hong007 on Google Maps for Flash group was cool enough to post the following function:

[Code]...

I was also playing around with the area calculator at [URL]. These functions produce slightly different results. I'm trying to figure out which one is more accurate. It seems that hong007's function produces results that are on average slightly larger than freemaptools' function. However, I don't know which one is more accurate.

View 2 Replies

ActionScript 3.0 :: Specify Rectangular Region Zoom Into Video

Jul 3, 2009

If it's possible to zoom into a video? For example specify a rectangular region in the video and zoom in.

View 1 Replies

Professional :: Getting Points Position From A Polygon?

Jul 1, 2011

if there is a way to get by Actionscript the position of points in a polygon made using Pen Tool?

View 3 Replies

ActionScript 3.0 :: Get The Polygon Boundary Points Of A Sprite Or Movie Clip?

Feb 5, 2009

I'm working on a pathfinding algorithim using A* and using irregular polygon shapes as obstacles rather than a grid. I don't fancy plugging in all the points and links by hand and was wondering if there was some way I could just get them from a Sprite or MovieClip?

View 1 Replies

Flash :: Determine The Center Of A Circle Using Multiple Points?

Feb 10, 2011

I can do it on pen and paper using a compass, but can't do it in Actionscript 3.As the title says, essentially I need to find the centre of a circle using multiple points from the radius.

View 1 Replies

Flex :: Develop A Softare For 3D Object Compression (by Polygon Reduction) In Flex Using Papervision 3D

Jun 11, 2010

I wish to develop a softare for 3D object compression (by polygon reduction) in flex using papervision 3D. Could you please suggest me an efficient algorithm for the same?

View 1 Replies

Flex :: 3D Object Compression (By Polygon Reduction)

Jun 11, 2010

I wish to develop a software for 3D object compression (by polygon reduction) in flex using papervision 3D.

View 1 Replies

Flex :: Crop Image Using A Non-rectangular Shape?

Oct 30, 2009

I've been following this tutorial to crop images in flex: [URL]

At the heart of its cropping is using a method called "copyPixels". However, this method takes as one of its arguments a rectangular shape for its crop region. Are there other strategies I can use to crop it not using a rectangle.

I am going after letting the user specify the region that should be cropped using a series of points.

View 1 Replies

Flex :: How To Exclude Series In Legend

Mar 22, 2010

In flex charting, I want to draw something like "reference lines" which are related to specific series, therefore these lines are not independent series and should not be shown in legend. Is it possible to exclude some series from chart legend?

View 3 Replies

Flex :: Set DataTipRenderer On A Series-basis For Charts?

Mar 3, 2011

I have a Flex LineChart which contains three series:

two LineSeries
one ColumnSet

Has anyone seen or heard of a way to set the dataTipRenderer on a per-series basis? You can only override it for the entire chart and I would prefer to not have to overlay multiple charts just to achieve this effect.

View 1 Replies

Flex :: Set Background Color Of Line Series Chart?

Nov 22, 2009

I have a Line Series Chart in Flex with values from 0 to 90. I would like to set the background of the chart in such a way that, 0 - 30 is in green, 31 - 60 is in red and 61 - 90 is in blue.

View 2 Replies

Flex :: Is There An Event Dispatched When A Series Is Added To A Chart

Mar 22, 2010

I want to know when the data has been added to a chart so I can use localToData() to draw on the chart. If I do this immediately after setting the dataProvider the chart has not yet updated, so the the call to localToData will not return the correct values. Is there an event I can subscribe to so I know the chart has drawn the data in the dataProvider?

View 2 Replies

Flex :: Adding One Point To Line Series Without Everything Getting Redrawn

Apr 19, 2011

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.

View 2 Replies

Flex :: Charts - Positioning Plot Series Item?

Sep 5, 2011

I have a chart with multiple series (Area and Plot). The Area series has 'xField' as 'timeStamp' and 'yField' as 'price'. The Plot Series has 'xField' as 'timeStamp' and no 'yField'.... ! Can I position the plot series though I do not have a corresponding 'yField' value ? Can I assign a default value to the 'yField' (say '10' for all...?)

[Code]...

View 1 Replies

Flex :: Dynamically Add Column Series Adobe Flash

Dec 12, 2011

I have a column chart that I made using Adobe Flash Builder.

I'd like to be able to dynamically add (or remove) column series.

View 2 Replies

Flex :: Charting Only Display Datatip For Specific Series?

May 19, 2009

I have a LineChart that contains multiple series, both LineSeries and PlotSeries, and I have a custom dataTipFunction set for the chart. However, I only want data tips displayed for line series, not the plot series. I have tried returning null from my format function, but that just displays an empty box. I have also tried disable mouse events on the plot series (by setting both mouseEnabled and mouseFocusEnabled to false), to no avail. Is this even possible?

View 1 Replies

Actionscript :: Flex - Set Individual Colors To Each Series Using Per Item Fills

Nov 3, 2009

I am creating a chart using mxml. The mxml tags only create a chart with a horizontal axis and vertical axis. My result event handler has actionscript code that loops through the xml result set and creates all the series (line series and stacked bar). This part of the code works fine. Now I need to use the functionfill function to set individual colors to each series. All the examples I have found call the functionfill from within an MXML tag, like so:

[Code]...

View 1 Replies

Flex :: Use A Custom Text Component To Show A Series Of Comments?

Apr 1, 2010

I'm trying to use a custom Text component to show a series of comments. I got the original idea from:

[URL]

I've got the base case working but I am stuck with 2 problems I cant seem to figure out:

Since I am drawing around the text, the actual height of each bubble is greater than that of the Text field, as a result, the last bubble is always chopped off. I have tried explicitly overriding the height getter, and adding some padding, but I cant seem to get it right. You can see an example here: [URL] In my layout, I have 2 VBoxes (one nested inside the other). The first vbox shows a form where the user can enter a comment, and the second box has all the comments. In order to ensure that the scrollbars only show up on the second box, I set minHeight="0" on the nested VBox, but then for some reason, some comments' text is shifted to the right. You can see an example here (look at the first comment): [URL]

Rather than posting the code here, I've provided some links:

[URL]

View 1 Replies

Flex :: Show / Hide Datatips On A Chart With A Secondary Series

Feb 13, 2011

I have a line chart with a column chart as a secondary series. When I roll over the line, the datatips appear. However, if I move the mouse to a spot where a column appears while still on the line, the data tip item appears for the line AND the column. How do I get it so that I only show datatips for the line but not the column?

[Code]...

View 2 Replies

Flex :: Multiple Line Series On Single Chart Control

Apr 10, 2011

I want to show the second line series underneath the first one, however with this code they are appearing sequentially. Not sure how to make sure they are overlayed! I followed some code I saw for combining charts.. not sure what to do.

<mx:LineChart showDataTips="true" x="10" y="77" id="GlucoseChart" width="1009" height="219">
<mx:horizontalAxis>
<mx:DateTimeAxis dataUnits="hours" parseFunction="parseDateString" displayLocalTime="true" />
</mx:horizontalAxis>
<mx:series>
[Code] .....

View 2 Replies

Flash :: Open Source Flex Time-series Charts

Jun 16, 2011

Can anyone suggest an open-sourced time-series chart created using flex??(With functionalities like the one on google/yahoo finance??)Googling gives a lot of unnecessary data,

View 1 Replies

Flex :: Charts - Color Fill In Column Series In Conditional

Jul 8, 2011

I want to create a daily build chart with 1 column as 1 build, 1 build will have 3 series for eg feature 1, feature 2, feature 3. Now i need to fill the color of the series dynamically based on the feature is pass or fail. for eg if in a particular build feature 1: Pass, feature 2: Fail, feature 3:Fail then the color sequence of the column will be green, red, red. how to implement this logic and where? (if in fillfunction)

View 1 Replies

Bug/Error In The Adobe Flex SDK 4.5 When Removing Series From Cartesian Charts?

Mar 2, 2012

I have a problem with the cartesian charts in the Adobe Flex SDK 4.5 and 4.5.1. Perhaps it's a bug, because it's not in the SDK 4.0, 4.1 and 4.6. Or it's just a problem of my code.

I made a little example project to range over series data in a CartesianChart (Line/Area/Column/Bar), a little bit like the google finance chart. When I add all series to the chart, the problem didn't occur. Only when I have multiple series and remove one or more series and than range over the data, the series data get compressed:

Chart image It seems like the horizontal axis didn't change or didn't get an update that the chart data changed, when I range over the current data.

[Code]...

Had someone the same problem or has an idea how to remove a series in another way?

View 1 Replies

Actionscript 3 :: Flex : Dynamically Created Series Doesn't Show On The Chart?

Oct 13, 2011

I have the follow class :

package my.controls.charts.series
{
import mx.charts.series.LineSeries;
import mx.collections.ArrayCollection;

[Code]....

The new series name appear on the chart, but the data doest, and the chart always remains blank.

View 2 Replies

Actionscript :: Flex: Feed Multiple Series Of Different Array Lengths Into LineChart?

Jan 19, 2012

I'm new to Flex. I've been graphing multiple series in a line chart where all of these series are the same length. Now I need to plot new data and each series has a different length from each other. The question is how to modify the following code to do this.

The initApp() function is called at the start of the program, and it calls function genData() to generate the dataSet used for plotting in the LineChart.

public function initApp():void {
// Initialize data provider array.
dataSet = new ArrayCollection(genData());

[Code]....

Can someone recommend how to place array1, array2, array3, and array4 into x1, y1, x2, y2 (respectively) when the length of array1 and array2 do not equal that of array3 and array4? Or, equivalent outcome.

I'm assuming everything has to come in through dataSet, but I wonder if it's possible to simply reference array1 (etc.) directly from <mx:LineChart ...> or <mx:LineSeries ...> somehow, to avoid wasting memory on an unnecessary array (e.g. dataSet).

View 1 Replies

Actionscript 3 :: Calculating Evenly Distributed Points On A Line Of Points

Oct 3, 2011

I have been tasked with trying to create a drawing tool that draws dotted lines as you drag the mouse across the stage. I can easily capture the points on MouseEvent.MOUSE_MOVE and store them in a vector and then draw the points as dots:

The problem is that I need to calculate evenly distributed points on an ever growing Vector of points so I can only draw the line between say every 5th point (say using modulus). I have been battling away with Bezier curve equations both Quadratic and Cubic but still can't quite figure out how to convert my Vector of points into an evenly distributed Vector of Points without sucking the life from the CPU.

View 1 Replies

ActionScript 3.0 :: Polygon Drawing App?

Aug 10, 2011

I want to create an app for drawing polygons with a variable number of vertices, with the following requirements (very similar to a vector drawing program such as Adobe Illustrator):

-each click of the mouse on the stage sets a vertice (e.g. draws a small square or circle to mark the spot), which draws a line to (e.g. LineTo) the prior vertice, and so on, until the final click, if close enough to the first vertice, will complete and close the polygon

-each of the vertices of the completed polygon should be draggable with the mouse, so that that completed (or partially completed) polygon maintains its integrity while changing shape, that is, so the user can modify the polygon shape without having to redraw it. it's the second step I'm having the most difficulty with...in general terms, how would I implement this? Perhaps each vertice should be a draggable Sprite containing a small square or circle graphic?

View 8 Replies

ActionScript 3.0 :: Create Polygon From Array?

Jun 30, 2009

I'm trying to figure out how to draw a polygon from an array. I've found a few examples, one which the author says works, but am not getting anything to appear. I've traced the array (it's registering) and am getting no errors.

Code:
//called from constructor
polygon(thisArray);

[code].....

View 1 Replies

ActionScript 3.0 :: Get Pixels Of Bitmap From Polygon?

Mar 20, 2011

I know that I can collect the pixels of a rectangular area within a Bitmap using getPixels(), but is there a way to collect the pixels of a polygonal area with more than 4 points? Or at least determine whether a particular pixel lies within a polygonal area of a Bitmap?

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved