Example #1
0
 public Model()
 {
     WorldMouse = new Models.WorldMouse();
      BoundingBox = new BoundingBox();
      allViewPorts = new Dictionary<String, CadViewPort>();
      allGrahics = new List<Graphic>();
      NotificationTarget = null;
      FeatureList = new FeatureList();
 }
Example #2
0
        public FeatureList GetFeatureList()
        {
            if (null == dxf) throw new Exception("Dxf file has not been set.");
             FeatureList fList = new FeatureList();

             foreach(var layer in dxf.Layers)
             {
            Feature feature = new Feature();
            feature.Name = layer.Name;
            feature.Color =
               new ColorAsBrush
                  ( layer.Color.R
                  , layer.Color.G
                  , layer.Color.B
                  );
            feature.FillColor = feature.Color;
            //feature.Style = layer.LineType;
            feature.Weight = layer.Lineweight.Value;
            feature.Printable = layer.Plot;
            fList.AddFeature(feature);
             }

             return fList;
        }
Example #3
0
 private void add3Features(FeatureList aFL)
 {
     var f1 = new Feature();
      f1.Name = "F1";
      aFL.AddFeature(f1);
      f1 = new Feature();
      f1.Name = "F2";
      aFL.AddFeature(f1);
      f1 = new Feature();
      f1.Name = "F3";
      aFL.AddFeature(f1);
 }
Example #4
0
 public void FeatureList_RemovingNonExistantMember_Fails()
 {
     FeatureList fl = new FeatureList();
      add3Features(fl);
      int precount = fl.Children.Count;
      bool actual = fl.TryRemoveFeature("Doesnt Exist");
      Assert.AreEqual(expected: false,
     actual: actual);
      Assert.AreEqual(expected: precount,
     actual: fl.Children.Count);
 }
Example #5
0
 public void FeatureList_RemovingExistingMember_Succeeds()
 {
     FeatureList fl = new FeatureList();
      add3Features(fl);
      int precount = fl.Children.Count;
      bool actual = fl.TryRemoveFeature("F2");
      Assert.AreEqual(expected: true,
     actual: actual);
      Assert.AreEqual(expected: precount - 1,
     actual: fl.Children.Count);
 }
Example #6
0
 public void FeatureList_NewHasDefaultFeature()
 {
     FeatureList fl = new FeatureList();
      Assert.AreEqual(expected: 1,
     actual: fl.Children.Count);
      Assert.AreEqual(expected: "Default",
     actual: fl.Children["Default"].Name);
 }
Example #7
0
 public void FeatureList_Adding3Features_yields4Count()
 {
     FeatureList fl = new FeatureList();
      add3Features(fl);
      Assert.AreEqual(expected: 4,
     actual: fl.Children.Count);
 }