コード例 #1
0
        //--------------------------------------------------------------------------------------------------

        void _UpdatePresentationForGhost()
        {
            _AisShape.SetDisplayMode((int)AIS_DisplayMode.AIS_Shaded);
            var ghostDrawer = new Prs3d_Drawer();

            ghostDrawer.Link(_AisShape.Attributes());

            var shadingAspect = new Prs3d_ShadingAspect();

            shadingAspect.SetColor(Colors.Ghost);
            shadingAspect.SetTransparency(0.5);
            ghostDrawer.SetShadingAspect(shadingAspect);

            var lineAspect = new Prs3d_LineAspect(Colors.Ghost, Aspect_TypeOfLine.Aspect_TOL_SOLID, 2.0);

            ghostDrawer.SetLineAspect(lineAspect);
            ghostDrawer.SetSeenLineAspect(lineAspect);
            ghostDrawer.SetWireAspect(lineAspect);
            ghostDrawer.SetFaceBoundaryAspect(lineAspect);
            ghostDrawer.SetFreeBoundaryAspect(lineAspect);
            ghostDrawer.SetUnFreeBoundaryAspect(lineAspect);
            ghostDrawer.SetPointAspect(new Prs3d_PointAspect(Aspect_TypeOfMarker.Aspect_TOM_O_POINT, Colors.Ghost, 2.0));
            ghostDrawer.SetFaceBoundaryDraw(true);

            _AisShape.SetAttributes(ghostDrawer);
        }
コード例 #2
0
        //--------------------------------------------------------------------------------------------------

        public override void OnPointsChanged(Dictionary <int, Pnt2d> points, Dictionary <int, SketchSegment> segments, Dictionary <int, int> markerCounts = default)
        {
            var ctx  = SketchEditorTool.WorkspaceController.Workspace.AisContext;
            var edge = Segment.MakeEdge(points);

            if (edge == null)
            {
                Remove();
                return;
            }

            if (AisObject != null)
            {
                var aisShape = AisObject as AIS_Shape;
                aisShape.Set(edge.Located(new TopLoc_Location(Transform)));
                if (_IsActive)
                {
                    ctx.Redisplay(aisShape, false);
                }
                else
                {
                    ctx.RecomputePrsOnly(aisShape, false);
                }
            }
            else
            {
                var aisShape = new AIS_Shape(edge.Located(new TopLoc_Location(Transform)));
                aisShape.SetZLayer(-3); // TOP
                aisShape.SetWidth(2.0);

                if (_HighlightDrawer == null)
                {
                    _HighlightDrawer = new Prs3d_Drawer();
                    _HighlightDrawer.SetColor(Colors.Highlight);
                    _HighlightDrawer.SetDisplayMode(0);
                    _HighlightDrawer.SetZLayer(-3); // TOP
                }
                aisShape.SetDynamicHilightAttributes(_HighlightDrawer);

                var paramSet = InteractiveContext.Current.Parameters.Get <SketchEditorParameterSet>();
                aisShape.SetAngleAndDeviation(paramSet.DeviationAngle.ToRad());
                aisShape.SetColor(Colors.SketchEditorSegments);

                ctx.Display(aisShape, false);
                ctx.SetSelectionSensitivity(aisShape, 0, (int)(paramSet.SegmentSelectionSensitivity * 1.0));
                if (_IsActive)
                {
                    ctx.Activate(aisShape, 0, false);
                }
                else
                {
                    ctx.Deactivate(aisShape);
                }

                AisObject = aisShape;
                UpdateVisual();
            }

            UpdateHints(points);
        }
コード例 #3
0
 public StdSelect_Shape(TopoDS_Shape theShape, Prs3d_Drawer theDrawer)
     : base()
 {
     throw new NotImplementedException();
 }
