示例#1
0
 internal SwCommandGroup(ISwApplication app, CommandGroupSpec spec, CommandGroup cmdGroup)
 {
     Spec         = spec;
     CommandGroup = cmdGroup;
     m_App        = app;
 }
 public virtual CustomFeatureState_e OnUpdateState(ISwApplication app, ISwDocument model, ISwMacroFeature feature)
 {
     return(CustomFeatureState_e.Default);
 }
 public PropertyManagerPageListBoxControlConstructor(ISwApplication app, IIconsCreator iconsConv)
     : base(app.Sw, swPropertyManagerPageControlType_e.swControlType_Listbox, iconsConv)
 {
     m_SwApp  = app;
     m_Helper = new PropertyManagerPageItemsControlConstructorHelper();
 }
示例#4
0
 public override CustomFeatureRebuildResult OnRebuild(ISwApplication app, ISwDocument model, ISwMacroFeature feature)
 {
     return(base.OnRebuild(app, model, feature));
 }
 public virtual bool OnEditDefinition(ISwApplication app, ISwDocument model, ISwMacroFeature feature)
 {
     return(true);
 }
示例#6
0
 internal SwSurface(ISurface surface, ISwDocument doc, ISwApplication app) : base(surface, doc, app)
 {
     Surface     = surface;
     m_MathUtils = app.Sw.IGetMathUtility();
 }
示例#7
0
 internal SwPolylineCurve(ICurve[] curves, ISwDocument doc, ISwApplication app, bool isCreated)
     : base(curves, doc, app, isCreated)
 {
 }
示例#8
0
 internal NewSelectionEventHandler(SwDocument doc, ISwApplication app) : base(doc, app)
 {
 }
示例#9
0
 internal SwFeatureMgrTab(FeatureManagerTabCreator <TControl> ctrlCreator, SwDocument doc, ISwApplication app, IXLogger logger)
     : base(doc, app, logger)
 {
     m_ModelViewMgr = doc.Model.ModelViewManager;
     m_CtrlCreator  = ctrlCreator;
 }
示例#10
0
 internal SwEdge(IEdge edge, ISwDocument doc, ISwApplication app) : base((IEntity)edge, doc, app)
 {
     Edge = edge;
 }
示例#11
0
 internal SwLinearEdge(IEdge edge, ISwDocument doc, ISwApplication app) : base(edge, doc, app)
 {
 }
示例#12
0
 internal DocumentRebuildEventsHandler(SwDocument doc, ISwApplication app) : base(doc, app)
 {
 }
 public PropertyManagerPageCustomItemsComboBoxControlConstructor(ISwApplication app, IIconsCreator iconsConv)
     : base(app, iconsConv)
 {
 }
示例#14
0
 internal SwEntity(IEntity entity, ISwDocument doc, ISwApplication app) : base(entity, doc, app)
 {
     Entity = entity;
 }
示例#15
0
 internal SwSketchSpline(ISketchSpline spline, ISwDocument doc, ISwApplication app, bool created)
     : base((ISketchSegment)spline, doc, app, created)
 {
 }
示例#16
0
文件: ComboBox.cs 项目: xarial/xcad
 public override IEnumerable <string> ProvideItems(ISwApplication app, IControl[] dependencies)
 => new string[]
 {
     "A", "B", "C"
 };
示例#17
0
 public override CustomFeatureRebuildResult OnRebuild(ISwApplication app, ISwDocument model,
                                                      ISwMacroFeature <MacroFeatureEditBodiesParams> feature, MacroFeatureEditBodiesParams parameters, out AlignDimensionDelegate <MacroFeatureEditBodiesParams> alignDim)
 {
     alignDim = null;
     return(new CustomFeatureRebuildResult());
 }
示例#18
0
文件: ComboBox.cs 项目: xarial/xcad
 public override IEnumerable <int> ProvideItems(ISwApplication app, IControl[] dependencies)
 => new int[]
 {
     1, 2, 3
 };
示例#19
0
 public SwModelViewsCollection(ISwDocument3D doc, ISwApplication app)
 {
     m_Doc = doc;
     m_App = app;
 }
示例#20
0
 internal SwTempSolidBody(IBody2 body, ISwApplication app) : base(body, app)
 {
 }
 public PropertyManagerPageSelectionBoxControlConstructor(ISwApplication app, IconsConverter iconsConv, IXLogger logger)
     : base(app.Sw, swPropertyManagerPageControlType_e.swControlType_Selectionbox, iconsConv)
 {
     m_SwApp  = app;
     m_Logger = logger;
 }
示例#22
0
 internal SwTempPlanarSheetBody(IBody2 body, ISwApplication app) : base(body, app)
 {
 }
示例#23
0
 public override void OnPostRebuild(ISwApplication app, ISwDocument model, ISwMacroFeature <PmpMacroFeatData> feature, PmpMacroFeatData parameters)
 {
     base.OnPostRebuild(app, model, feature, parameters);
 }
示例#24
0
        public override ISwBody[] CreateGeometry(ISwApplication app, ISwDocument model,
                                                 SweepSketchData data, bool isPreview, out AlignDimensionDelegate <SweepSketchData> alignDim)
        {
            m_App = app;

            var cutListLengthTrackingId = app.Sw.RegisterTrackingDefinition(CUT_LIST_LENGTH_TRACKING_DEF_NAME);

            var result = new List <ISwBody>();

            Point  firstCenterPt = null;
            Vector firstDir      = null;

            int index   = 0;
            var lengths = new List <double>();

            var setLengthPrp = !isPreview && data.AddLengthPropety && (model as ISwPart).Part.IsWeldment();

            foreach (var sketch in data.Sketches)
            {
                foreach (var seg in sketch.Entities.OfType <ISwSketchSegment>().Where(s => !s.Segment.ConstructionGeometry))
                {
                    var path = seg.Definition;

                    var startPt = path.StartPoint.Coordinate;

                    if (firstCenterPt == null)
                    {
                        firstCenterPt = startPt;
                    }

                    var uParam = path.Curves.First().ReverseEvaluate(startPt.X, startPt.Y, startPt.Z);

                    var evalData = path.Curves.First().Evaluate2(uParam, 2) as double[];

                    var normalAtPoint = new Vector(evalData[3], evalData[4], evalData[5]);

                    if (firstDir == null)
                    {
                        firstDir = normalAtPoint;
                    }

                    var profile = app.MemoryGeometryBuilder.CreateCircle(startPt, normalAtPoint, data.Radius * 2);

                    var profileRegion = app.MemoryGeometryBuilder.CreateRegionFromSegments(profile);

                    var region = app.MemoryGeometryBuilder.CreatePlanarSheet(profileRegion).Bodies.First();

                    var sweep = app.MemoryGeometryBuilder.CreateSolidSweep(path, region);

                    var body = sweep.Bodies.OfType <ISwBody>().First();

                    if (setLengthPrp)
                    {
                        body.Body.SetTrackingID(cutListLengthTrackingId, index++);

                        lengths.Add(path.Length);
                    }

                    result.Add(body);
                }
            }

            alignDim = (name, dim) =>
            {
                switch (name)
                {
                case nameof(SweepSketchData.Radius):
                    this.AlignRadialDimension(dim, firstCenterPt, firstDir);
                    break;
                }
            };

            if (setLengthPrp)
            {
                model.Tags.Put(CUT_LIST_LENGTH_TRACKING_DEF_NAME, lengths);
                (model as ISwPart).CutListRebuild += OnCutListRebuild;
            }

            return(result.ToArray());
        }
 public virtual CustomFeatureRebuildResult OnRebuild(ISwApplication app, ISwDocument model, ISwMacroFeature feature)
 {
     return(null);
 }
示例#26
0
        internal SwCutListCustomPropertiesCollection(CustomPropertyManager prpsMgr,
                                                     ISwDocument3D parentDoc, ISwConfiguration parentConf, ISwApplication app)
            : base((SwDocument)parentDoc, app)
        {
            PrpMgr = prpsMgr;

            m_ParentDoc  = parentDoc;
            m_ParentConf = parentConf;
        }
示例#27
0
 public override IEnumerable <MyItem> ProvideItems(ISwApplication app, IControl[] dependencies)
 => MyItem.All;
示例#28
0
 internal SwCutListCustomProperty(CustomPropertyManager prpMgr, string name,
                                  ISwDocument3D refDoc, ISwConfiguration refConf, bool isCommited, ISwApplication app)
     : base(prpMgr, name, isCommited, app)
 {
     m_RefDoc  = refDoc;
     m_RefConf = refConf;
 }
示例#29
0
 internal SwSketchRegion(ISketchRegion region, ISwDocument doc, ISwApplication app) : base(region, doc, app)
 {
     Region = region;
 }
示例#30
0
 public LazyNewDocumentGeometryBuilderDocumentProvider(ISwApplication app)
 {
     m_App = app;
 }