OpenVSP API Documentation 3.57.0
Loading...
Searching...
No Matches
Results Plot Functions

This group is for functions that make and edit Results plots. Plots are saved with the model and shown on the Plot tab of the Results viewer. Each plot holds curves that name the kinds of Result and the variables they plot. Click here to return to the main page. More...

Functions

std::string vsp::AddResultsPlot ()
std::string vsp::CopyResultsPlot (const std::string &plot_id)
void vsp::DeleteResultsPlot (const std::string &plot_id)
void vsp::DeleteAllResultsPlots ()
void vsp::WriteResultsPlotFile (const std::string &plot_id, const std::string &file_name)
std::string vsp::ReadResultsPlotFile (const std::string &file_name)
std::vector< std::string > vsp::GetAllResultsPlotIDs ()
void vsp::SetActiveResultsPlot (const std::string &plot_id)
std::string vsp::GetActiveResultsPlot ()
std::string vsp::AddResultsCurve (const std::string &plot_id)
void vsp::DeleteResultsCurve (const std::string &curve_id)
std::vector< std::string > vsp::GetResultsCurveIDs (const std::string &plot_id)
void vsp::SetResultsCurveSources (const std::string &curve_id, const std::vector< std::string > &names, const std::vector< std::string > &case_names)
std::vector< std::string > vsp::GetResultsCurveSourceNames (const std::string &curve_id)
std::vector< std::string > vsp::GetResultsCurveSourceCaseNames (const std::string &curve_id)
void vsp::SetResultsCurveXVar (const std::string &curve_id, const std::string &label)
std::string vsp::GetResultsCurveXVar (const std::string &curve_id)
void vsp::SetResultsCurveYVars (const std::string &curve_id, const std::vector< std::string > &labels)
std::vector< std::string > vsp::GetResultsCurveYVars (const std::string &curve_id)
std::vector< std::string > vsp::GetResultsCurveResultIDs (const std::string &curve_id)
void vsp::SetResultsCurveChosenIDs (const std::string &curve_id, const std::vector< std::string > &results_ids)
std::vector< std::string > vsp::GetResultsCurveChosenIDs (const std::string &curve_id)
std::vector< std::string > vsp::GetResultsPlotVarLabels (const std::string &results_id, bool matrix_rows=false)
std::vector< double > vsp::GetResultsPlotVarData (const std::string &results_id, const std::string &label, bool matrix_rows=false)

Detailed Description

Function Documentation

◆ AddResultsCurve()

std::string vsp::AddResultsCurve ( const std::string & plot_id)
extern

Add an empty curve to a Results plot. A curve plots kinds of Result, named with SetResultsCurveSources, and the variables named with SetResultsCurveXVar and SetResultsCurveYVars. How it plots them is set by Parms in group "ResultsCurve": Mode (see RESULTS_PLOT_MODE), Element (see RESULTS_PLOT_ELEMENT), MatrixRows, and Run (0 for every run of each kind of Result, 1 for the newest, 2 for the one before it, and so on).

string plot_id = AddResultsPlot();
string curve_id = AddResultsCurve( plot_id );
if ( GetResultsCurveIDs( plot_id ).size() != 2 ) { Print( "ERROR: AddResultsCurve" ); __failure++; }
// Plot the newest run only, one point per Result.
SetParmVal( FindParm( curve_id, "Run", "ResultsCurve" ), 1.0 );
SetParmVal( FindParm( curve_id, "Mode", "ResultsCurve" ), RESULTS_PLOT_ACROSS_RESULTS );
void Print(const std::string &data, bool new_line=true)
@ RESULTS_PLOT_ACROSS_RESULTS
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)
std::string AddResultsCurve(const std::string &plot_id)
std::string AddResultsPlot()
std::vector< std::string > GetResultsCurveIDs(const std::string &plot_id)
See also
DeleteResultsCurve, GetResultsCurveIDs, SetResultsCurveSources
Parameters
[in]plot_idstring Results plot ID
Returns
string ID of the new curve
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddResultsPlot()

std::string vsp::AddResultsPlot ( )
extern

Add a Results plot to the model. The plot starts with one empty curve and becomes the active plot. A plot's axes and style are Parms in group "ResultsPlot" (XMin, XMax, YMin, YMax and their XMinManual etc. flags, XLog, YLog, ShowLines, ShowPoints and Legend, see RESULTS_PLOT_LEGEND), and its name is set with SetContainerName.

