115 lines
4.1 KiB
C#
115 lines
4.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Teigha.Geometry;
|
|
|
|
namespace DwgExtractorManual.Models
|
|
{
|
|
/// <summary>
|
|
/// 테이블 셀 시각화를 위한 데이터 클래스
|
|
/// </summary>
|
|
public class TableCellVisualizationData
|
|
{
|
|
public string FileName { get; set; } = "";
|
|
public string NoteText { get; set; } = "";
|
|
public List<CellBounds> Cells { get; set; } = new List<CellBounds>();
|
|
public List<SegmentInfo> TableSegments { get; set; } = new List<SegmentInfo>();
|
|
public List<TextInfo> TextEntities { get; set; } = new List<TextInfo>();
|
|
public List<IntersectionInfo> IntersectionPoints { get; set; } = new List<IntersectionInfo>(); // 교차점 정보 추가
|
|
public List<DiagonalLine> DiagonalLines { get; set; } = new List<DiagonalLine>(); // 셀 대각선 정보 추가
|
|
public List<CellBoundaryInfo> CellBoundaries { get; set; } = new List<CellBoundaryInfo>(); // 정확한 셀 경계 정보 추가
|
|
public (double minX, double minY, double maxX, double maxY) NoteBounds { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 셀 경계 정보
|
|
/// </summary>
|
|
public class CellBounds
|
|
{
|
|
public double MinX { get; set; }
|
|
public double MinY { get; set; }
|
|
public double MaxX { get; set; }
|
|
public double MaxY { get; set; }
|
|
public int Row { get; set; }
|
|
public int Column { get; set; }
|
|
public string Text { get; set; } = "";
|
|
public bool IsValid { get; set; } = true;
|
|
|
|
public double Width => MaxX - MinX;
|
|
public double Height => MaxY - MinY;
|
|
public double CenterX => (MinX + MaxX) / 2;
|
|
public double CenterY => (MinY + MaxY) / 2;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 선분 정보
|
|
/// </summary>
|
|
public class SegmentInfo
|
|
{
|
|
public double StartX { get; set; }
|
|
public double StartY { get; set; }
|
|
public double EndX { get; set; }
|
|
public double EndY { get; set; }
|
|
public bool IsHorizontal { get; set; }
|
|
public string Color { get; set; } = "Black";
|
|
}
|
|
|
|
/// <summary>
|
|
/// 텍스트 정보
|
|
/// </summary>
|
|
public class TextInfo
|
|
{
|
|
public double X { get; set; }
|
|
public double Y { get; set; }
|
|
public string Text { get; set; } = "";
|
|
public bool IsInTable { get; set; }
|
|
public string Color { get; set; } = "Blue";
|
|
}
|
|
|
|
/// <summary>
|
|
/// 교차점 정보
|
|
/// </summary>
|
|
public class IntersectionInfo
|
|
{
|
|
public double X { get; set; }
|
|
public double Y { get; set; }
|
|
public int DirectionBits { get; set; } // 비트 플래그 숫자
|
|
public int Row { get; set; } // Row 번호
|
|
public int Column { get; set; } // Column 번호
|
|
public bool IsTopLeft { get; set; } // topLeft 후보인지
|
|
public bool IsBottomRight { get; set; } // bottomRight 후보인지
|
|
public string Color { get; set; } = "Red";
|
|
}
|
|
|
|
/// <summary>
|
|
/// 대각선 정보 (셀 디버깅용)
|
|
/// </summary>
|
|
public class DiagonalLine
|
|
{
|
|
public double StartX { get; set; }
|
|
public double StartY { get; set; }
|
|
public double EndX { get; set; }
|
|
public double EndY { get; set; }
|
|
public string Color { get; set; } = "Green";
|
|
public string Label { get; set; } = ""; // 디버깅 라벨
|
|
}
|
|
|
|
/// <summary>
|
|
/// 정확한 셀 경계 정보 (4개 모서리 좌표)
|
|
/// </summary>
|
|
public class CellBoundaryInfo
|
|
{
|
|
public double TopLeftX { get; set; }
|
|
public double TopLeftY { get; set; }
|
|
public double TopRightX { get; set; }
|
|
public double TopRightY { get; set; }
|
|
public double BottomLeftX { get; set; }
|
|
public double BottomLeftY { get; set; }
|
|
public double BottomRightX { get; set; }
|
|
public double BottomRightY { get; set; }
|
|
public string Label { get; set; } = "";
|
|
public double Width { get; set; }
|
|
public double Height { get; set; }
|
|
public string Color { get; set; } = "DarkBlue";
|
|
public string CellText { get; set; } = ""; // 셀 내 텍스트 내용
|
|
}
|
|
} |