예제 #1
0
        //--------------------------------------------------------------------------------------------------

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

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

            if (_Circle.Radius() <= 0)
            {
                return(false);
            }

            _AisCircle = new AIS_Circle(_Circle);

            SetAspects(_AisCircle, _Style);

            AisContext.Display(_AisCircle, false);
            AisContext.Deactivate(_AisCircle);
            return(true);
        }
예제 #2
0
        //--------------------------------------------------------------------------------------------------

        void _UpdateInteractivityStatus()
        {
            if (_AisShape == null)
            {
                return;
            }

            if (_Options.HasFlag(Options.Ghosting))
            {
                AisContext.Display(_AisShape, false);
                AisContext.Deactivate(_AisShape);
                return;
            }

            var layer = _ShapeSource?.GetLayer();

            if (layer == null)
            {
                return;
            }

            bool isVisible = !_IsHidden && layer.IsVisible;

            if (WorkspaceController.VisualShapes.EntityIsolationEnabled)
            {
                isVisible &= WorkspaceController.VisualShapes.GetIsolatedEntities().Contains(_ShapeSource);
            }

            if (isVisible)
            {
                if (AisContext.IsDisplayed(_AisShape))
                {
                    AisContext.Update(_AisShape, false);
                }
                else
                {
                    AisContext.Display(_AisShape, false);
                }

                _UpdateSelectionSensitivity();
            }
            else
            {
                if (AisContext.IsDisplayed(_AisShape))
                {
                    AisContext.Erase(_AisShape, false);
                }
            }

            _RaiseAisObjectChanged();
        }
예제 #3
0
        //--------------------------------------------------------------------------------------------------

        #region Selection

        void _UpdateActivation()
        {
            if (_AisPoint == null)
            {
                return;
            }

            if (_IsSelectable)
            {
                AisContext.Activate(_AisPoint, 0, false);
            }
            else
            {
                AisContext.Deactivate(_AisPoint);
            }
        }
예제 #4
0
        //--------------------------------------------------------------------------------------------------

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

            _AisAxis = new AIS_AxisEx(new Geom_Line(Ax1.OX));
            _AisAxis.SetWidth(3);
            _AisAxis.SetColor(new Quantity_Color(Quantity_NameOfColor.Quantity_NOC_RED));

            var datumAspect = new Prs3d_DatumAspect();

            datumAspect.LineAspect(Prs3d_DatumParts.Prs3d_DP_XArrow).SetTypeOfLine(Aspect_TypeOfLine.Aspect_TOL_SOLID);
            datumAspect.ArrowAspect().SetLength(5);

            SetAspects(_AisAxis, _Style);

            AisContext.Display(_AisAxis, false);
            AisContext.Deactivate(_AisAxis);
            return(true);
        }
예제 #5
0
        //--------------------------------------------------------------------------------------------------

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

            if (((_P1 == null) || (_P2 == null)) &&
                (_GeomLine == null))
            {
                return(false);
            }

            _AisLine = (_GeomLine != null)
                ? new AIS_Line(_GeomLine)
                : new AIS_Line(_P1, _P2);

            SetAspects(_AisLine, _Style);

            AisContext.Display(_AisLine, false);
            AisContext.Deactivate(_AisLine);
            return(true);
        }