string plot_id = AddResultsPlot();
if ( GetAllResultsPlotIDs().size() != 1 ) { Print( "ERROR: AddResultsPlot" ); __failure++; }
if ( GetResultsCurveIDs( plot_id ).size() != 1 ) { Print( "ERROR: AddResultsPlot did not add a curve" ); __failure++; }
if ( GetActiveResultsPlot() != plot_id ) { Print( "ERROR: AddResultsPlot did not make the plot active" ); __failure++; }
// The axes are Parms.
SetParmVal( FindParm( plot_id, "YLog", "ResultsPlot" ), 1.0 );
SetParmVal( FindParm( plot_id, "Legend", "ResultsPlot" ), RESULTS_LEGEND_UPPER_LEFT );
SetContainerName( plot_id, "Lift Curve" );
@ RESULTS_LEGEND_UPPER_LEFT
void SetContainerName(const std::string &parm_container_id, const std::string &name)
std::string GetActiveResultsPlot()
std::vector< std::string > GetAllResultsPlotIDs()
See also
CopyResultsPlot, DeleteResultsPlot, AddResultsCurve, SetContainerName
Returns
string ID of the new plot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CopyResultsPlot()

std::string vsp::CopyResultsPlot ( const std::string & plot_id)
extern

Add a copy of a Results plot, with copies of its curves. The copy becomes the active plot.

string plot_id = AddResultsPlot();
SetParmVal( FindParm( plot_id, "XLog", "ResultsPlot" ), 1.0 );
string copy_id = CopyResultsPlot( plot_id );
if ( copy_id == plot_id || GetAllResultsPlotIDs().size() != 2 ) { Print( "ERROR: CopyResultsPlot" ); __failure++; }
if ( GetParmVal( FindParm( copy_id, "XLog", "ResultsPlot" ) ) != 1.0 ) { Print( "ERROR: CopyResultsPlot lost a Parm" ); __failure++; }
if ( GetResultsCurveIDs( copy_id ).size() != 1 ) { Print( "ERROR: CopyResultsPlot lost the curve" ); __failure++; }
double GetParmVal(const std::string &parm_id)
std::string CopyResultsPlot(const std::string &plot_id)
See also
AddResultsPlot
Parameters
[in]plot_idstring Results plot ID
Returns
string ID of the copy
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeleteAllResultsPlots()

void vsp::DeleteAllResultsPlots ( )
extern

Delete every Results plot.

if ( GetAllResultsPlotIDs().size() != 0 ) { Print( "ERROR: DeleteAllResultsPlots" ); __failure++; }
void DeleteAllResultsPlots()
See also
DeleteResultsPlot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeleteResultsCurve()

void vsp::DeleteResultsCurve ( const std::string & curve_id)
extern

Delete a curve from its Results plot.

string plot_id = AddResultsPlot();
string curve_id = GetResultsCurveIDs( plot_id )[0];
DeleteResultsCurve( curve_id );
if ( GetResultsCurveIDs( plot_id ).size() != 0 ) { Print( "ERROR: DeleteResultsCurve" ); __failure++; }
void DeleteResultsCurve(const std::string &curve_id)
See also
AddResultsCurve
Parameters
[in]curve_idstring Results curve ID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeleteResultsPlot()

void vsp::DeleteResultsPlot ( const std::string & plot_id)
extern

Delete a Results plot and its curves.

string plot_id = AddResultsPlot();
DeleteResultsPlot( plot_id );
if ( GetAllResultsPlotIDs().size() != 0 ) { Print( "ERROR: DeleteResultsPlot" ); __failure++; }
if ( GetActiveResultsPlot() != "" ) { Print( "ERROR: DeleteResultsPlot left it active" ); __failure++; }
void DeleteResultsPlot(const std::string &plot_id)
See also
AddResultsPlot, DeleteAllResultsPlots
Parameters
[in]plot_idstring Results plot ID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetActiveResultsPlot()

std::string vsp::GetActiveResultsPlot ( )
extern

Get the ID of the active Results plot, the plot the Results viewer shows.

if ( GetActiveResultsPlot() != "" ) { Print( "ERROR: GetActiveResultsPlot with no plots" ); __failure++; }
string plot_id = AddResultsPlot();
if ( GetActiveResultsPlot() != plot_id ) { Print( "ERROR: GetActiveResultsPlot" ); __failure++; }
See also
SetActiveResultsPlot
Returns
string Active Results plot ID, empty when there are no plots
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAllResultsPlotIDs()

