Example #1
0
        //--------------------------------------------------------------------------------------------------

        public override void Remove()
        {
            if (_AisPoint != null)
            {
                AisContext.Erase(_AisPoint, false);
                _AisPoint = null;
            }
        }
Example #2
0
        //--------------------------------------------------------------------------------------------------

        bool _EnsureAisObject()
        {
            if (_AisPoint != null)
            {
                return(true);
            }

            if (_P == null)
            {
                return(false);
            }

            Prs3d_PointAspect pointAspect;

            _AisPoint = new AIS_PointEx(_P);

            switch (_Styles & Styles.ModeMask)
            {
            case Styles.Bitmap:
                _AisPoint.SetMarker(Aspect_TypeOfMarker.Aspect_TOM_USERDEFINED);
                _AisPoint.SetColor(_Color);

                pointAspect = CreateBitmapPointAspect(_Image, Colors.BallMarker);
                _AisPoint.Attributes().SetPointAspect(pointAspect);
                _AisPoint.HilightAttributes().SetPointAspect(pointAspect);
                _AisPoint.HilightAttributes().SetColor(Colors.Highlight);
                _AisPoint.DynamicHilightAttributes().SetPointAspect(pointAspect);
                _AisPoint.DynamicHilightAttributes().SetColor(Colors.Highlight);
                break;

            case Styles.Image:
                _AisPoint.SetMarker(Aspect_TypeOfMarker.Aspect_TOM_USERDEFINED);

                pointAspect = CreateImagePointAspect(_Image);
                _AisPoint.Attributes().SetPointAspect(pointAspect);
                _AisPoint.HilightAttributes().SetPointAspect(pointAspect);
                _AisPoint.HilightAttributes().SetColor(Colors.Highlight);
                _AisPoint.DynamicHilightAttributes().SetPointAspect(pointAspect);
                _AisPoint.DynamicHilightAttributes().SetColor(Colors.Highlight);

                if (_Styles.HasFlag(Styles.Background))
                {
                    _AisPoint.EnableBackground(0.75);
                }
                break;
            }

            if (_Styles.HasFlag(Styles.Topmost))
            {
                _AisPoint.SetZLayer(-4); // TopOSD
                _AisPoint.HilightAttributes().SetZLayer(-4);
                _AisPoint.DynamicHilightAttributes().SetZLayer(-4);
            }

            AisContext.Display(_AisPoint, 0, _Styles.HasFlag(Styles.Selectable) ? 0 : -1, false);
            AisContext.SetSelectionSensitivity(_AisPoint, 0, Math.Min(_Image.Height, _Image.Width));

            _UpdateActivation();

            return(true);
        }