Example #1
0
void OmniFEMMainFrame::createDimensionClient()
{
	systemState currentState = controller.getOmniFEMState();
	
	if(currentState == systemState::problemChooseing)
		problemSelectPanel->Destroy();
	else if(currentState == systemState::initialStartUp)
		initialStartPanel->Destroy();
	else if(currentState == systemState::problemDefining)
	{
		//problemDefiningPanel->Destroy();
//		this->SetSize(minSize);
//this
//this->SetSize(500, 500);
		enableToolMenuBar(false);
//		this->SetMinSize(minSize);
//		this->SetMaxSize(minSize);
	}
		
    dimSelectPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(clientSizeWidth, clientSizeLength), wxBORDER_SIMPLE);
	
    wxButton *TwoDimButton = new wxButton(dimSelectPanel, buttonID::ID_buttonTwoDim, "2-D", wxPoint(10, 50), wxSize(50, 50));
	wxButton *backButton = new wxButton(dimSelectPanel, buttonID::ID_buttonBack, "Back", wxPoint(5, clientSizeLength - 25 - 5), wxSize(100, 25));
	
	wxStaticText *text = new wxStaticText(dimSelectPanel, wxID_ANY, "Choose Spatial Dimension:", wxPoint(5, 5));
	
	
	controller.updateOmniFEMState(systemState::dimensionChoosing);
}
Example #2
0
void OmniFEMMainFrame::createModelDefiningClient()
{
	systemState currentState = controller.getOmniFEMState();
	
	
	if(currentState == systemState::initialStartUp)
		initialStartPanel->Destroy();
	else if(currentState == systemState::dimensionChoosing)
		dimSelectPanel->Destroy();
	else if(currentState == systemState::problemChooseing)
		problemSelectPanel->Destroy();
		
	enableToolMenuBar(true);
	
	this->SetMaxSize(wxSize(-1, -1));
	this->SetSize(960, 544);
	this->SetMinSize(wxSize(960, 544));
	
	
	wxSize modelBuilderPanelSize = wxSize((int)((double)0.17 * (double)clientSizeWidth - (double)20), (int)((double)0.66 * (double)clientSizeLength));
	
	/* This section is creating the general layout of the panel using he sizers in wxWidgets */
	modelBuilderTreePanel = new wxPanel(this, panelID::ID_modelBuilderTree, wxDefaultPosition, modelBuilderPanelSize, wxBORDER_SIMPLE | wxVSCROLL | wxHSCROLL);
	groupOneSizer->Add(modelBuilderTreePanel, 1, wxALIGN_LEFT | wxALL | wxEXPAND, controller.getBorderSize());

	//geometryBuilderPanel = new wxPanel(this, panelID::ID_geometryBuilder, wxDefaultPosition, wxSize((int)((double)0.66 * (double)clientSizeWidth), (int)((double)0.66 * (double)clientSizeLength)), wxBORDER_SIMPLE);
	twoDimGeometryEditor = new geometryEditor2DPresentation(this, wxDefaultPosition, wxSize((int)((double)0.66 * (double)clientSizeWidth), (int)((double)0.66 * (double)clientSizeLength)));
	
	groupOneSizer->Add(twoDimGeometryEditor, 3, wxALIGN_CENTER | wxALL | wxEXPAND, controller.getBorderSize());// THe middle frame will get the highest propoty when sizing becuase this is what the user will use most often
	
	settingsPanel = new wxPanel(this, panelID::ID_settings, wxDefaultPosition, wxSize((int)((double)0.17 * (double)clientSizeWidth - (double)20), (int)((double)0.66 * (double)clientSizeLength)), wxBORDER_SIMPLE);
	groupOneSizer->Add(settingsPanel, 1, wxALIGN_RIGHT | wxALL | wxEXPAND, controller.getBorderSize());
	
	vertBoxSizer->Add(groupOneSizer, 1, wxALL | wxEXPAND, controller.getBorderSize());
	
	statusInfoPanel = new wxPanel(this, panelID::ID_status, wxDefaultPosition, wxSize(clientSizeWidth - 20, clientSizeLength - (int)((double)0.66 * (double)clientSizeLength + (double)20) - 10), wxBORDER_SIMPLE);
	vertBoxSizer->Add(statusInfoPanel, 0, wxEXPAND | wxALL, controller.getBorderSize());
	
	
	/* This section is populating the layout with everything that is needed for the user */
	/*********************************
	* Tree Ctrl (Hiearchary Listbox) *
	**********************************/
	
	modelbuilderTreeCtrl = new wxTreeCtrl(modelBuilderTreePanel, wxID_ANY, wxDefaultPosition, modelBuilderPanelSize - wxSize(2, 0), wxTR_TWIST_BUTTONS | wxTR_NO_LINES | wxTR_FULL_ROW_HIGHLIGHT | wxTR_SINGLE | wxTR_HAS_BUTTONS);// The -2 appears in the size in order to give some extra room for hte scroll bars
	
	controller.setRootTreeIDAbstraction(modelbuilderTreeCtrl->AddRoot(controller.getWorkspaceNameAbstraction()));// This is the highest level
	
	controller.setAbstractProblemID(modelbuilderTreeCtrl->AppendItem(controller.getRootTreeIDAbstraction(), controller.getAbstractSimName()));// This will be for the project
	
	controller.setAbstractGeometryID(modelbuilderTreeCtrl->AppendItem(controller.getAbstractProblemID(), "Geometry"));
	controller.setAbstractMaterialsID(modelbuilderTreeCtrl->AppendItem(controller.getAbstractProblemID(), "Materials"));
	controller.setAbstractMeshID(modelbuilderTreeCtrl->AppendItem(controller.getAbstractProblemID(), "Mesh"));
	
	modelbuilderTreeCtrl->ExpandAll();
	
	/*******************
	* Geometry Builder *
	********************/
//	wxGLCanvas *test = new wxGLCanvas(twoDimDeometryEditor);
//	twoDimGeometryEditor->createOpenGLCanvas();
//	twoDimGeometryEditor->render();
	this->SetSizer(vertBoxSizer);
	this->Layout();
	
	controller.updateOmniFEMState(systemState::problemDefining);
	
}
Example #3
0
OmniFEMMainFrame::OmniFEMMainFrame(const wxString &title, const wxPoint &pos, const wxSize &size) : wxFrame(NULL, wxID_ANY, title, pos, size)
{
	minSize = size;
	
    /* This creates the main menu Bar at the top */
    menuBar->Append(menuFile, "&File");
    menuBar->Append(menuEdit, "&Edit");
    menuBar->Append(menuView, "&View");
    menuBar->Append(menuMesh, "&Mesh");
    menuBar->Append(menuProblem, "&Problem");
    menuBar->Append(menuHelp, "&Help");
    
    
    /* Creating the menu listing of File menu */
    menuFile->Append(menubarID::ID_menubarNew, "&New\tCtrl-N");
    menuFile->Append(menubarID::ID_menubarSave, "&Save\tCtrl-S");
    menuFile->Append(menubarID::ID_menubarSaveAs, "&Save As");
	menuFile->Append(menubarID::ID_menubarOpen, "&Open");
    menuFile->AppendSeparator();
    menuFile->Append(wxID_EXIT);
    
    /* Creating the menu listinging of the Edit Menu */
	menuEdit->Append(menubarID::ID_menubarLUASCRIPT, "&Lua Script\tCtrl-L");
    menuEdit->Append(menubarID::ID_menubarPreferences, "&Preferences\tCtrl-P");
	
	/* Creting the menu listing of the View Menu */
	menuView->Append(menubarID::ID_menubarViewResults, "&View Results");
	
	/* Create the menu listing for the mesh menu */
	menuMesh->Append(menubarID::ID_menubarCreateMesh, "&Create Mesh");
	menuMesh->Append(menubarID::ID_menubarShowMesh, "&Show Mesh");
	menuMesh->Append(menubarID::ID_menubarDeleteMesh, "&Delete Mesh");
    
    /* Creates the menu listing of the help menu */
    menuHelp->Append(menubarID::ID_menubarManual, "View Manual");
    menuHelp->AppendSeparator();
    menuHelp->Append(menubarID::ID_menubarLicense, "License");
    menuHelp->Append(wxID_ABOUT);
	
	/*Create the menu listing of the Problem Menu */
	menuProblem->Append(menubarID::ID_menubarPrecision, "&Set Precision");
    
    /* Create and display the menu bar */
    SetMenuBar(menuBar);
    CreateStatusBar();
    
    SetStatusText("Omni-FEM Simulator");

	createTopToolBar();
	this->GetClientSize(&clientSizeWidth, &clientSizeLength);
	
	createInitialStartupClient();
	enableToolMenuBar(false);
	
	
	this->SetMinSize(minSize);
	this->SetMaxSize(minSize);
	this->SetInitialSize(minSize);
	
	arrayPhysicsProblem.Add("Electrostatics");
	arrayPhysicsProblem.Add("Magnetics");
}
Example #4
0
OmniFEMMainFrame::OmniFEMMainFrame(const wxString &title, const wxPoint &pos, const wxSize &size) : wxFrame(NULL, wxID_ANY, title, pos, size)
{
	minSize = size;
	
    /* This creates the main menu Bar at the top */
    menuBar->Append(menuFile, "&File");
    menuBar->Append(menuEdit, "&Edit");
    menuBar->Append(menuView, "&View");
    menuBar->Append(menuProblem, "&Problem");
    menuBar->Append(menuGrid, "&Grid");
    menuBar->Append(menuProperties, "&Properties");
    menuBar->Append(menuMesh, "&Mesh");
    menuBar->Append(menuHelp, "&Help");
    
    
    /* Creating the menu listing of File menu */
    menuFile->Append(menubarID::ID_menubarNew, "&New\tCtrl-N");
    menuFile->Append(menubarID::ID_menubarSave, "&Save\tCtrl-S");
    menuFile->Append(menubarID::ID_menubarSaveAs, "&Save As");
	menuFile->Append(menubarID::ID_menubarOpen, "&Open");
    menuFile->AppendSeparator();
    menuFile->Append(wxID_EXIT);
    
    /* Creating the menu listinging of the Edit Menu */
	menuEdit->Append(menubarID::ID_menubarLUASCRIPT, "&Lua Script\tCtrl-L");
    menuEdit->Append(menubarID::ID_menubarPreferences, "&Preferences\tCtrl-P");
	
	/* Creting the menu listing of the View Menu */
	menuView->Append(menubarID::ID_menubarViewResults, "&View Results");
    menuView->AppendSeparator();
    menuView->Append(menubarID::ID_menubarDispBlockLabels, "&Show Block Name");
	menuView->Append(menubarID::ID_menubarDispStatusBar, "&Show Status Bar");
    menuView->Append(menubarID::ID_menubarDispLuaConsole, "&Lua Console");
    
    /* Create hte menu listing for the grid menu option */
    menuGrid->Append(menubarID::ID_menubarShowGrid, "&Display Grid");
    menuGrid->Append(menubarID::ID_menubarSnapGrid, "&Snap to Grid");
    menuGrid->Append(menubarID::ID_menubarSetGrid, "&Set Grid");
    
    /* Create the menu listing for the properties option */
    menuProperties->Append(menubarID::ID_menubarMaterials, "&Materials\tCtrl-M");
    menuProperties->Append(menubarID::ID_menubarBoundary, "&Boundary Conditions\tCtrl-B");
    menuProperties->Append(menubarID::ID_menubarPoint, "&Nodal Properties");
    menuProperties->Append(menubarID::ID_menubarCircuitsCond, "&Circuits/Conductors");
    menuProperties->AppendSeparator();
    menuProperties->Append(menubarID::ID_menubarMatLibrary, "&Materials Library\tCtrl-L");
    
    
	/* Create the menu listing for the mesh menu */
	menuMesh->Append(menubarID::ID_menubarCreateMesh, "&Create Mesh");
	menuMesh->Append(menubarID::ID_menubarShowMesh, "&Show Mesh");
	menuMesh->Append(menubarID::ID_menubarDeleteMesh, "&Delete Mesh");
    
    /* Creates the menu listing of the help menu */
    menuHelp->Append(menubarID::ID_menubarManual, "View Manual");
    menuHelp->AppendSeparator();
    menuHelp->Append(menubarID::ID_menubarLicense, "License");
    menuHelp->Append(wxID_ABOUT);
	
	/*Create the menu listing of the Problem Menu */
	menuProblem->Append(menubarID::ID_menubarPrecision, "&Set Precision");
    
    /* Create and display the menu bar */
    SetMenuBar(menuBar);
    CreateStatusBar();
    
    SetStatusText("Omni-FEM Simulator");

	createTopToolBar();
	this->GetClientSize(&clientSizeWidth, &clientSizeLength);
	
	createInitialStartupClient();
	enableToolMenuBar(false);
	
	
	this->SetMinSize(minSize);
	this->SetMaxSize(minSize);
	this->SetInitialSize(minSize);
	
	arrayPhysicsProblem.Add("Electrostatics");
	arrayPhysicsProblem.Add("Magnetics");
}