コード例 #1
0
ファイル: PanelBase.cs プロジェクト: RugCode/drg-pt
		protected void AddSlider(Panel panel, string text,
								float min, float max, float value, SliderValueChangedEvent changed,
								ref int index, ref int verticalOffset,
								out Slider slider, out DynamicLabel valueLabel)
		{
			Label label = new Label();
			label.TextAlign = System.Drawing.ContentAlignment.TopLeft;
			label.FixedSize = true;
			label.Size = new System.Drawing.Size(this.Size.Width - 100, 15);
			label.Location = new System.Drawing.Point(0, verticalOffset);
			label.Text = text;
			label.FontType = FontType.Small;
			label.IsVisible = true;
			label.Padding = new System.Windows.Forms.Padding(5);
			label.RelitiveZIndex = index++;
			panel.Controls.Add(label);

			valueLabel = new DynamicLabel();
			valueLabel.TextAlign = System.Drawing.ContentAlignment.TopRight;
			valueLabel.FixedSize = true;
			valueLabel.Size = new System.Drawing.Size(95, 15);
			valueLabel.Location = new System.Drawing.Point(this.Size.Width - 100, verticalOffset);
			valueLabel.MaxLength = 8;
			valueLabel.Text = value.ToString("N2");
			valueLabel.FontType = FontType.Small;
			valueLabel.IsVisible = true;
			valueLabel.Padding = new System.Windows.Forms.Padding(5);
			valueLabel.RelitiveZIndex = index++;
			panel.Controls.Add(valueLabel);

			verticalOffset += 20;

			slider = new Slider();
			slider.MinValue = min;
			slider.MaxValue = max;
			slider.Size = new System.Drawing.Size(this.Size.Width - 10, 15);
			slider.Location = new System.Drawing.Point(5, verticalOffset);
			slider.IsVisible = true;
			slider.Value = value;
			slider.ValueChanged += changed;
			slider.RelitiveZIndex = index++;
			panel.Controls.Add(slider);

			verticalOffset += 15;
		}
コード例 #2
0
ファイル: ParticlesPanel.cs プロジェクト: RugCode/drg-pt
		public override void Initiate()
		{			
			int index = 1;

			Label label = new Label();
			label.TextAlign = System.Drawing.ContentAlignment.TopLeft;
			label.FixedSize = true;
			label.Size = new System.Drawing.Size(290, 30);
			label.Location = new System.Drawing.Point(0, 5);
			label.Text = "Particle Settings";
			label.FontType = FontType.Heading;
			label.IsVisible = true;
			label.Padding = new System.Windows.Forms.Padding(5);
			label.RelitiveZIndex = index++;

			this.Controls.Add(label);

			int verticalOffset = 35;

			List<object> objects = new List<object>();
			List<string> strings = new List<string>(); 

			for (int i = 0; i < ParticleStaticObjects.AtomPropertiesDefinition.Count; i++)
			{
				objects.Add(i);
				strings.Add(ParticleStaticObjects.AtomPropertiesDefinition.Lookup[i].Name); 
			}

			AddButtonSet(this, "Particle Type",
						 objects.ToArray(),
						 strings.ToArray(), new EventHandler(particleTypeButton_Click), ref index, ref verticalOffset, m_ParticleTypeButtons);

			m_IsEnabled = new ToggleButton();
			m_IsEnabled.Text = "Is Enabled";
			m_IsEnabled.FontType = FontType.Regular;
			m_IsEnabled.Size = new System.Drawing.Size(Size.Width - 10, 20);
			m_IsEnabled.Location = new System.Drawing.Point(5, verticalOffset);
			m_IsEnabled.IsVisible = true;
			m_IsEnabled.Click += new EventHandler(IsEnabled_Click);
			m_IsEnabled.RelitiveZIndex = index++;

			this.Controls.Add(m_IsEnabled);

			verticalOffset += 25;

			m_AttractiveOrRepulsive = new ToggleButton();
			m_AttractiveOrRepulsive.Text = "Attractive";
			m_AttractiveOrRepulsive.FontType = FontType.Regular;
			m_AttractiveOrRepulsive.Size = new System.Drawing.Size(Size.Width - 10, 20);
			m_AttractiveOrRepulsive.Location = new System.Drawing.Point(5, verticalOffset);
			m_AttractiveOrRepulsive.IsVisible = true;
			m_AttractiveOrRepulsive.Click += new EventHandler(AttractiveOrRepulsive_Click);
			m_AttractiveOrRepulsive.RelitiveZIndex = index++;

			this.Controls.Add(m_AttractiveOrRepulsive);

			verticalOffset += 25;

			m_IsSoundOn = new ToggleButton();
			m_IsSoundOn.Text = "Sound On";
			m_IsSoundOn.FontType = FontType.Regular;
			m_IsSoundOn.Size = new System.Drawing.Size(Size.Width - 10, 20);
			m_IsSoundOn.Location = new System.Drawing.Point(5, verticalOffset);
			m_IsSoundOn.IsVisible = true;
			m_IsSoundOn.Click += new EventHandler(IsSoundOn_Click);
			m_IsSoundOn.RelitiveZIndex = index++;

			this.Controls.Add(m_IsSoundOn);

			verticalOffset += 25;

			m_AttractiveOrRepulsive.Value = ParticleStaticObjects.AtomPropertiesDefinition.Lookup[m_ActiveIndex].AttractiveOrRepulsive > 0;
			m_IsEnabled.Value = !ParticleStaticObjects.AtomPropertiesDefinition.Lookup[m_ActiveIndex].Enabled;
			m_IsSoundOn.Value = !ParticleStaticObjects.AtomPropertiesDefinition.Lookup[m_ActiveIndex].IsSoundOn;

			this.Size = new System.Drawing.Size(this.Size.Width, verticalOffset + 5);
		}
