I´m programming in C# and I have a Surface with a texture and I want to clone the texture inside a closed curve that intersecting with the surface in a new View. I´ve been thinking in diffents options and I´ve trying to do it creating a new page view and create a duplicate of the object in this new page view. I do not know if it is the best option but would appreciate advice if you know a better
For this, I have a List of Curve, I draw a Curve over the surface and I clone the surface in the new PageView, I know how to do it,
Moreover, I want to move the Curve over the surface and To clone the texture when I finish my movement of the curve. I´ve solved this with a button, First I move the Curve and after I push a button and clone it.
My problem is that I want to capture an Event when I finish the movement and To clone automatically without push a button.
I´ve tried with protected override void OnMouseUp(MouseCallbackEventArgs e)
, but when I move the curve, the curve is selected and I ´ve read that event OnMouseUp is disabled when an object is selected.
My second option is to capture the movement, I´ve used AddRhinoObjec and I can capture it when I finish the movement but when I try to draw in the new PageView(mascara) to clone the new texture it always draw in the main Pageview, I change activeview with RhinoDoc.ActiveDoc.Views.ActiveView = vistaMascara
before RhinoDoc,Activedoc.Objects.Add(), but it always add in the main View.
If I move the Curve and after I push a button, in this button I change the ActiveView it draw in the MascaraView, but If I tried to do the same in the AddRhinoObject Event, it always draw it in the main view. this is my problem.
Here my code:
To create a new View.
var pageview = RhinoDoc.ActiveDoc.Views.AddPageView(Constantes.NOMBRE_NUEVA_VISTA_MASCARA_FIGURAS);
if (pageview != null)
{
pageview.PageWidth = 4000;
pageview.PageHeight = 5000;
pageview.SetPageAsActive();
pageview.Floating = true;
pageview.ActiveViewport.ZoomExtents();
RhinoDoc.ActiveDoc.Views.ActiveView = pageview;
RhinoDoc.ActiveDoc.Views.Redraw();
}
Event when capture the movement
RhinoPageView vistaMascara = GetViewMascara();
vistaMascara.SetPageAsActive();
RhinoDoc.ActiveDoc.Views.ActiveView = vistaMascara;
RhinoDoc.ActiveDoc.Views.Redraw();
Guid guidTexture = RhinoDoc.ActiveDoc.Objects.AddBrep(brep, atributs);