Esempio n. 1
0
 public void GridPlacementTest()
 {
     //this test checks that a object is correctly copied and moved
     //create a box
     using (
         var m = IfcStore.Create(new XbimEditorCredentials(), IfcSchemaVersion.Ifc4, XbimStoreType.InMemoryModel)
         )
     {
         using (var txn = m.BeginTransaction())
         {
             var block         = IfcModelBuilder.MakeBlock(m, 10, 10, 10);
             var solid         = _geomEngine.CreateSolid(block);
             var grid          = IfcModelBuilder.MakeGrid(m, 3, 100);
             var gridPlacement = m.Instances.New <IfcGridPlacement>();
             gridPlacement.PlacementLocation = m.Instances.New <IfcVirtualGridIntersection>();
             gridPlacement.PlacementLocation.IntersectingAxes.Add(grid.UAxes.Last());
             gridPlacement.PlacementLocation.IntersectingAxes.Add(grid.VAxes.Last());
             var solidA = _geomEngine.Moved(solid, gridPlacement) as IXbimSolid;
             Assert.IsNotNull(solidA, "Should be the same type as the master");
             var displacement = solidA.BoundingBox.Centroid() - solid.BoundingBox.Centroid();
             Assert.IsTrue(displacement == new XbimVector3D(200, 200, 0));
         }
     }
 }