예제 #1
0
 static RunExamples()
 {
     projectDir = GetProjectDir();
     if (File.Exists("License.lic"))
     {
         var lic = new Aspose.ThreeD.License();
         lic.SetLicense("License.lic");
     }
 }
예제 #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
        {
            this._logger = loggerFactory.CreateLogger <Startup>();
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                _logger.LogInformation("Starting in development mode");
            }
            else
            {
                _logger.LogInformation("Starting in production mode");
            }

            var aspose3DVersion = typeof(Aspose.ThreeD.Scene).Assembly.GetName().Version;

            _logger.LogInformation($"Aspose.3D Version : {aspose3DVersion}");

            app.UseStaticFiles();
            app.UseCookiePolicy();
            app.UseSession();
            app.UseRouting();
            app.UseCors("any");
            app.UseAuthentication();
            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
            //app.UseMvc();
            app.UseSwagger();
            app.UseSwaggerUI(option =>
            {
                option.ShowExtensions();
                option.SwaggerEndpoint("/swagger/v1/swagger.json", "AsposeApp V1");
            });
            var workingDirectory = Configuration["SystemConfig:WorkingDirectory"];

            Console.WriteLine("Working directory : {0}", workingDirectory);
            Console.WriteLine("Forum URL : {0}", Configuration["SystemConfig:ForumUrl"]);
            if (File.Exists("Aspose.Total.lic"))
            {
                _logger.LogInformation("Applying license");
                var lic = new Aspose.ThreeD.License();
                lic.SetLicense("Aspose.Total.lic");
            }
            else
            {
                _logger.LogInformation("License file is missing, enter evaluation mode.");
            }
        }
예제 #3
0
        public MainForm()
        {
            InitializeComponent();
            originalTitle = Text;
            string currentPath = ConfigKey.GetValue("Directory", null) as string;

            if (string.IsNullOrEmpty(currentPath))
            {
                currentPath = Directory.GetCurrentDirectory();
            }
            fileSystemTree1.CurrentPath       = currentPath;
            fileSystemTree1.DirectoryChanged += OnDirectoryChanged;
            renderView1.Scene         = scene;
            sceneHierarchy.RenderView = renderView1;

            contextMenu.Items.Add("Perspective").Click += delegate(object sender, EventArgs e)
            {
                Camera c = (Camera)renderView1.SelectedViewport.Frustum;
                c.ProjectionType = ProjectionType.Perspective;
                OnMovementChanged(btnStandardMovement, null);
            };
            Func <Vector3, Vector3, bool> ortho = delegate(Vector3 pos, Vector3 up)
            {
                Camera c = (Camera)renderView1.SelectedViewport.Frustum;
                OnMovementChanged(btnStandardMovement, null);
                c.ProjectionType = ProjectionType.Orthographic;
                c.Direction      = -pos;
                c.Up             = up;
                c.ParentNode.Transform.Translation = pos * c.ParentNode.Transform.Translation.Length;
                return(true);
            };

            contextMenu.Items.Add("Orthographic - Front").Click += delegate(object sender, EventArgs e)
            {
                ortho(new Vector3(1, 0, 0), Vector3.YAxis);
            };
            contextMenu.Items.Add("Orthographic - Back").Click += delegate(object sender, EventArgs e)
            {
                ortho(new Vector3(-1, 0, 0), Vector3.YAxis);
            };
            contextMenu.Items.Add("Orthographic - Left").Click += delegate(object sender, EventArgs e)
            {
                ortho(new Vector3(0, 0, 1), Vector3.YAxis);
            };
            contextMenu.Items.Add("Orthographic - Right").Click += delegate(object sender, EventArgs e)
            {
                ortho(new Vector3(0, 0, -1), Vector3.YAxis);
            };
            contextMenu.Items.Add("Orthographic - Top").Click += delegate(object sender, EventArgs e)
            {
                ortho(new Vector3(0, 1, 0), Vector3.XAxis);
            };
            contextMenu.Items.Add("Orthographic - Bottom").Click += delegate(object sender, EventArgs e)
            {
                ortho(new Vector3(0, -1, 0), Vector3.XAxis);
            };
            renderView1.ContextMenuStrip = contextMenu;

            if (File.Exists("Aspose.3D.lic"))
            {
                Aspose.ThreeD.License lic = new Aspose.ThreeD.License();
                lic.SetLicense("Aspose.3D.lic");
            }
            WindowState = FormWindowState.Maximized;
            renderView1.SceneUpdated("");
            sceneHierarchy.UpdateHierarchy(scene);
        }