std::vector< std::string > vsp::GetAllResultsPlotIDs ( )
extern

Get the IDs of every Results plot, in the order the Results viewer lists them.

string first_id = AddResultsPlot();
string second_id = AddResultsPlot();
array < string > @plot_ids = GetAllResultsPlotIDs();
if ( plot_ids.size() != 2 || plot_ids[0] != first_id || plot_ids[1] != second_id )
{
Print( "ERROR: GetAllResultsPlotIDs" );
__failure++;
}
See also
AddResultsPlot
Returns
vector<string> Results plot IDs
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetResultsCurveChosenIDs()

std::vector< std::string > vsp::GetResultsCurveChosenIDs ( const std::string & curve_id)
extern

Get the IDs of the Results of a curve's kinds that it plots when its Run Parm is RESULTS_RUN_CHOSEN. Until some are left out with SetResultsCurveChosenIDs, every one is chosen.

string plot_id = AddResultsPlot();
string curve_id = GetResultsCurveIDs( plot_id )[0];
array < string > names = { "Test_Results" };
array < string > case_names = { "" };
SetResultsCurveSources( curve_id, names, case_names );
if ( GetResultsCurveChosenIDs( curve_id ).size() != 2 ) { Print( "ERROR: GetResultsCurveChosenIDs of a new curve" ); __failure++; }
array < string > chosen = { FindLatestResultsID( "Test_Results" ) };
SetResultsCurveChosenIDs( curve_id, chosen );
if ( GetResultsCurveChosenIDs( curve_id ).size() != 1 ) { Print( "ERROR: GetResultsCurveChosenIDs" ); __failure++; }
std::string FindLatestResultsID(const std::string &name)
void WriteTestResults()
std::vector< std::string > GetResultsCurveChosenIDs(const std::string &curve_id)
void SetResultsCurveSources(const std::string &curve_id, const std::vector< std::string > &names, const std::vector< std::string > &case_names)
void SetResultsCurveChosenIDs(const std::string &curve_id, const std::vector< std::string > &results_ids)
See also
SetResultsCurveChosenIDs
Parameters
[in]curve_idstring Results curve ID
Returns
vector<string> IDs of the chosen Results
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetResultsCurveIDs()

std::vector< std::string > vsp::GetResultsCurveIDs ( const std::string & plot_id)
extern

Get the IDs of a Results plot's curves, in order.

string plot_id = AddResultsPlot();
string curve_id = AddResultsCurve( plot_id );
array < string > @curve_ids = GetResultsCurveIDs( plot_id );
if ( curve_ids.size() != 2 || curve_ids[1] != curve_id ) { Print( "ERROR: GetResultsCurveIDs" ); __failure++; }
See also
AddResultsCurve
Parameters
[in]plot_idstring Results plot ID
Returns
vector<string> Results curve IDs
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetResultsCurveResultIDs()

std::vector< std::string > vsp::GetResultsCurveResultIDs ( const std::string & curve_id)
extern

Get the IDs of the Results a curve plots now: the runs its Run Parm picks of each of its kinds of Result, oldest first.

WriteTestResults(); // Two runs of Test_Results
string plot_id = AddResultsPlot();
string curve_id = GetResultsCurveIDs( plot_id )[0];
array < string > names = { "Test_Results" };
array < string > case_names = { "" };
SetResultsCurveSources( curve_id, names, case_names );
// Every run.
if ( GetResultsCurveResultIDs( curve_id ).size() != 2 ) { Print( "ERROR: GetResultsCurveResultIDs every run" ); __failure++; }
// The newest run.
SetParmVal( FindParm( curve_id, "Run", "ResultsCurve" ), 1.0 );
array < string > @ids = GetResultsCurveResultIDs( curve_id );
if ( ids.size() != 1 || ids[0] != FindLatestResultsID( "Test_Results" ) ) { Print( "ERROR: GetResultsCurveResultIDs newest run" ); __failure++; }
std::vector< std::string > GetResultsCurveResultIDs(const std::string &curve_id)
See also
SetResultsCurveSources
Parameters
[in]curve_idstring Results curve ID
Returns
vector<string> Results IDs
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetResultsCurveSourceCaseNames()

std::vector< std::string > vsp::GetResultsCurveSourceCaseNames ( const std::string & curve_id)
extern

Get the case names of the kinds of Result a curve plots, empty for a kind with no case name.

