Bridges-C++  3.4.4
Bridges(C++ API)
Public Member Functions | List of all members
bridges::Bridges Class Reference

#include <Bridges.h>

Detailed Description

This class contains methods to connect and transmit a user's data structure representation to the Bridges server.

If the FORCE_BRIDGES_APIKEY environment variable is set, use the environment variable as APIkey in all cases.

If the FORCE_BRIDGES_USERNAME environment variable is set, use the environment variable as username in all cases.

If the FORCE_BRIDGES_ASSIGNMENT environment variable is set, use the environment variable as assignment number in all cases.

If the FORCE_BRIDGES_APISERVER environment variable is set, use the environment variable as API server in all cases.

If the FORCE_BRIDGES_DATADEBUG environment variable is set, output debug information about access data sources.

Author
Kalpathi Subramanian, Dakota Carmer, Erik Saule
Date
7/26/15, 6/5/17, 10/30/18, 7/12/19

Public Member Functions

 Bridges ()
 
 Bridges (const string &name, const string &key)
 constructor to bridges More...
 
 Bridges (unsigned int num, const string &name, const string &key)
 constructor to bridges More...
 
void setElementLabelFlag (bool flag)
 Flag that controls if labels of elements (nodes) are to be turned on. More...
 
void setLinkLabelFlag (bool flag)
 Flag that controls if labels of links(edges) are to be turned on/off. More...
 
bool getElementLabelFlag () const
 status of flag for element labels More...
 
bool getLinkLabelFlag () const
 Return status of flag for link labels. More...
 
bool getJSONFlag () const
 
void postVisualizationLink (bool link_url)
 
void setJSONFlag (bool flag)
 
const string & getUserName () const
 
void setUserName (string name)
 Set user name. More...
 
const string & getApiKey () const
 
void setApiKey (string key)
 Set API key credentials. More...
 
unsigned int getAssignment () const
 
void setAssignment (unsigned int num)
 
const string & getTitle () const
 
void setTitle (const string &t)
 
const string & getDescription () const
 
void setDescription (const string &descr)
 
void setDataStructure (DataStructure *ds)
 
void setDataStructure (DataStructure &ds)
 
DataStructuregetDataStructure ()
 
void setServer (string server_type)
 
void setMapOverlay (bool overlay_flag)
 Turns on map overlay for subsequent visualizations - used with location specific datasets. More...
 
void setMap (string my_map, string info)
 Sets the type of map overlay to use. More...
 
void setCoordSystemType (string coord)
 
const string & getCoordSystemType ()
 
void setWindow (int xmin, int xmax, int ymin, int ymax)
 
void setWindow (double xmin, double xmax, double ymin, double ymax)
 sets the world coordinate window defining the space of the user defined objects (or nodes) More...
 
string getVisualizeURL () const
 
void visualize ()
 

Constructor & Destructor Documentation

◆ Bridges() [1/3]

bridges::Bridges::Bridges ( )
inline

◆ Bridges() [2/3]

bridges::Bridges::Bridges ( const string &  name,
const string &  key 
)
inline

constructor to bridges

If the FORCE_BRIDGES_APIKEY environment variable is set, use the environment variable as APIkey in all cases.

If the FORCE_BRIDGES_USERNAME environment variable is set, use the environment variable as username in all cases.

Parameters
nameBridges username
keyBridges APIKey of the name account. (Note that it is not the password, but the API Key one can find in the user profile.)

◆ Bridges() [3/3]

bridges::Bridges::Bridges ( unsigned int  num,
const string &  name,
const string &  key 
)
inline

constructor to bridges

If the FORCE_BRIDGES_APIKEY environment variable is set, use the environment variable as APIkey in all cases.

If the FORCE_BRIDGES_USERNAME environment variable is set, use the environment variable as username in all cases.

If the FORCE_BRIDGES_ASSIGNMENT environment variable is set, use the environment variable as assignment number in all cases.

If the FORCE_BRIDGES_APISERVER environment variable is set, use the environment variable as API server in all cases.

Parameters
numassignment ID
nameBridges username
keyBridges APIKey of the name account. (Note that it is not the password, but the API Key one can find in the user profile.)

Member Function Documentation

◆ getApiKey()

const string& bridges::Bridges::getApiKey ( ) const
inline

Get API key credentials

Returns
BRIDGES api key credential for the server

◆ getAssignment()

unsigned int bridges::Bridges::getAssignment ( ) const
inline

Return assignmet id

Returns
assignment number for holding the visualization on the server

◆ getCoordSystemType()

const string& bridges::Bridges::getCoordSystemType ( )
inline

Gets the coordinate system type for location specific datasets

Returns
coord system type ; will be one of ['cartesian', 'albersUsa', 'equirectangular']. 'cartesian'

◆ getDataStructure()

DataStructure* bridges::Bridges::getDataStructure ( )
inline
Returns
member holding the data structure handle

◆ getDescription()

const string& bridges::Bridges::getDescription ( ) const
inline

Get visualization description

Returns
description of visualization

◆ getElementLabelFlag()

bool bridges::Bridges::getElementLabelFlag ( ) const
inline

status of flag for element labels

Returns
flag boolean of element labels

