OpenVSP API Documentation 3.40.0
 
Loading...
Searching...
No Matches
Background3D Functions

This group of functions is used to work with 3D background images. Click here to return to the main page. More...

Functions

string vsp::AddBackground3D ()
 
int vsp::GetNumBackground3Ds ()
 
vector< string > vsp::GetAllBackground3Ds ()
 
void vsp::ShowAllBackground3Ds ()
 
void vsp::HideAllBackground3Ds ()
 
void vsp::DelAllBackground3Ds ()
 
void vsp::DelBackground3D (const string &id)
 
vector< string > vsp::GetAllBackground3DRelativePaths ()
 
vector< string > vsp::GetAllBackground3DAbsolutePaths ()
 
string vsp::GetBackground3DRelativePath (const string &id)
 
string vsp::GetBackground3DAbsolutePath (const string &id)
 
void vsp::SetBackground3DRelativePath (const string &id, const string &fname)
 
void vsp::SetBackground3DAbsolutePath (const string &id, const string &fname)
 

Detailed Description

Function Documentation

◆ AddBackground3D()

string vsp::AddBackground3D ( )
extern

Add a Background3D to model

int nbg = GetNumBackground3Ds();
// Add Background3D
string bg_id = AddBackground3D();
if ( GetNumBackground3Ds() != nbg + 1 )
{
Print( "ERROR: AddBackground3D" );
}
DelBackground3D( bg_id );
int GetNumBackground3Ds()
string AddBackground3D()
void DelBackground3D(const string &id)
Returns
string ID for added Background3D

◆ DelAllBackground3Ds()

void vsp::DelAllBackground3Ds ( )
extern

Delete all Background3Ds in model

// Add Background3D
int nbg = GetNumBackground3Ds();
if ( nbg != 0 )
{
Print( "ERROR: DelAllBackground3Ds" );
}
void DelAllBackground3Ds()

◆ DelBackground3D()

void vsp::DelBackground3D ( const string & id)
extern

Delete specific Background3D frommodel

// Add Background3D
string bg_id = AddBackground3D();
int nbg = GetNumBackground3Ds();
DelBackground3D( bg_id );
if ( GetNumBackground3Ds() != nbg - 1 )
{
Print( "ERROR: DelBackground3D" );
}
Parameters
[in]idstring Background3D ID to delete

◆ GetAllBackground3DAbsolutePaths()

vector< string > vsp::GetAllBackground3DAbsolutePaths ( )
extern

Get absolute paths to all Background3D images in model.

// Add Background3D
array< string > @bg_file_array = GetAllBackground3DAbsolutePaths();
for( int n = 0; n < int( bg_file_array.length() ); n++ )
{
Print( bg_file_array[n] );
}
vector< string > GetAllBackground3DAbsolutePaths()
Returns
vector<string> Vector of absolute paths to Background3D image files

◆ GetAllBackground3DRelativePaths()

vector< string > vsp::GetAllBackground3DRelativePaths ( )
extern

Get relative paths to all Background3D images in model. Note that path is relative to the model's *.vsp3 file. Consequently, if a file has not yet been saved or assigned a file name, the relative path is meaningless.

// Add Background3D
array< string > @bg_file_array = GetAllBackground3DRelativePaths();
for( int n = 0; n < int( bg_file_array.length() ); n++ )
{
Print( bg_file_array[n] );
}
vector< string > GetAllBackground3DRelativePaths()
Returns
vector<string> Vector of relative paths to Background3D image files

◆ GetAllBackground3Ds()

vector< string > vsp::GetAllBackground3Ds ( )
extern

Get id's of all Background3Ds in model

int nbg = GetNumBackground3Ds();
// Add Background3D
if ( GetNumBackground3Ds() != nbg + 3 )
{
Print( "ERROR: AddBackground3D" );
}
array< string > @bg_array = GetAllBackground3Ds();
for( int n = 0; n < int( bg_array.length() ); n++ )
{
Print( bg_array[n] );
}
vector< string > GetAllBackground3Ds()
Returns
vector<string> Vector of Background3D IDs

◆ GetBackground3DAbsolutePath()

string vsp::GetBackground3DAbsolutePath ( const string & id)
extern

Get absolute path to specified Background3D's image.

// Add Background3D
string bg_id = AddBackground3D();
SetBackground3DAbsolutePath( bg_id, "/user/me/vsp_work/front.png" );
string bg_file = GetBackground3DAbsolutePath( bg_id );
Print( bg_file );
void SetBackground3DAbsolutePath(const string &id, const string &fname)
string GetBackground3DAbsolutePath(const string &id)
Parameters
[in]idstring Background3D ID
Returns
string Absolute path to Background3D image file

◆ GetBackground3DRelativePath()

string vsp::GetBackground3DRelativePath ( const string & id)
extern

Get relative path to specified Background3D's image. Note that path is relative to the model's *.vsp3 file. Consequently, if a file has not yet been saved or assigned a file name, the relative path is meaningless.

// Add Background3D
string bg_id = AddBackground3D();
SetBackground3DRelativePath( bg_id, "front.png" );
string bg_file = GetBackground3DRelativePath( bg_id );
Print( bg_file );
void SetBackground3DRelativePath(const string &id, const string &fname)
string GetBackground3DRelativePath(const string &id)
Parameters
[in]idstring Background3D ID
Returns
string Relative path to Background3D image file

◆ GetNumBackground3Ds()

int vsp::GetNumBackground3Ds ( )
extern

Get Number of Background3D's in a model

int nbg = GetNumBackground3Ds();
// Add Background3D
string bg_id = AddBackground3D();
if ( GetNumBackground3Ds() != nbg + 1 )
{
Print( "ERROR: AddBackground3D" );
}
DelBackground3D( bg_id );
Returns
int Number of Background3D's in model

◆ HideAllBackground3Ds()

void vsp::HideAllBackground3Ds ( )
extern

Hide all Background3Ds in model

◆ SetBackground3DAbsolutePath()

void vsp::SetBackground3DAbsolutePath ( const string & id,
const string & fname )
extern

Set absolute path to specified Background3D's image.

// Add Background3D
string bg_id = AddBackground3D();
SetBackground3DAbsolutePath( bg_id, "front.png" );
string bg_file = GetBackground3DAbsolutePath( bg_id );
Print( bg_file );
Parameters
[in]idstring Background3D ID
[in]fnamestring Absolute path to Background3D image file

◆ SetBackground3DRelativePath()

void vsp::SetBackground3DRelativePath ( const string & id,
const string & fname )
extern

Set relative path to specified Background3D's image. Note that path is relative to the model's *.vsp3 file. Consequently, if a file has not yet been saved or assigned a file name, the relative path is meaningless.

// Add Background3D
string bg_id = AddBackground3D();
SetBackground3DRelativePath( bg_id, "front.png" );
string bg_file = GetBackground3DRelativePath( bg_id );
Print( bg_file );
Parameters
[in]idstring Background3D ID
[in]fnamestring Relative path to Background3D image file

◆ ShowAllBackground3Ds()

void vsp::ShowAllBackground3Ds ( )
extern

Show all Background3Ds in model