コード例 #3
0
ファイル: PanelBase.cs プロジェクト: RugCode/drg-pt
		protected void AddPathControl(Panel panel, string text,
								string value, EventHandler openFileDialog, EventHandler openLocation,
								ref int index, ref int verticalOffset,
								out DynamicLabel valueLabel)
		{
			Label label = new Label();
			label.TextAlign = System.Drawing.ContentAlignment.TopLeft;
			label.FixedSize = true;
			label.Size = new System.Drawing.Size(this.Size.Width - 100, 15);
			label.Location = new System.Drawing.Point(0, verticalOffset);
			label.Text = text;
			label.FontType = FontType.Small;
			label.IsVisible = true;
			label.Padding = new System.Windows.Forms.Padding(5);
			label.RelitiveZIndex = index++;
			panel.Controls.Add(label);

			verticalOffset += 20;

			valueLabel = new DynamicLabel();
			valueLabel.TextAlign = System.Drawing.ContentAlignment.TopLeft;
			valueLabel.FixedSize = true;
			valueLabel.Size = new System.Drawing.Size(this.Size.Width - 70, 15);
			valueLabel.Location = new System.Drawing.Point(5, verticalOffset);
			valueLabel.MaxLength = 100;
			valueLabel.Text = value;
			valueLabel.FontType = FontType.Small;
			valueLabel.IsVisible = true;
			valueLabel.Padding = new System.Windows.Forms.Padding(5);
			valueLabel.RelitiveZIndex = index++;
			panel.Controls.Add(valueLabel);

			Button openFileDialogButton = new Button();
			openFileDialogButton.Size = new System.Drawing.Size(25, 20);
			openFileDialogButton.Location = new System.Drawing.Point(this.Size.Width - 65, verticalOffset);
			openFileDialogButton.Text = "...";
			openFileDialogButton.FontType = FontType.Small;
			openFileDialogButton.IsVisible = true;
			openFileDialogButton.RelitiveZIndex = index++;
			openFileDialogButton.Click += openFileDialog; 
			panel.Controls.Add(openFileDialogButton);

			Button openLocationButton = new Button();
			openLocationButton.Size = new System.Drawing.Size(30, 20);
			openLocationButton.Location = new System.Drawing.Point(this.Size.Width - 35, verticalOffset);
			openLocationButton.Text = "Open";
			openLocationButton.FontType = FontType.Small;
			openLocationButton.IsVisible = true;
			openLocationButton.RelitiveZIndex = index++;
			openLocationButton.Click += openLocation;
			panel.Controls.Add(openLocationButton);

			verticalOffset += 25;
		}
