using System; using System.Collections.Generic; using Teigha.Geometry; namespace DwgExtractorManual.Models { /// /// 테이블 셀 시각화를 위한 데이터 클래스 /// public class TableCellVisualizationData { public string FileName { get; set; } = ""; public string NoteText { get; set; } = ""; public List Cells { get; set; } = new List(); public List TableSegments { get; set; } = new List(); public List TextEntities { get; set; } = new List(); public List IntersectionPoints { get; set; } = new List(); // 교차점 정보 추가 public List DiagonalLines { get; set; } = new List(); // 셀 대각선 정보 추가 public List CellBoundaries { get; set; } = new List(); // 정확한 셀 경계 정보 추가 public (double minX, double minY, double maxX, double maxY) NoteBounds { get; set; } } /// /// 셀 경계 정보 /// 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; } /// /// 선분 정보 /// 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"; } /// /// 텍스트 정보 /// 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"; } /// /// 교차점 정보 /// 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"; } /// /// 대각선 정보 (셀 디버깅용) /// 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; } = ""; // 디버깅 라벨 } /// /// 정확한 셀 경계 정보 (4개 모서리 좌표) /// 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; } = ""; // 셀 내 텍스트 내용 } }