1
0
Fork 0

Change cout and cerr in SG_LOG() where appropriate, otherwise comment it out

This commit is contained in:
ehofman 2003-03-20 10:43:02 +00:00
parent f2e2101264
commit df2ce45ab7
14 changed files with 89 additions and 73 deletions

View file

@ -100,9 +100,9 @@ static string GetReverseRunwayNo(string rwyno) {
string tmp = rwyno.substr(1, 1); string tmp = rwyno.substr(1, 1);
if (( tmp == "L" || tmp == "R" || tmp == "C" ) || (rwyno.size() == 1)) { if (( tmp == "L" || tmp == "R" || tmp == "C" ) || (rwyno.size() == 1)) {
tmp = rwyno; tmp = rwyno;
cout << "Standardising rwy number from " << tmp;
rwyno = "0" + tmp; rwyno = "0" + tmp;
cout << " to " << rwyno << '\n'; SG_LOG( SG_GENERAL, SG_INFO, "Standardising rwy number from " << tmp
<< " to " << rwyno );
} }
char buf[4]; char buf[4];
@ -196,9 +196,9 @@ bool FGRunways::search( const string& aptid, const string& rwyno, FGRunway* r )
string tmp = runwayno.substr(1, 1); string tmp = runwayno.substr(1, 1);
if (( tmp == "L" || tmp == "R" || tmp == "C" ) || (runwayno.size() == 1)) { if (( tmp == "L" || tmp == "R" || tmp == "C" ) || (runwayno.size() == 1)) {
tmp = runwayno; tmp = runwayno;
cout << "Standardising rwy number from " << tmp;
runwayno = "0" + tmp; runwayno = "0" + tmp;
cout << " to " << runwayno << '\n'; SG_LOG(SG_GENERAL, SG_INFO, "Standardising rwy number from " << tmp
<< " to " << runwayno );
} }
c4_RowRef row = vRunway->GetAt(index); c4_RowRef row = vRunway->GetAt(index);

View file

@ -91,7 +91,7 @@ FGAirports::search( const string& id, FGAirport* a ) const
c4_FloatProp pElev ("Elevation"); c4_FloatProp pElev ("Elevation");
int idx = vAirport->Find(pID[id.c_str()]); int idx = vAirport->Find(pID[id.c_str()]);
cout << "idx = " << idx << endl; SG_LOG( SG_TERRAIN, SG_INFO, "idx = " << idx );
if ( idx == -1 ) { if ( idx == -1 ) {
return false; return false;
@ -214,7 +214,7 @@ bool FGAirportsUtil::dump_mk4( const string& file ) {
const_iterator end = airports.end(); const_iterator end = airports.end();
while ( current != end ) { while ( current != end ) {
// add each airport record // add each airport record
cout << "out -> " << current->id << endl; SG_LOG( SG_TERRAIN, SG_BULK, "out -> " << current->id );
pID (row) = current->id.c_str(); pID (row) = current->id.c_str();
pLon (row) = current->longitude; pLon (row) = current->longitude;
pLat (row) = current->latitude; pLat (row) = current->latitude;

View file

@ -284,7 +284,7 @@ void FGKR_87::update( double dt ) {
if ( set_rst_btn == 1 && set_rst_btn == last_set_rst_btn ) { if ( set_rst_btn == 1 && set_rst_btn == last_set_rst_btn ) {
// button depressed and was last iteration too // button depressed and was last iteration too
tmp_timer += dt; tmp_timer += dt;
cout << "tmp_timer = " << tmp_timer << endl; // cout << "tmp_timer = " << tmp_timer << endl;
if ( tmp_timer > 2.0 ) { if ( tmp_timer > 2.0 ) {
// button held depressed for 2 seconds // button held depressed for 2 seconds
cout << "entering elapsed count down mode" << endl; cout << "entering elapsed count down mode" << endl;

View file

@ -547,7 +547,7 @@ void FGNavCom::search()
if ( globals->get_soundmgr()->add( sound, nav_fx_name ) ) { if ( globals->get_soundmgr()->add( sound, nav_fx_name ) ) {
// cout << "Added nav-vor-ident sound" << endl; // cout << "Added nav-vor-ident sound" << endl;
} else { } else {
cout << "Failed to add v1-vor-ident sound" << endl; SG_LOG(SG_COCKPIT, SG_WARN, "Failed to add v1-vor-ident sound");
} }
if ( globals->get_soundmgr()->exists( dme_fx_name ) ) { if ( globals->get_soundmgr()->exists( dme_fx_name ) ) {
@ -576,7 +576,7 @@ void FGNavCom::search()
nav_trans_ident = ""; nav_trans_ident = "";
last_nav_id = ""; last_nav_id = "";
if ( ! globals->get_soundmgr()->remove( nav_fx_name ) ) { if ( ! globals->get_soundmgr()->remove( nav_fx_name ) ) {
cout << "Failed to remove nav-vor-ident sound" << endl; SG_LOG(SG_COCKPIT, SG_WARN, "Failed to remove nav-vor-ident sound");
} }
globals->get_soundmgr()->remove( dme_fx_name ); globals->get_soundmgr()->remove( dme_fx_name );
// cout << "not picking up vor1. :-(" << endl; // cout << "not picking up vor1. :-(" << endl;

View file

@ -26,8 +26,6 @@
#include STL_FSTREAM #include STL_FSTREAM
#include STL_IOSTREAM #include STL_IOSTREAM
SG_USING_STD(cout);
#include "IO360.hxx" #include "IO360.hxx"
#include "LaRCsim/ls_constants.h" #include "LaRCsim/ls_constants.h"
@ -131,10 +129,10 @@ void FGNewEngine::update() {
// cout << "n = " << RPM << " rpm\n"; // cout << "n = " << RPM << " rpm\n";
// cout << "T_amb = " << T_amb << '\n'; // cout << "T_amb = " << T_amb << '\n';
// cout << "running = " << running << '\n'; // cout << "running = " << running << '\n';
cout << "fuel = " << fgGetFloat("/consumables/fuel/tank[0]/level-gal_us") << '\n'; // cout << "fuel = " << fgGetFloat("/consumables/fuel/tank[0]/level-gal_us") << '\n';
// cout << "Percentage_Power = " << Percentage_Power << '\n'; // cout << "Percentage_Power = " << Percentage_Power << '\n';
// cout << "current_oil_temp = " << current_oil_temp << '\n'; // cout << "current_oil_temp = " << current_oil_temp << '\n';
cout << "EGT = " << EGT << '\n'; // cout << "EGT = " << EGT << '\n';
} }
count1++; count1++;
if(count1 == 100) if(count1 == 100)
@ -340,7 +338,7 @@ float FGNewEngine::Lookup_Combustion_Efficiency(float thi_actual)
} }
//if we get here something has gone badly wrong //if we get here something has gone badly wrong
cout << "ERROR: error in FGNewEngine::Lookup_Combustion_Efficiency\n"; SG_LOG(SG_AIRCRAFT, SG_ALERT, "error in FGNewEngine::Lookup_Combustion_Efficiency");
return neta_comb_actual; return neta_comb_actual;
} }
@ -394,7 +392,7 @@ float FGNewEngine::Power_Mixture_Correlation(float thi_actual)
} }
//if we get here something has gone badly wrong //if we get here something has gone badly wrong
cout << "ERROR: error in FGNewEngine::Power_Mixture_Correlation\n"; SG_LOG(SG_AIRCRAFT, SG_ALERT, "error in FGNewEngine::Power_Mixture_Correlation");
return mixPerPow_actual; return mixPerPow_actual;
} }

View file

@ -313,7 +313,7 @@ void SaveDialogOk(puObject*) {
SaveDialogInput->getValue(&s); SaveDialogInput->getValue(&s);
ofstream output(s); ofstream output(s);
cout << saveFile << endl; // cout << saveFile << endl;
if (output.good() && fgSaveFlight(output)) { if (output.good() && fgSaveFlight(output)) {
output.close(); output.close();
mkDialog("Saved flight"); mkDialog("Saved flight");

View file

@ -458,8 +458,8 @@ bool fgDetectLanguage() {
SGPropertyNode *locale = fgInitLocale(language); SGPropertyNode *locale = fgInitLocale(language);
if (!locale) { if (!locale) {
cerr << "No internationalization settings specified in preferences.xml" SG_LOG(SG_GENERAL, SG_ALERT,
<< endl; "No internationalization settings specified in preferences.xml" );
return false; return false;
} }
@ -1212,11 +1212,11 @@ void fgInitFDM() {
static void printMat(const sgVec4 *mat, char *name="") static void printMat(const sgVec4 *mat, char *name="")
{ {
int i; int i;
cout << name << endl; SG_LOG(SG_GENERAL, SG_BULK, name );
for(i=0; i<4; i++) { for(i=0; i<4; i++) {
cout <<" "<<mat[i][0]<<" "<<mat[i][1]<<" "<<mat[i][2]<<" "<<mat[i][3]<<endl; SG_LOG(SG_GENERAL, SG_BULK, " " << mat[i][0] << " " << mat[i][1]
<< " " << mat[i][2] << " " << mat[i][3] );
} }
cout << endl;
} }
// Initialize view parameters // Initialize view parameters

View file

@ -463,7 +463,7 @@ getWindEast ()
static void static void
setWindEast (double speed) setWindEast (double speed)
{ {
cout << "Set wind-east to " << speed << endl; SG_LOG(SG_GENERAL, SG_INFO,, "Set wind-east to " << speed );
current_aircraft.fdm_state->set_Velocities_Local_Airmass(getWindNorth(), current_aircraft.fdm_state->set_Velocities_Local_Airmass(getWindNorth(),
speed, speed,
getWindDown()); getWindDown());
@ -578,7 +578,7 @@ setFDMDataLogging (bool state)
void void
fgInitProps () fgInitProps ()
{ {
cout << "start of fgInitProps()" << endl; SG_LOG(SG_GENERAL, SG_DEBUG, "start of fgInitProps()" );
// Simulation // Simulation
fgTie("/sim/logging/priority", getLoggingPriority, setLoggingPriority); fgTie("/sim/logging/priority", getLoggingPriority, setLoggingPriority);
fgTie("/sim/logging/classes", getLoggingClasses, setLoggingClasses); fgTie("/sim/logging/classes", getLoggingClasses, setLoggingClasses);
@ -617,7 +617,7 @@ fgInitProps ()
fgTie("/sim/temp/full-screen", getFullScreen, setFullScreen); fgTie("/sim/temp/full-screen", getFullScreen, setFullScreen);
fgTie("/sim/temp/fdm-data-logging", getFDMDataLogging, setFDMDataLogging); fgTie("/sim/temp/fdm-data-logging", getFDMDataLogging, setFDMDataLogging);
cout << "end of fgInitProps()" << endl; SG_LOG(SG_GENERAL, SG_DEBUG, "end of fgInitProps()" );
} }

View file

@ -576,19 +576,21 @@ void fgRenderFrame() {
// update the sky dome // update the sky dome
if ( fgGetBool("/sim/rendering/skyblend") ) { if ( fgGetBool("/sim/rendering/skyblend") ) {
/* cout << "thesky->repaint() sky_color = " /*
SG_LOG( SG_GENERAL, SG_BULK, "thesky->repaint() sky_color = "
<< cur_light_params.sky_color[0] << " " << cur_light_params.sky_color[0] << " "
<< cur_light_params.sky_color[1] << " " << cur_light_params.sky_color[1] << " "
<< cur_light_params.sky_color[2] << " " << cur_light_params.sky_color[2] << " "
<< cur_light_params.sky_color[3] << endl; << cur_light_params.sky_color[3] );
cout << " fog = " SG_LOG( SG_GENERAL, SG_BULK, " fog = "
<< cur_light_params.fog_color[0] << " " << cur_light_params.fog_color[0] << " "
<< cur_light_params.fog_color[1] << " " << cur_light_params.fog_color[1] << " "
<< cur_light_params.fog_color[2] << " " << cur_light_params.fog_color[2] << " "
<< cur_light_params.fog_color[3] << endl; << cur_light_params.fog_color[3] );
cout << " sun_angle = " << cur_light_params.sun_angle SG_LOG( SG_GENERAL, SG_BULK,
<< " moon_angle = " << cur_light_params.moon_angle " sun_angle = " << cur_light_params.sun_angle
<< endl; */ << " moon_angle = " << cur_light_params.moon_angle );
*/
thesky->repaint( cur_light_params.sky_color, thesky->repaint( cur_light_params.sky_color,
cur_light_params.adj_fog_color, cur_light_params.adj_fog_color,
cur_light_params.sun_angle, cur_light_params.sun_angle,
@ -598,18 +600,24 @@ void fgRenderFrame() {
globals->get_ephem()->getNumStars(), globals->get_ephem()->getNumStars(),
globals->get_ephem()->getStars() ); globals->get_ephem()->getStars() );
/* cout << "thesky->reposition( view_pos = " << view_pos[0] << " " /*
<< view_pos[1] << " " << view_pos[2] << endl; SG_LOG( SG_GENERAL, SG_BULK,
cout << " zero_elev = " << zero_elev[0] << " " "thesky->reposition( view_pos = " << view_pos[0] << " "
<< view_pos[1] << " " << view_pos[2] );
SG_LOG( SG_GENERAL, SG_BULK,
" zero_elev = " << zero_elev[0] << " "
<< zero_elev[1] << " " << zero_elev[2] << zero_elev[1] << " " << zero_elev[2]
<< " lon = " << cur_fdm_state->get_Longitude() << " lon = " << cur_fdm_state->get_Longitude()
<< " lat = " << cur_fdm_state->get_Latitude() << endl; << " lat = " << cur_fdm_state->get_Latitude() );
cout << " sun_rot = " << cur_light_params.sun_rotation SG_LOG( SG_GENERAL, SG_BULK,
<< " gst = " << SGTime::cur_time_params->getGst() << endl; " sun_rot = " << cur_light_params.sun_rotation
cout << " sun ra = " << globals->get_ephem()->getSunRightAscension() << " gst = " << SGTime::cur_time_params->getGst() );
<< " sun dec = " << globals->get_ephem()->getSunDeclination() SG_LOG( SG_GENERAL, SG_BULK,
<< " moon ra = " << globals->get_ephem()->getMoonRightAscension() " sun ra = " << globals->get_ephem()->getSunRightAscension()
<< " moon dec = " << globals->get_ephem()->getMoonDeclination() << endl; */ << " sun dec = " << globals->get_ephem()->getSunDeclination()
<< " moon ra = " << globals->get_ephem()->getMoonRightAscension()
<< " moon dec = " << globals->get_ephem()->getMoonDeclination() );
*/
thesky->reposition( current__view->get_view_pos(), thesky->reposition( current__view->get_view_pos(),
current__view->get_zero_elev(), current__view->get_zero_elev(),

View file

@ -338,7 +338,7 @@ parse_time(const string& time_in) {
result += seconds / 3600.0; result += seconds / 3600.0;
} }
cout << " parse_time() = " << sign * result << endl; SG_LOG( SG_GENERAL, SG_INFO, " parse_time() = " << sign * result );
return(sign * result); return(sign * result);
} }
@ -526,11 +526,11 @@ parse_fov( const string& arg ) {
static bool static bool
add_channel( const string& type, const string& channel_str ) { add_channel( const string& type, const string& channel_str ) {
cout << "Channel string = " << channel_str << endl; SG_LOG(SG_GENERAL, SG_INFO, "Channel string = " << channel_str );
globals->get_channel_options_list()->push_back( type + "," + channel_str ); globals->get_channel_options_list()->push_back( type + "," + channel_str );
cout << "here" << endl; // cout << "here" << endl;
return true; return true;
} }
@ -1808,7 +1808,7 @@ fgUsage (bool verbose)
SGPropertyNode options_root; SGPropertyNode options_root;
cout << "" << endl; cout << endl;
try { try {
fgLoadProps("options.xml", &options_root); fgLoadProps("options.xml", &options_root);

View file

@ -56,6 +56,8 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include <plib/netSocket.h> #include <plib/netSocket.h>
#include <stdlib.h> #include <stdlib.h>
#include <simgear/debug/logstream.hxx>
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
#include "multiplayrxmgr.hxx" #include "multiplayrxmgr.hxx"
@ -119,9 +121,13 @@ bool FGMultiplayRxMgr::init(void) {
m_sRxAddress = fgGetString("/sim/multiplay/rxhost"); m_sRxAddress = fgGetString("/sim/multiplay/rxhost");
m_iRxPort = fgGetInt("/sim/multiplay/rxport"); m_iRxPort = fgGetInt("/sim/multiplay/rxport");
cout << "FGMultiplayRxMgr::init - rxaddress= " << m_sRxAddress << endl; SG_LOG( SG_NETWORK, SG_INFO, "FGMultiplayRxMgr::init - rxaddress= "
cout << "FGMultiplayRxMgr::init - rxport= " << m_iRxPort << endl; << m_sRxAddress );
cout << "FGMultiplayRxMgr::init - callsign= " << m_sCallsign << endl; SG_LOG( SG_NETWORK, SG_INFO, "FGMultiplayRxMgr::init - rxport= "
<< m_iRxPort);
SG_LOG( SG_NETWORK, SG_INFO, "FGMultiplayRxMgr::init - callsign= "
<< m_sCallsign );
// Create and open rx socket // Create and open rx socket
mDataRxSocket = new netSocket(); mDataRxSocket = new netSocket();
@ -238,9 +244,9 @@ void FGMultiplayRxMgr::ProcessData(void) {
case CHAT_MSG_ID: case CHAT_MSG_ID:
if (MsgHdr->iMsgLen == sizeof(T_MsgHdr) + sizeof(T_ChatMsg)) { if (MsgHdr->iMsgLen == sizeof(T_MsgHdr) + sizeof(T_ChatMsg)) {
ChatMsg = (T_ChatMsg *)(sMsg + sizeof(T_MsgHdr)); ChatMsg = (T_ChatMsg *)(sMsg + sizeof(T_MsgHdr));
cout << "Chat [" << MsgHdr->sCallsign << "]" << " " << ChatMsg->sText << endl; SG_LOG( SG_NETWORK, SG_BULK, "Chat [" << MsgHdr->sCallsign << "]" << " " << ChatMsg->sText );
} else { } else {
cerr << "FGMultiplayRxMgr::MP_ProcessData - Chat message received with insufficient data" << endl; SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayRxMgr::MP_ProcessData - Chat message received with insufficient data" );
} }
break; break;
@ -268,8 +274,7 @@ void FGMultiplayRxMgr::ProcessData(void) {
iPlayerCnt = 0; iPlayerCnt = 0;
do { do {
if (m_Player[iPlayerCnt] == NULL) { if (m_Player[iPlayerCnt] == NULL) {
cout << "FGMultiplayRxMgr::ProcessRxData - Add new player. IP: " << sIpAddress SG_LOG( SG_NETWORK, SG_INFO, "FGMultiplayRxMgr::ProcessRxData - Add new player. IP: " << sIpAddress << ", Call: " << sCallsign << ", model: " << sModelName );
<< ", Call: " << sCallsign << ", model: " << sModelName << endl;
m_Player[iPlayerCnt] = new MPPlayer; m_Player[iPlayerCnt] = new MPPlayer;
m_Player[iPlayerCnt]->Open(string(sIpAddress), iPort, string(sCallsign), string(sModelName), false); m_Player[iPlayerCnt]->Open(string(sIpAddress), iPort, string(sCallsign), string(sModelName), false);
m_Player[iPlayerCnt]->SetPosition(PosMsg->PlayerPos); m_Player[iPlayerCnt]->SetPosition(PosMsg->PlayerPos);

View file

@ -36,7 +36,10 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include <plib/netSocket.h> #include <plib/netSocket.h>
#include <stdlib.h> #include <stdlib.h>
#include <simgear/debug/logstream.hxx>
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
#include "multiplaytxmgr.hxx" #include "multiplaytxmgr.hxx"
#include "mpmessages.hxx" #include "mpmessages.hxx"
#include "mpplayer.hxx" #include "mpplayer.hxx"
@ -92,8 +95,10 @@ bool FGMultiplayTxMgr::init(void) {
string sTxAddress = fgGetString("/sim/multiplay/txhost"); string sTxAddress = fgGetString("/sim/multiplay/txhost");
iTxPort = fgGetInt("/sim/multiplay/txport"); iTxPort = fgGetInt("/sim/multiplay/txport");
cout << "FGMultiplayTxMgr::init - txaddress= " << sTxAddress << endl; SG_LOG( SG_NETWORK, SG_INFO, "FGMultiplayTxMgr::init - txaddress= "
cout << "FGMultiplayTxMgr::init - txport= " << iTxPort << endl; << sTxAddress );
SG_LOG( SG_NETWORK, SG_INFO, "FGMultiplayTxMgr::init - txport= "
<< iTxPort );
if (iTxPort > 0) { if (iTxPort > 0) {
@ -126,7 +131,7 @@ bool FGMultiplayTxMgr::init(void) {
// If Tx port == zero then don't initialise // If Tx port == zero then don't initialise
} else { } else {
cout << "FGMultiplayTxMgr::init - Tx Port is zero. Multiplay out disabled." << endl; SG_LOG( SG_NETWORK, SG_WARN, "FGMultiplayTxMgr::init - Tx Port is zero. Multiplay out disabled." );
bSuccess = false; bSuccess = false;
} }
@ -135,7 +140,7 @@ bool FGMultiplayTxMgr::init(void) {
m_bInitialised = bSuccess; m_bInitialised = bSuccess;
} else { } else {
cerr << "FGMultiplayTxMgr::init - Attempt to init object that is already opened" << endl; SG_LOG( SG_NETWORK, SG_ALERT, "FGMultiplayTxMgr::init - Attempt to init object that is already opened" );
bSuccess = false; bSuccess = false;
} }

View file

@ -53,7 +53,7 @@ mgcLinInterp2D::mgcLinInterp2D (int _numPoints, double* x, double* y,
return; return;
} }
cout << "[ 20%] allocating memory \r"; SG_LOG(SG_MATH, SG_DEBUG, "[ 20%] allocating memory");
point = new double*[numPoints]; point = new double*[numPoints];
tmppoint = new double*[numPoints+3]; tmppoint = new double*[numPoints+3];
@ -71,7 +71,7 @@ mgcLinInterp2D::mgcLinInterp2D (int _numPoints, double* x, double* y,
f[i] = _f[i]; f[i] = _f[i];
} }
cout << "[ 30%] creating delaunay diagram \r"; SG_LOG(SG_MATH, SG_DEBUG, "[ 30%] creating delaunay diagram");
Delaunay2D(); Delaunay2D();
} }
@ -290,7 +290,7 @@ int mgcLinInterp2D::Delaunay2D ()
nts = 1; // number of triangles nts = 1; // number of triangles
i4 = 1; i4 = 1;
cout << "[ 40%] create triangulation \r"; SG_LOG(SG_MATH, SG_DEBUG, "[ 40%] create triangulation");
// compute triangulation // compute triangulation
for (i0 = 0; i0 < numPoints; i0++) for (i0 = 0; i0 < numPoints; i0++)
@ -383,7 +383,7 @@ Corner3:;
} }
// count the number of triangles // count the number of triangles
cout << "[ 50%] count the number of triangles \r"; SG_LOG(SG_MATH, SG_DEBUG, "[ 50%] count the number of triangles");
numTriangles = 0; numTriangles = 0;
i0 = -1; i0 = -1;
@ -405,7 +405,7 @@ Corner3:;
} }
// create the triangles // create the triangles
cout << "[ 60%] create the triangles \r"; SG_LOG(SG_MATH, SG_DEBUG "[ 60%] create the triangles");
triangle = new Triangle[numTriangles]; triangle = new Triangle[numTriangles];
@ -439,7 +439,7 @@ Corner3:;
} }
// build edge table // build edge table
cout << "[ 70%] build the edge table \r"; SG_LOG(SG_MATH, SG_DEBUG, "[ 70%] build the edge table");
numEdges = 0; numEdges = 0;
edge = new Edge[3*numTriangles]; edge = new Edge[3*numTriangles];
@ -448,7 +448,7 @@ Corner3:;
for (i = 0; i < numTriangles; i++) for (i = 0; i < numTriangles; i++)
{ {
if ( (i%500) == 0) if ( (i%500) == 0)
cout << "[ 7" << 10*i/numTriangles << "%] build the edge table \r"; SG_LOG(SG_MATH, SG_BULK, "[ 7" << 10*i/numTriangles << "%] build the edge table");
Triangle& t = triangle[i]; Triangle& t = triangle[i];
@ -481,7 +481,7 @@ Corner3:;
} }
// establish links between adjacent triangles // establish links between adjacent triangles
cout << "[ 80%] establishing links between adjacent triangles \r"; SG_LOG(SG_MATH, SG_DEBUG, "[ 80%] establishing links between adjacent triangles");
for (i = 0; i < numEdges; i++) for (i = 0; i < numEdges; i++)
{ {
@ -505,7 +505,7 @@ ExitDelaunay:;
delete[] ccr[0]; delete[] ccr[0];
delete[] ccr; delete[] ccr;
cout << "[ 90%] finsishes delauney triangulation \r"; SG_LOG(SG_MATH, SG_DEBUG, "[ 90%] finsishes delauney triangulation");
return result; return result;
} }

View file

@ -51,8 +51,8 @@ SphereInterpolate::SphereInterpolate (int n, const double* x,
// For complete spherical coverage, include the two antipodal points // For complete spherical coverage, include the two antipodal points
// (0,0,1,f(0,0,1)) and (0,0,-1,f(0,0,-1)) in the data set. // (0,0,1,f(0,0,1)) and (0,0,-1,f(0,0,-1)) in the data set.
cout << "Initialising spherical interpolator.\n"; SG_LOG(SG_MATH, SG_DEBUG, "Initialising spherical interpolator.");
cout << "[ 0%] Allocating memory \r"; SG_LOG(SG_MATH, SG_DEBUG, "[ 0%] Allocating memory");
theta = new double[3*n]; theta = new double[3*n];
phi = new double[3*n]; phi = new double[3*n];
@ -68,7 +68,7 @@ SphereInterpolate::SphereInterpolate (int n, const double* x,
} }
// use periodicity to get wrap-around in the Delaunay triangulation // use periodicity to get wrap-around in the Delaunay triangulation
cout << "[ 10%] copying vertices for wrap-around\r"; SG_LOG(SG_MATH, SG_DEBUG, "[ 10%] copying vertices for wrap-aroundr");
int j, k; int j, k;
for (i = 0, j = n, k = 2*n; i < n; i++, j++, k++) for (i = 0, j = n, k = 2*n; i < n; i++, j++, k++)
{ {
@ -82,7 +82,7 @@ SphereInterpolate::SphereInterpolate (int n, const double* x,
pInterp = new mgcLinInterp2D(3*n,theta,phi,func); pInterp = new mgcLinInterp2D(3*n,theta,phi,func);
cout << "[100%] Finished initialising spherical interpolator. \n"; SG_LOG(SG_MATH, SG_DEBUG, "[100%] Finished initialising spherical interpolator.");
} }
SphereInterpolate::SphereInterpolate (int n, const sgVec2* p, const unsigned int* f) SphereInterpolate::SphereInterpolate (int n, const sgVec2* p, const unsigned int* f)
@ -90,15 +90,15 @@ SphereInterpolate::SphereInterpolate (int n, const sgVec2* p, const unsigned int
// Assumes (x[i],y[i],z[i]) is unit length for all 0 <= i < n. // Assumes (x[i],y[i],z[i]) is unit length for all 0 <= i < n.
// For complete spherical coverage, include the two antipodal points // For complete spherical coverage, include the two antipodal points
// (0,0,1,f(0,0,1)) and (0,0,-1,f(0,0,-1)) in the data set. // (0,0,1,f(0,0,1)) and (0,0,-1,f(0,0,-1)) in the data set.
cout << "Initialising spherical interpolator.\n"; SG_LOG(SG_MATH, SG_DEBUG, "Initialising spherical interpolator.");
cout << "[ 0%] Allocating memory \r"; SG_LOG(SG_MATH, SG_DEBUG, "[ 0%] Allocating memory");
theta = new double[3*n]; theta = new double[3*n];
phi = new double[3*n]; phi = new double[3*n];
func = new unsigned int[3*n]; func = new unsigned int[3*n];
// convert data to spherical coordinates // convert data to spherical coordinates
cout << "[ 10%] copying vertices for wrap-around \r"; SG_LOG(SG_MATH, SG_DEBUG, "[ 10%] copying vertices for wrap-around");
int i, j, k; int i, j, k;
for (i = 0, j = n, k = 2*n; i < n; i++, j++, k++) for (i = 0, j = n, k = 2*n; i < n; i++, j++, k++)
@ -118,7 +118,7 @@ SphereInterpolate::SphereInterpolate (int n, const sgVec2* p, const unsigned int
pInterp = new mgcLinInterp2D(3*n,theta,phi,func); pInterp = new mgcLinInterp2D(3*n,theta,phi,func);
cout << "[100%] Finished initialising spherical interpolator. \n"; SG_LOG(SG_MATH, SG_DEBUG, "[100%] Finished initialising spherical interpolator.");
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
SphereInterpolate::~SphereInterpolate () SphereInterpolate::~SphereInterpolate ()