Exemple #1
0
        public override bool BuildCustomMeshes(ViewportInfo vp, RhinoDoc doc, RenderPrimitiveList objMeshes, Guid requestingPlugIn, DisplayPipelineAttributes attrs)
        {
            if (!WillBuildCustomMeshes(vp, objMeshes.RhinoObject, doc, requestingPlugIn, attrs))
            {
                return(false);
            }

            var obj = objMeshes.RhinoObject;

            if (obj == null)
            {
                Sphere sphere = new Sphere(new Point3d(0.0, 0.0, 0.0), 10.0);
                objMeshes.Add(Rhino.Geometry.Mesh.CreateFromSphere(sphere, 100, 100), RenderMaterial.CreateBasicMaterial(Rhino.DocObjects.Material.DefaultMaterial));
            }
            else
            {
                var sphere = SphereFromObject(obj);
                objMeshes.Add(Mesh.CreateFromSphere(sphere, 100, 100), obj.RenderMaterial);
            }

            return(true);
        }
Exemple #2
0
 public override bool WillBuildCustomMeshes(ViewportInfo vp, RhinoObject obj, RhinoDoc doc, Guid requestingPlugIn, DisplayPipelineAttributes attrs)
 {
     return(true);
 }
 public override void CreateWorld(RhinoDoc doc, ViewInfo viewInfo, DisplayPipelineAttributes displayPipelineAttributes)
 {
     Dpa = displayPipelineAttributes;
 }
Exemple #4
0
        public override BoundingBox BoundingBox(ViewportInfo vp, RhinoObject obj, RhinoDoc doc, Guid requestingPlugIn, DisplayPipelineAttributes attrs)
        {
            var bbox = base.BoundingBox(vp, obj, doc, requestingPlugIn, attrs);

            if (obj == null)
            {
                var sphere = new Sphere(new Point3d(0.0, 0.0, 0.0), 10.0);
                bbox.Union(sphere.BoundingBox);
            }
            else
            {
                var sphere = SphereFromObject(obj);
                bbox.Union(sphere.BoundingBox);
            }

            return(bbox);
        }
 public RenderEngine(Guid pluginId, uint docRuntimeSerialnumber, ViewInfo view, ViewportInfo vp, DisplayPipelineAttributes attributes, bool interactive)
 {
     SetKernelFlags();
     SupportClippingPlanes = RcCore.It.EngineSettings.RaytracedClippingPlanes;
     m_doc_serialnumber    = docRuntimeSerialnumber;
     View          = view;
     m_interactive = interactive;
     Database      = new ChangeDatabase(pluginId, this, m_doc_serialnumber, View, attributes, !m_interactive)
     {
         SupportClippingPlanes = SupportClippingPlanes
     };
     RegisterEventHandler();
 }