public override void GenerateGraphics(DisplayItemList DLList) { if (null == DLList) return; if (m_dRadius < 0) return; //DisplayItemList DisplayList = new DisplayItemList(); DisplayItemCircle Circle = new DisplayItemCircle( m_CenterPoint, m_dRadius); DLList.AddItem(Circle); DisplayItemPoint CenterPoint = new DisplayItemPoint(m_CenterPoint); DLList.AddItem(CenterPoint); }
public static DisplayItemCircle GenDisplayItemCircle(DisplayItemList list, GePoint center, double radius) { DisplayItemCircle Circle = new DisplayItemCircle( center, radius); if (list != null) list.AddItem(Circle); return Circle; }
public static void GenDisplayItemLine(DisplayItemList DLList , GePoint startPoint, GePoint endPoint) { Debug.Assert(DLList != null && startPoint != null && endPoint != null); if (null == DLList || null == startPoint || null == endPoint) return; if (!startPoint.IsEqualTo(endPoint)) { DisplayItemLine dpLine = new DisplayItemLine(startPoint, endPoint); DLList.AddItem(dpLine); } }
public override void GenerateGraphics(DisplayItemList DLList) { Debug.Assert(DLList != null); if (null == DLList) return; // create a 3D feature. DisplayItemList extDL = Extrusion.GetDisplayList(); DLList.AddItem(extDL); Matrix44 trans = Matrix44.Identity; trans.SetScaling(2); trans.SetRotate(MathUtil.PI / 4, UnitVector.kXAxis, GePoint.kOrigin); trans.SetTranslation(new Vector(50, 50, 0)); DLList.Transformation = trans; }
public override void GenerateGraphics(DisplayItemList DLList) { Debug.Assert(DLList != null); if (null == DLList) return; // It must exist two point at least. if (m_AttachPoint == null) return; if (m_InternalPoints.Empty()) return; // Attach point to the first internal point GePoint p1 = m_AttachPoint; GePoint p2 = m_InternalPoints[0]; // If the first two points are equal, we needn't continue to calculate. if (p1.IsEqualTo(p2)) return; Matrix44 trans = new Matrix44(); trans.SetTranslation(p1 - GePoint.kOrigin); //trans.SetRotate(MathFactory.Math.PI, UnitVector.kZAxis, GePoint.kOrigin); Vector direction = p2 - p1; trans.SetRotate(UnitVector.kXAxis, direction.UnitVector, GePoint.kOrigin); //trans.SetRotate(UnitVector.kXAxis, UnitVector.kYAxis, p2); // Arrowhead BFxSolidArrowHead arrow = new BFxSolidArrowHead(); arrow.GetDisplayList(DLList, trans); DisplayItemBuilder.GenDisplayItemLine(DLList, p1, p2); DisplayItemBuilder.GenDisplayItemPoint(DLList, p1); DisplayItemBuilder.GenDisplayItemLines(DLList, m_InternalPoints); DisplayItemBuilder.GenDisplayItemPoints(DLList, m_InternalPoints); // Text if (!m_Text.Empty) { GeRectangle rec = PtApp.ActiveView.GetRichStringRange(m_Text); if (rec != null) { Vector offset = new Vector(0, -rec.Height / 2, 0); GePoint basePoint = m_InternalPoints[m_InternalPoints.Count - 1] + offset; DisplayItemText DLText = new DisplayItemText(m_Text.GetString(), basePoint, PtApp.ActiveDocument.GetFontManager().GetFont(m_Text.FontID)); DLList.AddItem(DLText); rec.MoveTo(basePoint); DisplayItemBuilder.GenDisplayItemLines(DLList, rec); } } }
public static void GenDisplayItemMesh(DisplayItemList DLList, FRList<int> connectivity , FRList<GePoint> points, FRList<UnitVector> normals , FRList<Color> colors) { Debug.Assert(DLList != null && connectivity != null && points != null); if (null == DLList || null == connectivity || null == points) return; if (connectivity.Count < 3 || points.Count < 3) return; DisplayItemMesh mesh = new DisplayItemMesh(); mesh.Connectivity = connectivity; mesh.Points = points; mesh.Normals = normals; mesh.Colors = colors; DLList.AddItem(mesh); }
public static void GenDisplayItemLines(DisplayItemList DLList, GeRectangle rec) { Debug.Assert(DLList != null && rec != null); if (null == DLList || null == rec) return; GePoint MinPoint = rec.MinPoint; GePoint MaxPoint = rec.MaxPoint; GePoint Corner1 = new GePoint(MinPoint.X, MaxPoint.Y); GePoint Corner2 = new GePoint(MaxPoint.X, MinPoint.Y); // Add the bounding of the rectangular. GenDisplayItemLine(DLList, Corner1, MinPoint); GenDisplayItemLine(DLList, MinPoint, Corner2); GenDisplayItemLine(DLList, Corner2, MaxPoint); GenDisplayItemLine(DLList, MaxPoint, Corner1); DLList.AddItem(new DisplayItemPoint(MinPoint)); DLList.AddItem(new DisplayItemPoint(MaxPoint)); DLList.AddItem(new DisplayItemPoint(Corner1)); DLList.AddItem(new DisplayItemPoint(Corner2)); }
public static DisplayItemText GenDisplayItemText(DisplayItemList list, RichString str, GePoint position, GeRectangle rec) { //GeRectangle rec = PtApp.ActiveView.GetRichStringRange(str); DisplayItemText DLText = new DisplayItemText(str.GetString(), position, str.GetFont()); DLText.Range = rec; if (list != null) list.AddItem(DLText); return DLText; }
public static void GenDisplayItemPoints(DisplayItemList DLList, FRList<GePoint> points) { Debug.Assert(DLList != null && points != null); if (null == DLList || null == points) return; for (int i = 0; i < points.Count; i++) { GePoint point = points[i]; DisplayItemPoint DLPoint = new DisplayItemPoint(point); DLList.AddItem(DLPoint); } }
public static DisplayItemPoint GenDisplayItemPoint(DisplayItemList list, GePoint position) { DisplayItemPoint DLPoint = new DisplayItemPoint(position); if (list != null) list.AddItem(DLPoint); return DLPoint; }