string plot_id = AddResultsPlot();
string curve_id = GetResultsCurveIDs( plot_id )[0];
array < string > names = { "Test_Results", "Other_Results" };
array < string > case_names = { "", "Case A" };
SetResultsCurveSources( curve_id, names, case_names );
array < string > @got = GetResultsCurveSourceCaseNames( curve_id );
if ( got.size() != 2 || got[0] != "" || got[1] != "Case A" ) { Print( "ERROR: GetResultsCurveSourceCaseNames" ); __failure++; }
std::vector< std::string > GetResultsCurveSourceCaseNames(const std::string &curve_id)
See also
SetResultsCurveSources, GetResultsCurveSourceNames
Parameters
[in]curve_idstring Results curve ID
Returns
vector<string> Case name of each kind
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetResultsCurveSourceNames()

std::vector< std::string > vsp::GetResultsCurveSourceNames ( const std::string & curve_id)
extern

Get the Results names of the kinds of Result a curve plots.

string plot_id = AddResultsPlot();
string curve_id = GetResultsCurveIDs( plot_id )[0];
array < string > names = { "Test_Results", "Other_Results" };
array < string > case_names = { "", "Case A" };
SetResultsCurveSources( curve_id, names, case_names );
array < string > @got = GetResultsCurveSourceNames( curve_id );
if ( got.size() != 2 || got[1] != "Other_Results" ) { Print( "ERROR: GetResultsCurveSourceNames" ); __failure++; }
std::vector< std::string > GetResultsCurveSourceNames(const std::string &curve_id)
See also
SetResultsCurveSources, GetResultsCurveSourceCaseNames
Parameters
[in]curve_idstring Results curve ID
Returns
vector<string> Results name of each kind
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetResultsCurveXVar()

std::string vsp::GetResultsCurveXVar ( const std::string & curve_id)
extern

Get the label of the variable a curve plots on the X axis.

string plot_id = AddResultsPlot();
string curve_id = GetResultsCurveIDs( plot_id )[0];
if ( GetResultsCurveXVar( curve_id ) != "" ) { Print( "ERROR: GetResultsCurveXVar of a new curve" ); __failure++; }
std::string GetResultsCurveXVar(const std::string &curve_id)
See also
SetResultsCurveXVar
Parameters
[in]curve_idstring Results curve ID
Returns
string Variable label, empty for the point index or Results order
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetResultsCurveYVars()

std::vector< std::string > vsp::GetResultsCurveYVars ( const std::string & curve_id)
extern

Get the labels of the variables a curve plots on the Y axis.

string plot_id = AddResultsPlot();
string curve_id = GetResultsCurveIDs( plot_id )[0];
array < string > labels = { "Test_Double_Vec" };
SetResultsCurveYVars( curve_id, labels );
array < string > @got = GetResultsCurveYVars( curve_id );
if ( got.size() != 1 || got[0] != "Test_Double_Vec" ) { Print( "ERROR: GetResultsCurveYVars" ); __failure++; }
void SetResultsCurveYVars(const std::string &curve_id, const std::vector< std::string > &labels)
std::vector< std::string > GetResultsCurveYVars(const std::string &curve_id)
See also
SetResultsCurveYVars
Parameters
[in]curve_idstring Results curve ID
Returns
vector<string> Variable labels
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetResultsPlotVarData()

std::vector< double > vsp::GetResultsPlotVarData ( const std::string & results_id,
const std::string & label,
bool matrix_rows = false )
extern

Get the values of a variable in a Result, as a curve plots them.

string res_id = FindLatestResultsID( "Test_Results" );
array < double > @data = GetResultsPlotVarData( res_id, "Test_Double_Vec" );
// The newest run holds 0, 2, 4, 6, 8.
if ( data.size() != 5 || abs( data[4] - 8.0 ) > 1e-12 ) { Print( "ERROR: GetResultsPlotVarData" ); __failure++; }
array < double > @mag = GetResultsPlotVarData( res_id, "|Test_Vec3d|" );
// The newest run holds ( 1, 2, 4 ).
if ( mag.size() != 1 || abs( mag[0] * mag[0] - 21.0 ) > 1e-9 ) { Print( "ERROR: GetResultsPlotVarData magnitude" ); __failure++; }
std::vector< double > GetResultsPlotVarData(const std::string &results_id, const std::string &label, bool matrix_rows=false)
See also
GetResultsPlotVarLabels
Parameters
[in]results_idstring Results ID
[in]labelstring Variable label
[in]matrix_rowsbool True when the label names a matrix row rather than a column
Returns
vector<double> Values
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetResultsPlotVarLabels()