コード例 #4
0
ファイル: KinectPanel.cs プロジェクト: RugCode/drg-pt
		public override void Initiate()
		{
			int index = 1;

			Label label = new Label();
			label.TextAlign = System.Drawing.ContentAlignment.TopLeft;
			label.FixedSize = true;
			label.Size = new System.Drawing.Size(290, 30);
			label.Location = new System.Drawing.Point(0, 5);
			label.Text = "Camera Settings";
			label.FontType = FontType.Heading;
			label.IsVisible = true;
			label.Padding = new System.Windows.Forms.Padding(5);
			label.RelitiveZIndex = index++;

			this.Controls.Add(label);

			int verticalOffset = 35;

			// KinectImageMode { Color, RawDepth, DepthBackgroundImage, DepthBackgroundRemoved }
			AddButtonSet(this, "Image Mode",
						 new object[] { KinectImageMode.Color, KinectImageMode.RawDepth, KinectImageMode.DepthBackgroundImage, KinectImageMode.DepthBackgroundRemoved },
						 new string[] { "Color", "Raw", "Back", "Final" }, new EventHandler(kinectImageModeButton_Click), ref index, ref verticalOffset, m_KinectImageModeButtons);

			ToggleButton UseTestImageButton = new ToggleButton();
			UseTestImageButton.Text = "Use Test Image";
			UseTestImageButton.FontType = FontType.Regular;
			UseTestImageButton.Size = new System.Drawing.Size(290, 20);
			UseTestImageButton.Location = new System.Drawing.Point(5, verticalOffset);
			UseTestImageButton.IsVisible = true;
			UseTestImageButton.Click += new EventHandler(UseTestImageButton_Click);
			UseTestImageButton.RelitiveZIndex = index++;

			this.Controls.Add(UseTestImageButton);

			verticalOffset += 25;		

			AddSlider(this, "Elevation Angle",
						-27, 27, (float)ArtworkStaticObjects.Options.Kinect.ElevationAngle,
						new SliderValueChangedEvent(m_ElevationAngleSlider_ValueChanged),
						ref index, ref verticalOffset,
						out m_ElevationAngleSlider, out m_ElevationAngleValueLabel);

			AddSlider(this, "Near Clipping Plane",
						0, 8000, (float)ArtworkStaticObjects.Options.Kinect.NearClippingPlane,
						new SliderValueChangedEvent(m_NearClippingPlaneSlider_ValueChanged),
						ref index, ref verticalOffset,
						out m_NearClippingPlaneSlider, out m_NearClippingPlaneLabel);

			AddSlider(this, "Far Clipping Plane",
						0, 8000, (float)ArtworkStaticObjects.Options.Kinect.FarClippingPlane,
						new SliderValueChangedEvent(m_FarClippingPlaneSlider_ValueChanged),
						ref index, ref verticalOffset,
						out m_FarClippingPlaneSlider, out m_FarClippingPlaneLabel);

			AddSlider(this, "Noise Tolerance",
						0, 100, (float)ArtworkStaticObjects.Options.Kinect.NoiseTolerance,
						new SliderValueChangedEvent(m_NoiseToleranceSlider_ValueChanged),
						ref index, ref verticalOffset,
						out m_NoiseToleranceSlider, out m_NoiseToleranceValueLabel);
			
			AddSlider(this, "Background Calibaration Frames",
						0, 10000, (float)ArtworkStaticObjects.Options.Kinect.BackgroundCalibarationFrames,
						new SliderValueChangedEvent(m_BackgroundCalibarationFramesSlider_ValueChanged),
						ref index, ref verticalOffset,
						out m_BackgroundCalibarationFramesSlider, out m_BackgroundCalibarationFramesValueLabel);
			

			verticalOffset += 10;

			m_BackgroundProgressBar = new ProgressBar();

			m_BackgroundProgressBar.MaxValue = (float)ArtworkStaticObjects.Options.Kinect.BackgroundCalibarationFrames;
			m_BackgroundProgressBar.Size = new System.Drawing.Size(290, 15);
			m_BackgroundProgressBar.Location = new System.Drawing.Point(5, verticalOffset);
			m_BackgroundProgressBar.IsVisible = true;
			m_BackgroundProgressBar.Value = 0;
			m_BackgroundProgressBar.RelitiveZIndex = index++;
			this.Controls.Add(m_BackgroundProgressBar);

			verticalOffset += 25;

			Button SampleBackgroundButton = new Button();
			SampleBackgroundButton.Text = "Calibarate Background";
			SampleBackgroundButton.FontType = FontType.Regular;
			SampleBackgroundButton.Size = new System.Drawing.Size(290, 20);
			SampleBackgroundButton.Location = new System.Drawing.Point(5, verticalOffset);
			SampleBackgroundButton.IsVisible = true;
			SampleBackgroundButton.Click += new EventHandler(SampleBackgroundButton_Click);
			SampleBackgroundButton.RelitiveZIndex = index++;

			verticalOffset += 25;			 

			this.Controls.Add(SampleBackgroundButton);

			this.Size = new System.Drawing.Size(this.Size.Width, verticalOffset + 5);
		}
