예제 #1
0
                private static Boolean IsOriginEndConcave(PartitionParam param)
                {
                    int originCurrentIndex = param.OutlineLabel.Core.FindIndex
                                                 (i => (i.PureLine == param.OriginPost.BasePureLine));

                    RoomLine cornerLinePre  = new RoomLine();
                    RoomLine cornerLinePost = new RoomLine();


                    if (originCurrentIndex == param.OutlineLabel.Core.Count - 1)
                    {
                        return(false);
                    }

                    cornerLinePre  = param.OutlineLabel.Core[originCurrentIndex];
                    cornerLinePost = param.OutlineLabel.Core[originCurrentIndex + 1];



                    PartitionSetter.CornerState cornerStat = PartitionSetter.GetCCWCornerState(cornerLinePre.UnitTangent, cornerLinePost.UnitTangent);

                    if (cornerStat == PartitionSetter.CornerState.Concave)
                    {
                        return(true);
                    }

                    return(false);
                }
예제 #2
0
                private static PartitionParam PushOriginToEnd(PartitionParam param)
                {
                    List <RoomLine> coreSeg      = param.OutlineLabel.Core;
                    int             indexCurrent = coreSeg.FindIndex(i => i.PureLine == param.OriginPost.BasePureLine);

                    if (indexCurrent >= coreSeg.Count - 2) // 사실상 마지막 세그먼트인 경우..
                    {
                        param.OriginPost.Point = param.OriginPost.BaseLine.EndPt;
                        return(DrawOrtho(param));
                    }

                    PartitionSetter.CornerState cornerStat =
                        PartitionSetter.GetCCWCornerState(coreSeg[indexCurrent].UnitTangent, coreSeg[indexCurrent + 1].UnitTangent);

                    if (cornerStat == PartitionSetter.CornerState.Concave)
                    {
                        SetPostParallelToOrigin(param);
                        return(DrawOrtho(param));
                    }

                    param.OriginPost.Point = param.OriginPost.BaseLine.EndPt;
                    return(DrawOrtho(param));
                }
예제 #3
0
                private static PartitionParam PushOriginToStart(PartitionParam param)
                {
                    List <RoomLine> coreSeg      = param.OutlineLabel.Core;
                    int             indexCurrent = param.OutlineLabel.Core.FindIndex
                                                       (i => i.PureLine == param.OriginPost.BasePureLine);

                    if (indexCurrent < 2) //이 경우는 거의 없을듯..
                    {
                        return(DrawOrtho(param));
                    }

                    PartitionSetter.CornerState cornerStat =
                        PartitionSetter.GetCCWCornerState(coreSeg[indexCurrent - 1].UnitTangent, coreSeg[indexCurrent - 1].UnitTangent);

                    if (cornerStat == PartitionSetter.CornerState.Concave)
                    {
                        PartitionOrigin newOrigin = new PartitionOrigin(coreSeg[indexCurrent - 2].EndPt, coreSeg[indexCurrent - 2]);
                        param.OriginPost = newOrigin;
                        return(DrawOrtho(param));
                    }

                    param.OriginPost.Point = param.OriginPost.BaseLine.StartPt;
                    return(DrawOrtho(param));
                }