std::vector< std::string > vsp::GetResultsPlotVarLabels ( const std::string & results_id,
bool matrix_rows = false )
extern

Get the labels of the variables in a Result that a curve can plot. A numeric vector is labeled with its data name, followed by #1, #2, ... for a second or later entry of the same name. A vec3d vector gives .x, .y and .z components and its magnitude, |name|; a matrix gives its columns, name[:,j], or its rows, name[i,:].

array < string > @labels = GetResultsPlotVarLabels( FindLatestResultsID( "Test_Results" ) );
if ( labels.find( "Test_Double_Vec" ) < 0 ) { Print( "ERROR: GetResultsPlotVarLabels vector" ); __failure++; }
if ( labels.find( "Test_Int#1" ) < 0 ) { Print( "ERROR: GetResultsPlotVarLabels second entry" ); __failure++; }
if ( labels.find( "|Test_Vec3d|" ) < 0 ) { Print( "ERROR: GetResultsPlotVarLabels magnitude" ); __failure++; }
// Strings are not plotted.
if ( labels.find( "Test_String" ) >= 0 ) { Print( "ERROR: GetResultsPlotVarLabels string" ); __failure++; }
std::vector< std::string > GetResultsPlotVarLabels(const std::string &results_id, bool matrix_rows=false)
See also
GetResultsPlotVarData, SetResultsCurveXVar, SetResultsCurveYVars
Parameters
[in]results_idstring Results ID
[in]matrix_rowsbool True to label a matrix's rows rather than its columns
Returns
vector<string> Variable labels
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadResultsPlotFile()

std::string vsp::ReadResultsPlotFile ( const std::string & file_name)
extern

Add the Results plot a file written by WriteResultsPlotFile holds. The plot goes after the others and becomes the active plot; a name already taken gets a number added. Its curves plot the Results of the kinds they name that the model has, and stay empty until it has some.

string plot_id = AddResultsPlot();
SetContainerName( plot_id, "Drag Polar" );
SetParmVal( FindParm( plot_id, "YLog", "ResultsPlot" ), 1.0 );
WriteResultsPlotFile( plot_id, "DragPolar.vspplot" );
string read_id = ReadResultsPlotFile( "DragPolar.vspplot" );
if ( GetActiveResultsPlot() != read_id ) { Print( "ERROR: ReadResultsPlotFile" ); __failure++; }
if ( GetContainerName( read_id ) != "Drag Polar" ) { Print( "ERROR: ReadResultsPlotFile lost the name" ); __failure++; }
if ( GetParmVal( FindParm( read_id, "YLog", "ResultsPlot" ) ) != 1.0 ) { Print( "ERROR: ReadResultsPlotFile lost a Parm" ); __failure++; }
void VSPRenew()
std::string GetContainerName(const std::string &parm_container_id)
void WriteResultsPlotFile(const std::string &plot_id, const std::string &file_name)
std::string ReadResultsPlotFile(const std::string &file_name)
See also
WriteResultsPlotFile
Parameters
[in]file_namestring File name
Returns
string ID of the new plot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetActiveResultsPlot()

void vsp::SetActiveResultsPlot ( const std::string & plot_id)
extern

Make a Results plot the active one, the plot the Results viewer shows.

string first_id = AddResultsPlot();
string second_id = AddResultsPlot();
if ( GetActiveResultsPlot() != first_id ) { Print( "ERROR: SetActiveResultsPlot" ); __failure++; }
void SetActiveResultsPlot(const std::string &plot_id)
See also
GetActiveResultsPlot
Parameters
[in]plot_idstring Results plot ID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetResultsCurveChosenIDs()

void vsp::SetResultsCurveChosenIDs ( const std::string & curve_id,
const std::vector< std::string > & results_ids )
extern

Choose the Results a curve plots when its Run Parm is RESULTS_RUN_CHOSEN. Of its kinds of Result, the curve leaves out those not chosen; Results made later are plotted until they are left out too. The choice is not saved with the model, as Results are not.