コード例 #5
0
ファイル: SpeedTestPanel.cs プロジェクト: RugCode/drg-pt
		public override void Initiate()
		{
			int index = 1;

			Label label = new Label();
			label.TextAlign = System.Drawing.ContentAlignment.TopLeft;
			label.FixedSize = true;
			label.Size = new System.Drawing.Size(this.Size.Width - 10, 30);
			label.Location = new System.Drawing.Point(0, 5);
			label.Text = "Ensemble Tests";
			label.FontType = FontType.Heading;
			label.IsVisible = true;
			label.Padding = new System.Windows.Forms.Padding(5);
			label.RelitiveZIndex = index++;

			this.Controls.Add(label);

			int verticalOffset = 35;

			Button button = new Button();
			button.Size = new System.Drawing.Size(this.Size.Width - 10, 20);
			button.Location = new System.Drawing.Point(5, verticalOffset);
			button.Text = "Start Tests";
			button.FontType = FontType.Small;
			button.IsVisible = true;
			button.RelitiveZIndex = index++;
			button.Click += new EventHandler(button_Click);
			this.Controls.Add(button);

			verticalOffset += 25;

			m_ProgressBar = new ProgressBar();
			m_ProgressBar.Size = new System.Drawing.Size(this.Size.Width - 10, 20);
			m_ProgressBar.Location = new System.Drawing.Point(5, verticalOffset);
			m_ProgressBar.IsVisible = true;
			m_ProgressBar.RelitiveZIndex = index++;
			m_ProgressBar.Value = 0;
			m_ProgressBar.MaxValue = 100;
			this.Controls.Add(m_ProgressBar);

			verticalOffset += 25;

			m_SpeedGraph = new MultiGraph();

			m_SpeedGraph.Location = new System.Drawing.Point(5, verticalOffset);
			m_SpeedGraph.Size = new System.Drawing.Size(this.Size.Width - 40, 200);
			m_SpeedGraph.IsVisible = true;
			m_SpeedGraph.RelitiveZIndex = index++;

			this.Controls.Add(m_SpeedGraph);

			m_OrginalGraph = new SubGraph(100);
			m_OrginalGraph.IsVisible = true;
			m_OrginalGraph.LineColor = new SlimDX.Color4(1f, 1f, 0.3f, 0.3f);
			m_OrginalGraph.MaxValue = 0.1f;
			m_OrginalGraph.Scrolling = false;
			m_SpeedGraph.Graphs.Add(m_OrginalGraph);

			m_OptoGraph = new SubGraph(100);
			m_OptoGraph.IsVisible = true;
			m_OptoGraph.LineColor = new SlimDX.Color4(1f, 0.3f, 1f, 0.3f);
			m_OptoGraph.MaxValue = 0.1f;
			m_OptoGraph.Scrolling = false;
			m_SpeedGraph.Graphs.Add(m_OptoGraph);


			m_OptoGraph2 = new SubGraph(100);
			m_OptoGraph2.IsVisible = true;
			m_OptoGraph2.LineColor = new SlimDX.Color4(1f, 1f, 1f, 0.3f);
			m_OptoGraph2.MaxValue = 0.1f;
			m_OptoGraph2.Scrolling = false;
			m_SpeedGraph.Graphs.Add(m_OptoGraph2);


			m_GraphMax = new DynamicLabel();
			m_GraphMax.TextAlign = System.Drawing.ContentAlignment.TopLeft;
			m_GraphMax.FixedSize = true;
			m_GraphMax.Size = new System.Drawing.Size(30, 15);
			m_GraphMax.Location = new System.Drawing.Point(this.Size.Width - 35, verticalOffset);
			m_GraphMax.MaxLength = 10;
			m_GraphMax.Text = "0";
			m_GraphMax.FontType = FontType.Small;
			m_GraphMax.IsVisible = true;
			m_GraphMax.Padding = new System.Windows.Forms.Padding(5);
			m_GraphMax.RelitiveZIndex = index++;
			this.Controls.Add(m_GraphMax);


			m_GraphMin = new DynamicLabel();
			m_GraphMin.TextAlign = System.Drawing.ContentAlignment.TopLeft;
			m_GraphMin.FixedSize = true;
			m_GraphMin.Size = new System.Drawing.Size(30, 15);
			m_GraphMin.Location = new System.Drawing.Point(this.Size.Width - 35, verticalOffset + 185);
			m_GraphMin.MaxLength = 10;
			m_GraphMin.Text = "0";
			m_GraphMin.FontType = FontType.Small;
			m_GraphMin.IsVisible = true;
			m_GraphMin.Padding = new System.Windows.Forms.Padding(5);
			m_GraphMin.RelitiveZIndex = index++;
			this.Controls.Add(m_GraphMin);
			

			verticalOffset += 200;

			this.Size = new System.Drawing.Size(this.Size.Width, verticalOffset + 5);
		}
コード例 #6
0
ファイル: OscPanel.cs プロジェクト: RugCode/drg-pt
		public override void Initiate()
		{
			ArtworkStaticObjects.OscControler.ConnectionChanged += new EventHandler(OscControler_ConnectionChanged);

			int index = 1;

			Label label = new Label();
			label.TextAlign = System.Drawing.ContentAlignment.TopLeft;
			label.FixedSize = true;
			label.Size = new System.Drawing.Size(290, 30);
			label.Location = new System.Drawing.Point(0, 5);
			label.Text = "Osc Properties";
			label.FontType = FontType.Heading;
			label.IsVisible = true;
			label.Padding = new System.Windows.Forms.Padding(5);
			label.RelitiveZIndex = index++;
			this.Controls.Add(label);

			int verticalOffset = 35;

			m_OscMessage = new DynamicLabel();
			m_OscMessage.TextAlign = System.Drawing.ContentAlignment.TopLeft;
			m_OscMessage.FixedSize = true;
			m_OscMessage.Size = new System.Drawing.Size(Size.Width - 10, 15);
			m_OscMessage.Location = new System.Drawing.Point(0, verticalOffset);
			m_OscMessage.Text = ArtworkStaticObjects.OscControler.Message;
			m_OscMessage.MaxLength = 200;
			m_OscMessage.FontType = FontType.Small;
			m_OscMessage.IsVisible = true;
			m_OscMessage.Padding = new System.Windows.Forms.Padding(5);
			m_OscMessage.RelitiveZIndex = index++;

			this.Controls.Add(m_OscMessage);

			verticalOffset += 20;

			m_OscAddress = new TextBox();
			m_OscAddress.Text = ArtworkStaticObjects.OscControler.Address;
			m_OscAddress.MaxLength = 80;
			m_OscAddress.Size = new System.Drawing.Size(Size.Width - 140, 20);
			m_OscAddress.Location = new System.Drawing.Point(5, verticalOffset);
			m_OscAddress.FontType = FontType.Small;
			m_OscAddress.RelitiveZIndex = index++;
			m_OscAddress.IsVisible = true;
			m_OscAddress.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			m_OscAddress.TextChanged += new EventHandler(m_OscAddress_TextChanged);
			this.Controls.Add(m_OscAddress);

			m_OscPort = new TextBox();
			m_OscPort.Text = ArtworkStaticObjects.OscControler.Port.ToString();
			m_OscPort.MaxLength = 6;
			m_OscPort.Size = new System.Drawing.Size(50, 20);
			m_OscPort.Location = new System.Drawing.Point(Size.Width - 130, verticalOffset);
			m_OscPort.FontType = FontType.Small;
			m_OscPort.RelitiveZIndex = index++;
			m_OscPort.IsVisible = true;
			m_OscPort.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			m_OscPort.TextChanged += new EventHandler(m_OscPort_TextChanged);
			this.Controls.Add(m_OscPort);

			m_OscConnectButton = new Button();
			m_OscConnectButton.Text = ArtworkStaticObjects.OscControler.Connected ? "Dissconnect" : "Connect";
			m_OscConnectButton.Size = new System.Drawing.Size(70, 20);
			m_OscConnectButton.Location = new System.Drawing.Point(Size.Width - 75, verticalOffset);
			m_OscConnectButton.FontType = FontType.Small;
			m_OscConnectButton.RelitiveZIndex = index++;
			m_OscConnectButton.IsVisible = true;
			m_OscConnectButton.Click += new EventHandler(m_OscConnectButton_Click);
			this.Controls.Add(m_OscConnectButton);

			verticalOffset += 25;

			AddSlider(this, "Movement Threshold",
				0, 2, (float)Options.Osc.SpeedThreshold,
				new SliderValueChangedEvent(m_SpeedThresholdSlider_ValueChanged),
				ref index, ref verticalOffset,
				out m_SpeedThresholdSlider, out m_SpeedThresholdValueLabel);

			AddSlider(this, "Distance Threshold",
				0, 10, (float)Options.Osc.DistanceThreshold,
				new SliderValueChangedEvent(m_DistanceThresholdSlider_ValueChanged),
				ref index, ref verticalOffset,
				out m_DistanceThresholdSlider, out m_DistanceThresholdValueLabel);


			AddSlider(this, "Portal ID",
				0, 10, (float)Options.Osc.PortalID,
				new SliderValueChangedEvent(m_PortalIDSlider_ValueChanged),
				ref index, ref verticalOffset,
				out m_PortalIDSlider, out m_PortalIDValueLabel);

			this.Size = new System.Drawing.Size(this.Size.Width, verticalOffset + 5);
		}
コード例 #7
0
ファイル: PanelBase.cs プロジェクト: RugCode/drg-pt
		protected void AddButtonSet(Panel panel, string labelText, object[] obj, string[] text, EventHandler click, ref int index, ref int verticalOffset, List<ToggleButton> buttons)
		{
			Label label = new Label();
			label.TextAlign = System.Drawing.ContentAlignment.TopLeft;
			label.FixedSize = true;
			label.Size = new System.Drawing.Size(200, 15);
			label.Location = new System.Drawing.Point(0, verticalOffset);
			label.Text = labelText;
			label.FontType = FontType.Small;
			label.IsVisible = true;
			label.Padding = new System.Windows.Forms.Padding(5);
			label.RelitiveZIndex = index++;
			panel.Controls.Add(label);

			verticalOffset += 20;

			int totalSpace = Size.Width - 5;

			int buttonSize = ((totalSpace - (5 * obj.Length)) / obj.Length);
			int buttonSpace = buttonSize + 5;
			int currentButtonOffset = 5;

			for (int i = 0; i < obj.Length; i++)
			{
				buttons.Add(AddToggleButton(panel, obj[i], text[i], click, buttonSize, buttonSpace, ref currentButtonOffset, ref index, ref verticalOffset));
			}

			verticalOffset += 30;
		}
コード例 #8
0
ファイル: VisualPanel.cs プロジェクト: RugCode/drg-pt
		public override void Initiate()
		{			
			int index = 1;

			int verticalOffset = 5;

			if (this.PanelControler != null)
			{
				Label label = new Label();
				label.TextAlign = System.Drawing.ContentAlignment.TopLeft;
				label.FixedSize = true;
				label.Size = new System.Drawing.Size(290, 30);
				label.Location = new System.Drawing.Point(0, 5);
				label.Text = "Visual Properties";
				label.FontType = FontType.Heading;
				label.IsVisible = true;
				label.Padding = new System.Windows.Forms.Padding(5);
				label.RelitiveZIndex = index++;

				this.Controls.Add(label);

				verticalOffset += 30;
			}

			AddSlider(this, "Feedback Level",
						0, 1, ArtworkStaticObjects.Options.Visual.FeedbackLevel,
						new SliderValueChangedEvent(m_FeedbackLevel_ValueChanged),
						ref index, ref verticalOffset,
						out m_FeedbackLevel, out m_FeedbackLevelLabel);

			AddSlider(this, "Particle Feedback Level",
						0, 1, ArtworkStaticObjects.Options.Visual.ParticleFeedbackLevel,
						new SliderValueChangedEvent(m_ParticleFeedbackLevel_ValueChanged),
						ref index, ref verticalOffset,
						out m_ParticleFeedbackLevel, out m_ParticleFeedbackLevelLabel);

			AddSlider(this, "Self Image",
						0, 1f, ArtworkStaticObjects.Options.Visual.SelfImage, // * 10f,
						new SliderValueChangedEvent(m_SelfImage_ValueChanged),
						ref index, ref verticalOffset,
						out m_SelfImage, out m_SelfImageLabel);

			AddSlider(this, "Self Color",
						0, 1f, ArtworkStaticObjects.Options.Visual.SelfColor, // * 10f,
						new SliderValueChangedEvent(m_SelfColor_ValueChanged),
						ref index, ref verticalOffset,
						out m_SelfColor, out m_SelfColorLabel);	

			AddSlider(this, "Self Feedback",
						0, 1f, ArtworkStaticObjects.Options.Visual.SelfFeedback, // * 10f,
						new SliderValueChangedEvent(m_SelfFeedback_ValueChanged),
						ref index, ref verticalOffset,
						out m_SelfFeedback, out m_SelfFeedbackLabel);

			AddSlider(this, "Self Feedback Color",
						0, 1f, ArtworkStaticObjects.Options.Visual.SelfColor, // * 10f,
						new SliderValueChangedEvent(m_SelfFeedbackColor_ValueChanged),
						ref index, ref verticalOffset,
						out m_SelfFeedbackColor, out m_SelfFeedbackColorLabel);	

			AddSlider(this, "Warp Variance",
						-0.2f, 0.2f, ArtworkStaticObjects.Options.Visual.WarpVariance, // * 10f,
						new SliderValueChangedEvent(m_WarpVariance_ValueChanged),
						ref index, ref verticalOffset,
						out m_WarpVariance, out m_WarpVarianceLabel);

			AddSlider(this, "Warp Persistence",
						-0.6f, 0.6f, ArtworkStaticObjects.Options.Visual.WarpPersistence, // * 10f,
						new SliderValueChangedEvent(m_WarpPersistence_ValueChanged),
						ref index, ref verticalOffset,
						out m_WarpPersistence, out m_WarpPersistenceLabel);

			AddSlider(this, "Warp Propagation",
						0, 0.25f, ArtworkStaticObjects.Options.Visual.WarpPropagation, // * 10f,
						new SliderValueChangedEvent(m_WarpPropagation_ValueChanged),
						ref index, ref verticalOffset,
						out m_WarpPropagation, out m_WarpPropagationLabel);

			verticalOffset += 10;

			this.Size = new System.Drawing.Size(this.Size.Width, verticalOffset + 5);
		}		
コード例 #9
0
		public override void Initiate()
		{
			int index = 1;

			Label label = new Label();
			label.TextAlign = System.Drawing.ContentAlignment.TopLeft;
			label.FixedSize = true;
			label.Size = new System.Drawing.Size(290, 30);
			label.Location = new System.Drawing.Point(0, 5);
			label.Text = "Compose Field Data";
			label.FontType = FontType.Heading;
			label.IsVisible = true;
			label.Padding = new System.Windows.Forms.Padding(5);
			label.RelitiveZIndex = index++;

			this.Controls.Add(label);

			int verticalOffset = 35;

			//AddSlider(this, "Feedback Level",
			//	0, 1, ArtworkStaticObjects.Options.Visual.FeedbackLevel,
			//	new SliderValueChangedEvent(m_FeedbackLevel_ValueChanged),
			//	ref index, ref verticalOffset,
			//	out m_FeedbackLevel, out m_FeedbackLevelLabel);
			 

			// KinectFieldImageType { BlendMap, ClipMap, Final }
			AddButtonSet(this, "Image Mode",
						 new object[] { KinectFieldImageType.BlendMap, KinectFieldImageType.ClipMap, KinectFieldImageType.Identify, KinectFieldImageType.Final },
						 new string[] { "Blend", "Clip", "Identify", "Final" }, new EventHandler(fieldImageModeButton_Click), ref index, ref verticalOffset, m_FieldImageModeButtons);

			//float widthPerImage = (float)(this.Size.Width / m_KinectColorImages.Count);
			//float heightPerImage = (widthPerImage / 4) * 3;

			m_CompositeFieldImageEditor = new CompositeFieldImageEditor();
			m_CompositeFieldImageEditor.Location = new System.Drawing.Point(5, verticalOffset);
			m_CompositeFieldImageEditor.Size = new System.Drawing.Size((this.Size.Width - 25), 400);
			m_CompositeFieldImageEditor.ShowBorder = true;
			m_CompositeFieldImageEditor.RelitiveZIndex = index++;
			m_CompositeFieldImageEditor.RebuildImages = true; 

			this.Controls.Add(m_CompositeFieldImageEditor);

			m_TopEdge = new Slider();
			m_TopEdge.BarAlignment = BarAlignment.Vertical;
			m_TopEdge.InvertHighlight = true; 
			m_TopEdge.MinValue = 0;
			m_TopEdge.MaxValue = 198;
			m_TopEdge.Size = new System.Drawing.Size(15, 198);
			m_TopEdge.Location = new System.Drawing.Point(this.Size.Width - 20, verticalOffset);
			m_TopEdge.IsVisible = true;
			m_TopEdge.Value = m_TopEdge.MaxValue - ArtworkStaticObjects.CompositeFieldImage.Bounds.Top;
			m_TopEdge.ValueChanged += new SliderValueChangedEvent(m_TopEdge_ValueChanged);
			m_TopEdge.RelitiveZIndex = index++;
			this.Controls.Add(m_TopEdge);

			m_BottomEdge = new Slider();
			m_BottomEdge.BarAlignment = BarAlignment.Vertical; 
			m_BottomEdge.MinValue = 202;
			m_BottomEdge.MaxValue = 400;
			m_BottomEdge.Size = new System.Drawing.Size(15, 198);
			m_BottomEdge.Location = new System.Drawing.Point(this.Size.Width - 20, verticalOffset + 200);
			m_BottomEdge.IsVisible = true;
			m_BottomEdge.Value = m_BottomEdge.MaxValue - (ArtworkStaticObjects.CompositeFieldImage.Bounds.Bottom - m_BottomEdge.MinValue);
			m_BottomEdge.ValueChanged += new SliderValueChangedEvent(m_BottomEdge_ValueChanged);
			m_BottomEdge.RelitiveZIndex = index++;
			this.Controls.Add(m_BottomEdge);

			verticalOffset += 400;

			int widthOverTwo = (this.Size.Width - 29) / 2; 

			m_LeftEdge = new Slider();
			m_LeftEdge.MinValue = 0;
			m_LeftEdge.MaxValue = widthOverTwo - 2;
			m_LeftEdge.Size = new System.Drawing.Size(widthOverTwo, 15);
			m_LeftEdge.Location = new System.Drawing.Point(5, verticalOffset);
			m_LeftEdge.IsVisible = true;
			m_LeftEdge.Value = ArtworkStaticObjects.CompositeFieldImage.Bounds.Left;
			m_LeftEdge.ValueChanged += new SliderValueChangedEvent(m_LeftEdge_ValueChanged);
			m_LeftEdge.RelitiveZIndex = index++;
			this.Controls.Add(m_LeftEdge);

			m_RightEdge = new Slider();
			m_RightEdge.MinValue = widthOverTwo + 2;
			m_RightEdge.MaxValue = widthOverTwo * 2;
			m_RightEdge.InvertHighlight = true; 
			m_RightEdge.Size = new System.Drawing.Size(widthOverTwo, 15);
			m_RightEdge.Location = new System.Drawing.Point(m_LeftEdge.Location.X + m_LeftEdge.Size.Width + 4, verticalOffset);
			m_RightEdge.IsVisible = true;
			m_RightEdge.Value = ArtworkStaticObjects.CompositeFieldImage.Bounds.Right;
			m_RightEdge.ValueChanged += new SliderValueChangedEvent(m_RightEdge_ValueChanged);
			m_RightEdge.RelitiveZIndex = index++;
			this.Controls.Add(m_RightEdge);

			verticalOffset += 25;

			this.Size = new System.Drawing.Size(this.Size.Width, verticalOffset + 5);

			m_CompositeFieldImageEditor.UpdateRegionBounds(); 
		}
コード例 #10
0
ファイル: FFTPanel.cs プロジェクト: RugCode/drg-pt
		public override void Initiate()
		{
			int index = 1;

			Label label = new Label();
			label.TextAlign = System.Drawing.ContentAlignment.TopLeft;
			label.FixedSize = true;
			label.Size = new System.Drawing.Size(290, 30);
			label.Location = new System.Drawing.Point(0, 5);
			label.Text = "FFT Properties";
			label.FontType = FontType.Heading;
			label.IsVisible = true;
			label.Padding = new System.Windows.Forms.Padding(5); 
			label.RelitiveZIndex = index++;
			this.Controls.Add(label);

			int verticalOffset = 35;

			int buttonSize = (Size.Width - 15) / 2; 

			m_FFTEnabled = new ToggleButton();
			m_FFTEnabled.Text = ArtworkStaticObjects.Options.FFT.FFTEnabled ? "FFT Enabled" : "FFT Disabled";
			m_FFTEnabled.Value = !ArtworkStaticObjects.Options.FFT.FFTEnabled;
			m_FFTEnabled.Size = new System.Drawing.Size(buttonSize, 20);
			m_FFTEnabled.Location = new System.Drawing.Point(5, verticalOffset);
			m_FFTEnabled.FontType = FontType.Small;
			m_FFTEnabled.RelitiveZIndex = index++;
			m_FFTEnabled.IsVisible = true;
			m_FFTEnabled.Click += new EventHandler(m_FFTEnabled_Click);
			this.Controls.Add(m_FFTEnabled);

			m_ParticleEventsEnabled = new ToggleButton();
			m_ParticleEventsEnabled.Text = ArtworkStaticObjects.Options.FFT.ParticleEventsEnabled ? "Particle Events On" : "Particle Events Off";
			m_ParticleEventsEnabled.Value = !ArtworkStaticObjects.Options.FFT.ParticleEventsEnabled;
			m_ParticleEventsEnabled.Size = new System.Drawing.Size(buttonSize, 20);
			m_ParticleEventsEnabled.Location = new System.Drawing.Point(buttonSize + 10, verticalOffset);
			m_ParticleEventsEnabled.FontType = FontType.Small;
			m_ParticleEventsEnabled.RelitiveZIndex = index++;
			m_ParticleEventsEnabled.IsVisible = true;
			m_ParticleEventsEnabled.Click += new EventHandler(m_ParticleEventsEnabled_Click);
			this.Controls.Add(m_ParticleEventsEnabled);

			verticalOffset += 25;

			AddSlider(this, "FFT Frequency",
				1, 60, (float)ArtworkStaticObjects.Options.FFT.FFTFrequency,
				new SliderValueChangedEvent(m_FFTFrequency_ValueChanged),
				ref index, ref verticalOffset,
				out m_FFTFrequency, out m_FFTFrequencyLabel);

			AddSlider(this, "Correlation Function Update Frequency",
				1, 60, (float)ArtworkStaticObjects.Options.FFT.CorrelationFunctionUpdateFrequency,
				new SliderValueChangedEvent(m_ParticleCorrelationFunctionFreqency_ValueChanged),
				ref index, ref verticalOffset,
				out m_ParticleCorrelationFunctionFreqency, out m_ParticleCorrelationFunctionFreqencyLabel);

			AddSlider(this, "Peak Count",
				1, 24, (float)ArtworkStaticObjects.Options.FFT.PeakCount,
				new SliderValueChangedEvent(m_PeakCount_ValueChanged),
				ref index, ref verticalOffset,
				out m_PeakCount, out m_PeakCountLabel);

			AddSlider(this, "Send FFT Frequency",
				1, 60 * 60, (float)ArtworkStaticObjects.Options.FFT.SendFFTFrequency,
				new SliderValueChangedEvent(m_SendFFTFrequency_ValueChanged),
				ref index, ref verticalOffset,
				out m_SendFFTFrequency, out m_SendFFTFrequencyLabel);

			this.Size = new System.Drawing.Size(this.Size.Width, verticalOffset + 5);
		}