/************************************************************************************************ * CParseGroup * copy constructor. recursively copies all subgroups and pairs. * * Input * an existing parse group * * Output * none * ************************************************************************************************/ CParseGroup::CParseGroup(CParseGroup *orig) { CParseGroup *newGroup = 0; if (orig == 0) { return; } mWriteable = orig->mWriteable; mName = orig->mName; mParent = orig->mParent; for (TParsePairIter itp = orig->PairsBegin(); itp != orig->PairsEnd(); itp++) { AddPair((*itp).first, (*itp).second); } for (TParseGroupIter itg = orig->GroupsBegin(); itg != orig->GroupsEnd(); itg++) { newGroup = new CParseGroup((*itg).second); AddSubGroup(newGroup); } }
//==== Constructor ====// WireScreen::WireScreen( ScreenMgr* mgr ) : GeomScreen( mgr, 300, 525, "Wireframe" ) { RemoveTab( GetTab( m_SubSurfTab_ind ) ); Fl_Group* wire_tab = AddTab( "WireFrame" ); Fl_Group* wire_group = AddSubGroup( wire_tab, 5 ); m_WireLayout.SetGroupAndScreen( wire_group, this ); m_WireLayout.AddDividerBox( "Wireframe Characteristics" ); m_TypeChoice.AddItem( "Lifting" ); m_TypeChoice.AddItem( "Non-Lifting" ); m_WireLayout.AddChoice( m_TypeChoice, "Type" ); m_WireLayout.AddYGap(); m_WireLayout.AddDividerBox( "Normal Vector" ); m_WireLayout.AddButton( m_InvertButton, "Invert" ); m_WireLayout.AddYGap(); m_WireLayout.AddDividerBox( "Swap Point Ordering" ); m_WireLayout.AddButton( m_SwapIJButton, "Swap I/J" ); m_WireLayout.AddYGap(); m_WireLayout.AddDividerBox( "Reverse" ); m_WireLayout.AddButton( m_RevIButton, "Reverse I" ); m_WireLayout.AddButton( m_RevJButton, "Reverse J" ); m_WireLayout.AddYGap(); m_WireLayout.AddDividerBox( "Patch" ); m_IStartPatchTypeChoice.AddItem( "None" ); m_IStartPatchTypeChoice.AddItem( "Point" ); m_IStartPatchTypeChoice.AddItem( "Line" ); m_IStartPatchTypeChoice.AddItem( "Copy Opposite" ); m_IStartPatchTypeChoice.AddItem( "Halfway Opposite" ); m_WireLayout.AddChoice( m_IStartPatchTypeChoice, "I Start" ); m_IEndPatchTypeChoice.AddItem( "None" ); m_IEndPatchTypeChoice.AddItem( "Point" ); m_IEndPatchTypeChoice.AddItem( "Line" ); m_IEndPatchTypeChoice.AddItem( "Copy Opposite" ); m_IEndPatchTypeChoice.AddItem( "Halfway Opposite" ); m_WireLayout.AddChoice( m_IEndPatchTypeChoice, "I End" ); m_JStartPatchTypeChoice.AddItem( "None" ); m_JStartPatchTypeChoice.AddItem( "Point" ); m_JStartPatchTypeChoice.AddItem( "Line" ); m_JStartPatchTypeChoice.AddItem( "Copy Opposite" ); m_JStartPatchTypeChoice.AddItem( "Halfway Opposite" ); m_WireLayout.AddChoice( m_JStartPatchTypeChoice, "J Start" ); m_JEndPatchTypeChoice.AddItem( "None" ); m_JEndPatchTypeChoice.AddItem( "Point" ); m_JEndPatchTypeChoice.AddItem( "Line" ); m_JEndPatchTypeChoice.AddItem( "Copy Opposite" ); m_JEndPatchTypeChoice.AddItem( "Halfway Opposite" ); m_WireLayout.AddChoice( m_JEndPatchTypeChoice, "J End" ); m_WireLayout.AddYGap(); m_WireLayout.AddDividerBox( "Start/End Skip" ); m_WireLayout.AddIndexSelector( m_ISkipStartIndexSelector, "I Start Skip" ); m_WireLayout.AddIndexSelector( m_ISkipEndIndexSelector, "I End Skip" ); m_WireLayout.AddIndexSelector( m_JSkipStartIndexSelector, "J Start Skip" ); m_WireLayout.AddIndexSelector( m_JSkipEndIndexSelector, "J End Skip" ); m_WireLayout.AddYGap(); m_WireLayout.AddDividerBox( "Stride" ); m_WireLayout.AddIndexSelector( m_IStrideIndexSelector, "I Stride" ); m_WireLayout.AddIndexSelector( m_JStrideIndexSelector, "J Stride" ); }
FitModelScreen::FitModelScreen( ScreenMgr* mgr ) : TabScreen( mgr, 400, 469 + 107, "Fit Model", 107 ) { m_NVarLast = 0; m_FLTK_Window->callback( staticCloseCB, this ); Fl_Group* pts_tab = AddTab( "Pick Points" ); Fl_Group* var_tab = AddTab( "Pick Vars" ); ( (Vsp_Group*) var_tab )->SetAllowDrop( true ); var_tab->callback( staticCB, this ); Fl_Group* tree_tab = AddTab( "Var Tree" ); ( (Vsp_Group*) tree_tab )->SetAllowDrop( true ); tree_tab->callback( staticCB, this ); Fl_Group* fit_tab = AddTab( "Fit Model" ); Fl_Group* saveLoad_tab = AddTab( "Save/Import" ); pts_tab->show(); // Set up pts tab Fl_Group* pts_group = AddSubGroup( pts_tab, 5 ); m_PickPtsLayout.SetGroupAndScreen( pts_group, this ); m_PickPtsLayout.AddDividerBox( "Point Selection" ); m_PickPtsLayout.SetButtonWidth( 100 ); m_PickPtsLayout.AddOutput( m_NSelOutput, "Num Selected" ); m_PickPtsLayout.SetFitWidthFlag( false ); m_PickPtsLayout.SetSameLineFlag( true ); m_PickPtsLayout.SetButtonWidth( ( m_PickPtsLayout.GetRemainX() ) / 2 ); m_PickPtsLayout.AddButton( m_SelOneButton, "Select One" ); m_PickPtsLayout.AddButton( m_HideSelButton, "Hide Selection" ); m_PickPtsLayout.ForceNewLine(); m_PickPtsLayout.AddButton( m_SelBoxButton, "Select Region" ); m_PickPtsLayout.AddButton( m_HideUnselButton, "Hide Unselected" ); m_PickPtsLayout.ForceNewLine(); m_PickPtsLayout.AddButton( m_SelAllButton, "Select All" ); m_PickPtsLayout.AddButton( m_HideAllButton, "Hide All" ); m_PickPtsLayout.ForceNewLine(); m_PickPtsLayout.AddButton( m_SelNoneButton, "Select None" ); m_PickPtsLayout.AddButton( m_HideNoneButton, "Show All" ); m_PickPtsLayout.ForceNewLine(); m_PickPtsLayout.AddButton( m_SelInvButton, "Invert Selection" ); m_PickPtsLayout.AddButton( m_HideInvButton, "Invert Hidden" ); m_PickPtsLayout.SetFitWidthFlag( true ); m_PickPtsLayout.SetSameLineFlag( false ); m_PickPtsLayout.ForceNewLine(); m_PickPtsLayout.AddYGap(); m_PickPtsLayout.AddDividerBox( "Target Points" ); int browser_h = 150; m_TargetPtBrowser = new Fl_Browser( m_PickPtsLayout.GetX(), m_PickPtsLayout.GetY(), m_PickPtsLayout.GetW(), browser_h ); m_TargetPtBrowser->type( 1 ); m_TargetPtBrowser->labelfont( 13 ); m_TargetPtBrowser->labelsize( 12 ); m_TargetPtBrowser->textsize( 12 ); m_TargetPtBrowser->callback( staticScreenCB, this ); pts_group->add( m_TargetPtBrowser ); m_PickPtsLayout.AddY( browser_h ); m_TargetGeomPicker.AddExcludeType( MESH_GEOM_TYPE ); m_TargetGeomPicker.AddExcludeType( PT_CLOUD_GEOM_TYPE ); m_TargetGeomPicker.AddExcludeType( BLANK_GEOM_TYPE ); m_PickPtsLayout.AddGeomPicker( m_TargetGeomPicker ); m_PickPtsLayout.SetFitWidthFlag( false ); m_PickPtsLayout.SetSameLineFlag( true ); m_PickPtsLayout.SetButtonWidth( 50 ); m_PickPtsLayout.AddButton( m_UFreeButton, "Free" ); m_PickPtsLayout.AddButton( m_UFixButton, "Fix" ); m_PickPtsLayout.SetFitWidthFlag( true ); m_PickPtsLayout.AddSlider( m_USlider, "U", 1.0, "%7.3f" ); m_PickPtsLayout.ForceNewLine(); m_UToggleGroup.Init( this ); m_UToggleGroup.AddButton( m_UFixButton.GetFlButton() ); m_UToggleGroup.AddButton( m_UFreeButton.GetFlButton() ); m_PickPtsLayout.SetFitWidthFlag( false ); m_PickPtsLayout.AddButton( m_WFreeButton, "Free" ); m_PickPtsLayout.AddButton( m_WFixButton, "Fix" ); m_PickPtsLayout.SetFitWidthFlag( true ); m_PickPtsLayout.AddSlider( m_WSlider, "W", 1.0, "%7.3f" ); m_PickPtsLayout.ForceNewLine(); m_WToggleGroup.Init( this ); m_WToggleGroup.AddButton( m_WFixButton.GetFlButton() ); m_WToggleGroup.AddButton( m_WFreeButton.GetFlButton() ); m_PickPtsLayout.SetFitWidthFlag( false ); m_PickPtsLayout.SetButtonWidth( ( m_PickPtsLayout.GetRemainX() ) / 3 ); m_PickPtsLayout.AddButton( m_AddTargetPtButton, "Add Target" ); m_PickPtsLayout.AddButton( m_DelTargetPtButton, "Delete Target" ); m_PickPtsLayout.AddButton( m_ClearTargetPtButton, "Clear Target" ); m_PickPtsLayout.ForceNewLine(); m_PickPtsLayout.SetFitWidthFlag( true ); m_PickPtsLayout.SetSameLineFlag( false ); m_PickPtsLayout.SetButtonWidth( 100 ); m_PickPtsLayout.AddOutput( m_NTgtOutput, "Num Target Pts." ); // Set up vars tab Fl_Group* var_group = AddSubGroup( var_tab, 5 ); m_PickVarLayout.SetGroupAndScreen( var_group, this ); m_PickVarLayout.AddDividerBox( "Variable" ); m_PickVarLayout.AddParmPicker( m_ParmPicker ); m_PickVarLayout.AddYGap(); m_PickVarLayout.SetFitWidthFlag( false ); m_PickVarLayout.SetSameLineFlag( true ); m_PickVarLayout.SetButtonWidth( ( m_PickVarLayout.GetRemainX() ) / 3 ); m_PickVarLayout.AddButton( m_AddVarButton, "Add Variable" ); m_PickVarLayout.AddButton( m_DelVarButton, "Delete Variable" ); m_PickVarLayout.AddButton( m_ClearVarButton, "Clear Variables" ); m_PickVarLayout.ForceNewLine(); m_PickVarLayout.SetFitWidthFlag( true ); m_PickVarLayout.SetSameLineFlag( false ); m_PickVarLayout.SetButtonWidth( 100 ); m_PickVarLayout.AddOutput( m_NVarOutput, "Num Variables" ); m_PickVarLayout.AddYGap(); m_PickVarLayout.AddDividerBox( "Variable List" ); browser_h = 265; varBrowser = new Fl_Browser( m_PickVarLayout.GetX(), m_PickVarLayout.GetY(), m_PickVarLayout.GetW(), browser_h ); varBrowser->type( 1 ); varBrowser->labelfont( 13 ); varBrowser->labelsize( 12 ); varBrowser->textsize( 12 ); varBrowser->callback( staticScreenCB, this ); var_group->add( varBrowser ); m_PickVarLayout.AddY( browser_h ); // Set up tree tab Fl_Group* tree_group = AddSubGroup( tree_tab, 5 ); m_PickTreeLayout.SetGroupAndScreen( tree_group, this ); m_PickTreeLayout.AddDividerBox( "Variable Tree" ); m_PickTreeLayout.AddParmTreePicker( m_ParmTreePicker, m_PickTreeLayout.GetW(), 370 ); m_PickTreeLayout.AddButton( m_ClearVarButton2, "Clear Variables" ); // Set up fit tab Fl_Group* fit_group = AddSubGroup( fit_tab, 5 ); m_FitModelLayout.SetGroupAndScreen( fit_group, this ); m_FitScrollGroup = AddSubScroll( fit_group, 5 ); m_FitScrollGroup->type( Fl_Scroll::VERTICAL_ALWAYS ); m_FitVarScrollLayout.SetGroupAndScreen( m_FitScrollGroup, this ); // Set up optimization area at bottom of GUI. m_OptimLayout.SetGroupAndScreen( m_FLTK_Window, this ); m_OptimLayout.AddY( m_OptimLayout.GetRemainY() - 4 * m_OptimLayout.GetStdHeight() - m_OptimLayout.GetGapHeight() - m_OptimLayout.GetDividerHeight() ); m_OptimLayout.AddDividerBox( "Optimizer Control" ); m_OptimLayout.SetFitWidthFlag( false ); m_OptimLayout.SetSameLineFlag( true ); m_OptimLayout.SetButtonWidth( ( m_OptimLayout.GetRemainX() ) / 4 ); m_OptimLayout.SetInputWidth( ( m_OptimLayout.GetRemainX() ) / 4 ); m_OptimLayout.AddOutput( m_DOFOutput, "DOF" ); m_OptimLayout.AddOutput( m_CondOutput, "Conditions" ); m_OptimLayout.ForceNewLine(); m_OptimLayout.SetButtonWidth( ( m_OptimLayout.GetRemainX() ) / 2 ); m_OptimLayout.AddButton( m_SearchUWButton, "Search UW" ); m_OptimLayout.AddButton( m_RefineUWButton, "Refine UW" ); m_OptimLayout.ForceNewLine(); m_OptimLayout.AddButton( m_UpdateDistButton, "Update Distance" ); m_OptimLayout.AddButton( m_OptimizeButton, "Fit" ); m_OptimLayout.ForceNewLine(); m_OptimLayout.SetFitWidthFlag( true ); m_OptimLayout.SetSameLineFlag( false ); m_OptimLayout.SetButtonWidth( 100 ); m_OptimLayout.AddOutput( m_DistOutput, "Distance Metric" ); //===== Save/Load Tab =====// Fl_Group* saveLoad_group = AddSubGroup( saveLoad_tab, 5 ); m_FitModelLayout.SetGroupAndScreen( saveLoad_group, this ); m_FitModelLayout.AddDividerBox("Save Targets & Variables"); m_FitModelLayout.AddYGap(); m_FitModelLayout.SetFitWidthFlag( false ); m_FitModelLayout.SetSameLineFlag( true ); m_FitModelLayout.SetButtonWidth( 75 ); m_FitModelLayout.SetInputWidth( m_FitModelLayout.GetRemainX() - m_FitModelLayout.GetButtonWidth() - 50 ); m_FitModelLayout.AddOutput(m_SaveOutput, "File Name:"); m_FitModelLayout.SetButtonWidth( 50 ); m_FitModelLayout.AddButton(m_SaveSelect, "..."); m_FitModelLayout.ForceNewLine(); m_FitModelLayout.AddYGap(); m_FitModelLayout.SetFitWidthFlag( true ); m_FitModelLayout.SetSameLineFlag( false ); m_FitModelLayout.AddButton(m_Save, "Save"); m_FitModelLayout.AddYGap(); m_FitModelLayout.AddDividerBox("Import Targets & Variables"); m_FitModelLayout.AddYGap(); m_FitModelLayout.SetFitWidthFlag( false ); m_FitModelLayout.SetSameLineFlag( true ); m_FitModelLayout.SetButtonWidth( 75 ); m_FitModelLayout.AddOutput(m_LoadOutput, "File Name:"); m_FitModelLayout.SetButtonWidth( 50 ); m_FitModelLayout.AddButton(m_LoadSelect, "..."); m_FitModelLayout.ForceNewLine(); m_FitModelLayout.AddYGap(); m_FitModelLayout.SetFitWidthFlag( true ); m_FitModelLayout.SetSameLineFlag( false ); m_FitModelLayout.AddButton(m_Load, "Import"); }
DesignVarScreen::DesignVarScreen( ScreenMgr* mgr ) : TabScreen( mgr, 300, 463, "Design Variables" ) { m_NVarLast = 0; Fl_Group* pick_tab = AddTab( "Pick" ); ( (Vsp_Group*) pick_tab )->SetAllowDrop( true ); pick_tab->callback( staticCB, this ); Fl_Group* adj_tab = AddTab( "Adjust" ); Fl_Group* pick_group = AddSubGroup( pick_tab, 5 ); m_AdjustGroup = AddSubScroll( adj_tab, 5 ); m_AdjustGroup->type( Fl_Scroll::VERTICAL_ALWAYS ); m_PickLayout.SetGroupAndScreen( pick_group, this ); m_PickLayout.AddDividerBox( "Variable" ); m_PickLayout.AddParmPicker( m_ParmPicker ); m_PickLayout.SetFitWidthFlag( false ); m_PickLayout.SetSameLineFlag( true ); m_PickLayout.AddLabel( "XDDM Type:", 100 ); m_PickLayout.SetButtonWidth( m_PickLayout.GetRemainX() / 2 ); m_PickLayout.AddButton( m_XDDMVarButton, "Variable" ); m_PickLayout.AddButton( m_XDDMConstButton, "Constant" ); m_PickLayout.ForceNewLine(); m_XDDMGroup.Init( this ); m_XDDMGroup.AddButton( m_XDDMVarButton.GetFlButton() ); m_XDDMGroup.AddButton( m_XDDMConstButton.GetFlButton() ); vector< int > dv_val_map; dv_val_map.push_back( vsp::XDDM_VAR ); dv_val_map.push_back( vsp::XDDM_CONST ); m_XDDMGroup.SetValMapVec( dv_val_map ); m_PickLayout.AddYGap(); m_PickLayout.SetButtonWidth( ( m_PickLayout.GetRemainX() ) / 2 ); m_PickLayout.AddButton( m_AddVarButton, "Add Variable" ); m_PickLayout.AddButton( m_DelVarButton, "Delete Variable" ); m_PickLayout.ForceNewLine(); m_PickLayout.SetFitWidthFlag( true ); m_PickLayout.SetSameLineFlag( false ); m_PickLayout.AddYGap(); m_PickLayout.AddDividerBox( "Variable List" ); int browser_h = 200; varBrowser = new Fl_Browser( m_PickLayout.GetX(), m_PickLayout.GetY(), m_PickLayout.GetW(), browser_h ); varBrowser->type( 1 ); varBrowser->labelfont( 13 ); varBrowser->labelsize( 12 ); varBrowser->textsize( 12 ); varBrowser->callback( staticScreenCB, this ); pick_group->add( varBrowser ); m_PickLayout.AddY( browser_h ); m_PickLayout.AddYGap(); m_PickLayout.AddDividerBox( "Design File" ); m_FileTypeChoice.AddItem( "Design file *.des" ); m_FileTypeChoice.AddItem( "Cart3D XDDM file *.xddm" ); m_PickLayout.AddChoice( m_FileTypeChoice, "File Type:" ); m_PickLayout.SetFitWidthFlag( false ); m_PickLayout.SetSameLineFlag( true ); m_PickLayout.AddButton( m_SaveButton, "Save" ); m_PickLayout.AddButton( m_LoadButton, "Load" ); m_PickLayout.ForceNewLine(); pick_tab->show(); m_AdjustLayout.SetGroupAndScreen( m_AdjustGroup, this ); }
VSPAEROScreen::VSPAEROScreen( ScreenMgr* mgr ) : TabScreen( mgr, VSPAERO_SCREEN_WIDTH, VSPAERO_SCREEN_HEIGHT, "VSPAERO" ) { m_FLTK_Window->callback( staticCloseCB, this ); m_SolverPair = make_pair( &VSPAEROMgr, this ); //solverpair type m_ViewerPair = make_pair( this, VSPAERO_VIEWER ); //monitorpair type int window_border_width = 5; int group_border_width = 2; int total_width = VSPAERO_SCREEN_WIDTH - 2 * window_border_width; int total_height = VSPAERO_SCREEN_HEIGHT - 2 * window_border_width; int row_height = 20; int action_button_height = 0 * row_height; //space reserved for action buttons at the bottom //==== Overview Tab ====// Fl_Group* overview_tab = AddTab( "Overview" ); Fl_Group* overview_group = AddSubGroup( overview_tab, window_border_width ); m_OverviewLayout.SetGroupAndScreen( overview_group, this ); // Column layout GroupLayout left_col_layout; int left_col_width = 350 - 2 * group_border_width; int col_height = m_OverviewLayout.GetH() - group_border_width - action_button_height; m_OverviewLayout.AddSubGroupLayout( left_col_layout, left_col_width, col_height ); m_OverviewLayout.AddX( left_col_layout.GetW() + 2 * group_border_width ); GroupLayout right_col_layout; int right_col_width = m_OverviewLayout.GetRemainX(); m_OverviewLayout.AddSubGroupLayout( right_col_layout, right_col_width, col_height ); m_OverviewLayout.ForceNewLine(); m_OverviewLayout.AddY( right_col_layout.GetH() ); //add Y for Execute divider box // Case Setup left_col_layout.AddSubGroupLayout( m_GeomLayout, left_col_layout.GetW() - 2 * group_border_width, 8 * row_height ); left_col_layout.AddY( m_GeomLayout.GetH() ); m_GeomLayout.AddDividerBox( "Case Setup" ); m_GeomLayout.SetSameLineFlag( true ); m_GeomLayout.SetFitWidthFlag( false ); // Analysis method radio button group setup m_GeomLayout.SetButtonWidth( m_GeomLayout.GetW() / 2 ); m_GeomLayout.AddButton( m_AeroMethodToggleVLM, "Vortex Lattice (VLM)" ); m_GeomLayout.AddButton( m_AeroMethodTogglePanel, "Panel Method" ); m_AeroMethodToggleGroup.Init( this ); m_AeroMethodToggleGroup.AddButton( m_AeroMethodToggleVLM.GetFlButton() ); m_AeroMethodToggleGroup.AddButton( m_AeroMethodTogglePanel.GetFlButton() ); vector< int > val_map; val_map.push_back( vsp::VSPAERO_ANALYSIS_METHOD::VORTEX_LATTICE ); val_map.push_back( vsp::VSPAERO_ANALYSIS_METHOD::PANEL ); m_AeroMethodToggleGroup.SetValMapVec( val_map ); m_GeomLayout.ForceNewLine(); // Degengeom output file selection, used for VLM & Panel methods int labelButtonWidth = 60; int fileButtonWidth = 25; int inputWidth = m_GeomLayout.GetW() - labelButtonWidth - fileButtonWidth; m_GeomLayout.SetButtonWidth( labelButtonWidth ); m_GeomLayout.SetInputWidth( inputWidth ); m_GeomLayout.AddOutput( m_DegenFileName, "Degen" ); m_GeomLayout.SetButtonWidth( fileButtonWidth ); m_GeomLayout.AddButton( m_DegenFileButton, "..." ); m_GeomLayout.ForceNewLine(); // CompGeom output file selection, used for Panel method only m_GeomLayout.SetButtonWidth( labelButtonWidth ); m_GeomLayout.SetInputWidth( inputWidth ); m_GeomLayout.AddOutput( m_CompGeomFileName, "Panel" ); m_GeomLayout.SetButtonWidth( fileButtonWidth ); m_GeomLayout.AddButton( m_CompGeomFileButton, "..." ); m_GeomLayout.ForceNewLine(); m_GeomLayout.InitWidthHeightVals(); m_GeomLayout.SetSameLineFlag( false ); m_GeomLayout.SetFitWidthFlag( true ); m_GeomLayout.AddChoice( m_GeomSetChoice, "Geometry Set:" ); m_GeomLayout.AddSlider( m_NCPUSlider, "Num CPU", 10.0, "%3.0f" ); m_GeomLayout.AddButton( m_StabilityCalcToggle, "Stability Calculation" ); m_GeomLayout.AddButton( m_BatchCalculationToggle, "Batch Calculation" ); left_col_layout.AddY( group_border_width ); // Wake left_col_layout.AddSubGroupLayout( m_WakeLayout, left_col_layout.GetW() - 2 * group_border_width, 4 * row_height ); left_col_layout.AddY( m_WakeLayout.GetH() ); m_WakeLayout.AddDividerBox( "Wake" ); m_WakeLayout.SetSameLineFlag( false ); m_WakeLayout.SetFitWidthFlag( true ); m_WakeLayout.AddSlider( m_WakeNumIterSlider, "Num It.", 10, "%3.0f" ); m_WakeLayout.AddSlider( m_WakeAvgStartIterSlider, "Avg Start It.", 11, "%3.0f" ); m_WakeLayout.AddSlider( m_WakeSkipUntilIterSlider, "Skip Until It.", 11, "%3.0f" ); left_col_layout.AddY( group_border_width ); // Reference Quantities left_col_layout.AddSubGroupLayout( m_RefLayout, left_col_layout.GetW() - 2 * group_border_width, 6 * row_height ); left_col_layout.AddY( m_RefLayout.GetH() ); m_RefLayout.AddDividerBox( "Reference Area, Lengths" ); m_RefLayout.SetSameLineFlag( true ); m_RefLayout.SetFitWidthFlag( false ); m_RefLayout.SetButtonWidth( m_RefLayout.GetW() / 2 ); m_RefLayout.AddButton( m_RefManualToggle, "Manual" ); m_RefLayout.AddButton( m_RefChoiceToggle, "From Model" ); m_RefLayout.ForceNewLine(); m_RefLayout.InitWidthHeightVals(); m_RefLayout.SetSameLineFlag( false ); m_RefLayout.SetFitWidthFlag( true ); m_RefLayout.AddChoice( m_RefWingChoice, "Ref. Wing" ); m_RefLayout.AddSlider( m_SrefSlider, "Sref", 1000.0, "%7.3f" ); m_RefLayout.AddSlider( m_brefSlider, "bref", 100.0, "%7.3f" ); m_RefLayout.AddSlider( m_crefSlider, "cref", 100.0, "%7.3f" ); m_RefToggle.Init( this ); m_RefToggle.AddButton( m_RefManualToggle.GetFlButton() ); m_RefToggle.AddButton( m_RefChoiceToggle.GetFlButton() ); left_col_layout.AddY( group_border_width ); // CG left_col_layout.AddSubGroupLayout( m_CGLayout, left_col_layout.GetW() - 2 * group_border_width, 6 * row_height ); left_col_layout.AddY( m_CGLayout.GetH() ); m_CGLayout.AddDividerBox( "Moment Reference Position" ); m_CGLayout.SetButtonWidth( 125 ); m_CGLayout.SetSameLineFlag( true ); m_CGLayout.AddChoice( m_CGSetChoice, "Mass Set:", m_CGLayout.GetButtonWidth() ); m_CGLayout.SetFitWidthFlag( false ); m_CGLayout.AddButton( m_MassPropButton, "Calc CG" ); m_CGLayout.ForceNewLine(); m_CGLayout.SetSameLineFlag( false ); m_CGLayout.SetFitWidthFlag( true ); m_CGLayout.InitWidthHeightVals(); m_CGLayout.AddSlider( m_NumSliceSlider, "Num Slices", 100, "%4.0f" ); m_CGLayout.AddSlider( m_XcgSlider, "Xref", 100.0, "%7.3f" ); m_CGLayout.AddSlider( m_YcgSlider, "Yref", 100.0, "%7.3f" ); m_CGLayout.AddSlider( m_ZcgSlider, "Zref", 100.0, "%7.3f" ); left_col_layout.AddY( group_border_width ); // Flow Condition left_col_layout.AddSubGroupLayout( m_FlowLayout, left_col_layout.GetW() - 2 * group_border_width, 4 * row_height ); left_col_layout.AddY( m_FlowLayout.GetH() ); m_FlowLayout.AddDividerBox( "Flow Condition" ); m_FlowLayout.SetSameLineFlag( false ); m_FlowLayout.SetFitWidthFlag( true ); m_FlowLayout.AddInputEvenSpacedVector( m_AlphaStartInput, m_AlphaEndInput, m_AlphaNptsInput, "Alpha", "%7.3f" ); m_FlowLayout.AddInputEvenSpacedVector( m_BetaStartInput, m_BetaEndInput, m_BetaNptsInput, "Beta", "%7.3f" ); m_FlowLayout.AddInputEvenSpacedVector( m_MachStartInput, m_MachEndInput, m_MachNptsInput, "Mach", "%7.3f" ); left_col_layout.AddY( group_border_width ); // Execute left_col_layout.AddSubGroupLayout( m_ExecuteLayout, left_col_layout.GetW() - 2 * group_border_width, 7 * row_height ); left_col_layout.AddY( m_ExecuteLayout.GetH() ); m_ExecuteLayout.AddDividerBox( "Execute" ); m_ExecuteLayout.AddButton( m_ComputeGeometryButton, "Generate Geometry" ); //This calls VSAERO.ComputeGeometry() m_ExecuteLayout.SetButtonWidth( m_ExecuteLayout.GetW() / 2 ); m_ExecuteLayout.SetSameLineFlag( true ); m_ExecuteLayout.SetFitWidthFlag( false ); m_ExecuteLayout.AddButton( m_SetupButton, "Create New Setup" ); m_ExecuteLayout.AddButton( m_KillSolverSetupButton, "Kill Setup" ); m_ExecuteLayout.ForceNewLine(); m_ExecuteLayout.AddButton( m_SolverButton, "Launch Solver" ); m_ExecuteLayout.AddButton( m_KillSolverButton, "Kill Solver" ); m_ExecuteLayout.ForceNewLine(); m_ExecuteLayout.AddButton( m_PlotButton, "Show Results Mgr" ); m_ExecuteLayout.AddButton( m_ViewerButton, "Launch Viewer" ); m_ExecuteLayout.ForceNewLine(); //m_ExecuteLayout.AddButton( m_ExportResultsToMatlabButton, "Export to *.m" ); m_ExecuteLayout.AddButton( m_ExportResultsToCsvButton, "Export to *.csv" ); m_ExportResultsToCsvButton.Deactivate(); // Setup File right_col_layout.AddSubGroupLayout( m_SetupLayout, right_col_layout.GetW() - 2 * group_border_width, right_col_layout.GetH() - 2 * group_border_width ); m_SetupDividerBox = m_SetupLayout.AddDividerBox( "Setup File: *.vspaero" ); m_SetupEditor = m_SetupLayout.AddFlTextEditor( m_SetupLayout.GetRemainY() - m_SetupLayout.GetStdHeight() ); m_SetupBuffer = new Fl_Text_Buffer; m_SetupEditor->buffer( m_SetupBuffer ); m_SetupEditor->textfont( FL_COURIER ); m_SetupLayout.SetButtonWidth( m_SetupLayout.GetW() / 2 ); m_SetupLayout.SetSameLineFlag( true ); m_SetupLayout.SetFitWidthFlag( false ); m_SetupLayout.AddButton( m_ReadSetup, "Read Setup" ); m_SetupLayout.AddButton( m_SaveSetup, "Save Setup" ); //==== Solver Tab ====// Fl_Group* solver_tab = AddTab( "Solver Console" ); Fl_Group* solver_group = AddSubGroup( solver_tab, window_border_width ); m_SolverLayout.SetGroupAndScreen( solver_group, this ); m_SolverLayout.AddDividerBox( "VSPAERO Solver Console" ); m_SolverDisplay = m_SolverLayout.AddFlTextDisplay( m_SolverLayout.GetRemainY() - m_SolverLayout.GetStdHeight() ); m_SolverBuffer = new Fl_Text_Buffer; m_SolverDisplay->buffer( m_SolverBuffer ); //==== Viewer Tab ====// Fl_Group* viewer_tab = AddTab( "Viewer Console" ); Fl_Group* viewer_group = AddSubGroup( viewer_tab, window_border_width ); m_ViewerLayout.SetGroupAndScreen( viewer_group, this ); m_ViewerLayout.AddDividerBox( "VSPAERO Viewer Console" ); m_ViewerDisplay = m_ViewerLayout.AddFlTextDisplay( m_ViewerLayout.GetRemainY() - m_ViewerLayout.GetStdHeight() ); m_ViewerBuffer = new Fl_Text_Buffer; m_ViewerDisplay->buffer( m_ViewerBuffer ); // Show the starting tab overview_tab->show(); // Flags to control Kill thread functionality m_SolverSetupThreadIsRunning = false; m_SolverThreadIsRunning = false; // String to enable detection of degen file name changes m_ModelNameBasePrevious = string(); }
//==== Constructor ====// HingeScreen::HingeScreen( ScreenMgr* mgr ) : GeomScreen( mgr, 300, 720, "Hinge" ) { Fl_Group* orient_tab = AddTab( "Orient" ); Fl_Group* orient_group = AddSubGroup( orient_tab, 5 ); m_BaseOrientationLayout.SetGroupAndScreen( orient_group, this ); m_BaseOrientationLayout.AddDividerBox( "Orient Base" ); m_BaseOrientationLayout.AddButton( m_OrientRotToggle, "Rotations (Use XForm Tab)" ); m_BaseOrientationLayout.AddButton( m_OrientVecToggle, "Vectors" ); m_OrientTypeGroup.Init( this ); m_OrientTypeGroup.AddButton( m_OrientRotToggle.GetFlButton() ); m_OrientTypeGroup.AddButton( m_OrientVecToggle.GetFlButton() ); m_BaseOrientationLayout.AddYGap(); m_BaseOrientationLayout.AddDividerBox( "Vectors" ); // Indivdual SubSurface Parameters m_PrimaryDirLayout.SetGroupAndScreen( AddSubGroup( orient_tab, 5 ), this ); m_PrimaryDirLayout.SetY( m_BaseOrientationLayout.GetY() ); m_PrimaryDirLayout.SetButtonWidth( m_PrimaryDirLayout.GetW()/4 ); m_PrimaryDirLayout.SetSameLineFlag( true ); m_PrimaryDirLayout.SetFitWidthFlag( false ); m_PrimaryDirLayout.AddLabel( "Axis", m_PrimaryDirLayout.GetButtonWidth() ); m_PrimaryDirLayout.AddButton( m_PrimaryXToggle, "X" ); m_PrimaryDirLayout.AddButton( m_PrimaryYToggle, "Y" ); m_PrimaryDirLayout.AddButton( m_PrimaryZToggle, "Z" ); m_PrimaryDirLayout.ForceNewLine(); m_PrimaryDirGroup.Init( this ); m_PrimaryDirGroup.AddButton( m_PrimaryXToggle.GetFlButton() ); m_PrimaryDirGroup.AddButton( m_PrimaryYToggle.GetFlButton() ); m_PrimaryDirGroup.AddButton( m_PrimaryZToggle.GetFlButton() ); m_SecondaryDirLayout.SetGroupAndScreen( AddSubGroup( orient_tab, 5 ), this ); m_SecondaryDirLayout.SetY( m_PrimaryDirLayout.GetY() ); m_SecondaryDirLayout.SetButtonWidth( m_SecondaryDirLayout.GetW()/4 ); m_SecondaryDirLayout.SetSameLineFlag( true ); m_SecondaryDirLayout.SetFitWidthFlag( false ); m_SecondaryDirLayout.AddLabel( "Reference", m_SecondaryDirLayout.GetButtonWidth() ); m_SecondaryDirLayout.AddButton( m_SecondaryXToggle, "X" ); m_SecondaryDirLayout.AddButton( m_SecondaryYToggle, "Y" ); m_SecondaryDirLayout.AddButton( m_SecondaryZToggle, "Z" ); m_SecondaryDirLayout.ForceNewLine(); m_SecondaryDirGroup.Init( this ); m_SecondaryDirGroup.AddButton( m_SecondaryXToggle.GetFlButton() ); m_SecondaryDirGroup.AddButton( m_SecondaryYToggle.GetFlButton() ); m_SecondaryDirGroup.AddButton( m_SecondaryZToggle.GetFlButton() ); m_VectorLayout.SetGroupAndScreen( AddSubGroup( orient_tab, 5 ), this ); m_VectorLayout.SetY( m_SecondaryDirLayout.GetY() ); m_VectorLayout.AddYGap(); m_VectorLayout.AddDividerBox( "Axis" ); m_PrimTypeChoice.AddItem( "VECTOR3D" ); m_PrimTypeChoice.AddItem( "POINT3D" ); m_PrimTypeChoice.AddItem( "SURFPT" ); m_PrimTypeChoice.AddItem( "UDIR" ); m_PrimTypeChoice.AddItem( "WDIR" ); m_PrimTypeChoice.AddItem( "NDIR" ); m_VectorLayout.AddChoice( m_PrimTypeChoice, "Type" ); m_VectorLayout.AddYGap(); m_PrimVecLayout.SetGroupAndScreen( AddSubGroup( orient_tab, 5 ), this ); m_PrimVecLayout.SetY( m_VectorLayout.GetY() ); m_PrimVecLayout.SetFitWidthFlag( false ); m_PrimVecLayout.SetSameLineFlag( true ); m_PrimVecLayout.AddLabel( "Direction Vector:", 170 ); m_PrimVecLayout.SetButtonWidth( m_PrimVecLayout.GetRemainX() / 2 ); m_PrimVecLayout.AddButton( m_PrimVecRelToggle, "Rel" ); m_PrimVecLayout.AddButton( m_PrimVecAbsToggle, "Abs" ); m_PrimVecLayout.ForceNewLine(); m_PrimVecAbsRelToggle.Init( this ); m_PrimVecAbsRelToggle.AddButton( m_PrimVecAbsToggle.GetFlButton() ); m_PrimVecAbsRelToggle.AddButton( m_PrimVecRelToggle.GetFlButton() ); m_PrimVecLayout.SetFitWidthFlag( true ); m_PrimVecLayout.SetSameLineFlag( false ); m_PrimVecLayout.AddYGap(); m_PrimVecLayout.SetButtonWidth( 50 ); m_PrimVecLayout.AddSlider( m_PrimXVecSlider, "X", 10.0, "%7.3f" ); m_PrimVecLayout.AddSlider( m_PrimYVecSlider, "Y", 10.0, "%7.3f" ); m_PrimVecLayout.AddSlider( m_PrimZVecSlider, "Z", 10.0, "%7.3f" ); m_VectorLayout.SetY( m_PrimVecLayout.GetY() ); m_VectorLayout.AddYGap(); m_PrimOffLayout.SetGroupAndScreen( AddSubGroup( orient_tab, 5 ), this ); m_PrimOffLayout.SetY( m_VectorLayout.GetY() ); m_PrimOffLayout.SetFitWidthFlag( false ); m_PrimOffLayout.SetSameLineFlag( true ); m_PrimOffLayout.AddLabel( "Offset:", 170 ); m_PrimOffLayout.SetButtonWidth( m_PrimOffLayout.GetRemainX() / 2 ); m_PrimOffLayout.AddButton( m_PrimOffRelToggle, "Rel" ); m_PrimOffLayout.AddButton( m_PrimOffAbsToggle, "Abs" ); m_PrimOffLayout.ForceNewLine(); m_PrimOffAbsRelToggle.Init( this ); m_PrimOffAbsRelToggle.AddButton( m_PrimOffAbsToggle.GetFlButton() ); m_PrimOffAbsRelToggle.AddButton( m_PrimOffRelToggle.GetFlButton() ); m_PrimOffLayout.SetFitWidthFlag( true ); m_PrimOffLayout.SetSameLineFlag( false ); m_PrimOffLayout.AddYGap(); m_PrimOffLayout.SetButtonWidth( 50 ); m_PrimOffLayout.AddSlider( m_PrimXOffSlider, "X", 10.0, "%7.3f" ); m_PrimOffLayout.AddSlider( m_PrimYOffSlider, "Y", 10.0, "%7.3f" ); m_PrimOffLayout.AddSlider( m_PrimZOffSlider, "Z", 10.0, "%7.3f" ); m_VectorLayout.SetY( m_PrimOffLayout.GetY() ); m_VectorLayout.AddYGap(); m_PrimUWLayout.SetGroupAndScreen( AddSubGroup( orient_tab, 5 ), this ); m_PrimUWLayout.SetY( m_VectorLayout.GetY() ); m_PrimUWLayout.AddSlider( m_PrimUSlider, "U", 1, "%5.4f" ); m_PrimUWLayout.AddSlider( m_PrimWSlider, "W", 1, "%5.4f" ); m_VectorLayout.SetY( m_PrimUWLayout.GetY() ); m_VectorLayout.AddYGap(); m_SecVecLayout.SetGroupAndScreen( AddSubGroup( orient_tab, 5 ), this ); m_SecVecLayout.SetY( m_VectorLayout.GetY() ); m_SecVecLayout.AddDividerBox( "Reference Vector" ); m_SecVecLayout.SetFitWidthFlag( false ); m_SecVecLayout.SetSameLineFlag( true ); m_SecVecLayout.SetButtonWidth( m_SecVecLayout.GetRemainX() / 3 ); m_SecVecLayout.AddLabel( "Reference Vec", m_SecVecLayout.GetButtonWidth() ); m_SecVecLayout.AddButton( m_SecVecAbsToggle, "Rel" ); m_SecVecLayout.AddButton( m_SecVecRelToggle, "Abs" ); m_SecVecLayout.ForceNewLine(); m_SecVecAbsRelToggle.Init( this ); m_SecVecAbsRelToggle.AddButton( m_SecVecAbsToggle.GetFlButton() ); m_SecVecAbsRelToggle.AddButton( m_SecVecRelToggle.GetFlButton() ); m_SecVecLayout.AddButton( m_SecondaryVecXToggle, "X" ); m_SecVecLayout.AddButton( m_SecondaryVecYToggle, "Y" ); m_SecVecLayout.AddButton( m_SecondaryVecZToggle, "Z" ); m_SecVecLayout.ForceNewLine(); m_SecondaryVecDirGroup.Init( this ); m_SecondaryVecDirGroup.AddButton( m_SecondaryVecXToggle.GetFlButton() ); m_SecondaryVecDirGroup.AddButton( m_SecondaryVecYToggle.GetFlButton() ); m_SecondaryVecDirGroup.AddButton( m_SecondaryVecZToggle.GetFlButton() ); Fl_Group* motion_tab = AddTab( "Motion" ); Fl_Group* motion_group = AddSubGroup( motion_tab, 5 ); m_MotionLayout.SetGroupAndScreen( motion_group, this ); int bw = 110; int tw = 15; int sw = 35; m_MotionLayout.SetSameLineFlag( false ); m_MotionLayout.SetFitWidthFlag( true ); m_MotionLayout.AddDividerBox( "DOF and Coordinates" ); m_MotionLayout.AddYGap(); m_MotionLayout.AddDividerBox( "Translate" ); m_MotionLayout.SetSameLineFlag( true ); m_MotionLayout.SetFitWidthFlag( false ); m_MotionLayout.SetButtonWidth( tw ); m_MotionLayout.AddButton( m_JointTransMinToggle, "" ); m_MotionLayout.SetButtonWidth( sw ); m_MotionLayout.AddButton( m_JointTransMinSetButton, "Set" ); m_MotionLayout.SetFitWidthFlag( true ); m_MotionLayout.SetButtonWidth( bw - tw - sw ); m_MotionLayout.AddSlider( m_JointTransMinSlider, "Min", 10, "%6.2f" ); m_MotionLayout.ForceNewLine(); m_MotionLayout.SetFitWidthFlag( false ); m_MotionLayout.SetButtonWidth( tw ); m_MotionLayout.AddButton( m_JointTranslateToggle, "" ); m_MotionLayout.SetButtonWidth( sw ); m_MotionLayout.AddButton( m_JointTranslateRngButton, "Rng" ); m_MotionLayout.SetFitWidthFlag( true ); m_MotionLayout.SetButtonWidth( bw - tw - sw ); m_MotionLayout.AddSlider( m_JointTranslateSlider, "Translate", 10, "%6.2f" ); m_MotionLayout.ForceNewLine(); m_MotionLayout.SetFitWidthFlag( false ); m_MotionLayout.SetButtonWidth( tw ); m_MotionLayout.AddButton( m_JointTransMaxToggle, "" ); m_MotionLayout.SetButtonWidth( sw ); m_MotionLayout.AddButton( m_JointTransMaxSetButton, "Set" ); m_MotionLayout.SetFitWidthFlag( true ); m_MotionLayout.SetButtonWidth( bw - tw - sw ); m_MotionLayout.AddSlider( m_JointTransMaxSlider, "Max", 10, "%6.2f" ); m_MotionLayout.ForceNewLine(); m_MotionLayout.AddYGap(); m_MotionLayout.SetSameLineFlag( false ); m_MotionLayout.AddDividerBox( "Rotate" ); m_MotionLayout.SetSameLineFlag( true ); m_MotionLayout.SetFitWidthFlag( false ); m_MotionLayout.SetButtonWidth( tw ); m_MotionLayout.AddButton( m_JointRotMinToggle, "" ); m_MotionLayout.SetButtonWidth( sw ); m_MotionLayout.AddButton( m_JointRotMinSetButton, "Set" ); m_MotionLayout.SetFitWidthFlag( true ); m_MotionLayout.SetButtonWidth( bw - tw - sw ); m_MotionLayout.AddSlider( m_JointRotMinSlider, "Min", 100, "%6.2f" ); m_MotionLayout.ForceNewLine(); m_MotionLayout.SetFitWidthFlag( false ); m_MotionLayout.SetButtonWidth( tw ); m_MotionLayout.AddButton( m_JointRotateToggle, "" ); m_MotionLayout.SetButtonWidth( sw ); m_MotionLayout.AddButton( m_JointRotateRngButton, "Rng" ); m_MotionLayout.SetFitWidthFlag( true ); m_MotionLayout.SetButtonWidth( bw - tw - sw ); m_MotionLayout.AddSlider( m_JointRotateSlider, "Rotate", 100, "%6.2f" ); m_MotionLayout.ForceNewLine(); m_MotionLayout.SetFitWidthFlag( false ); m_MotionLayout.SetButtonWidth( tw ); m_MotionLayout.AddButton( m_JointRotMaxToggle, "" ); m_MotionLayout.SetButtonWidth( sw ); m_MotionLayout.AddButton( m_JointRotMaxSetButton, "Set" ); m_MotionLayout.SetFitWidthFlag( true ); m_MotionLayout.SetButtonWidth( bw - tw - sw ); m_MotionLayout.AddSlider( m_JointRotMaxSlider, "Max", 100, "%6.2f" ); m_MotionLayout.ForceNewLine(); RemoveTab( GetTab( m_SubSurfTab_ind ) ); }