Exemplo n.º 1
0
        private bool MeshIsTooBigToLoad(string fileLocation)
        {
            if (Is32Bit())
            {
                long estimatedMemoryUse = 0;
                if (File.Exists(fileLocation))
                {
                    estimatedMemoryUse = MeshFileIo.GetEstimatedMemoryUse(fileLocation);

                    if (OsInformation.OperatingSystem == OSType.Android)
                    {
                        if (estimatedMemoryUse > tooBigAndroid)
                        {
                            return(true);
                        }
                    }
                    else
                    {
                        if (estimatedMemoryUse > tooBigDesktop)
                        {
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
        private static RenderType GetRenderType(string fileLocation)
        {
            return(RenderType.ORTHOGROPHIC);

            if (Is32Bit())
            {
                long estimatedMemoryUse = 0;
                if (File.Exists(fileLocation))
                {
                    estimatedMemoryUse = MeshFileIo.GetEstimatedMemoryUse(fileLocation);

                    if (OsInformation.OperatingSystem == OSType.Android)
                    {
                        if (estimatedMemoryUse > renderOrthoAndroid)
                        {
                            return(RenderType.ORTHOGROPHIC);
                        }
                    }
                    else
                    {
                        if (estimatedMemoryUse > renderOrthoDesktop)
                        {
                            return(RenderType.ORTHOGROPHIC);
                        }
                    }
                }
            }

            return(RenderType.RAY_TRACE);
        }
Exemplo n.º 3
0
        private static RenderType GetRenderType(string fileLocation)
        {
            if (UserSettings.Instance.get("ThumbnailRenderingMode") == "raytraced")
            {
                if (Is32Bit())
                {
                    long estimatedMemoryUse = 0;
                    if (File.Exists(fileLocation))
                    {
                        estimatedMemoryUse = MeshFileIo.GetEstimatedMemoryUse(fileLocation);

                        if (OsInformation.OperatingSystem == OSType.Android)
                        {
                            if (estimatedMemoryUse > renderOrthoAndroid)
                            {
                                return(RenderType.ORTHOGROPHIC);
                            }
                        }
                        else
                        {
                            if (estimatedMemoryUse > renderOrthoDesktop)
                            {
                                return(RenderType.ORTHOGROPHIC);
                            }
                        }
                    }
                }

                return(RenderType.RAY_TRACE);
            }

            return(RenderType.ORTHOGROPHIC);
        }
Exemplo n.º 4
0
        public void AddItem(PrintItemWrapper item, int indexToInsert = -1, ValidateSizeOn32BitSystems checkSize = ValidateSizeOn32BitSystems.Required)
        {
            if (Is32Bit())
            {
                // Check if the part we are adding is BIG. If it is warn the user and
                // possibly don't add it
                bool warnAboutFileSize  = false;
                long estimatedMemoryUse = 0;
                if (File.Exists(item.FileLocation) &&
                    checkSize == ValidateSizeOn32BitSystems.Required)
                {
                    estimatedMemoryUse = MeshFileIo.GetEstimatedMemoryUse(item.FileLocation);

                    if (OsInformation.OperatingSystem == OSType.Android)
                    {
                        if (estimatedMemoryUse > 100000000)
                        {
                            warnAboutFileSize = true;
                        }
                    }
                    else
                    {
                        if (estimatedMemoryUse > 500000000)
                        {
                            warnAboutFileSize = true;
                        }
                    }
                }

                if (warnAboutFileSize)
                {
                    partUnderConsideration = item;
                    // Show a dialog and only load the part to the queue if the user clicks yes.
                    UiThread.RunOnIdle(() =>
                    {
                        string memoryWarningMessage = "Are you sure you want to add this part ({0}) to the Queue?\nThe 3D part you are trying to load may be too complicated and cause performance or stability problems.\n\nConsider reducing the geometry before proceeding.".Localize().FormatWith(item.Name);
                        StyledMessageBox.ShowMessageBox(UserSaidToAllowAddToQueue, memoryWarningMessage, "File May Cause Problems".Localize(), StyledMessageBox.MessageType.YES_NO, "Add To Queue", "Do Not Add");
                        // show a dialog to tell the user there is an update
                    });
                    return;
                }
                else
                {
                    DoAddItem(item, indexToInsert);
                    //copyQueueItemToQueueItemFolder(item.FileLocation);
                }
            }
            else
            {
                DoAddItem(item, indexToInsert);
                //copyQueueItemToQueueItemFolder(item.FileLocation);
            }
        }