Re: [Flightgear-devel] [Simgear-cvslogs] CVS: source/simgear/misc strutils.cxx, 1.4, 1.5 strutils.hxx, 1.4, 1.5

2009-10-05 Thread Curtis Olson
Hi Jim,

Thanks for the quick fix on the strutils.  In this case, (haha, so to speak)
yes, I think if code is already referencing OpenGL, then it would be fair to
replace that with code that references OSG.  And yes, if you can generate
png's instead of the 42x larger ppm format, that would be a big nice
convenience.

Thanks!

Curt.


On Mon, Oct 5, 2009 at 4:54 PM, James Turner  wrote:

>
> On 30 Sep 2009, at 19:44, Curtis Olson wrote:
>
> > I just noticed you added an OSG dependency to strutils.cxx/hxx  If
> > possible it would be nice to avoid adding graphics system
> > dependencies to these text manipulation libraries.  SimGear and
> > SimGear code is used in a variety of places beyond FlightGear, even
> > in embedded systems where compiling opengl and OSG is completely
> > impossible.
>
> I have a pending change to replace the screenshot code in SimGear
> (simgear/screen/screen-dump.cxx) with a version using osgDB. The major
> advantage being that we would create screenshots as .pngs instead of
> PPMs.
>
> Is it 'safe' (from your point of view) to use OSG code in this place?
> It's already code that directly calls OpenGL, so I *guess* it's not
> used on your embedded device?
>
> Regards,
> James
>
>
>
> --
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> ___
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>



-- 
Curtis Olson: http://baron.flightgear.org/~curt/
--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] [Simgear-cvslogs] CVS: source/simgear/misc strutils.cxx, 1.4, 1.5 strutils.hxx, 1.4, 1.5

2009-10-05 Thread James Turner

On 30 Sep 2009, at 19:44, Curtis Olson wrote:

> I just noticed you added an OSG dependency to strutils.cxx/hxx  If  
> possible it would be nice to avoid adding graphics system  
> dependencies to these text manipulation libraries.  SimGear and  
> SimGear code is used in a variety of places beyond FlightGear, even  
> in embedded systems where compiling opengl and OSG is completely  
> impossible.

I have a pending change to replace the screenshot code in SimGear  
(simgear/screen/screen-dump.cxx) with a version using osgDB. The major  
advantage being that we would create screenshots as .pngs instead of  
PPMs.

Is it 'safe' (from your point of view) to use OSG code in this place?  
It's already code that directly calls OpenGL, so I *guess* it's not  
used on your embedded device?

Regards,
James


--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] [Simgear-cvslogs] CVS: source/simgear/misc strutils.cxx, 1.4, 1.5 strutils.hxx, 1.4, 1.5

2009-09-30 Thread James Turner

On 30 Sep 2009, at 20:15, Simon Hollier wrote:

> I don't think there's an STL function, but there is
> boost::to_lower(str) or even something like:
>
> for (unsigned i=0; i < str.length(); ++i) {
>str[i] = tolower(str[i]);
>  }

I already chatted to Tim about this, I'm going to switch to the boost  
version.

tolower/toupper() worry me.



--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] [Simgear-cvslogs] CVS: source/simgear/misc strutils.cxx, 1.4, 1.5 strutils.hxx, 1.4, 1.5

2009-09-30 Thread Simon Hollier
Hello,

On Wed, Sep 30, 2009 at 2:47 PM, Curtis Olson  wrote:
> Ok, duh! I see that is a single character function, but there has to be a
>  class function or it can't be too hard to whip up a little function
> ourselves.

I don't think there's an STL function, but there is
boost::to_lower(str) or even something like:

for (unsigned i=0; i < str.length(); ++i) {
str[i] = tolower(str[i]);
  }



-- 
Simon Hollier

--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] [Simgear-cvslogs] CVS: source/simgear/misc strutils.cxx, 1.4, 1.5 strutils.hxx, 1.4, 1.5

2009-09-30 Thread Curtis Olson
Ok, duh! I see that is a single character function, but there has to be a
 class function or it can't be too hard to whip up a little function
ourselves.

Thanks,

Curt.


On Wed, Sep 30, 2009 at 1:44 PM, Curtis Olson wrote:

