cart: empty [ Login ]

Interactors

1 
sarge
5/2/2017 7:17 PM
Hi, I masted most stuff I wanted to do, but now I'm stucking to unterstand how that mechanism with the WW.Cad.Actions.SelectInteractor.MoveInteractor e.g. should work. I found some refs and (very old) example code where it's used more less. I found an thread about the CadEditControl and some code (from 2013!) but that don't helps me much :/ It's possible to see some current source how the move is cadlib conform? kind regards
Wout
5/3/2017 11:16 AM
Hi, The SelectInteractor takes care of mouse selection. Then if there is a non-empty selection, the SelectInteractor.MoveInteractor can do a selection move interaction. This is started by either a left mouse down event, or activation by calling the Activate() method. If property StartInteractionOnMouseDownAtSelectionRectangle is true (default), the interaction starts if the mouse down event takes place on the selection rectangle. - Wout
sarge
5/3/2017 7:04 PM
Hi, that's not what I mean. I wrote a class which provides some more selections with add,sub,in rect,outer rect, etc. .. that works fine .. now I'm tryin to create a selectinteractor for using in moveinteractor snippted:
C# Code:
var getCollection = _SelectionBuffer.GetSelectedItems(); // this is not empty but the items has no handle don't if it matters or not s. image selint1.png var selCmd = new WW.Cad.Actions.SelectInteractor(_wireframeGraphicsCache, gdiGraphics3D.Config, model, getCollection, new CommandInvoker()); // this looks like a default instance s. image selint0.png
The wireframecache gets created while setting new model:
C# Code:
_wireframeGraphicsCache = new WireframeGraphicsCache(true, true); _wireframeGraphicsCache.Config = gdiGraphics3D.Config; _wireframeGraphicsCache.CreateDrawables(model, Matrix4D.Identity);
Most stuff I'm doing with your libary I don't even know for what I need it nor what it is doing .. the docu don't really helps in most cases (explanation or examples would be helpfully at many points). I think you created a powerfull and great lib .. but its hard become familar with it What I'm tryin to build is a basic cad for editing purposes with really basic functions delete, rotate, scale ... and selections .. look at your CadEditControl it covers most of that what I need for now. I found old code from 2013 and actual project example which calls methods of the CadEditControl (4 years between, a lot has changed). I'm interessed to look what that methods do to get an idea how it works in generel e.g. (iirc) BeginMoveInteraction. A little example how I create successfully a SelectionInteractor from a existing collection and or what I'm doing wrong in my code would help me get familar with it .. kind regards
selint0.png
selint1.png
Wout
5/3/2017 10:19 PM
Hi, Yes, the editing bits are officially not part of CadLib, as it's mostly prototype and it gets pretty complex and would require a disproportionate amount of support. So it's provided as is basically. The SelectInteractor does have a method Select(List<DxfEntity> entities, Matrix4D projectionTransform) where you should be able to pass your own selection, and from that point onwards it should be business as usual. - Wout
1