root/OpenSceneGraph/trunk/include/osgWidget/Util @ 10764

Revision 10764, 2.2 kB (checked in by robert, 4 years ago)

<iterator>, <stdlib.h> and <ctype.h> includes required for QNX compiler

RevLine 
[8691]1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under 
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version.  The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * OpenSceneGraph Public License for more details.
12*/
13
[9287]14// Code by: Jeremy Moles (cubicool) 2007-2008
[8588]15
16#ifndef OSGWIDGET_UTIL
17#define OSGWIDGET_UTIL
18
[10764]19#include <ctype.h>
[9287]20#include <cctype>
[8588]21#include <algorithm>
22#include <sstream>
23#include <osg/Camera>
24#include <osgViewer/Viewer>
25#include <osgViewer/CompositeViewer>
26
27#include <osgWidget/Export>
28#include <osgWidget/Types>
29
30namespace osgWidget {
31
32// These are NOT OSGWIDGET_EXPORT'd; these are internal only!
33
[8690]34inline std::ostream& _notify(osg::NotifySeverity ns = osg::INFO)
35{
36    std::ostream& n = osg::notify(ns);
37   
38    return n << "osgWidget: ";
[8588]39}
40
[8690]41inline std::ostream& warn()
42{
43    return _notify(osg::WARN);
[8588]44}
45
[8690]46inline std::ostream& info()
47{
48    return _notify();
[8588]49}
50
[8690]51inline std::string lowerCase(const std::string& str)
52{
53    std::string s = str;
[8588]54
[8690]55    // TODO: Why can't I specify std::tolower?
56    std::transform(s.begin(), s.end(), s.begin(), ::tolower);
[8588]57
[8690]58    return s;
[8588]59}
60
61// TODO: Is this totally ghetto or what?
62template <typename T>
[8690]63inline bool hasDecimal(T v)
64{
65    return (v - static_cast<T>(static_cast<long>(v))) > 0.0f;
[8588]66}
67
68class WindowManager;
69
70// These ARE OSGWIDGET_EXPORT'd for your convenience. :)
71
72OSGWIDGET_EXPORT std::string  getFilePath        (const std::string&);
73OSGWIDGET_EXPORT std::string  generateRandomName (const std::string&);
[9287]74OSGWIDGET_EXPORT osg::Camera* createOrthoCamera  (matrix_type, matrix_type);
[8588]75
76// This function sets up our basic example framework, and optionally sets some root
77// scene data.
[9287]78OSGWIDGET_EXPORT int  createExample          (osgViewer::Viewer&, WindowManager*, osg::Node* = 0);
79OSGWIDGET_EXPORT bool writeWindowManagerNode (WindowManager*);
[8588]80
81}
82
83#endif
Note: See TracBrowser for help on using the browser.