Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Freeform nodes location and outline (Read 3281 times)
Sabrina C.
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 35
Joined: Dec 20th, 2012
Freeform nodes location and outline
Mar 14th, 2016 at 7:56am
Print Post  
Hi,

we've tried the new functionality of free form nodes in the last 3.4 version (non beta).

Currently we experience two issues:
- stroke and stroke thickness in the free form nodes seem to be ignored and when specified remain unchanged
- when we create a new FreeFormNode by specifying the Points with the StylusPointCollection, the node is not created with the absolute coordinates specified in the collection, but relative ones (*) by placing the node at (0,0).


(*) For example if we create a square (or any irregular polygon) by passing (100,100), (100,200), (200,100), (200,200), the rectangle is created at (0,0), (0,100), (100,0), (100,100). In our application with the free form node we're trying to draw a convex hull and this is particularly annoying because we have to do a second pass by calculating the bounding box of all the points and apply the Bounds property.

One request is that it would be very useful (from the convex hull purposes) to include a bezier curve option to be set for the the freeformnode, so that the outline of the resulting shape will appear continuous.

Sabrina


  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: Freeform nodes location and outline
Reply #1 - Mar 14th, 2016 at 10:04am
Print Post  
Hi Sabrina,

Quote:
- when we create a new FreeFormNode by specifying the Points with the StylusPointCollection, the node is not created with the absolute coordinates specified in the collection, but relative ones (*) by placing the node at (0,0).


Call UpdateFromPoints after modifying Points from code to fix that -

Code
Select All
var freeForm = new FreeFormNode();
freeForm.Points = new StylusPointCollection
{
	new StylusPoint(100, 100),
	new StylusPoint(100, 200),
	new StylusPoint(200, 100),
	new StylusPoint(200, 200)
};
freeForm.UpdateFromPoints();
diagram.Nodes.Add(freeForm); 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: Freeform nodes location and outline
Reply #2 - Mar 14th, 2016 at 2:34pm
Print Post  
Hi Sabrina,

Here's a new build of the assemblies that will honor StrokeThickness and Stroke, as long as the latter is a SolidColorBrush -

https://mindfusion.eu/_temp/freeform_stroke.zip

The thing is, currently we use System.Windows.Ink.Stroke to draw free-form nodes as it works much faster than rendering a Shapes.Path according to our tests. It supports only Color and Thickness customization though; if you need to used dashed strokes and other types of brushes, we could implement them by falling back to drawing a path when they are set, at the cost of a performance hit you might see with many points in the node.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Sabrina C.
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 35
Joined: Dec 20th, 2012
Re: Freeform nodes location and outline
Reply #3 - Mar 19th, 2016 at 7:38am
Print Post  
Slavcho wrote on Mar 14th, 2016 at 10:04am:
Hi Sabrina,

Quote:
- when we create a new FreeFormNode by specifying the Points with the StylusPointCollection, the node is not created with the absolute coordinates specified in the collection, but relative ones (*) by placing the node at (0,0).


Call UpdateFromPoints after modifying Points from code to fix that -

Code
Select All
var freeForm = new FreeFormNode();
freeForm.Points = new StylusPointCollection
{
	new StylusPoint(100, 100),
	new StylusPoint(100, 200),
	new StylusPoint(200, 100),
	new StylusPoint(200, 200)
};
freeForm.UpdateFromPoints();
diagram.Nodes.Add(freeForm); 



Regards,
Slavcho
Mindfusion


In version 3.4 of the library I'm not able to find the call UpdateFromPoints();


  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: Freeform nodes location and outline
Reply #4 - Mar 19th, 2016 at 8:51am
Print Post  
Check if you haven't mistyped it. I can see FreeFormNode.UpdateFromPoints imported as public method in the help file and was able to call above code from a sample project from v3.4 installation.
  
Back to top
 
IP Logged
 
Sabrina C.
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 35
Joined: Dec 20th, 2012
Re: Freeform nodes location and outline
Reply #5 - Mar 21st, 2016 at 4:11pm
Print Post  
Nevermind, we found that in one of our machines we had the beta version of Freeformnodes which was missing that call.

Thanks
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint