コード例 #1
0
ファイル: XPath.cs プロジェクト: 3DInstruments/Kaliber3D
 /// <summary>
 /// 
 /// </summary>
 /// <param name="name"></param>
 /// <param name="style"></param>
 /// <param name="geometry"></param>
 /// <param name="isStroked"></param>
 /// <param name="isFilled"></param>
 /// <returns></returns>
 public static XPath Create(
     string name,
     ShapeStyle style,
     XPathGeometry geometry,
     bool isStroked = true,
     bool isFilled = true)
 {
     return new XPath()
     {
         Name = name,
         Style = style,
         IsStroked = isStroked,
         IsFilled = isFilled,
         Data = new Data()
         {
             Bindings = ImmutableArray.Create<ShapeBinding>(),
             Properties = ImmutableArray.Create<ShapeProperty>()
         },
         Geometry = geometry
     };
 }
コード例 #2
0
ファイル: PathHelper.cs プロジェクト: 3DInstruments/Kaliber3D
        private void InitializeWorkingPath(XPoint start)
        {
            _geometry = XPathGeometry.Create(
                new List<XPathFigure>(),
                _editor.Project.Options.DefaultFillRule);

            _geometry.BeginFigure(
                start,
                _editor.Project.Options.DefaultIsFilled,
                _editor.Project.Options.DefaultIsClosed);

            _path = XPath.Create(
                "Path",
                _editor.Project.CurrentStyleLibrary.CurrentStyle,
                _geometry,
                _editor.Project.Options.DefaultIsStroked,
                _editor.Project.Options.DefaultIsFilled);

            _editor.Project.CurrentContainer.WorkingLayer.Shapes = _editor.Project.CurrentContainer.WorkingLayer.Shapes.Add(_path);

            _previousPathTool = _editor.CurrentPathTool;
            _isInitialized = true;
        }
コード例 #3
0
 /// <summary>
 /// Creates a new instance of the XPath class.
 /// </summary>
 /// <param name="geometry"></param>
 /// <param name="isStroked"></param>
 /// <param name="isFilled"></param>
 /// <returns></returns>
 public XPath Path(
     XPathGeometry geometry,
     bool isStroked = true,
     bool isFilled = false)
 {
     var path = XPath.Create(
         "",
         Context.Editor.Project.CurrentStyleLibrary.CurrentStyle,
         geometry,
         isStroked,
         isFilled);
     Context.Editor.AddWithHistory(path);
     return path;
 }
コード例 #4
0
ファイル: PathHelper.cs プロジェクト: 3DInstruments/Kaliber3D
 private void DeInitializeWorkingPath()
 {
     _isInitialized = false;
     _geometry = null;
     _path = null;
 }