Ejemplo n.º 1
0
 private void FormMain_Load(object sender, EventArgs e)
 {
     //this.scientificCanvas.Scene.RootObject.Children.ItemAdded += RootObject.Children_ItemAdded;
     //this.scientificCanvas.Scene.RootObject.Children.ItemRemoved += RootObject.Children_ItemRemoved;
     {
         SceneObject groundObj = SceneObjectFactory.GetBuildInSceneObject(BuildInSceneObject.Ground);
         {
             BoundingBoxRenderer boxRenderer = groundObj.Renderer.GetBoundingBoxRenderer();
             SceneObject         boxObj      = boxRenderer.WrapToSceneObject(new ModelScaleScript());
             groundObj.Children.Add(boxObj);
         }
         this.scientificCanvas.Scene.RootObject.Children.Add(groundObj);
         //TreeNode groundTreeNode = this.objectsTreeView.Nodes.Add(groundObj.Name);
         //groundTreeNode.Tag = groundObj;
         TreeNode groundTreeNode = DumpTreeNode(groundObj);
         this.objectsTreeView.Nodes.Add(groundTreeNode);
     }
     {
         SceneObject axisObj = SceneObjectFactory.GetBuildInSceneObject(BuildInSceneObject.Axis);
         {
             BoundingBoxRenderer boxRenderer = axisObj.Renderer.GetBoundingBoxRenderer();
             SceneObject         boxObj      = boxRenderer.WrapToSceneObject(new ModelScaleScript());
             axisObj.Children.Add(boxObj);
         }
         this.scientificCanvas.Scene.RootObject.Children.Add(axisObj);
         //TreeNode axisTreeNode = this.objectsTreeView.Nodes.Add(axisObj.Name);
         //axisTreeNode.Tag = axisObj;
         TreeNode axisTreeNode = DumpTreeNode(axisObj);
         this.objectsTreeView.Nodes.Add(axisTreeNode);
         this.objectsTreeView.ExpandAll();
     }
     Application.Idle += Application_Idle;
 }
Ejemplo n.º 2
0
        private void addSceneObjectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BuildInSceneObject type = (BuildInSceneObject)Enum.Parse(typeof(BuildInSceneObject),
                                                                     (sender as ToolStripItem).Text);
            SceneObject obj = SceneObjectFactory.GetBuildInSceneObject(type);

            obj.Children.ItemAdded   += Children_ItemAdded;
            obj.Children.ItemRemoved += Children_ItemRemoved;
            var node = new TreeNode(obj.ToString());

            node.Tag = obj;
            obj.Tag  = node;
            this.scene.RootObject.Children.Add(obj);
            this.treeView1.Nodes.Add(node);
        }
Ejemplo n.º 3
0
        void FormMain_Load(object sender, EventArgs e)
        {
            //this.scientificCanvas.Scene.RootObject.Children.ItemAdded += RootObject.Children_ItemAdded;
            //this.scientificCanvas.Scene.RootObject.Children.ItemRemoved += RootObject.Children_ItemRemoved;
            SceneObject ground = SceneObjectFactory.GetBuildInSceneObject(BuildInSceneObject.Ground);

            this.scientificCanvas.Scene.RootObject.Children.Add(ground);
            TreeNode groundTreeNode = this.objectsTreeView.Nodes.Add(ground.Name);

            groundTreeNode.Tag = ground;
            SceneObject axis = SceneObjectFactory.GetBuildInSceneObject(BuildInSceneObject.Axis);

            this.scientificCanvas.Scene.RootObject.Children.Add(axis);
            TreeNode axisTreeNode = this.objectsTreeView.Nodes.Add(axis.Name);

            axisTreeNode.Tag = axis;

            Application.Idle += Application_Idle;
        }