The following group of functions allow for the OpenVSP GUI to be manipulated through the API. Click here to return to the main page.
More...
|
void | vsp::InitGUI () |
|
void | vsp::StartGUI () |
|
void | vsp::EnableStopGUIMenuItem () |
|
void | vsp::DisableStopGUIMenuItem () |
|
void | vsp::StopGUI () |
|
void | vsp::PopupMsg (const std::string &msg) |
|
void | vsp::UpdateGUI () |
|
bool | vsp::IsGUIBuild () |
|
void | vsp::Lock () |
|
void | vsp::Unlock () |
|
bool | vsp::IsEventLoopRunning () |
|
void | vsp::ScreenGrab (const string &fname, int w, int h, bool transparentBG, bool autocrop=false) |
|
void | vsp::SetViewAxis (bool vaxis) |
|
void | vsp::SetShowBorders (bool brdr) |
|
void | vsp::SetGeomDrawType (const string &geom_id, int type) |
|
void | vsp::SetGeomWireColor (const string &geom_id, int r, int g, int b) |
|
void | vsp::SetGeomDisplayType (const string &geom_id, int type) |
|
void | vsp::SetGeomMaterialName (const string &geom_id, const string &name) |
|
void | vsp::AddMaterial (const string &name, const vec3d &ambient, const vec3d &diffuse, const vec3d &specular, const vec3d &emissive, const double &alpha, const double &shininess) |
|
vector< string > | vsp::GetMaterialNames () |
|
void | vsp::SetBackground (double r, double g, double b) |
|
void | vsp::SetAllViews (int view) |
|
void | vsp::SetView (int viewport, int view) |
|
void | vsp::FitAllViews () |
|
void | vsp::ResetViews () |
|
void | vsp::SetWindowLayout (int r, int c) |
|
void | vsp::SetGUIElementDisable (int e, bool state) |
|
void | vsp::SetGUIScreenDisable (int s, bool state) |
|
void | vsp::SetGeomScreenDisable (int s, bool state) |
|
◆ AddMaterial()
void vsp::AddMaterial |
( |
const string & | name, |
|
|
const vec3d & | ambient, |
|
|
const vec3d & | diffuse, |
|
|
const vec3d & | specular, |
|
|
const vec3d & | emissive, |
|
|
const double & | alpha, |
|
|
const double & | shininess ) |
|
extern |
Set the visualization material the specified geometry
AddMaterial(
"RedGlass",
vec3d( 44, 2, 2 ),
vec3d( 156, 10, 10 ),
vec3d( 185, 159, 159 ),
vec3d( 44, 2, 2 ), 30, 0.4 );
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
void SetGeomMaterialName(const string &geom_id, const string &name)
void AddMaterial(const string &name, const vec3d &ambient, const vec3d &diffuse, const vec3d &specular, const vec3d &emissive, const double &alpha, const double &shininess)
- Parameters
-
[in] | name | string Material name |
[in] | ambient | vec3d Ambient color RGB triple on scale [0, 255] |
[in] | diffuse | vec3d Diffuse color RGB triple on scale [0, 255] |
[in] | specular | vec3d Specular color RGB triple on scale [0, 255] |
[in] | emmissive | vec3d Emissive color RGB triple on scale [0, 255] |
[in] | shininess | double Shininess exponent on scale [0, 127] |
[in] | alpha | double Transparency factor on scale [0, 1] |
◆ DisableStopGUIMenuItem()
void vsp::DisableStopGUIMenuItem |
( |
| ) |
|
|
extern |
Disable Stop GUI Menu Item from the OpenVSP GUI.
This reverses the operation of EnableStopGUIMenuItem.
void EnableStopGUIMenuItem()
- See also
- EnableStopGUIMenuItem
◆ EnableStopGUIMenuItem()
void vsp::EnableStopGUIMenuItem |
( |
| ) |
|
|
extern |
Enable Stop GUI Menu Item from the OpenVSP GUI.
Typically used for the blocking-mode OpenVSP GUI from the API.
This will add a "Stop GUI" option to the file pulldown menu and will also cause the exit button on the window frame to have the same effect. When selected, these options will stop the OpenVSP GUI event loop, returning control to the API program. OpenVSP will not terminate, the model will remain in memory and will be responsive to subsequent API calls.
- See also
- DisableStopGUIMenuItem
◆ FitAllViews()
void vsp::FitAllViews |
( |
| ) |
|
|
extern |
Fit contents to all viewports
◆ GetMaterialNames()
vector< string > vsp::GetMaterialNames |
( |
| ) |
|
|
extern |
Get the names of all visualization materials
for ( int i = 0; i < int( mat_array.size() ); i++ )
{
Print( mat_array[i] );
}
vector< string > GetMaterialNames()
- Returns
- vector<string> Array of material names
◆ InitGUI()
Low level routine that should be called to set up GUI before running StartGUI()
◆ IsEventLoopRunning()
bool vsp::IsEventLoopRunning |
( |
| ) |
|
|
extern |
Test if the OpenVSP GUI event loop is running.
{
Print( "Event loop is running." );
}
bool IsEventLoopRunning()
- Returns
- bool True if the OpenVSP GUI event loop is running. False otherwise.
◆ IsGUIBuild()
Test if the current OpenVSP build includes graphics capabilities.
{
Print( "OpenVSP build is graphics capable." );
}
else
{
Print( "OpenVSP build is not graphics capable." );
}
- Returns
- bool True if the current OpenVSP build includes graphics capabilities. False otherwise.
◆ Lock()
Obtain the lock on the OpenVSP GUI event loop. This will prevent the interactive GUI from updating or accepting user input until the lock is released – thereby allowing longer-time commands including analyses to execute without the chance of the OpenVSP state changing during execution.
std::string ExecAnalysis(const std::string &analysis)
void DeleteGeomVec(const std::vector< std::string > &del_vec)
const std::vector< std::string > & GetStringResults(const std::string &id, const std::string &name, int index=0)
- See also
- Unlock
◆ PopupMsg()
void vsp::PopupMsg |
( |
const std::string & | msg | ) |
|
|
extern |
Cause OpenVSP to display a popup message.
void PopupMsg(const std::string &msg)
- Parameters
-
[in] | msg | string Message to display. |
◆ ResetViews()
Reset views of all viewports
◆ ScreenGrab()
void vsp::ScreenGrab |
( |
const string & | fname, |
|
|
int | w, |
|
|
int | h, |
|
|
bool | transparentBG, |
|
|
bool | autocrop = false ) |
|
extern |
Capture the specified screen and save to file. Note, VSP_USE_FLTK must be defined
int screenw = 2000;
int screenh = 2000;
string fname = "test_screen_grab.png";
ScreenGrab( fname, screenw, screenh,
true,
true );
void ScreenGrab(const string &fname, int w, int h, bool transparentBG, bool autocrop=false)
- Parameters
-
[in] | fname | string Output file name |
[in] | w | int Width of screen grab |
[in] | h | int Height of screen grab |
[in] | transparentBG | bool Transparent background flag |
[in] | autocrop | bool Automatically crop transparent background flag |
◆ SetAllViews()
void vsp::SetAllViews |
( |
int | view | ) |
|
|
extern |
Set the view of all viewports
void SetAllViews(int view)
- Parameters
-
[in] | view | int CAMERA_VIEW enum |
◆ SetBackground()
void vsp::SetBackground |
( |
double | r, |
|
|
double | g, |
|
|
double | b ) |
|
extern |
Set the background color
void SetBackground(double r, double g, double b)
- Parameters
-
[in] | r | Red 8-bit unsigned integer (range: 0-255) |
[in] | g | Green 8-bit unsigned integer (range: 0-255) |
[in] | b | Blue 8-bit unsigned integer (range: 0-255) |
◆ SetGeomDisplayType()
void vsp::SetGeomDisplayType |
( |
const string & | geom_id, |
|
|
int | type ) |
|
extern |
Set the display type of the specified geometry
void SetGeomDisplayType(const string &geom_id, int type)
- See also
- DISPLAY_TYPE
- Parameters
-
[in] | geom_id | string Geom ID |
[in] | type | Display type enum (i.e. DISPLAY_BEZIER) |
◆ SetGeomDrawType()
void vsp::SetGeomDrawType |
( |
const string & | geom_id, |
|
|
int | type ) |
|
extern |
Set the draw type of the specified geometry
void SetGeomDrawType(const string &geom_id, int type)
- See also
- DRAW_TYPE
- Parameters
-
[in] | geom_id | string Geom ID |
[in] | type | Draw type enum (i.e. GEOM_DRAW_SHADE) |
◆ SetGeomMaterialName()
void vsp::SetGeomMaterialName |
( |
const string & | geom_id, |
|
|
const string & | name ) |
|
extern |
Set the visualization material the specified geometry
- Parameters
-
[in] | geom_id | string Geom ID |
[in] | name | string Material name |
◆ SetGeomScreenDisable()
void vsp::SetGeomScreenDisable |
( |
int | s, |
|
|
bool | state ) |
|
extern |
Set whether geom screen is disabled
void SetGeomScreenDisable(int s, bool state)
- Parameters
-
[in] | e | int GUI_GEOM_SCREEN enum for geom screen |
[in] | state | bool True to disable geom screen |
◆ SetGeomWireColor()
void vsp::SetGeomWireColor |
( |
const string & | geom_id, |
|
|
int | r, |
|
|
int | g, |
|
|
int | b ) |
|
extern |
Set the wireframe color of the specified geometry
void SetGeomWireColor(const string &geom_id, int r, int g, int b)
- Parameters
-
[in] | geom_id | string Geom ID |
[in] | r | int Red component of color [0, 255] |
[in] | g | int Green component of color [0, 255] |
[in] | b | int Blue component of color [0, 255] |
◆ SetGUIElementDisable()
void vsp::SetGUIElementDisable |
( |
int | e, |
|
|
bool | state ) |
|
extern |
Set whether all instances of GUI device type are disabled
void SetGUIElementDisable(int e, bool state)
- Parameters
-
[in] | e | int GDEV enum for GUI device type |
[in] | state | bool True to disable GUI device type |
◆ SetGUIScreenDisable()
void vsp::SetGUIScreenDisable |
( |
int | s, |
|
|
bool | state ) |
|
extern |
Set whether screen is disabled
void SetGUIScreenDisable(int s, bool state)
- Parameters
-
[in] | e | int GUI_VSP_SCREEN enum for screen |
[in] | state | bool True to disable screen |
◆ SetShowBorders()
void vsp::SetShowBorders |
( |
bool | brdr | ) |
|
|
extern |
Toggle viewing the border frame
void SetShowBorders(bool brdr)
- Parameters
-
[in] | brdr | True to show the border frame, false to hide the border frame |
◆ SetView()
void vsp::SetView |
( |
int | viewport, |
|
|
int | view ) |
|
extern |
Set the view of a particular viewports
void SetView(int viewport, int view)
- Parameters
-
[in] | view | int CAMERA_VIEW enum |
◆ SetViewAxis()
void vsp::SetViewAxis |
( |
bool | vaxis | ) |
|
|
extern |
Toggle viewing the axis
void SetViewAxis(bool vaxis)
- Parameters
-
[in] | vaxis | True to show the axis, false to hide the axis |
◆ SetWindowLayout()
void vsp::SetWindowLayout |
( |
int | r, |
|
|
int | c ) |
|
extern |
Set the rows and columns of the window layout
void SetWindowLayout(int r, int c)
- Parameters
-
[in] | r | int Number of viewport rows |
[in] | c | int Number of viewport columns |
◆ StartGUI()
Launch the interactive OpenVSP GUI. In a multi-threaded environment, this must be called from the main thread only. This starts the GUI event loop. It will also show the main screen and screens displayed when StopGUI() was previously called.
◆ StopGUI()
Stop OpenVSP GUI event loop and hide screens. Keep OpenVSP running and in memory.
- See also
- StartGUI
◆ Unlock()
Release the lock on the OpenVSP GUI event loop.
- See also
- Lock
◆ UpdateGUI()
Tell OpenVSP that the GUI needs to be updated.
string length =
FindParm( pod_id,
"Length",
"Design" );
std::string FindParm(const std::string &parm_container_id, const std::string &parm_name, const std::string &group_name)
double SetParmVal(const std::string &parm_id, double val)
- See also
- StartGUI