Exemplo n.º 1
0
        public void DrawViewportWires(IGH_PreviewArgs args)
        {
            IGH_StructureEnumerator data = this.VolatileData.AllData(true);
            Color c = args.WireColour;

            if (Attributes.Selected)
            {
                c = args.WireColour_Selected;
            }

            foreach (IMesh m in data)
            {
                if (!m.ElementTypes.Contains(-1))
                {
                    args.Display.DrawMeshWires(m.RenderMesh, c);
                }
                else
                {
                    int[]     hf;
                    Point3d[] pts;
                    foreach (IElement e in m.Elements)
                    {
                        if (e.TopologicDimension == 2)
                        {
                            pts = IRhinoGeometry.GetPointsFromElements(e.Vertices, m);
                            args.Display.DrawPolyline(pts, c);
                        }
                        else
                        {
                            if (!m.IsMultidimensionalMesh)
                            {
                                for (int i = 1; i <= e.HalfFacetsCount; i++)
                                {
                                    if (e.IsNakedSiblingHalfFacet(i))
                                    {
                                        e.GetHalfFacet(i, out hf);
                                        pts = IRhinoGeometry.GetPointsFromElements(hf, m);
                                        args.Display.DrawPolyline(pts, c);
                                    }
                                }
                            }
                            else
                            {
                                if (e.IsBoundaryElement())
                                {
                                    for (int i = 1; i <= e.HalfFacetsCount; i++)
                                    {
                                        e.GetHalfFacet(i, out hf);
                                        pts = IRhinoGeometry.GetPointsFromElements(hf, m);
                                        args.Display.DrawPolyline(pts, c);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        public _OdDb.ObjectIdCollection BakeGhGeometry(IGH_StructureEnumerator se)
        {
            var tmpFile = new File3dm();

            foreach (var paramValue in se)
            {
                AddGeometry(tmpFile, paramValue);
            }
            return(BakeGhGeometry(tmpFile));
        }
Exemplo n.º 3
0
        public void DrawViewportMeshes(IGH_PreviewArgs args)
        {
            IGH_StructureEnumerator data = this.VolatileData.AllData(true);

            Rhino.Display.DisplayMaterial mat = args.ShadeMaterial;
            if (Attributes.Selected)
            {
                mat = args.ShadeMaterial_Selected;
            }

            foreach (IMesh m in data)
            {
                args.Display.DrawMeshShaded(m.RenderMesh, mat);
            }
        }