private void ApplyColor(NodeBuilder builder, AISInteractiveObject aisShape)
        {
            var parent           = builder.Node;
            var col              = Color.DarkTurquoise;
            var colorInterpreter = parent.Get <DrawingAttributesInterpreter>();

            if (colorInterpreter.HasColorSet)
            {
                col = colorInterpreter.Color;
            }
            var color = ShapeUtils.GetOccColor(col);

            _context.SetColor(aisShape, color, false);
        }
示例#2
0
        private static void UpdateInteractiveColor(AISInteractiveContext context, Node parent,
                                                   AISInteractiveObject interactive, bool setWireAspect)
        {
            var col = Color.DarkTurquoise;
            var colorInterpreter = parent.Get <DrawingAttributesInterpreter>();

            if (colorInterpreter.HasNoColor)
            {
                context.Display(interactive, false);
                return;
            }
            if (colorInterpreter.HasColorSet)
            {
                col = colorInterpreter.Color;
            }
            var color = ShapeUtils.GetOccColor(col);

            var layerContainer = parent.Root.Get <LayerContainerInterpreter>();

            if (layerContainer.UseLayerColors)
            {
                var layerIndex = parent.Get <LayerVisibilityInterpreter>().TagIndex;
                color = ShapeUtils.GetOccColor(layerContainer.LayerColors[layerIndex]);
            }

            context.SetColor(interactive, color, false);
            var drawer = interactive.Attributes;

            if (setWireAspect)
            {
                var wireAspect = drawer.WireAspect;
                wireAspect.SetColor(color.Name());
                wireAspect.Width  = (1.5);
                drawer.LineAspect = (new Prs3dLineAspect(QuantityNameOfColor.Quantity_NOC_GRAY70,
                                                         AspectTypeOfLine.Aspect_TOL_DOT, 0.5));
                var pointAspect = drawer.PointAspect;
                pointAspect.SetColor(color.Name());
                pointAspect.Scale = (1);
                context.SetDisplayMode(interactive, (int)colorInterpreter.DisplayMode, false);
            }
            if (colorInterpreter.EnableSelection == false)
            {
                interactive.UnsetSelectionMode();
                interactive.HilightMode = (3);
            }
            context.Display(interactive, false);
        }