1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield
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.
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.
14// Code by: Jeremy Moles (cubicool) 2007-2008
24#include <osgViewer/Viewer>
25#include <osgViewer/CompositeViewer>
27#include <osgWidget/Export>
28#include <osgWidget/Types>
32// These are NOT OSGWIDGET_EXPORT'd; these are internal only!
34inline std::ostream& _notify(osg::NotifySeverity ns = osg::INFO)
36 std::ostream& n = osg::notify(ns);
38 return n << "osgWidget: ";
41inline std::ostream& warn()
43 return _notify(osg::WARN);
46inline std::ostream& info()
51inline char lowerCaseChar(const char in)
53 return (unsigned char)(::tolower((int)((unsigned char)in)));
56inline std::string lowerCase(const std::string& str)
60 // TODO: Why can't I specify std::tolower?
61 std::transform(s.begin(), s.end(), s.begin(), lowerCaseChar);
66// TODO: Is this totally ghetto or what?
68inline bool hasDecimal(T v)
70 return (v - static_cast<T>(static_cast<long>(v))) > 0.0f;
75// These ARE OSGWIDGET_EXPORT'd for your convenience. :)
77OSGWIDGET_EXPORT std::string getFilePath (const std::string&);
78OSGWIDGET_EXPORT std::string generateRandomName (const std::string&);
79OSGWIDGET_EXPORT osg::Camera* createOrthoCamera (matrix_type, matrix_type);
81// This function sets up our basic example framework, and optionally sets some root
83OSGWIDGET_EXPORT int createExample (osgViewer::Viewer&, WindowManager*, osg::Node* = 0);
84OSGWIDGET_EXPORT bool writeWindowManagerNode (WindowManager*);