コード例 #1
0
ファイル: PdfExportBodyTests.cs プロジェクト: Macad3D/Macad3D
        public void MultiLayer()
        {
            var layer1 = new Layer()
            {
                Color        = new Color(0, 1, 0),
                Transparency = 0.5f,
                Name         = "Layer Number One"
            };

            Context.Current.Layers.Add(layer1);

            var layer2 = new Layer()
            {
                Color = new Color(0, 0, 1),
                Name  = "Layer Number Two"
            };

            Context.Current.Layers.Add(layer2);

            var bodies = TestGeomGenerator.CreateBoxCylinderSphere();

            bodies[0].Layer = layer1;
            bodies[1].Layer = layer2;
            bodies[2].Layer = layer2;

            Context.Current.ViewportController.ZoomFitAll();

            var pdf = PdfBodyExporter.Export(bodies);

            Assert.IsNotNull(pdf);
            Assert.That(pdf.Length > 0);
            AssertHelper.IsSameTextFile(Path.Combine(_BasePath, "MultiLayer.pdf"), pdf, AssertHelper.TextCompareFlags.IgnoreFloatPrecision);
        }
コード例 #2
0
ファイル: PdfExportBodyTests.cs プロジェクト: Macad3D/Macad3D
        public void SimpleMesh()
        {
            var bodies = TestGeomGenerator.CreateBoxCylinderSphere();

            Context.Current.ViewportController.ZoomFitAll();

            var pdf = PdfBodyExporter.Export(bodies);

            Assert.IsNotNull(pdf);
            Assert.That(pdf.Length > 0);
            AssertHelper.IsSameTextFile(Path.Combine(_BasePath, "SimpleMesh.pdf"), pdf, AssertHelper.TextCompareFlags.IgnoreFloatPrecision);
        }