diff --git a/examples/osgtransferfunction/CMakeLists.txt b/examples/osgtransferfunction/CMakeLists.txt index 645cb1fcc..bc99c2e47 100644 --- a/examples/osgtransferfunction/CMakeLists.txt +++ b/examples/osgtransferfunction/CMakeLists.txt @@ -3,7 +3,7 @@ SET(TARGET_SRC osgtransferfunction.cpp ) -SET(TARGET_ADDED_LIBRARIES osgVolume osgManipulator) +SET(TARGET_ADDED_LIBRARIES osgVolume osgUI osgManipulator) #### end var setup ### SETUP_EXAMPLE(osgtransferfunction) diff --git a/examples/osgtransferfunction/TransferFunctionWidget.h b/examples/osgtransferfunction/TransferFunctionWidget.h index e9d16a54f..806f4dbd2 100644 --- a/examples/osgtransferfunction/TransferFunctionWidget.h +++ b/examples/osgtransferfunction/TransferFunctionWidget.h @@ -17,14 +17,14 @@ #include #include -#include +#include #define OSGUI_EXPORT namespace osgUI { -class OSGUI_EXPORT TransferFunctionWidget : public osgGA::Widget +class OSGUI_EXPORT TransferFunctionWidget : public osgUI::Widget { public: TransferFunctionWidget(osg::TransferFunction1D* tf=0); diff --git a/include/osgUI/AlignmentSettings b/include/osgUI/AlignmentSettings new file mode 100644 index 000000000..01b1c692a --- /dev/null +++ b/include/osgUI/AlignmentSettings @@ -0,0 +1,67 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +#ifndef OSGUI_ALIGNMENTSETTINGS +#define OSGUI_ALIGNMENTSETTINGS + +#include +#include +#include +#include + +namespace osgUI +{ + +class OSGUI_EXPORT AlignmentSettings : public osg::Object +{ +public: + AlignmentSettings(); + AlignmentSettings(const AlignmentSettings& textSettings, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); + META_Object(osgUI, AlignmentSettings); + + enum Alignment + { + LEFT_TOP, + LEFT_CENTER, + LEFT_BOTTOM, + + CENTER_TOP, + CENTER_CENTER, + CENTER_BOTTOM, + + RIGHT_TOP, + RIGHT_CENTER, + RIGHT_BOTTOM, + + LEFT_BASE_LINE, + CENTER_BASE_LINE, + RIGHT_BASE_LINE, + + LEFT_BOTTOM_BASE_LINE, + CENTER_BOTTOM_BASE_LINE, + RIGHT_BOTTOM_BASE_LINE + }; + + void setAlignment(Alignment alignment) { _alignment = alignment; } + Alignment getAlignment() const { return _alignment; } + +protected: + + virtual ~AlignmentSettings() {} + + Alignment _alignment; +}; + +} + +#endif diff --git a/include/osgUI/Export b/include/osgUI/Export new file mode 100644 index 000000000..28c194206 --- /dev/null +++ b/include/osgUI/Export @@ -0,0 +1,57 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +// The following symbol has a underscore suffix for compatibility. +#ifndef OSGUI_EXPORT_ +#define OSGUI_EXPORT_ 1 + +#include + +#if defined(_MSC_VER) && defined(OSG_DISABLE_MSVC_WARNINGS) + #pragma warning( disable : 4244 ) + #pragma warning( disable : 4251 ) + #pragma warning( disable : 4267 ) + #pragma warning( disable : 4275 ) + #pragma warning( disable : 4290 ) + #pragma warning( disable : 4786 ) + #pragma warning( disable : 4305 ) + #pragma warning( disable : 4996 ) +#endif + +#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__) || defined( __MWERKS__) + # if defined( OSG_LIBRARY_STATIC ) + # define OSGUI_EXPORT + # elif defined( OSGVIEWER_LIBRARY ) + # define OSGUI_EXPORT __declspec(dllexport) + # else + # define OSGUI_EXPORT __declspec(dllimport) + #endif +#else + #define OSGUI_EXPORT +#endif + +#endif + + +/** + +\namespace osgViewer + +The osgViewer library provides high level viewer functionality designed to make it easier to write a range of different types of viewers, +from viewers embedded in existing windows via SimpleViewer, through to highly scalable and flexible Viewer and Composite classes. A +set of event handlers add functionality to these viewers so that you can rapidly compose the viewer functionality tailored to your needs. +Finally the viewer classes can be adapted to work with a range of different window toolkit API's via GraphicsWindow implementations, +with native Win32, X11 and Carbon implementations on Windows, Unices and OSX respectively, and other window toolkits such as WxWidgets, Qt etc. +*/ + + diff --git a/include/osgUI/FrameSettings b/include/osgUI/FrameSettings new file mode 100644 index 000000000..24d0d1297 --- /dev/null +++ b/include/osgUI/FrameSettings @@ -0,0 +1,66 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +#ifndef OSGUI_FRAMESETTINGS +#define OSGUI_FRAMESETTINGS + +#include +#include +#include +#include + +namespace osgUI +{ +class OSGUI_EXPORT FrameSettings : public osg::Object +{ +public: + FrameSettings(); + FrameSettings(const FrameSettings& frameSettings, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); + META_Object(osgUI, FrameSettings); + + enum Shape + { + NO_FRAME, + BOX, + PANEL + }; + + void setShape(Shape shape) { _shape = shape; } + Shape getShape() const { return _shape; } + + enum Shadow + { + PLAIN, + SUNKEN, + RAISED + }; + + void setShadow(Shadow shadow) { _shadow = shadow; } + Shadow getShadow() const { return _shadow; } + + void setLineWidth(float width) { _lineWidth = width; } + float getLineWidth() const { return _lineWidth; } + +protected: + + virtual ~FrameSettings() {} + + Shape _shape; + Shadow _shadow; + float _lineWidth; + +}; + +} + +#endif diff --git a/include/osgUI/Label b/include/osgUI/Label new file mode 100644 index 000000000..2d5aac6bf --- /dev/null +++ b/include/osgUI/Label @@ -0,0 +1,49 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +#ifndef OSGUI_LABEL +#define OSGUI_LABEL + +#include +#include + +namespace osgUI +{ + +class OSGUI_EXPORT Label : public osgUI::Widget +{ +public: + Label(); + Label(const Label& label, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); + META_Node(osgUI, Label); + + void setText(const std::string& text) { _text = text; dirty(); } + std::string& getText() { return _text; } + const std::string& getText() const { return _text; } + + + virtual void createGraphicsImplementation(); + +protected: + virtual ~Label() {} + + std::string _text; + + // implementation detail + osg::ref_ptr _textDrawable; + osg::ref_ptr _textGeode; +}; + +} + +#endif diff --git a/include/osgUI/LineEdit b/include/osgUI/LineEdit new file mode 100644 index 000000000..8591ccc3e --- /dev/null +++ b/include/osgUI/LineEdit @@ -0,0 +1,50 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +#ifndef OSGUI_LINEEDIT +#define OSGUI_LINEEDIT + +#include +#include + +namespace osgUI +{ + +class OSGUI_EXPORT LineEdit : public osgUI::Widget +{ +public: + LineEdit(); + LineEdit(const LineEdit& label, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); + META_Node(osgUI, LineEdit); + + virtual bool handleImplementation(osgGA::EventVisitor* ev, osgGA::Event* event); + + void setText(const std::string& text) { _text = text; dirty(); } + std::string& getText() { return _text; } + const std::string& getText() const { return _text; } + + virtual void createGraphicsImplementation(); + +protected: + virtual ~LineEdit() {} + + std::string _text; + + // implementation detail + osg::ref_ptr _textDrawable; + osg::ref_ptr _textGeode; +}; + +} + +#endif diff --git a/include/osgUI/Style b/include/osgUI/Style new file mode 100644 index 000000000..bf57af13f --- /dev/null +++ b/include/osgUI/Style @@ -0,0 +1,61 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +#ifndef OSGUI_STYLE +#define OSGUI_STYLE + +#include +#include +#include + +#include +#include +#include + +namespace osgUI +{ + +class OSGUI_EXPORT Style : public osg::Object +{ +public: + Style(); + Style(const Style& style, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); + META_Object(osgUI, Style); + + static osg::ref_ptr