Esempio n. 1
0
        public void setPlan(SectionBase planToDraw)
        {
            Rectangle3d tempBoundingBox = new Rectangle3d(Plane.WorldXY, planToDraw.boundingBox.Min, planToDraw.boundingBox.Max);
            Rectangle   canvasRectangle = new Rectangle();

            canvasRectangle.Width  = typicalPlan.Width;
            canvasRectangle.Height = typicalPlan.Height;

            System.Windows.Point tempOrigin = new System.Windows.Point();
            double tempScaleFactor          = PlanDrawingFunction_90degree.scaleToFitFactor(canvasRectangle, tempBoundingBox, out tempOrigin);

            scaleFactor = tempScaleFactor;
            origin      = tempOrigin;


            foreach (Hatch i in planToDraw.Hatchs)
            {
                PlanDrawingFunction_90degree.drawHatch(tempBoundingBox, i, tempScaleFactor, tempOrigin, System.Windows.Media.Brushes.DimGray, ref this.typicalPlan);
            }

            PlanDrawingFunction_90degree.drawPlan(tempBoundingBox, planToDraw.CoreOutLines, tempScaleFactor, tempOrigin, ref this.typicalPlan, System.Windows.Media.Brushes.Black, 0.1);
            PlanDrawingFunction_90degree.drawPlan(tempBoundingBox, planToDraw.SectionLines, tempScaleFactor, tempOrigin, ref this.typicalPlan, System.Windows.Media.Brushes.Black, 0.2);

            foreach (Text3d i in planToDraw.texts)
            {
                PlanDrawingFunction_90degree.drawText_section(tempBoundingBox, i, tempScaleFactor, tempOrigin, ref this.typicalPlan, 5, System.Windows.Media.Brushes.Black);
            }

            PlanDrawingFunction_90degree.drawDimension(tempBoundingBox, planToDraw.Dimensions, tempScaleFactor, tempOrigin, ref this.typicalPlan);

            foreach (UnitInfo i in planToDraw.Unitinfo)
            {
                PlanDrawingFunction_90degree.drawPlan(tempBoundingBox, i.curves, tempScaleFactor, tempOrigin, ref this.typicalPlan, System.Windows.Media.Brushes.Black, 0.1);

                foreach (Text3d j in i.text)
                {
                    PlanDrawingFunction_90degree.drawText_section(tempBoundingBox, j, tempScaleFactor, tempOrigin, ref this.typicalPlan, 5, System.Windows.Media.Brushes.Black);
                }
            }

            PlanDrawingFunction_90degree.drawPlan(tempBoundingBox, planToDraw.RegsOutput, tempScaleFactor, tempOrigin, ref this.typicalPlan, System.Windows.Media.Brushes.HotPink, 0.4);
        }
        //--------JHL
        public void SetHouseOutline(List <Curve> coreOutline, List <Curve> coreDetail, List <Curve> houseOutline, TypicalPlan typicalPlan, Interval floor)
        {
            Curve            boundary         = typicalPlan.Boundary;
            List <Curve>     surroundingSite  = typicalPlan.SurroundingSite;
            List <FloorPlan> housePlanList    = typicalPlan.UnitPlans;
            List <Curve>     corePlanList     = coreOutline;
            List <FloorPlan> floorPlanList    = typicalPlan.UnitPlans;
            List <Curve>     coreDetailList   = coreDetail;
            List <Curve>     houseOutlineList = houseOutline;
            Rectangle3d      rectangleToFit   = new Rectangle3d(Plane.WorldXY, typicalPlan.GetBoundingBox().Min, typicalPlan.GetBoundingBox().Max);

            Rectangle canvasRectangle = new Rectangle();

            canvasRectangle.Width  = typicalPlanCanvas.Width;
            canvasRectangle.Height = typicalPlanCanvas.Height;

            if (floor.Min == 1)
            {
                System.Windows.Point initialOriginPoint = new System.Windows.Point();
                double scaleFactor = PlanDrawingFunction_90degree.scaleToFitFactor(canvasRectangle, rectangleToFit, out initialOriginPoint);

                PlanDrawingFunction_90degree.drawPlan(rectangleToFit, surroundingSite, scaleFactor, initialOriginPoint, ref this.typicalPlanCanvas, System.Windows.Media.Brushes.LightGray, 0.2);
                PlanDrawingFunction_90degree.drawPlan(rectangleToFit, boundary, scaleFactor, initialOriginPoint, ref this.typicalPlanCanvas, System.Windows.Media.Brushes.Red, 2);
                PlanDrawingFunction_90degree.drawBackGround(rectangleToFit, boundary, scaleFactor, initialOriginPoint, ref this.typicalPlanCanvas, System.Windows.Media.Brushes.White);

                foreach (Curve core in corePlanList)
                {
                    PlanDrawingFunction_90degree.drawPlan(rectangleToFit, core, scaleFactor, initialOriginPoint, ref this.typicalPlanCanvas, System.Windows.Media.Brushes.Black, 0.5);
                    PlanDrawingFunction_90degree.drawBackGround(rectangleToFit, core, scaleFactor, initialOriginPoint, ref this.typicalPlanCanvas, System.Windows.Media.Brushes.LightGray);
                }
                foreach (Curve detail in coreDetailList)
                {
                    PlanDrawingFunction_90degree.drawPlan(rectangleToFit, detail, scaleFactor, initialOriginPoint, ref this.typicalPlanCanvas, System.Windows.Media.Brushes.Black, 0.075);
                }
                PlanDrawingFunction_90degree.drawPlan(rectangleToFit, typicalPlan.OutLine.ToNurbsCurve(), scaleFactor, initialOriginPoint, ref this.typicalPlanCanvas, System.Windows.Media.Brushes.Black, 3);
            }
            else
            {
                System.Windows.Point initialOriginPoint = new System.Windows.Point();
                double scaleFactor = PlanDrawingFunction_90degree.scaleToFitFactor(canvasRectangle, rectangleToFit, out initialOriginPoint);
                PlanDrawingFunction_90degree.drawPlan(rectangleToFit, surroundingSite, scaleFactor, initialOriginPoint, ref this.typicalPlanCanvas, System.Windows.Media.Brushes.LightGray, 0.2);
                PlanDrawingFunction_90degree.drawPlan(rectangleToFit, boundary, scaleFactor, initialOriginPoint, ref this.typicalPlanCanvas, System.Windows.Media.Brushes.Red, 2);
                PlanDrawingFunction_90degree.drawBackGround(rectangleToFit, boundary, scaleFactor, initialOriginPoint, ref this.typicalPlanCanvas, System.Windows.Media.Brushes.White);


                foreach (Curve house in houseOutline)
                {
                    PlanDrawingFunction_90degree.drawPlan(rectangleToFit, house, scaleFactor, initialOriginPoint, ref this.typicalPlanCanvas, System.Windows.Media.Brushes.Black, 0.5);
                    PlanDrawingFunction_90degree.drawBackGround(rectangleToFit, house, scaleFactor, initialOriginPoint, ref this.typicalPlanCanvas, System.Windows.Media.Brushes.LightSeaGreen);
                }

                foreach (Curve core in corePlanList)
                {
                    PlanDrawingFunction_90degree.drawPlan(rectangleToFit, core, scaleFactor, initialOriginPoint, ref this.typicalPlanCanvas, System.Windows.Media.Brushes.Black, 0.5);
                    PlanDrawingFunction_90degree.drawBackGround(rectangleToFit, core, scaleFactor, initialOriginPoint, ref this.typicalPlanCanvas, System.Windows.Media.Brushes.LightGray);
                }
                foreach (Curve detail in coreDetailList)
                {
                    PlanDrawingFunction_90degree.drawPlan(rectangleToFit, detail, scaleFactor, initialOriginPoint, ref this.typicalPlanCanvas, System.Windows.Media.Brushes.Black, 0.075);
                }
                foreach (FloorPlan floorPlan in floorPlanList)
                {
                    PlanDrawingFunction_90degree.drawPlan(rectangleToFit, floorPlan.balconyLines, scaleFactor, initialOriginPoint, ref this.typicalPlanCanvas, System.Windows.Media.Brushes.Black, 0.5);
                }

                PlanDrawingFunction_90degree.drawPlan(rectangleToFit, typicalPlan.OutLine.ToNurbsCurve(), scaleFactor, initialOriginPoint, ref this.typicalPlanCanvas, System.Windows.Media.Brushes.Black, 3);
            }
        }