コード例 #1
0
ファイル: RhinoVROpen.cs プロジェクト: jmorrison150/RhinoVR
        protected override Rhino.Commands.Result RunCommand(Rhino.RhinoDoc doc, Rhino.Commands.RunMode mode)
        {
            var type = typeof(VR_PANEL);

            Rhino.UI.Panels.OpenPanel(type.GUID);
            return(Rhino.Commands.Result.Success);
        }
コード例 #2
0
        /// <summary>
        /// Rhino calls this function to run the command.
        /// </summary>
        protected override Rhino.Commands.Result RunCommand(Rhino.RhinoDoc doc, Rhino.Commands.RunMode mode)
        {
            const Rhino.DocObjects.ObjectType filter = Rhino.DocObjects.ObjectType.Curve;

            Rhino.DocObjects.ObjRef objref;
            Rhino.Commands.Result   rc = Rhino.Input.RhinoGet.GetOneObject("Select curve to divide", false, filter, out objref);
            if (rc != Rhino.Commands.Result.Success || objref == null)
            {
                return(rc);
            }

            Rhino.Geometry.Curve curve = objref.Curve();
            if (null == curve || curve.IsShort(Rhino.RhinoMath.ZeroTolerance))
            {
                return(Rhino.Commands.Result.Failure);
            }

            int segmentCount = 2;

            rc = Rhino.Input.RhinoGet.GetInteger("Number of segments", false, ref segmentCount, 2, 100);
            if (rc != Rhino.Commands.Result.Success)
            {
                return(rc);
            }

            Rhino.Geometry.Point3d[] points;
            curve.DivideByCount(segmentCount, true, out points);
            if (null == points)
            {
                return(Rhino.Commands.Result.Failure);
            }

            // Create a history record
            Rhino.DocObjects.HistoryRecord history = new Rhino.DocObjects.HistoryRecord(this, _historyVersion);
            WriteHistory(history, objref, segmentCount, points.Length);

            for (int i = 0; i < points.Length; i++)
            {
                doc.Objects.AddPoint(points[i], null, history, false);
            }

            doc.Views.Redraw();

            return(Rhino.Commands.Result.Success);
        }
コード例 #3
0
            ///<summary> This gets called when when the user runs this command.</summary>
            protected override Result RunCommand(RhinoDoc doc, Rhino.Commands.RunMode mode)
            {
                ReceiverConduit m_Receiver_conduit = ReceiverConduit.Instance;
                Configuration   config             = ConfigurationManager.OpenExeConfiguration(System.Reflection.Assembly.GetExecutingAssembly().Location);
                ConfigurationSectionCollection S   = config.Sections;


                Rhino.Geometry.Point3d location;
                if (Rhino.Input.RhinoGet.GetPoint("Select Source Position", false, out location) != Result.Success)
                {
                    return(Result.Cancel);
                }

                Rhino.DocObjects.RhinoObject rhObj = doc.Objects.Find(doc.Objects.AddPoint(location));
                rhObj.Attributes.Name = "Acoustical Receiver";
                rhObj.Geometry.SetUserString("SWL", Utilities.PachTools.EncodeSourcePower(new double[] { 120, 120, 120, 120, 120, 120, 120, 120 }));

                Rhino.RhinoDoc.ActiveDoc.Objects.ModifyAttributes(rhObj, rhObj.Attributes, true);

                m_Receiver_conduit.SetReceiver(rhObj);
                doc.Views.Redraw();

                return(Result.Success);
            }
コード例 #4
0
 /// <summary>
 /// Is called when the user calls the _RenderWindow command.
 /// </summary>
 /// <param name="doc">The document to be rendered.</param>
 /// <param name="mode">The run mode: interactive or scripted.</param>
 /// <param name="fastPreview">Whether the render is in preview-mode.</param>
 /// <param name="view">The view being rendered.</param>
 /// <param name="rect">The rendering rectangle.</param>
 /// <param name="inWindow">Whether rendering should appear in the window.</param>
 /// <returns>The result of the command.</returns>
 protected override Rhino.Commands.Result RenderWindow(RhinoDoc doc, Rhino.Commands.RunMode mode, bool fastPreview, Rhino.Display.RhinoView view, System.Drawing.Rectangle rect, bool inWindow)
 {
     return(Result.Success);
 }
コード例 #5
0
 /// <summary>
 /// Is called when the user calls the _Render command.
 /// </summary>
 /// <param name="doc">The document to be rendered.</param>
 /// <param name="mode">The run mode: interactive or scripted.</param>
 /// <param name="fastPreview">Whether the render is in preview-mode.</param>
 /// <returns>The result of the command.</returns>
 protected override Rhino.Commands.Result Render(RhinoDoc doc, Rhino.Commands.RunMode mode, bool fastPreview)
 {
     return(Result.Success);
 }
コード例 #6
0
 public MyRenderPipeline(RhinoDoc doc, Rhino.Commands.RunMode mode, Rhino.PlugIns.RenderPlugIn plugin, ref AsyncRenderContext aRC)
     : base(doc, mode, plugin, RenderPipeline.RenderSize(doc),
            "RdkTest", Rhino.Render.RenderWindow.StandardChannels.RGBA, false, false, ref aRC)
 {
     m_asyncRenderContext = (MyAsyncRenderContext)aRC;
 }