OpenVSPAPI  3.20.0
Functions
Visualization Functions

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...

Functions

void ScreenGrab (const string &in file_name, int w, int h, bool transparentBG)
 
void SetViewAxis (bool vaxis)
 
void SetShowBorders (bool brdr)
 
void SetGeomDrawType (const string &in geom_id, int type)
 
void SetGeomDisplayType (const string &in geom_id, int type)
 
void SetBackground (double r, double g, double b)
 

Detailed Description

Function Documentation

◆ ScreenGrab()

void ScreenGrab ( const string &in  file_name,
int  w,
int  h,
bool  transparentBG 
)

Capture the specified screen and save to file. Note, VSP_USE_FLTK must be defined

int screenw = 2000; // Set screenshot width and height
int screenh = 2000;
string fname = "test_screen_grab.png";
ScreenGrab( fname, screenw, screenh, true ); // Take PNG screenshot
Parameters
[in]file_nameOutput file name
[in]wWidth of screen grab
[in]hHeight of screen grab
[in]transparentBGTransparent background flag

◆ SetBackground()

void SetBackground ( double  r,
double  g,
double  b 
)

Set the background color

SetBackground( 1.0, 1.0, 1.0 ); // Set background to bright white
Parameters
[in]rRed 8-bit unsigned integer (range: 0-255)
[in]gGreen 8-bit unsigned integer (range: 0-255)
[in]bBlue 8-bit unsigned integer (range: 0-255)

◆ SetGeomDisplayType()

void SetGeomDisplayType ( const string &in  geom_id,
int  type 
)

Set the dispay type of the specified goemetry

string pid = AddGeom( "POD" ); // Add Pod for testing
SetGeomDisplayType( pid, DISPLAY_DEGEN_PLATE ); // Make pod appear as Bezier plate (Degen Geom)
See also
DISPLAY_TYPE
Parameters
[in]geom_idGeom ID
[in]typeDisplay type enum (i.e. DISPLAY_BEZIER)

◆ SetGeomDrawType()

void SetGeomDrawType ( const string &in  geom_id,
int  type 
)

Set the draw type of the specified goemetry

string pid = AddGeom( "POD", "" ); // Add Pod for testing
SetGeomDrawType( pid, GEOM_DRAW_SHADE ); // Make pod appear as shaded
See also
DRAW_TYPE
Parameters
[in]geom_idGeom ID
[in]typeDraw type enum (i.e. GEOM_DRAW_SHADE)

◆ SetShowBorders()

void SetShowBorders ( bool  brdr)

Toggle viewing the border frame

SetShowBorders( false ); // Turn off red/black border on active window
Parameters
[in]brdrTrue to show the border frame, false to hide the border frame

◆ SetViewAxis()

void SetViewAxis ( bool  vaxis)

Toggle viewing the axis

SetViewAxis( false ); // Turn off axis marker in corner of viewscreen
Parameters
[in]vaxisTrue to show the axis, false to hide the axis
SetBackground
void SetBackground(double r, double g, double b)
ScreenGrab
void ScreenGrab(const string &in file_name, int w, int h, bool transparentBG)
DISPLAY_DEGEN_PLATE
Definition: openvsp_as.h:1315
SetGeomDrawType
void SetGeomDrawType(const string &in geom_id, int type)
SetViewAxis
void SetViewAxis(bool vaxis)
SetShowBorders
void SetShowBorders(bool brdr)
AddGeom
string AddGeom(const string &in type, const string &in parent=string())
SetGeomDisplayType
void SetGeomDisplayType(const string &in geom_id, int type)
GEOM_DRAW_SHADE
Definition: openvsp_as.h:1327