#if ACAD24
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Colors;
using AcAp = Autodesk.AutoCAD.ApplicationServices;
#elif BCAD
using Bricscad.EditorInput;
using Teigha.Geometry;
using Teigha.DatabaseServices;
using Teigha.Colors;
using AcAp = Bricscad.ApplicationServices;
#endif
using System;
using System.Collections.Generic;
namespace Boprs
{
///
/// Simple closed polygon.
///
public class Contour
{
///
/// Parent of this contour, null if external.
///
public Contour Parent { get; internal set; }
///
/// Vertices of the contour.
///
public List Vertices { get; }
///
/// Are the vertices of the contour arranged in clockwise manner?
///
/// true if the contour is clockwise, false if counter-clockwise.
public bool IsClockwise()
{
throw new NotImplementedException();
}
///
/// Reverse the orientation of the contour.
///
public void Reverse()
{
throw new NotImplementedException();
}
///
/// Constructor.
///
public Contour()
{
Vertices = new List();
}
#if DEBUG
internal void Draw(Color color = null)
{
AcAp.Document acDoc = AcAp.Application.DocumentManager.MdiActiveDocument;
Database acDb = acDoc.Database;
using (Transaction acTrans = acDb.TransactionManager.StartTransaction())
{
// Open the BlockTableRecord
BlockTable acBlkTbl = (BlockTable)acTrans.GetObject(acDb.BlockTableId, OpenMode.ForRead);
BlockTableRecord acBlkTblRec =
(BlockTableRecord)acTrans.GetObject(acBlkTbl[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
for(int i = 0; i < Vertices.Count; i++)
{
Line asLine = new Line(Vertices[i].To3d(), Vertices[(i + 1) % Vertices.Count].To3d());
acBlkTblRec.AppendEntity(asLine);
acTrans.AddNewlyCreatedDBObject(asLine, true);
}
acTrans.Commit();
}
}
#endif
}
}