WriteTestResults(); // Two runs of Test_Results
string plot_id = AddResultsPlot();
string curve_id = GetResultsCurveIDs( plot_id )[0];
array < string > names = { "Test_Results" };
array < string > case_names = { "" };
SetResultsCurveSources( curve_id, names, case_names );
// Plot the older run alone.
string oldest = GetResultsCurveResultIDs( curve_id )[0];
array < string > chosen = { oldest };
SetParmVal( FindParm( curve_id, "Run", "ResultsCurve" ), RESULTS_RUN_CHOSEN );
SetResultsCurveChosenIDs( curve_id, chosen );
array < string > @ids = GetResultsCurveResultIDs( curve_id );
if ( ids.size() != 1 || ids[0] != oldest ) { Print( "ERROR: SetResultsCurveChosenIDs" ); __failure++; }
@ RESULTS_RUN_CHOSEN
See also
GetResultsCurveChosenIDs, GetResultsCurveResultIDs, RESULTS_PLOT_RUN
Parameters
[in]curve_idstring Results curve ID
[in]results_idsvector<string> IDs of the Results to plot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetResultsCurveSources()

void vsp::SetResultsCurveSources ( const std::string & curve_id,
const std::vector< std::string > & names,
const std::vector< std::string > & case_names )
extern

Set the kinds of Result a curve plots. A kind is a Results name, such as "Test_Results", and a case name, which is empty for Results that carry no Case_Name. The curve plots the Results of those kinds that exist when it is drawn, so it can name kinds that have not been made yet.

string plot_id = AddResultsPlot();
string curve_id = GetResultsCurveIDs( plot_id )[0];
array < string > names = { "Test_Results" };
array < string > case_names = { "" };
SetResultsCurveSources( curve_id, names, case_names );
if ( GetResultsCurveSourceNames( curve_id ).size() != 1 ) { Print( "ERROR: SetResultsCurveSources" ); __failure++; }
See also
GetResultsCurveSourceNames, GetResultsCurveSourceCaseNames, GetResultsCurveResultIDs
Parameters
[in]curve_idstring Results curve ID
[in]namesvector<string> Results name of each kind
[in]case_namesvector<string> Case name of each kind, empty for none; as many as names
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetResultsCurveXVar()

void vsp::SetResultsCurveXVar ( const std::string & curve_id,
const std::string & label )
extern

Set the variable a curve plots on the X axis, by its label from GetResultsPlotVarLabels. An empty label plots against the point index, or against the Results' order when the curve plots across Results.

string plot_id = AddResultsPlot();
string curve_id = GetResultsCurveIDs( plot_id )[0];
SetResultsCurveXVar( curve_id, "Test_Double" );
if ( GetResultsCurveXVar( curve_id ) != "Test_Double" ) { Print( "ERROR: SetResultsCurveXVar" ); __failure++; }
void SetResultsCurveXVar(const std::string &curve_id, const std::string &label)
See also
GetResultsCurveXVar, SetResultsCurveYVars, GetResultsPlotVarLabels
Parameters
[in]curve_idstring Results curve ID
[in]labelstring Variable label, empty for the point index or Results order
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetResultsCurveYVars()

void vsp::SetResultsCurveYVars ( const std::string & curve_id,
const std::vector< std::string > & labels )
extern

Set the variables a curve plots on the Y axis, by their labels from GetResultsPlotVarLabels. Each makes its own series.

string plot_id = AddResultsPlot();
string curve_id = GetResultsCurveIDs( plot_id )[0];
array < string > labels = { "Test_Vec3d.x", "Test_Vec3d.y" };
SetResultsCurveYVars( curve_id, labels );
if ( GetResultsCurveYVars( curve_id ).size() != 2 ) { Print( "ERROR: SetResultsCurveYVars" ); __failure++; }
See also
GetResultsCurveYVars, SetResultsCurveXVar, GetResultsPlotVarLabels
Parameters
[in]curve_idstring Results curve ID
[in]labelsvector<string> Variable labels
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteResultsPlotFile()

void vsp::WriteResultsPlotFile ( const std::string & plot_id,
const std::string & file_name )
extern

Write a Results plot to a file of its own: its name, axes, style and curves, without any Results. The curves name kinds of Result and variables, not particular Results, so ReadResultsPlotFile can bring the plot into another model, where it plots that model's Results of the same kinds.

string plot_id = AddResultsPlot();
SetContainerName( plot_id, "Drag Polar" );
SetParmVal( FindParm( plot_id, "YLog", "ResultsPlot" ), 1.0 );
WriteResultsPlotFile( plot_id, "DragPolar.vspplot" );
See also
ReadResultsPlotFile
Parameters
[in]plot_idstring Results plot ID
[in]file_namestring File name, by convention ending in .vspplot
Here is the call graph for this function:
Here is the caller graph for this function: