Пример #1
0
 public void RemoveLight(Light xiLight)
 {
     if (mLights.Contains(xiLight))
       {
     mLights.Remove(xiLight);
       }
 }
Пример #2
0
        private ThreeDeeViewer(MainForm xiMainForm)
            : base(xiMainForm)
        {
            mMainForm.KeyPreview = true;
              mMainForm.KeyPress += new KeyPressEventHandler(this.KeyPressHandle);
              mMainForm.FormClosing += new FormClosingEventHandler(mMainForm_FormClosing);
              mMainForm.Viewer3DRenderingSurface.MouseDown += new MouseEventHandler(Viewer3DRenderingSurface_MouseDown);
              mMainForm.Viewer3DRenderingSurface.MouseUp += new MouseEventHandler(Viewer3DRenderingSurface_MouseUp);
              mMainForm.Viewer3DRenderingSurface.MouseMove += new MouseEventHandler(Viewer3DRenderingSurface_MouseMove);
              mMainForm.ChunkTreeView.NodeMouseClick += new TreeNodeMouseClickEventHandler(ChunkTreeView_NodeMouseClick);

              mRenderer = new ImmediateModeRenderer();
              mRenderer.Attach(mMainForm.Viewer3DRenderingSurface);

              mScene = new Scene();
              mCamera = new Camera(80, 0.1, 1e10);
              mView = new MMEdViewerView(this, mScene, mCamera, mRenderer);
              mLight = new Light();
              mLight.DiffuseIntensity = 0.1;
              mLight.SpecularIntensity = 0.02;

              //add view mode menus:
              mOptionsMenu = new ToolStripMenuItem("3D");
              //
              PropertyController lMoveCtrl = new PropertyController(this, "MovementMode");
              mOptionsMenu.DropDownItems.AddRange(lMoveCtrl.CreateMenuItems());
              mOptionsMenu.DropDownItems.Add(new ToolStripSeparator());
              //
              PropertyController lLightCtrl = new PropertyController(this, "LightingMode");
              mOptionsMenu.DropDownItems.AddRange(lLightCtrl.CreateMenuItems());
              mOptionsMenu.DropDownItems.Add(new ToolStripSeparator());
              //
              PropertyController lNormCtrl = new PropertyController(this, "DrawNormalsMode");
              mOptionsMenu.DropDownItems.AddRange(lNormCtrl.CreateMenuItems());
              mOptionsMenu.DropDownItems.Add(new ToolStripSeparator());
              //
              PropertyController lTexModeCtrl = new PropertyController(this, "TextureMode");
              mOptionsMenu.DropDownItems.AddRange(lTexModeCtrl.CreateMenuItems());
              mOptionsMenu.DropDownItems.Add(new ToolStripSeparator());
              //
              PropertyController lSelMetaCtrl = new PropertyController(this, "SelectedMetadata");
              mOptionsMenu.DropDownItems.Add(lSelMetaCtrl.CreateToolStripComboBox());
              mOptionsMenu.DropDownItems.Add(new ToolStripSeparator());
              //
              mOptionsMenu.DropDownItems.Add(new ToolStripMenuItem("Hide all invisible Flats", null, new EventHandler(this.HideAllFlatsWithoutFlgDClicked)));
              //
              if (DEBUG_ALLOW_LOAD_SAVE_SCENE)
              {
            mOptionsMenu.DropDownItems.Add(new ToolStripSeparator());
            mOptionsMenu.DropDownItems.Add(new ToolStripMenuItem(
              "Save scene to XML...",
              null,
              SaveSceneToXML));
            mOptionsMenu.DropDownItems.Add(new ToolStripMenuItem(
              "Load scene from XML...",
              null,
              LoadSceneFromXML));
              }
              mOptionsMenu.DropDownItems.Add(new ToolStripMenuItem(
            "Export scene to VRML...",
            null,
            ExportSceneToVRML));
              //
              mMainForm.mMenuStrip.Items.Add(mOptionsMenu);
        }
Пример #3
0
 public void AddLight(Light xiLight)
 {
     mLights.Add(xiLight);
 }