> Hi Jim,
>
> I just noticed you added an OSG dependency to strutils.cxx/hxx  If possible
> it would be nice to avoid adding graphics system dependencies to these text
> manipulation libraries.  SimGear and SimGear code is used in a variety of
> places beyond FlightGear, even in embedded systems where compiling opengl
> and OSG is completely impossible.
>
> Would it work to use something like the following instead of an OSG
> function?:
>
>   #include 
>
>int toupper(int c);
>int tolower(int c);
>
> Right now this OSG dependency is breaking one of my other projects.
>
> Thanks,
>
> Curt.
>
>
>
>
> On Sat, Sep 26, 2009 at 6:44 AM, James Turner 
> wrote:
>
>> Update of /var/cvs/SimGear-0.3/source/simgear/misc
>> In directory baron.flightgear.org:/tmp/cvs-serv8677/simgear/misc
>>
>> Modified Files:
>>strutils.cxx strutils.hxx
>> Log Message:
>> Extend simgear::strutils with convertToLowerCase helper - currently a
>> proxy for osgDB helper of the same name.
>>
>>
>> Index: strutils.cxx
>> ===
>> RCS file: /var/cvs/SimGear-0.3/source/simgear/misc/strutils.cxx,v
>> retrieving revision 1.4
>> retrieving revision 1.5
>> diff -u -r1.4 -r1.5
>> --- strutils.cxx13 Apr 2008 21:11:44 -  1.4
>> +++ strutils.cxx26 Sep 2009 11:44:33 -  1.5
>> @@ -25,6 +25,11 @@
>>
>>  #include "strutils.hxx"
>>
>> +#include  // for convertToLowerCase
>> +
>> +using std::string;
>> +using std::vector;
>> +
>>  namespace simgear {
>> namespace strutils {
>>
>> @@ -180,5 +185,12 @@
>>return do_strip( s, BOTHSTRIP );
>>}
>>
>> +  string convertToLowerCase(const string& str)
>> +  {
>> +// proxy onto osgDB - easy to reimplement here, but let's avoid
>> +// code duplication for the moment.
>> +return osgDB::convertToLowerCase(str);
>> +  }
>> +
>> } // end namespace strutils
>>  } // end namespace simgear
>>
>> Index: strutils.hxx
>> ===
>> RCS file: /var/cvs/SimGear-0.3/source/simgear/misc/strutils.hxx,v
>> retrieving revision 1.4
>> retrieving revision 1.5
>> diff -u -r1.4 -r1.5
>> --- strutils.hxx28 Jul 2008 07:52:14 -  1.4
>> +++ strutils.hxx26 Sep 2009 11:44:34 -  1.5
>> @@ -30,16 +30,12 @@
>>  #include 
>>
>>  #include 
>> -
>>  #include 
>> -using std::vector;
>> -
>>  #include 
>>
>> -using std::string;
>>
>>  namespace simgear {
>> -namespace strutils {
>> +  namespace strutils {
>>
>>  // /**
>>  //  * atof() wrapper for "string" type
>> @@ -64,9 +60,9 @@
>> * @param s String to strip.
>> * @return The stripped string.
>> */
>> -   string lstrip( const string& s );
>> -   string rstrip( const string& s );
>> -   string strip( const string& s );
>> +   std::string lstrip( const std::string& s );
>> +   std::string rstrip( const std::string& s );
>> +   std::string strip( const std::string& s );
>>
>>/**
>> * Split a string into a words using 'sep' as the delimiter string.
>> @@ -79,12 +75,15 @@
>> * resulting in at most maxsplit+1 words.
>> * @return Array of words.
>> */
>> -   vector
>> -   split( const string& s,
>> +   std::vector
>> +   split( const std::string& s,
>>   const char* sep = 0,
>>   int maxsplit = 0 );
>>
>> -} // end namespace strutils
>> +
>> +  std::string convertToLowerCase(const std::string& str);
>> +
>> +  } // end namespace strutils
>>  } // end namespace simgear
>>
>>  #endif // STRUTILS_H
>>
>>
>>
>> --
>> Come build with us! The BlackBerry® Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay
>> ahead of the curve. Join us from November 9-12, 2009. Register
>> now!
>> http://p.sf.net/sfu/devconf
>> ___
>> Simgear-cvslogs mailing list
>> simgear-cvsl...@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/simgear-cvslogs
>>
>
>
>
> --
> Curtis Olson: 
> http://baron.flightgear.org/~curt/
>



-- 
Curtis Olson: http://baron.flightgear.org/~curt/
--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Regi

Re: [Flightgear-devel] [Simgear-cvslogs] CVS: source/simgear/misc strutils.cxx, 1.4, 1.5 strutils.hxx, 1.4, 1.5

2009-09-30 Thread Curtis Olson
Hi Jim,

I just noticed you added an OSG dependency to strutils.cxx/hxx  If possible
it would be nice to avoid adding graphics system dependencies to these text
manipulation libraries.  SimGear and SimGear code is used in a variety of
places beyond FlightGear, even in embedded systems where compiling opengl
and OSG is completely impossible.

Would it work to use something like the following instead of an OSG
function?:

  #include 

   int toupper(int c);
   int tolower(int c);

Right now this OSG dependency is breaking one of my other projects.

Thanks,

Curt.



On Sat, Sep 26, 2009 at 6:44 AM, James Turner wrote:

> Update of /var/cvs/SimGear-0.3/source/simgear/misc
> In directory baron.flightgear.org:/tmp/cvs-serv8677/simgear/misc
>
> Modified Files:
>strutils.cxx strutils.hxx
> Log Message:
> Extend simgear::strutils with convertToLowerCase helper - currently a proxy
> for osgDB helper of the same name.
>
>
> Index: strutils.cxx
> ===
> RCS file: /var/cvs/SimGear-0.3/source/simgear/misc/strutils.cxx,v
> retrieving revision 1.4
> retrieving revision 1.5
> diff -u -r1.4 -r1.5
> --- strutils.cxx13 Apr 2008 21:11:44 -  1.4
> +++ strutils.cxx26 Sep 2009 11:44:33 -  1.5
> @@ -25,6 +25,11 @@
>
>  #include "strutils.hxx"
>
> +#include  // for convertToLowerCase
> +
> +using std::string;
> +using std::vector;
> +
>  namespace simgear {
> namespace strutils {
>
> @@ -180,5 +185,12 @@
>return do_strip( s, BOTHSTRIP );
>}
>
> +  string convertToLowerCase(const string& str)
> +  {
> +// proxy onto osgDB - easy to reimplement here, but let's avoid
> +// code duplication for the moment.
> +return osgDB::convertToLowerCase(str);
> +  }
> +
> } // end namespace strutils
>  } // end namespace simgear
>
> Index: strutils.hxx
> ===
> RCS file: /var/cvs/SimGear-0.3/source/simgear/misc/strutils.hxx,v
> retrieving revision 1.4
> retrieving revision 1.5
> diff -u -r1.4 -r1.5
> --- strutils.hxx28 Jul 2008 07:52:14 -  1.4
> +++ strutils.hxx26 Sep 2009 11:44:34 -  1.5
> @@ -30,16 +30,12 @@
>  #include 
>
>  #include 
> -
>  #include 
> -using std::vector;
> -
>  #include 
>
> -using std::string;
>
>  namespace simgear {
> -namespace strutils {
> +  namespace strutils {
>
>  // /**
>  //  * atof() wrapper for "string" type
> @@ -64,9 +60,9 @@
> * @param s String to strip.
> * @return The stripped string.
> */
> -   string lstrip( const string& s );
> -   string rstrip( const string& s );
> -   string strip( const string& s );
> +   std::string lstrip( const std::string& s );
> +   std::string rstrip( const std::string& s );
> +   std::string strip( const std::string& s );
>
>/**
> * Split a string into a words using 'sep' as the delimiter string.
> @@ -79,12 +75,15 @@
> * resulting in at most maxsplit+1 words.
> * @return Array of words.
> */
> -   vector
> -   split( const string& s,
> +   std::vector
> +   split( const std::string& s,
>   const char* sep = 0,
>   int maxsplit = 0 );
>
> -} // end namespace strutils
> +
> +  std::string convertToLowerCase(const std::string& str);
> +
> +  } // end namespace strutils
>  } // end namespace simgear
>
>  #endif // STRUTILS_H
>
>
>
> --
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> ___
> Simgear-cvslogs mailing list
> simgear-cvsl...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/simgear-cvslogs
>



-- 
Curtis Olson: http://baron.flightgear.org/~curt/
--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel