Permalink
Browse files

Mixed merge issues. Also fixed some scalling issues with the side pan…

…el in the MainForm.
  • Loading branch information...
2 parents 395728a + 58ecda6 commit 86f53740a9feb54cf0821103344333398d80b0a1 @mdfeist committed Jun 12, 2013
@@ -24,11 +24,16 @@ namespace BlinkAnalysis {
AddObjectForm(void)
{
InitializeComponent();
- //
- //TODO: Add the constructor code here
- //
+ displayWorld = -1;
}
+ void setDisplayWorld(int id) {
+ displayWorld = id;
+ this->Text = L"Add Object (World ID " + displayWorld.ToString() + ")";
+ }
+ int getDisplayWorld() { return displayWorld; }
+
+
protected:
/// <summary>
/// Clean up any resources being used.
@@ -82,8 +87,7 @@ namespace BlinkAnalysis {
private: System::Windows::Forms::RadioButton^ planeMarkersRadio;
private: System::Windows::Forms::Label^ planeRigidDataLabel;
-
- public: event EventHandler^ UpdateObject;
+ private: int displayWorld;
private:
/// <summary>
@@ -100,14 +104,14 @@ namespace BlinkAnalysis {
{
this->tabControl1 = (gcnew System::Windows::Forms::TabControl());
this->infoPage = (gcnew System::Windows::Forms::TabPage());
- this->planeInfoLabel = (gcnew System::Windows::Forms::Label());
this->planePage = (gcnew System::Windows::Forms::TabPage());
this->planeRigidDataLabel = (gcnew System::Windows::Forms::Label());
this->planePt2SetButton = (gcnew System::Windows::Forms::Button());
this->planeCornerSetButton = (gcnew System::Windows::Forms::Button());
this->planePt1SetButton = (gcnew System::Windows::Forms::Button());
this->planeRigidRadio = (gcnew System::Windows::Forms::RadioButton());
this->planeMarkersRadio = (gcnew System::Windows::Forms::RadioButton());
+ this->planeInfoLabel = (gcnew System::Windows::Forms::Label());
this->planeOptionalLabel = (gcnew System::Windows::Forms::Label());
this->planeNameTextBox = (gcnew System::Windows::Forms::TextBox());
this->planeNameLabel = (gcnew System::Windows::Forms::Label());
@@ -146,17 +150,6 @@ namespace BlinkAnalysis {
this->infoPage->Text = L"Info";
this->infoPage->UseVisualStyleBackColor = true;
//
- // planeInfoLabel
- //
- this->planeInfoLabel->AutoSize = true;
- this->planeInfoLabel->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(0)));
- this->planeInfoLabel->Location = System::Drawing::Point(18, 21);
- this->planeInfoLabel->Name = L"planeInfoLabel";
- this->planeInfoLabel->Size = System::Drawing::Size(167, 15);
- this->planeInfoLabel->TabIndex = 25;
- this->planeInfoLabel->Text = L"Add a finite plane to the world";
- //
// planePage
//
this->planePage->Controls->Add(this->planeRigidDataLabel);
@@ -260,6 +253,17 @@ namespace BlinkAnalysis {
this->planeMarkersRadio->UseVisualStyleBackColor = true;
this->planeMarkersRadio->CheckedChanged += gcnew System::EventHandler(this, &AddObjectForm::planeMarkersRadio_CheckedChanged);
//
+ // planeInfoLabel
+ //
+ this->planeInfoLabel->AutoSize = true;
+ this->planeInfoLabel->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
+ static_cast<System::Byte>(0)));
+ this->planeInfoLabel->Location = System::Drawing::Point(18, 21);
+ this->planeInfoLabel->Name = L"planeInfoLabel";
+ this->planeInfoLabel->Size = System::Drawing::Size(167, 15);
+ this->planeInfoLabel->TabIndex = 25;
+ this->planeInfoLabel->Text = L"Add a finite plane to the world";
+ //
// planeOptionalLabel
//
this->planeOptionalLabel->AutoSize = true;
@@ -403,7 +407,7 @@ namespace BlinkAnalysis {
this->ClientSize = System::Drawing::Size(418, 311);
this->Controls->Add(this->tabControl1);
this->Name = L"AddObjectForm";
- this->Text = L"AddObjectForm";
+ this->Text = L"Add Object ";
this->FormClosed += gcnew System::Windows::Forms::FormClosedEventHandler(this, &AddObjectForm::AddObjectForm_FormClosed);
this->Load += gcnew System::EventHandler(this, &AddObjectForm::AddObjectForm_Load);
this->tabControl1->ResumeLayout(false);
@@ -521,7 +525,7 @@ private: System::Void setPoint(osg::Vec3* pos, Label^ text) {
}
// add plane to world based on data from posC, pos1, pos2
private: System::Void planeSetButton_Click(System::Object^ sender, System::EventArgs^ e) {
- CaptureWorld* world = AppData::getInstance()->getWorld();
+ CaptureWorld* world = AppData::getInstance()->getWorld(displayWorld);
if (world)
{
std::string* str = new std::string( (const char*) (Runtime::InteropServices::Marshal::StringToHGlobalAnsi(this->planeNameTextBox->Text)).ToPointer());
@@ -530,8 +534,6 @@ private: System::Void planeSetButton_Click(System::Object^ sender, System::Even
{
String^ id = Convert::ToString(object->getID());
String^ name = gcnew String(object->getName().c_str());
- UpdateObject(this, gcnew EventArgs());
- AppViewer::redrawObjects();
}
}
this->Close();
@@ -0,0 +1,29 @@
+#pragma once
+#include "stdafx.h"
+#include <string>
+
+#include "AddObjectForm.h"
+#include "FormController.h"
+
+using namespace System;
+
+public ref class AddObjectFormController sealed :
+ public FormController<AddObjectFormController^ volatile, BlinkAnalysis::AddObjectForm^>
+{
+public:
+
+ void setDisplayWorld(int id)
+ {
+ if (form && !form->IsDisposed)
+ form->setDisplayWorld(id);
+ }
+
+ int getDisplayWorld()
+ {
+ if (form && !form->IsDisposed)
+ return form->getDisplayWorld();
+ return -1;
+ }
+
+};
+
@@ -0,0 +1,125 @@
+#pragma once
+
+#include "AppData.h"
+
+namespace BlinkAnalysis {
+
+ using namespace System;
+ using namespace System::ComponentModel;
+ using namespace System::Collections;
+ using namespace System::Windows::Forms;
+ using namespace System::Data;
+ using namespace System::Drawing;
+
+ /// <summary>
+ /// Summary for AddWorldForm
+ /// </summary>
+ public ref class AddWorldForm : public System::Windows::Forms::Form
+ {
+ public:
+ AddWorldForm(void)
+ {
+ InitializeComponent();
+ //
+ //TODO: Add the constructor code here
+ //
+ }
+
+ protected:
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ ~AddWorldForm()
+ {
+ if (components)
+ {
+ delete components;
+ }
+ }
+ private: System::Windows::Forms::Label^ nameLabel;
+ private: System::Windows::Forms::TextBox^ nameTextBox;
+ private: System::Windows::Forms::Button^ nameButton;
+
+ private:
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ System::ComponentModel::Container ^components;
+
+#pragma region Windows Form Designer generated code
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ void InitializeComponent(void)
+ {
+ this->nameLabel = (gcnew System::Windows::Forms::Label());
+ this->nameTextBox = (gcnew System::Windows::Forms::TextBox());
+ this->nameButton = (gcnew System::Windows::Forms::Button());
+ this->SuspendLayout();
+ //
+ // nameLabel
+ //
+ this->nameLabel->AutoSize = true;
+ this->nameLabel->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
+ static_cast<System::Byte>(0)));
+ this->nameLabel->Location = System::Drawing::Point(12, 13);
+ this->nameLabel->Name = L"nameLabel";
+ this->nameLabel->Size = System::Drawing::Size(41, 15);
+ this->nameLabel->TabIndex = 0;
+ this->nameLabel->Text = L"Name";
+ //
+ // nameTextBox
+ //
+ this->nameTextBox->Location = System::Drawing::Point(59, 12);
+ this->nameTextBox->Name = L"nameTextBox";
+ this->nameTextBox->Size = System::Drawing::Size(213, 20);
+ this->nameTextBox->TabIndex = 1;
+ this->nameTextBox->KeyPress += gcnew System::Windows::Forms::KeyPressEventHandler(this, &AddWorldForm::nameTextBox_KeyPress);
+ //
+ // nameButton
+ //
+ this->nameButton->Location = System::Drawing::Point(197, 38);
+ this->nameButton->Name = L"nameButton";
+ this->nameButton->Size = System::Drawing::Size(75, 23);
+ this->nameButton->TabIndex = 2;
+ this->nameButton->Text = L"Add World";
+ this->nameButton->UseVisualStyleBackColor = true;
+ this->nameButton->Click += gcnew System::EventHandler(this, &AddWorldForm::nameButton_Click);
+ //
+ // AddWorldForm
+ //
+ this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
+ this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
+ this->ClientSize = System::Drawing::Size(284, 73);
+ this->Controls->Add(this->nameButton);
+ this->Controls->Add(this->nameTextBox);
+ this->Controls->Add(this->nameLabel);
+ this->Name = L"AddWorldForm";
+ this->Text = L"Add a New World";
+ this->ResumeLayout(false);
+ this->PerformLayout();
+
+ }
+#pragma endregion
+ private: System::Void nameButton_Click(System::Object^ sender, System::EventArgs^ e) {
+ std::string *name = new std::string(
+ (const char*) (Runtime::InteropServices::Marshal::StringToHGlobalAnsi(this->nameTextBox->Text)).ToPointer()
+ );
+ CaptureWorld* world = new CaptureWorld(*name);
+ AppData::getInstance()->addWorld(world);
+ Close();
+ }
+ private: System::Void nameTextBox_KeyPress(System::Object^ sender, System::Windows::Forms::KeyPressEventArgs^ e) {
+ if (e->KeyChar == '\r')
+ {
+ std::string *name = new std::string(
+ (const char*) (Runtime::InteropServices::Marshal::StringToHGlobalAnsi(this->nameTextBox->Text)).ToPointer()
+ );
+ CaptureWorld* world = new CaptureWorld(*name);
+ AppData::getInstance()->addWorld(world);
+ Close();
+ }
+ }
+ };
+}
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
Oops, something went wrong.

0 comments on commit 86f5374

Please sign in to comment.