コード例 #4
0
        //--------------------------------------------------------------------------------------------------

        void _InitVisualSettings()
        {
            var aisContext = Workspace.AisContext;

            _UpdateParameter();

            // Higlight Selected
            var selectionDrawer = new Prs3d_Drawer();

            selectionDrawer.SetColor(Colors.Selection);
            selectionDrawer.SetDisplayMode(0);
            selectionDrawer.SetZLayer(0); // Graphic3d_ZLayerId_Default
            selectionDrawer.SetTypeOfDeflection(Aspect_TypeOfDeflection.Aspect_TOD_RELATIVE);
            selectionDrawer.SetDeviationAngle(aisContext.DeviationAngle());
            selectionDrawer.SetDeviationCoefficient(aisContext.DeviationCoefficient());
            aisContext.SetSelectionStyle(selectionDrawer);
            aisContext.SetHighlightStyle(Prs3d_TypeOfHighlight.Prs3d_TypeOfHighlight_Selected, selectionDrawer);
            aisContext.SetHighlightStyle(Prs3d_TypeOfHighlight.Prs3d_TypeOfHighlight_LocalSelected, selectionDrawer);
            aisContext.SetHighlightStyle(Prs3d_TypeOfHighlight.Prs3d_TypeOfHighlight_SubIntensity, selectionDrawer);

            // Higlight Dynamic
            var hilightDrawer = new Prs3d_Drawer();

            hilightDrawer.SetColor(Colors.Highlight);
            hilightDrawer.SetDisplayMode(0);
            hilightDrawer.SetZLayer(-2); // Graphic3d_ZLayerId_Top
            hilightDrawer.SetTypeOfDeflection(Aspect_TypeOfDeflection.Aspect_TOD_RELATIVE);
            hilightDrawer.SetDeviationAngle(aisContext.DeviationAngle());
            hilightDrawer.SetDeviationCoefficient(aisContext.DeviationCoefficient());
            aisContext.SetHighlightStyle(Prs3d_TypeOfHighlight.Prs3d_TypeOfHighlight_Dynamic, hilightDrawer);

            // Higlight Local
            var hilightLocalDrawer = new Prs3d_Drawer();

            hilightLocalDrawer.SetColor(Colors.Highlight);
            hilightLocalDrawer.SetDisplayMode(1);
            hilightLocalDrawer.SetZLayer(-2); // Graphic3d_ZLayerId_Top
            hilightLocalDrawer.SetTypeOfDeflection(Aspect_TypeOfDeflection.Aspect_TOD_RELATIVE);
            hilightLocalDrawer.SetDeviationAngle(aisContext.DeviationAngle());
            hilightLocalDrawer.SetDeviationCoefficient(aisContext.DeviationCoefficient());

            var shadingAspect = new Prs3d_ShadingAspect();

            shadingAspect.SetColor(Colors.Highlight);
            shadingAspect.SetTransparency(0);

            var aspectFill = new Graphic3d_AspectFillArea3d(shadingAspect.Aspect());

            aspectFill.SetPolygonOffsets((int)Aspect_PolygonOffsetMode.Aspect_POM_Fill, 0.99f, 0.0f);
            shadingAspect.SetAspect(aspectFill);
            hilightLocalDrawer.SetShadingAspect(shadingAspect);

            var lineAspect = new Prs3d_LineAspect(Colors.Highlight, Aspect_TypeOfLine.Aspect_TOL_SOLID, 3.0);

            hilightLocalDrawer.SetLineAspect(lineAspect);
            hilightLocalDrawer.SetSeenLineAspect(lineAspect);
            hilightLocalDrawer.SetWireAspect(lineAspect);
            hilightLocalDrawer.SetFaceBoundaryAspect(lineAspect);
            hilightLocalDrawer.SetFreeBoundaryAspect(lineAspect);
            hilightLocalDrawer.SetUnFreeBoundaryAspect(lineAspect);
            hilightLocalDrawer.SetPointAspect(Marker.CreateBitmapPointAspect(Marker.BallImage, Colors.Highlight));

            aisContext.SetHighlightStyle(Prs3d_TypeOfHighlight.Prs3d_TypeOfHighlight_LocalDynamic, hilightLocalDrawer);
        }
コード例 #5
0
 public void HilightWithColor(AIS_InteractiveObject theObj, Prs3d_Drawer theStyle, bool theToUpdateViewer)
 {
     throw new NotImplementedException();
 }
コード例 #6
0
 public bool HighlightStyle(AIS_InteractiveObject theObj, Prs3d_Drawer theStyle)
 {
     throw new NotImplementedException();
 }
コード例 #7
0
 public void SetHighlightStyle(Prs3d_TypeOfHighlight theStyleType, Prs3d_Drawer theStyle)
 {
     throw new NotImplementedException();
 }
コード例 #8
0
 public void highlightGlobal(AIS_InteractiveObject theObj, Prs3d_Drawer theStyle, int theD_ispMode)
 {
     throw new NotImplementedException();
 }
