Exemplo n.º 1
0
        public void Clone()
        {
            Pose pose = new Pose(new Vector3F(1, 2, 3));
              PointShape pointShape = new PointShape(3, 4, 5);
              GeometricObject geometry = new GeometricObject(pointShape, pose);

              TransformedShape transformedShape = new TransformedShape(geometry);
              TransformedShape clone = transformedShape.Clone() as TransformedShape;
              Assert.IsNotNull(clone);
              Assert.IsNotNull(clone.Child);
              Assert.AreNotSame(geometry, clone.Child);
              Assert.IsTrue(clone.Child is GeometricObject);
              Assert.AreEqual(pose, clone.Child.Pose);
              Assert.IsNotNull(clone.Child.Shape);
              Assert.AreNotSame(pointShape, clone.Child.Shape);
              Assert.IsTrue(clone.Child.Shape is PointShape);
              Assert.AreEqual(pointShape.Position, ((PointShape)clone.Child.Shape).Position);
              Assert.AreEqual(transformedShape.GetAabb(Pose.Identity).Minimum, clone.GetAabb(Pose.Identity).Minimum);
              Assert.AreEqual(transformedShape.GetAabb(Pose.Identity).Maximum, clone.GetAabb(Pose.Identity).Maximum);
        }
Exemplo n.º 2
0
        public void Clone()
        {
            Pose            pose       = new Pose(new Vector3(1, 2, 3));
            PointShape      pointShape = new PointShape(3, 4, 5);
            GeometricObject geometry   = new GeometricObject(pointShape, pose);

            TransformedShape transformedShape = new TransformedShape(geometry);
            TransformedShape clone            = transformedShape.Clone() as TransformedShape;

            Assert.IsNotNull(clone);
            Assert.IsNotNull(clone.Child);
            Assert.AreNotSame(geometry, clone.Child);
            Assert.IsTrue(clone.Child is GeometricObject);
            Assert.AreEqual(pose, clone.Child.Pose);
            Assert.IsNotNull(clone.Child.Shape);
            Assert.AreNotSame(pointShape, clone.Child.Shape);
            Assert.IsTrue(clone.Child.Shape is PointShape);
            Assert.AreEqual(pointShape.Position, ((PointShape)clone.Child.Shape).Position);
            Assert.AreEqual(transformedShape.GetAabb(Pose.Identity).Minimum, clone.GetAabb(Pose.Identity).Minimum);
            Assert.AreEqual(transformedShape.GetAabb(Pose.Identity).Maximum, clone.GetAabb(Pose.Identity).Maximum);
        }