Better highlighting functionality.



What I want is more functionality to highlight the selected entity.

I've found "aModel.SelectionColor = Color.aColor" to change the color of the highlighting but I need some more modifiability to offer the visual experience requested. The image shows my first thoughts regarding this, a light version of the selection color around the selected entity, and availability to temporarily change the size. 

Thank you!

Sorry if something similar already exists, was directed to here from a question in the FAQ.

7

Comments

8 comments
  • How does this apply to 3D objects or 3D objects edges?

    0
  • I have not fully thought about that, I'm trying to offer a top view only, i.e. 2D visual experience.

    I'd imagine it be pretty similar though, maybe the temporary size increase is superfluous in 3D and simple glow effect would be sufficient.

    0
  • Using
     
    yourEntity.LineWeightMethod = colorMethodType.byEntity;
    yourEntity.LineWeight = DesiredValue;

    Works to temporarily change the values back and forth when selecting/deselecting entities to highlight them further than a color change.
    0
  • I have previously implemented something similar to what you are after Adam. What I did was to create another 2 lines, parallel to either side of the original line, offset by the line thickness. These ghost outlines can be whatever colour you want, so you can set their colour with a transparency to give that glow effect.

    1
  • Yes, this ability would be great. I have often wanted to highlight ICurves with a 'glow'

    Damian, you have a good idea to offset the line in 2d normal to the screen projection. Along this idea, it maybe possible to offset the vertices of the ICurve as to allow any ICurve to be highlighted without worry of tessellation issues

    Maybe implementing a "Glow" entity that references any ICurve is a neat way to do this.

    0
  • Alberto & devDept team, I first tried this:
    model1.ActionMode = devDept.Eyeshot.actionType.SelectVisibleByPickDynamic;
    model1.SelectionColorDynamic = Color.FromArgb(120, Color.Red);

    But I get an exception "SelectionColorDynamic" must be opaque. Might it be possible to add this glow ability? I have developed it myself, but would be a nice addition built directly into Eyeshot.

    Here is how I found that we can implement the glow effect by using overlays:

        class MyModel : Model
    {
    protected override void OnMouseMove(MouseEventArgs e)
    {
    base.OnMouseMove(e);

    IndexsUnder = GetAllEntitiesUnderMouseCursor(e.Location);
    Invalidate();
    }
    int[] IndexsUnder;
    protected override void DrawOverlay(DrawSceneParams data)
    {
    if (IndexsUnder != null)
    {
    foreach (int i in IndexsUnder)
    {
    ICurve c = Entities[i] as ICurve;
    if(c != null)
    DrawScreenCurve(c, (c as Entity).LineWeight * SelectionLineWeightScaleFactor);
    }
    }
    base.DrawOverlay(data);
    }
    public void DrawScreenCurve(ICurve curve, float linesize)
    {
    Entity e = curve as Entity;
    if (e.Vertices != null)
    DrawOverLayLineStrip(e.Vertices, linesize);
    }
    public void DrawOverLayLineStrip(Point3D[] pts, float linesize)
    {
    Point3D[] screenpts = new Point3D[pts.Length];
    for (int ii = 0; ii < pts.Length; ii++)
    screenpts[ii] = WorldToScreen(pts[ii]);

    renderContext.EnableXOR(false);
    renderContext.SetState(devDept.Graphics.depthStencilStateType.DepthTestOff);

    renderContext.SetLineSize(linesize); // This needs to be about 2x the width of the line we're highlight glowing
    renderContext.SetState(blendStateType.Blend);
    renderContext.SetState(rasterizerStateType.CCW_PolygonFill_NoCullFace_NoPolygonOffset);
    renderContext.SetColorWireframe(Color.FromArgb(120, System.Drawing.Color.Red), true);
    renderContext.DrawLineStrip(screenpts);

    renderContext.SetLineSize(1);
    }
    }

    1
  • I understand the concern about how this is supposed to work for 3D entitites and I don't need outer glow, but I agree that it would be great if the selecting feature would be more flexible in terms of the visual. 

    In my case, the fact that the selection color must be opague is a problem: The selectable entities are tomography images that contain important information. When they are selected, they are overwritten by a solid color (light blue in my case): At the same time, selection is required, because the user can perform actions on the selected tomography. 

    I know that there are ways to bypass this, but it would be great if this would be possible with the standard API:

    • Use a transparent color as the SelectionColor or
    • Instead of painting the selected item in a color, it would be possible to outline/border the selected item
    0
  • Is there any news or updates about that?
    Found this post when searching for exactly that. I have an application that i need to show the texture of an item while it's selected, but due to that opaque color selection, I couldn't do it.

    0

Please sign in to leave a comment.

Didn't find what you were looking for?

New post