Exemple #1
0
		public StudioScene(Viewport viewport) : base(viewport)
		{
			_drawingBook = new DockBook(viewport);
			Root = _drawingBook;
			
			new StudioController(this);
		}
		public DrawingScene(Viewport viewport)
			: base(viewport)
		{
			Camera.SetViewDirection(ViewDirection.Standard);
			
			_controller = new DrawingController(this);
			
			EnableViewInteractor = true;
		}
Exemple #3
0
		public Plot3dScene(Viewport viewport) : base(viewport)
		{
			Name = "Plot 3D";
			
			TestAxes3D axes = new TestAxes3D();
			RenderList.AddActor(axes);

			PrimaryInteractor = new PlotInteractor(this);
			Camera.SetViewDirection(ViewDirection.Standard);
			new PlotController(this);
		}
Exemple #4
0
		public Plot2dScene(Viewport viewport) : base(viewport)
		{
			Name = "Plot 2D";
			
			TestAxes2D axes = new TestAxes2D();
			RenderList.AddActor(axes);
			
			Camera.Projection = Projection.Parallel;
			PrimaryInteractor = new PlotInteractor(this);
			Use2dInteraction = true;
			Camera.SetViewDirection(ViewDirection.Front);
			new PlotController(this);
		}
Exemple #5
0
		public MwxScene(Viewport viewport) : base(viewport)
		{
			Name = "Mwx";
			
			var mwxDemo = new MwxDemo() {
				Name = "Object Name",
				Description = "This is the description"
			};
			
			
			var propPanel = new PropertyPanel(mwxDemo);
			var pane = new OverlayPane(propPanel);
			RenderList.AddOverlay(pane);
			pane.Origin = new MonoWorks.Base.Coord(200, 200);
		}
		public ViewportAdapter()
			: base()
		{
			InitializeContexts();

			this.DoubleBuffered = false;

			// create the tooltip
			_toolTip = new ToolTip();
			_toolTip.SetToolTip(this, "");

			Viewport = new Viewport(this);

			InitializeGL();
		}
Exemple #7
0
		public CardScene(Viewport viewport) : base(viewport)
		{
			Name = "Cards";
			Mwx = new MwxSource(ResourceHelper.GetStream("cards.mwx"));
			
			var book = Mwx.Get<CardBook>("Book");
			RenderList.AddActor(book);
			book.ComputeGeometry();
			
			var interactor = new CardInteractor<DemoCard>(this) { CardBook = book };
			PrimaryInteractor = interactor;
			interactor.EditInteractor = new SingleActorInteractor<DemoCard>(this);

			var sceneInfo = new SceneInfoOverlay(this);
			RenderList.AddOverlay(sceneInfo);
		}
Exemple #8
0
		public Scene(Viewport viewport)
		{
			Viewport = viewport;
			
			Camera = new Camera(this);
			
			RenderManager = new RenderManager();
			
			// initialize the interactors
			ViewInteractor = new ViewInteractor(this);
			OverlayInteractor = new OverlayInteractor(this);
			EnableViewInteractor = true;
			
			Animator = new Animator(this);
			
			ViewportOffset = new Coord();
		}
Exemple #9
0
		public DockSpace(Viewport viewport) : base(viewport)
		{
			foreach (var side in Enum.GetValues(typeof(Side)))
			{
				var overlay = new OverlayPane();
				_gutterOverlays[(Side)side] = overlay;
				RenderList.AddOverlay(overlay);
			}
			
			// create the gutters
			_gutters[Side.E] = new Stack(Orientation.Vertical) { Padding = 0 };
			_gutters[Side.S] = new Stack(Orientation.Horizontal) { Padding = 0 };
			_gutters[Side.W] = new Stack(Orientation.Vertical) { Padding = 0 };
			_gutters[Side.N] = new Stack(Orientation.Horizontal) { Padding = 0 };
			
			foreach (var side in Enum.GetValues(typeof(Side)))
				_gutterOverlays[(Side)side].Control = _gutters[(Side)side];
			
			EnableViewInteractor = false;

			PrimaryInteractor = new DockInteractor(this);
		}
		public ControlsScene(Viewport viewport) : base(viewport)
		{
			Name = "Controls";
			
			// add an ActorInteractor to the viewport
			PrimaryInteractor = new ActorInteractor(this);
			
			
			// load the mwx file
			var mwx = new MwxSource(ResourceHelper.GetStream("demo.mwx"));
			
			
			// northeast buttons
			var cornerButtons = new CornerButtons(Corner.NE);
			//			cornerButtons.Image1 = Image.GetIcon("apply", 22);
			cornerButtons.Action1 += delegate(object sender, EventArgs e) {
				   Console.WriteLine("clicked apply");
			   };
			//			cornerButtons.Image2 = Image.GetIcon("cancel", 22);
			cornerButtons.Action2 += delegate(object sender, EventArgs e) {
				   Console.WriteLine("clicked cancel");
			   };
			var cornerAnchor = new AnchorPane(cornerButtons, AnchorLocation.NE);
			RenderList.AddOverlay(cornerAnchor);
			
			
			// northwest buttons
			cornerButtons = new CornerButtons(Corner.NW);
			//			cornerButtons.Image1 = Image.GetIcon("zoom-in", 22);
			cornerButtons.Action1 += delegate(object sender, EventArgs e) {
				  Console.WriteLine("clicked zoom-in");
			  };
			//			cornerButtons.Image2 = Image.GetIcon("zoom-out", 22);
			cornerButtons.Action2 += delegate(object sender, EventArgs e) {
				  Console.WriteLine("clicked zoom-out");
			  };
			cornerAnchor = new AnchorPane(cornerButtons, AnchorLocation.NW);
			RenderList.AddOverlay(cornerAnchor);
			
			
			// east control stack
			var stack = new Stack();
			stack.Orientation = Orientation.Vertical;
			
			var image = new Image(ResourceHelper.GetStream("plugin.png"));
			//			var image = Image.GetIcon("apply", 48);
			var button = new Button("Apply", image) { ButtonStyle = ButtonStyle.ImageOverLabel };
			button.Clicked += delegate(object sender, EventArgs e) {
				 Console.WriteLine("clicked apply");
			 };
			stack.AddChild(button);
			
			//			image = Image.GetIcon("cancel", 48);
			button = new Button("Cancel", image) { ButtonStyle = ButtonStyle.ImageOverLabel };
			button.Clicked += delegate(object sender, EventArgs e) {
				 Console.WriteLine("clicked cancel");
			 };
			stack.AddChild(button);
			
			var menuBox = new MenuBox();
			menuBox.Parse("One,Two,Three,Four");
			stack.AddChild(menuBox);
			
			var toolAnchor = new AnchorPane(stack, AnchorLocation.E);
			RenderList.AddOverlay(toolAnchor);
			
			
			// the controls dialog
			var controlsDialog = mwx.Get<Dialog>("controls-dialog");
			
			// attach the slider to its value label
			var slider = mwx.Get<Slider>("slider");
			var sliderValue = mwx.Get<Label>("sliderValue");
			sliderValue.Body = slider.Value.ToString("##.##");
			slider.ValueChanged += delegate(object sender, DoubleChangedEvent evt)
			{
				sliderValue.Body = evt.NewValue.ToString("##.##");
			};
			
			// attach the ForceStep checkbox to the slider
			var forceStepCheck = mwx.Get<CheckBox>("forceStepCheck");
			forceStepCheck.CheckChanged += delegate(object sender, BoolChangedEvent evt)
			{
				slider.ForceStep = evt.NewValue;
			};
			
			// floating toolbar
			var toolbar = new ToolBar();
			toolbar.Orientation = Orientation.Vertical;
			toolbar.ButtonStyle = ButtonStyle.ImageNextToLabel;
			
			//			image = Image.GetIcon("controls-dialog", 48);
			button = new Button("General Controls", image);
			button.Clicked += delegate(object sender, EventArgs e) { 
				ShowModal(controlsDialog);
			};
			toolbar.AddChild(button);
			
			
			// the progress dialog
			var progressDialog = mwx.Get<Dialog>("progress-dialog");
			
			// attach the slider to the progress bars
			var progressSlider = mwx.Get<Slider>("progressSlider");
			var progressBarH = mwx.Get<ProgressBar>("progressBarH");
			var progressBarV = mwx.Get<ProgressBar>("progressBarV");
			var progressDial = mwx.Get<ProgressDial>("progressDial");
			progressBarH.Value = progressSlider.Value;
			progressBarV.Value = progressSlider.Value;
			progressDial.Value = progressSlider.Value;
			progressSlider.ValueChanged += delegate(object sender, DoubleChangedEvent evt)
			{
				progressBarH.Value = progressSlider.Value;
				progressBarV.Value = progressSlider.Value;
				progressDial.Value = progressSlider.Value;
			};
			
			image = new Image(ResourceHelper.GetStream("radial-progress.png"));
			button = new Button("Progress Indicators", image);
			button.Clicked += delegate(object sender, EventArgs e) { 
				ShowModal(progressDialog);
			};
			toolbar.AddChild(button);
			
			// the tree view dialog
			var treeDialog = mwx.Get<Dialog>("tree-dialog");
			
			image = new Image(ResourceHelper.GetStream("view-tree.png"));
			button = new Button("Tree View", image);
			button.Clicked += delegate(object sender, EventArgs e) { 
				ShowModal(treeDialog);
			};
			toolbar.AddChild(button);
			
			var toolActor = new ActorPane(toolbar);
			toolActor.Normal = new Vector(0, -1, 0);
			RenderList.AddActor(toolActor);
			toolActor.ComputeGeometry();
			
			
			// the ring bar
			var ringBar = mwx.Get<RingBar>("ring-bar");
			toolActor = new ActorPane(ringBar);
			toolActor.Normal = new Vector(1, 0, 0);
			toolActor.Origin.Y = -192;
			toolActor.XAxis = new Vector(0, 1, 0);
			RenderList.AddActor(toolActor);
			toolActor.ComputeGeometry();

			mwx.Get<RingButton>("forward-button").Clicked += delegate {
				Console.WriteLine("forward pushed");
			};
			mwx.Get<RingButton>("backward-button").Clicked += delegate {
				Console.WriteLine("backward pushed");
			};
			mwx.Get<RingButton>("play-button").Clicked += delegate {
				Console.WriteLine("play pushed");
			};
			mwx.Get<RingButton>("pause-button").Clicked += delegate {
				Console.WriteLine("pause pushed");
			};


			var sceneInfo = new SceneInfoOverlay(this);
			RenderList.AddOverlay(sceneInfo);

			Camera.SetViewDirection(ViewDirection.Standard);
		}
		public ViewportAdapter(QWidget parent) : base(parent)
		{
			Viewport = new Viewport(this);
			SetMouseTracking(true);
			GrabKeyboard();
		}
Exemple #12
0
		public DrawingScene(Viewport viewport, Drawing drawing) : this(viewport)
		{
			Drawing = drawing;
		}
Exemple #13
0
		public DockStack(Viewport viewport) : base(viewport)
		{
		}
		public SceneContainer(Viewport viewport) : base(viewport)
		{
		}
		public DockContainer(Viewport viewport) : base(viewport)
		{

		}