public static void VisualizeBarriers(I_OSM_To_BIM visualizer, BarrierPolygon[] barriers, double height = 0)
 {
     foreach (BarrierPolygon item in barriers)
     {
         visualizer.VisualizePolygon(item.BoundaryPoints, height);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Visualizes the intersection in BIM environment.
        /// </summary>
        /// <param name="visualizer">The visualizer.</param>
        /// <param name="rayOrigin">The ray origin.</param>
        /// <param name="cellularFloor">The cellular floor.</param>
        /// <param name="elevation">The elevation.</param>
        /// <param name="pointSize">Size of the point.</param>
        public void Visualize(I_OSM_To_BIM visualizer, UV rayOrigin, CellularFloorBaseGeometry cellularFloor, double elevation, double pointSize = .3)
        {
            switch (this.Type)
            {
            case BarrierType.Visual:
                //visualizer.VisualizeBoundary(cellularFloor.VisualBarriers[this.BarrierIndex].BoundaryPoints, elevation);

                visualizer.VisualizeLine(cellularFloor.VisualBarrierEdges[this.EdgeIndexInCellularFloor], elevation);
                break;

            case BarrierType.Physical:
                //visualizer.VisualizeBoundary(cellularFloor.PhysicalBarriers[this.BarrierIndex].BoundaryPoints, elevation);

                visualizer.VisualizeLine(cellularFloor.PhysicalBarrierEdges[this.EdgeIndexInCellularFloor], elevation);
                break;

            case BarrierType.Field:
                //visualizer.VisualizeBoundary(cellularFloor.PhysicalBarriers[this.BarrierIndex].BoundaryPoints, elevation);

                visualizer.VisualizeLine(cellularFloor.FieldBarrierEdges[this.EdgeIndexInCellularFloor], elevation);
                break;

            default:
                break;
            }
            //visualizer.VisualizePoint(IntersectingPoint, pointSize, elevation);
            visualizer.VisualizeLine(new UVLine(rayOrigin, this.IntersectingPoint), elevation);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Visualize a cell in the BIM target platform
 /// </summary>
 /// <param name="visualizer">An instance of the IVisualize interface</param>
 /// <param name="size">Cell size</param>
 /// <param name="elevation">Elevation of visualization</param>
 public void Visualize(I_OSM_To_BIM visualizer, double size, double elevation)
 {
     UV[] pnts = new UV[4];
     pnts[0] = this;
     pnts[1] = this + UV.UBase * size;
     pnts[2] = this + UV.UBase * size + UV.VBase * size;
     pnts[3] = this + UV.VBase * size;
     visualizer.VisualizePolygon(pnts, elevation);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Visualizes this polygon at the BIM environment
        /// </summary>
        /// <param name="visualizer">The visualizer.</param>
        /// <param name="elevation">The elevation.</param>
        public void Visualize(I_OSM_To_BIM visualizer, double elevation = 0)
        {
            List <UVLine> lines = new List <UVLine>();

            for (int i = 0; i < this.PointCount - 1; i++)
            {
                lines.Add(new UVLine(this._pntList[i], this._pntList[i + 1]));
            }
            if (this.Closed)
            {
                lines.Add(new UVLine(this._end, this._start));
            }
            visualizer.VisualizeLines(lines, elevation);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Shows the point in the BIM environment.
 /// </summary>
 /// <param name="visualizer">The visualizer.</param>
 /// <param name="size">The size of the cross.</param>
 /// <param name="elevation">The elevation.</param>
 public void ShowPoint(I_OSM_To_BIM visualizer, double size, double elevation = 0.0d)
 {
     visualizer.VisualizePoint(this, size, elevation);
 }
 /// <summary>
 /// Visualizes the polygon in the BIM environment.
 /// </summary>
 /// <param name="visualizer">The visualizer.</param>
 /// <param name="elevation">The elevation.</param>
 public void Visualize(I_OSM_To_BIM visualizer, double elevation)
 {
     visualizer.VisualizePolygon(this.BoundaryPoints, elevation);
 }
Ejemplo n.º 7
0
        private static bool VisibleDebug(UV origin, UV target, BarrierType barrierType, ref UVLine hitEdge,
                                         CellularFloorBaseGeometry cellularFloor, I_OSM_To_BIM visualizer, double tolerance = OSMDocument.AbsoluteTolerance)
        {
            hitEdge = null;
            UV     direction = target - origin;
            double length    = direction.GetLength();

            direction /= length;
            Ray ray = new Ray(origin, direction, cellularFloor.Origin,
                              cellularFloor.CellSize, tolerance);

            while (ray.Length + tolerance < length)
            {
                Index index = ray.NextIndex(cellularFloor.FindIndex, tolerance);
                if (cellularFloor.ContainsCell(index))
                {
                    cellularFloor.Cells[index.I, index.J].Visualize(visualizer, cellularFloor.CellSize, 0);
                    switch (barrierType)
                    {
                    case BarrierType.Visual:
                        if (cellularFloor.Cells[index.I, index.J].VisualOverlapState == OverlapState.Overlap)
                        {
                            foreach (int item in cellularFloor.Cells[index.I, index.J].VisualBarrierEdgeIndices)
                            {
                                double?distance = ray.DistanceToForIsovist(cellularFloor.VisualBarrierEdges[item], tolerance);
                                if (distance != null && distance.Value + tolerance < length)
                                {
                                    hitEdge = cellularFloor.VisualBarrierEdges[item];
                                    return(false);
                                }
                            }
                        }
                        break;

                    case BarrierType.Field:
                        if (cellularFloor.Cells[index.I, index.J].FieldOverlapState == OverlapState.Overlap)
                        {
                            foreach (int item in cellularFloor.Cells[index.I, index.J].FieldBarrierEdgeIndices)
                            {
                                double?distance = ray.DistanceToForIsovist(cellularFloor.VisualBarrierEdges[item], tolerance);
                                if (distance != null && distance.Value + tolerance < length)
                                {
                                    hitEdge = cellularFloor.FieldBarrierEdges[item];
                                    return(false);
                                }
                            }
                        }
                        break;

                    case BarrierType.Physical:
                        if (cellularFloor.Cells[index.I, index.J].PhysicalOverlapState == OverlapState.Overlap)
                        {
                            foreach (int item in cellularFloor.Cells[index.I, index.J].PhysicalBarrierEdgeIndices)
                            {
                                double?distance = ray.DistanceToForIsovist(cellularFloor.PhysicalBarrierEdges[item], tolerance);
                                if (distance != null && distance.Value + tolerance < length)
                                {
                                    hitEdge = cellularFloor.PhysicalBarrierEdges[item];
                                    return(false);
                                }
                            }
                        }
                        break;

                    default:
                        break;
                    }
                }
            }

            return(true);
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Visualizes this line in the BIM environment
 /// </summary>
 /// <param name="visualizer">The visualizer.</param>
 /// <param name="elevation">The elevation.</param>
 public void Visualize(I_OSM_To_BIM visualizer, double elevation)
 {
     visualizer.VisualizeLine(this, elevation);
 }