コード例 #9
0
 public Quantity_NameOfColor GetInteriorColor(Prs3d_Drawer aDrawer)
 {
     throw new NotImplementedException();
 }
コード例 #10
0
 public void GetLineAtt(Prs3d_Drawer aDrawer, AIS_TypeOfAttribute TheTypeOfAttributes,
                        ref Quantity_NameOfColor aCol, ref double aWidth, ref Aspect_TypeOfLine aTyp)
 {
     throw new NotImplementedException();
 }
コード例 #11
0
 public Aspect_TypeOfLine GetLineType(Prs3d_Drawer aDrawer, AIS_TypeOfAttribute TheTypeOfAttributes)
 {
     throw new NotImplementedException();
 }
コード例 #12
0
 public double GetLineWidth(Prs3d_Drawer aDrawer, AIS_TypeOfAttribute TheTypeOfAttributes)
 {
     throw new NotImplementedException();
 }
コード例 #13
0
 public void GetLineColor(Prs3d_Drawer aDrawer, AIS_TypeOfAttribute TheTypeOfAttributes,
                          Quantity_Color TheLineColor)
 {
     throw new NotImplementedException();
 }
コード例 #14
0
 public Quantity_NameOfColor GetLineColor(Prs3d_Drawer aDrawer, AIS_TypeOfAttribute TheTypeOfAttributes)
 {
     throw new NotImplementedException();
 }
コード例 #15
0
 public AIS_ColoredDrawer(Prs3d_Drawer theLink)
     : base()
 {
     throw new NotImplementedException();
 }
コード例 #16
0
 public void setMaterial(Prs3d_Drawer theDrawer, Graphic3d_MaterialAspect theMaterial, bool theToKeepColor,
                         bool theToKeepTransp)
 {
     throw new NotImplementedException();
 }
コード例 #17
0
 public void computeHlrPresentation(Graphic3d_Camera theProjector, Graphic3d_Structure thePrs,
                                    TopoDS_Shape theShape, Prs3d_Drawer theDrawer)
 {
     throw new NotImplementedException();
 }
コード例 #18
0
 public void GetInteriorColor(Prs3d_Drawer aDrawer, Quantity_Color aColor)
 {
     throw new NotImplementedException();
 }
コード例 #19
0
 public int getHilightMode(AIS_InteractiveObject theObj, Prs3d_Drawer theStyle, int theD_ispMode)
 {
     throw new NotImplementedException();
 }
コード例 #20
0
 public Graphic3d_MaterialAspect GetMaterial(Prs3d_Drawer aDrawer)
 {
     throw new NotImplementedException();
 }
コード例 #21
0
 public void SetSelectionStyle(Prs3d_Drawer theStyle)
 {
     throw new NotImplementedException();
 }
コード例 #22
0
 public AttributeSet()
 {
     Drawer        = new Prs3d_Drawer();
     HilightDrawer = new Prs3d_Drawer();
     HilightDrawer.Link(Drawer);
 }
コード例 #23
0
 public bool HighlightStyle(SelectMgr_EntityOwner theOwner, Prs3d_Drawer theStyle)
 {
     throw new NotImplementedException();
 }
コード例 #24
0
 public bool setColor(Prs3d_Drawer theDrawer, Quantity_Color theColor)
 {
     throw new NotImplementedException();
 }
コード例 #25
0
 public void SetLocalAttributes(AIS_InteractiveObject theIObj, Prs3d_Drawer theDrawer, bool theToUpdateViewer)
 {
     throw new NotImplementedException();
 }
コード例 #26
0
 public bool setWidth(Prs3d_Drawer theDrawer, double theWidth)
 {
     throw new NotImplementedException();
 }
コード例 #27
0
 public void SetHilightStyle(Prs3d_Drawer theStyle)
 {
     throw new NotImplementedException();
 }
コード例 #28
0
 public void setTransparency(Prs3d_Drawer theDrawer, double theValue)
 {
     throw new NotImplementedException();
 }
コード例 #29
0
 public void SetDrawerForBRepOwner(SelectMgr_Selection aSelection, Prs3d_Drawer aDrawer)
 {
     throw new NotImplementedException();
 }
コード例 #30
0
 public void SetDynamicHilightAttributes(Prs3d_Drawer theDrawer)
 {
     throw new NotImplementedException();
 }