◆ getJSONFlag()

bool bridges::Bridges::getJSONFlag ( ) const
inline
Returns
flag indicating if JSON should be printed upon visualization

◆ getLinkLabelFlag()

bool bridges::Bridges::getLinkLabelFlag ( ) const
inline

Return status of flag for link labels.

Returns
flag boolean indicating if all labels in the visualization are turned on

◆ getTitle()

const string& bridges::Bridges::getTitle ( ) const
inline

Get the visualization title

Returns
title of visualization

◆ getUserName()

const string& bridges::Bridges::getUserName ( ) const
inline

Get user name

Returns
reference to member holding the BRIDGES username credential for the server

◆ getVisualizeURL()

string bridges::Bridges::getVisualizeURL ( ) const
inline

◆ postVisualizationLink()

void bridges::Bridges::postVisualizationLink ( bool  link_url)
inline

This method is used to suppress the visualization link that is usually printed to the console

Parameters
link_urlflag that controls if the link is printed to console
Returns
none

◆ setApiKey()

void bridges::Bridges::setApiKey ( string  key)
inline

Set API key credentials.

If the FORCE_BRIDGES_APIKEY environment variable is set, use the environment variable as key and disregard the parameter.

Parameters
keyAPI key to set for user

◆ setAssignment()

void bridges::Bridges::setAssignment ( unsigned int  num)
inline

Set the assignment number

If the FORCE_BRIDGES_ASSIGNMENT environment variable is set, use the environment variable as assignment number in all cases.

Parameters
numassignment number to set

◆ setCoordSystemType()

void bridges::Bridges::setCoordSystemType ( string  coord)
inline

Sets the coordinate system type for location specific data; default is cartesian

Parameters
coordthis is the desired coordinate space argument Options are: ['cartesian', 'albersusa', 'equirectangular', 'window']. 'cartesian' is the default

◆ setDataStructure() [1/2]

void bridges::Bridges::setDataStructure ( DataStructure ds)
inline

set handle to data structure

Parameters
dsreference to user's data Structure

◆ setDataStructure() [2/2]

void bridges::Bridges::setDataStructure ( DataStructure ds)
inline

set handle to data structure

Parameters
dspointer to user's data Structure

◆ setDescription()

void bridges::Bridges::setDescription ( const string &  descr)
inline

Set visualization description

Returns
descr description of visualization

◆ setElementLabelFlag()

void bridges::Bridges::setElementLabelFlag ( bool  flag)
inline

Flag that controls if labels of elements (nodes) are to be turned on.

Parameters
flagindicating if all labels in the visualization are turned on

◆ setJSONFlag()

void bridges::Bridges::setJSONFlag ( bool  flag)
inline
Parameters
flagindicating if JSON should be printed upon visualization

◆ setLinkLabelFlag()

void bridges::Bridges::setLinkLabelFlag ( bool  flag)
inline

Flag that controls if labels of links(edges) are to be turned on/off.

Parameters
flagindicating if all labels in the visualization are turned on

◆ setMap()

void bridges::Bridges::setMap ( string  my_map,
string  info 
)
inline

Sets the type of map overlay to use.

Parameters
mapthis is an Array describing the map overlay. The first element of the array is which map to use: "world" or "us" and the second element is what attribute from the map to show: a country from world map, or a state from US map.

◆ setMapOverlay()

void bridges::Bridges::setMapOverlay ( bool  overlay_flag)
inline

Turns on map overlay for subsequent visualizations - used with location specific datasets.

Parameters
overlay_flagtrue to display the map overlay

◆ setServer()

void bridges::Bridges::setServer ( string  server_type)
inline

Set server type

If the FORCE_BRIDGES_APISERVER environment variable is set, use the environment variable as API server in all cases.

Parameters
server_typeserver to which to connect. Options are: ['live', 'local', 'games', 'clone'], and 'live' is the default;

◆ setTitle()

void bridges::Bridges::setTitle ( const string &  t)
inline

Set title of visualization

Parameters
ttitle of visualization

◆ setUserName()

void bridges::Bridges::setUserName ( string  name)
inline

Set user name.

If the FORCE_BRIDGES_USERNAME environment variable is set, use the environment variable as username in all cases.

Parameters
nameBRIDGES user id to set

◆ setWindow() [1/2]

void bridges::Bridges::setWindow ( double  xmin,
double  xmax,
double  ymin,
double  ymax 
)
inline

sets the world coordinate window defining the space of the user defined objects (or nodes)

Parameters
xminminimum window x
yminminimum window y
xmaxmaximum window x
ymaxmaximum window y

◆ setWindow() [2/2]

void bridges::Bridges::setWindow ( int  xmin,
int  xmax,
int  ymin,
int  ymax 
)
inline

Sets the world coordinate window defining the space of the user defined objects (or nodes)

Parameters
xminminimum window x
yminminimum window y
xmaxmaximum window x
ymaxmaximum window y

◆ visualize()

void bridges::Bridges::visualize ( )
inline

Sends relevant meta-data and representation of the data structure to the BRIDGES server, and upon successful completion, prints the URL to display the Bridges visualization.


The documentation for this class was generated from the following file: