IfcDoc.Program.ImportVexRectangle C# (CSharp) Method

ImportVexRectangle() private static method

private static ImportVexRectangle ( DocDefinition docDefinition, IfcDoc.Schema.VEX.RECTANGLE rectangle, IfcDoc.Schema.VEX.SCHEMATA schemata ) : void
docDefinition DocDefinition
rectangle IfcDoc.Schema.VEX.RECTANGLE
schemata IfcDoc.Schema.VEX.SCHEMATA
return void
        private static void ImportVexRectangle(DocDefinition docDefinition, RECTANGLE rectangle, SCHEMATA schemata)
        {
            if (rectangle != null && schemata.settings != null && schemata.settings.page != null)
            {
                int px = (int)(rectangle.x / schemata.settings.page.width);
                int py = (int)(rectangle.y / schemata.settings.page.height);
                int page = 1 + py * schemata.settings.page.nhorizontalpages + px;
                docDefinition.DiagramNumber = page;

                docDefinition.DiagramRectangle = new DocRectangle();
                docDefinition.DiagramRectangle.X = rectangle.x;
                docDefinition.DiagramRectangle.Y = rectangle.y;
                docDefinition.DiagramRectangle.Width = rectangle.dx;
                docDefinition.DiagramRectangle.Height = rectangle.dy;
            }
        }