Profile Picture

Custom Class inherits NCreatePolygonTool

Posted By Tezcan Cirakoglu 13 Years Ago
Author
Message
Tezcan Cirakoglu
Posted 13 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 2, Visits: 1
Hi everyone,

We are in the middle of R&D period of a project and searching for 2D graphical components and evaluating Nevron Diagram for this purpose. Wee need to interactively draw a kind of room with 4 or more walls like Floor Plan sample. But this has to be done interactively by a custom tool. We tried to override NCreatePolygonTool but could not. Below is the skeleton of the overrides but we need to know the underlying execution and semantic.

Could you please give us a clue to draw 2 polygons interactively at the same time with this tool, which one of the polygons will cover the other? I mean the base NCreatePolygonTool creates a regular polygon, but wee need an inner polygon whicl will mimic as the inside part of a room.

It was hard to tell but i hope it is clear :-)

Best regards

public WallCreateTool(): base()
{
base.Name = "WallCreateTool";
}

protected override void AddNewPoint()
{
base.AddNewPoint();
}

protected override INDiagramElement CreateElement(bool preview)
{
//NDiagramElementFactory factory = View.ElementFactory;
//var inner = factory.CreatePolygon(preview);
//var outer = factory.CreatePolygon(preview);
//return inner;

return base.CreateElement(preview);
}

public override bool ProcessClick(EventArgs e)
{
return base.ProcessClick(e);
}

public override bool ProcessMouseMove(System.Windows.Forms.MouseEventArgs e)
{
return base.ProcessMouseMove(e);
}

public override bool ProcessMouseDown(System.Windows.Forms.MouseEventArgs e)
{
return base.ProcessMouseDown(e);
}

public override bool ProcessMouseUp(System.Windows.Forms.MouseEventArgs e)
{
return base.ProcessMouseUp(e);
}

protected override bool RedefineElement(INDiagramElement element, System.Collections.ArrayList points)
{
return base.RedefineElement(element, points);
}

public override void UpdateReferences(Nevron.INReferenceProvider provider)
{
base.UpdateReferences(provider);
}



Nevron Support
Posted 13 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009
Hi Tezcan,

Can you please elaborate a little. Can't you simply draw a polygon that represents the room walls. Why do you need two polygons?

Best Regards,
Nevron Support Team



Tezcan Cirakoglu
Posted 13 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 2, Visits: 1
Hi again,

Please see the attached image. As seen there, we need to draw a floor plan with some walls wihich will have thickness. And we should be able to draw this image interactively with mouse as we are drawing a simple polygon. So this type will be a custom NShape (or NPolyGon) to be drawn with a custom tool Whicl will inherit NCreatePolygonTool (or another tool)

By drag & drop, we are able to place a custom shape from our custom library but it is not requested. We have to let the end user to draw a plan as his or her needs. (How many walls, how many vertices etc.)

Further more, we would like to have the ability to change the thickness of each wall, so the shape placed into the document needs to be a custom shape that we may override its size - move - etc events.

I beileve, nevron diagramming engine is capable of covering our needs because, the object class hierarchy and extensibility is perfect.

Thanks again for further help.

Best regards

Attachments
sample.png (100 views, 113.00 KB)
Nevron Support
Posted 13 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

Hi Tezcan,

Unfortunately the complexity of the feature you request is much more greater than it looks at first glance. Just think of some of the following scenarios:

- What if the wall at some sides of the polygon is thicker than the available space?

- What if the user draws a polygon with self intersecting edges?, How should the internal polygon be drawn then?, etc.

Nevron Diagram is very extensible and we're sure you'll be able to create the custom tool you need, once you figure out all these special cases and complications of the algorithm.



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic