Restructed the osgPresentation and present3D directories back to the structure that was present in OSG-3.2

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14759 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2015-03-04 18:36:44 +00:00
parent 26d1679248
commit 8c8b8f3305
37 changed files with 127 additions and 130 deletions

View File

@ -1,20 +1,20 @@
SET(TARGET_SRC
deprecated/Cluster.cpp
deprecated/ExportHTML.cpp
deprecated/PointsEventHandler.cpp
deprecated/present3D.cpp
deprecated/ReadShowFile.cpp
deprecated/ShowEventHandler.cpp
deprecated/SpellChecker.cpp
Cluster.cpp
ExportHTML.cpp
PointsEventHandler.cpp
present3D.cpp
ReadShowFile.cpp
ShowEventHandler.cpp
SpellChecker.cpp
)
SET(TARGET_H
deprecated/Cluster.h
deprecated/ExportHTML.h
deprecated/PointsEventHandler.h
deprecated/ReadShowFile.h
deprecated/ShowEventHandler.h
deprecated/SpellChecker.h
Cluster.h
ExportHTML.h
PointsEventHandler.h
ReadShowFile.h
ShowEventHandler.h
SpellChecker.h
)
IF (SDL_FOUND)

View File

@ -1,12 +1,12 @@
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This software is open source and may be redistributed and/or modified under
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
*
* This software 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
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* include LICENSE.txt for more details.
*/
@ -46,16 +46,16 @@ public:
void setSnapImageOnNextFrame(bool flag) { _snapImageOnNextFrame = flag; }
bool getSnapImageOnNextFrame() const { return _snapImageOnNextFrame; }
virtual void operator () (const osg::Camera& camera) const
{
if (!_snapImageOnNextFrame) return;
int x = static_cast<int>(camera.getViewport()->x());
int y = static_cast<int>(camera.getViewport()->y());
unsigned int width = static_cast<unsigned int>(camera.getViewport()->width());
unsigned int height = static_cast<unsigned int>(camera.getViewport()->height());
osg::ref_ptr<osg::Image> image = new osg::Image;
image->readPixels(x,y,width,height,
GL_RGB,GL_UNSIGNED_BYTE);
@ -64,16 +64,16 @@ public:
{
osg::notify(osg::NOTICE) << "Saved screen image to `"<<_filename<<"`"<< std::endl;
}
_snapImageOnNextFrame = false;
}
protected:
std::string _filename;
mutable bool _snapImageOnNextFrame;
};
std::string ExportHTML::createFileName(const std::string& basename, unsigned int page, const std::string& ext)
@ -102,7 +102,7 @@ bool ExportHTML::write(osgPresentation::SlideEventHandler* seh, osgViewer::Viewe
image_basename = osgDB::getNameLessExtension(filename);
image_ext = ".jpg";
}
std::cout<<"Writing slides to "<<image_basename<<"_[slidenumber]"<<image_ext<<std::endl;
osg::ref_ptr<SnapImageDrawCallback> sidc = new SnapImageDrawCallback;
@ -169,7 +169,7 @@ bool ExportHTML::write(osgPresentation::SlideEventHandler* seh, osgViewer::Viewe
}
fout<<"</tr>"<<std::endl;
fout<<"</table>"<<std::endl;
fout<<"<img src=\""<<osgDB::getSimpleFileName(os.str())<<"\">"<<std::endl;
fout<<"<img src=\""<<osgDB::getSimpleFileName(os.str())<<"\">"<<std::endl;
fout<<"</html>"<<std::endl;
}
else

View File

@ -13,7 +13,7 @@
#ifndef EXPORTHTML_H
#define EXPORTHTML_H 1
#include <osgPresentation/deprecated/SlideEventHandler>
#include <osgPresentation/SlideEventHandler>
#include <osgViewer/Viewer>
class ExportHTML

View File

@ -13,7 +13,7 @@
#include "ReadShowFile.h"
#include "ShowEventHandler.h"
#include <osgPresentation/deprecated/SlideEventHandler>
#include <osgPresentation/SlideEventHandler>
#include <osg/ImageStream>
#include <osg/Shape>

View File

@ -38,7 +38,7 @@
#include <osgGA/StateSetManipulator>
#include <osgGA/MultiTouchTrackballManipulator>
#include <osgPresentation/deprecated/SlideEventHandler>
#include <osgPresentation/SlideEventHandler>
#include <osgPresentation/Cursor>
#include "ReadShowFile.h"
@ -149,15 +149,15 @@ public:
if (_forwardMouseEvents)
_device->sendEvent(ea);
break;
default:
_device->sendEvent(ea);
break;
}
return false;
}
bool handle(osgGA::Event* event, osg::Object* object, osg::NodeVisitor* nv)
{
if (event->asGUIEventAdapter())
@ -203,7 +203,7 @@ public:
std::cout << "SCROLL: ";
break;
break;
default:
std::cout << ea.getEventType() << " ";
break;
@ -211,8 +211,8 @@ public:
std::cout << ea.getX() << "/" << ea.getY() << " " << ea.isMultiTouchEvent() << std::endl;
return false;
}
bool handle(osgGA::Event* event, osg::Object* object, osg::NodeVisitor* nv)
{
if (event->asGUIEventAdapter())
@ -414,7 +414,7 @@ int main( int argc, char **argv )
viewer.readConfiguration(configurationFile);
doSetViewer = false;
}
bool forwardMouseEvents = false;
if (arguments.read("--forwardMouseEvents"))
forwardMouseEvents = true;
@ -498,7 +498,7 @@ int main( int argc, char **argv )
viewer.setCameraManipulator( keyswitchManipulator.get() );
}
//viewer.getEventHandlers().push_front(new DumpEventHandler());
// add the state manipulator
@ -752,7 +752,7 @@ int main( int argc, char **argv )
osg::ref_ptr<osgDB::ReaderWriter::Options> cacheAllOption = new osgDB::ReaderWriter::Options;
if(suppress_env_tags)
cacheAllOption->setPluginStringData("suppressEnvTags", "true");
cacheAllOption->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_ALL);
osgDB::Registry::instance()->setOptions(cacheAllOption.get());

View File

@ -18,7 +18,7 @@
#include <osgGA/GUIEventHandler>
#include <osgPresentation/deprecated/SlideEventHandler>
#include <osgPresentation/SlideEventHandler>
namespace osgPresentation
{

View File

@ -18,7 +18,7 @@
#include <osgGA/GUIEventHandler>
#include <osgPresentation/deprecated/SlideEventHandler>
#include <osgPresentation/SlideEventHandler>
namespace osgPresentation
{

View File

@ -21,8 +21,8 @@
#include <osgGA/GUIEventHandler>
#include <osgViewer/Viewer>
#include <osgPresentation/deprecated/CompileSlideCallback>
#include <osgPresentation/deprecated/PropertyManager>
#include <osgPresentation/CompileSlideCallback>
#include <osgPresentation/PropertyManager>
namespace osgPresentation
{

View File

@ -32,10 +32,10 @@
#include <osgVolume/VolumeTile>
#include <osgVolume/VolumeSettings>
#include <osgPresentation/deprecated/AnimationMaterial>
#include <osgPresentation/deprecated/SlideEventHandler>
#include <osgPresentation/deprecated/PropertyManager>
#include <osgPresentation/deprecated/Timeout>
#include <osgPresentation/AnimationMaterial>
#include <osgPresentation/SlideEventHandler>
#include <osgPresentation/PropertyManager>
#include <osgPresentation/Timeout>
namespace osgPresentation
{

View File

@ -16,7 +16,7 @@
#include <osg/Transform>
#include <osgPresentation/deprecated/SlideEventHandler>
#include <osgPresentation/SlideEventHandler>
namespace osgPresentation {

View File

@ -17,7 +17,7 @@
#include <osg/ValueObject>
#include <osgDB/FileUtils>
#include <osgDB/FileNameUtils>
#include <osgPresentation/deprecated/PropertyManager>
#include <osgPresentation/PropertyManager>
#include "osc/OscPrintReceivedElements.h"
#include "osc/OscHostEndianness.h"
@ -720,9 +720,9 @@ public:
osg::Vec2f pos, vel;
float accel;
osgGA::GUIEventAdapter::TouchPhase phase;
Cursor() : end_point(), id(0), frameId(0), pos(), vel(), accel(), phase(osgGA::GUIEventAdapter::TOUCH_UNKNOWN) {}
};
struct EndpointData {
std::string source;
@ -730,7 +730,7 @@ public:
bool mayClearUnhandledPointer;
std::set<unsigned int> unhandled;
};
typedef std::map<std::string, EndpointData> EndpointDataMap;
typedef std::map<unsigned int, Cursor> CursorMap;
typedef std::map<std::string, CursorMap> ApplicationCursorMap;
@ -739,38 +739,38 @@ public:
: OscReceivingDevice::RequestHandler("/tuio/2Dcur")
{
}
virtual void setDevice(OscReceivingDevice* device) {
OscReceivingDevice::RequestHandler::setDevice(device);
device->addHandleOnCheckEvents(this);
}
virtual bool operator()(const std::string& request_path, const std::string& full_request_path, const osc::ReceivedMessage& m, const IpEndpointName& remoteEndPoint)
{
// std::cout << m << std::endl;
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
std::string end_point(' ', IpEndpointName::ADDRESS_AND_PORT_STRING_LENGTH);
remoteEndPoint.AddressAndPortAsString(&end_point[0]);
osc::ReceivedMessageArgumentStream args = m.ArgumentStream();
const char* str;
args >> str;
std::string what(str);
if (what == "source")
{
args >> str;
_endpointData[end_point].source = std::string(str);
updateSourceIdMap(_endpointData[end_point].source);
_endpointData[end_point].unhandled.clear();
_endpointData[end_point].mayClearUnhandledPointer = true;
return true;
}
else if (what == "fseq")
@ -782,7 +782,7 @@ public:
{
std::string source = _endpointData[end_point].source;
unsigned int frame_id = _endpointData[end_point].frameId;
if (what == "alive")
{
while (!args.Eos())
@ -801,33 +801,33 @@ public:
{
_alive[source][id] = Cursor();
}
Cursor& c(_alive[source][id]);
args >> c.pos.x() >> c.pos.y() >> c.vel.x() >> c.vel.y() >> c.accel >> osc::EndMessage;
c.frameId = frame_id;
c.end_point = end_point;
_endpointData[end_point].unhandled.insert(id);
return true;
}
}
return false;
}
virtual void operator()(osgGA::EventQueue* queue)
{
// dispatch all touchpoints in one GUIEventAdapter
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
osg::ref_ptr<osgGA::GUIEventAdapter> event = NULL;
for(ApplicationCursorMap::iterator i = _alive.begin(); i != _alive.end(); ++i)
{
const std::string& source(i->first);
/*
std::cout << source << ": ";
for(std::set<unsigned int>::iterator k = _endpointData[source].unhandled.begin();
@ -838,13 +838,13 @@ public:
}
std::cout << std::endl;
*/
// remove all touchpoints which are not transmitted via alive-message, dispatching TOUCH_ENDED
unsigned int source_id = getSourceId(source);
std::vector<unsigned int> to_delete;
for(CursorMap::iterator k = i->second.begin(); k != i->second.end(); ++k)
{
EndpointData& endpoint_data(_endpointData[k->second.end_point]);
@ -852,19 +852,19 @@ public:
{
continue;
}*/
//create a unique touchpoint-id
unsigned int touch_id = (source_id << 16) + k->first;
std::set<unsigned int>& unhandled(endpoint_data.unhandled);
if ((unhandled.find(k->first) == unhandled.end()))
{
// std::cout << "deleting: " << k->first << " from " << k->second.end_point << std::endl;
to_delete.push_back(k->first);
float win_x = k->second.pos.x();
float win_y = k->second.pos.y();
if (!event)
event = queue->touchEnded(touch_id, osgGA::GUIEventAdapter::TOUCH_ENDED, win_x, win_y, 1);
else
@ -876,30 +876,30 @@ public:
{
_alive[source].erase(i->second.find(*k));
}
if (i->second.size() == 0)
{
// std::cout << "removing endpoint" << source << std::endl;
// _alive.erase(_alive.find(source));
}
}
// send all alive touchpoints
for(ApplicationCursorMap::iterator i = _alive.begin(); i != _alive.end(); ++i)
{
const std::string& source(i->first);
unsigned int source_id = getSourceId(source);
for(CursorMap::iterator k = i->second.begin(); k != i->second.end(); ++k)
{
unsigned int id = k->first;
unsigned int touch_id = (source_id << 16) + id;
Cursor& c(k->second);
float win_x = c.pos.x();
float win_y = c.pos.y();
bool down = c.phase != osgGA::GUIEventAdapter::TOUCH_MOVED && c.phase != osgGA::GUIEventAdapter::TOUCH_STATIONERY;
if(!event)
{
@ -912,11 +912,11 @@ public:
{
event->addTouchPoint(touch_id, down ? osgGA::GUIEventAdapter::TOUCH_BEGAN : osgGA::GUIEventAdapter::TOUCH_MOVED, win_x, win_y);
}
c.phase = osgGA::GUIEventAdapter::TOUCH_MOVED;
}
}
// adjust time + input range
if (event)
{
@ -925,19 +925,19 @@ public:
event->setMouseYOrientation(osgGA::GUIEventAdapter::Y_INCREASING_DOWNWARDS);
}
}
inline void updateSourceIdMap(const std::string& source)
{
if (_sourceIdMap.find(source) == _sourceIdMap.end())
_sourceIdMap[source] = _sourceIdMap.size();
}
inline unsigned int getSourceId(const std::string& source)
{
return _sourceIdMap[source];
}
private:
EndpointDataMap _endpointData;
ApplicationCursorMap _alive;
@ -993,15 +993,15 @@ OscReceivingDevice::OscReceivingDevice(const std::string& server_address, int li
addRequestHandler(new OscDevice::PenOrientationRequestHandler());
addRequestHandler(new OscDevice::PenProximityRequestHandler(true));
addRequestHandler(new OscDevice::PenProximityRequestHandler(false));
addRequestHandler(new OscDevice::TUIO2DCursorRequestHandler());
addRequestHandler(new OscDevice::StandardRequestHandler("/osg/set_user_value", true));
addRequestHandler(new OscDevice::StandardRequestHandler("", false));
// getEventQueue()->setFirstTouchEmulatesMouse(false);
setSchedulePriority(OpenThreads::Thread::THREAD_PRIORITY_LOW);
start();
}

View File

@ -52,7 +52,7 @@
#include <osgDB/FileUtils>
#include "OscSendingDevice.hpp"
#include "OscReceivingDevice.hpp"
#include <osgPresentation/deprecated/PropertyManager>
#include <osgPresentation/PropertyManager>

View File

@ -22,7 +22,7 @@
#include <osgWidget/PdfReader>
#include <osgPresentation/deprecated/SlideShowConstructor>
#include <osgPresentation/SlideShowConstructor>
#include <stdio.h>
#include <string.h>

View File

@ -20,8 +20,8 @@
#include <osgWidget/PdfReader>
#include <osgPresentation/deprecated/SlideShowConstructor>
#include <osgPresentation/deprecated/AnimationMaterial>
#include <osgPresentation/SlideShowConstructor>
#include <osgPresentation/AnimationMaterial>
#include <stdio.h>
#include <string.h>

View File

@ -10,7 +10,7 @@
* include LICENSE.txt for more details.
*/
#include <osgPresentation/deprecated/AnimationMaterial>
#include <osgPresentation/AnimationMaterial>
#include <osg/MatrixTransform>
#include <osg/PositionAttitudeTransform>

View File

@ -10,30 +10,27 @@ SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})
SET(TARGET_H
${HEADER_PATH}/Export
${HEADER_PATH}/Cursor
${HEADER_PATH}/deprecated/AnimationMaterial
${HEADER_PATH}/deprecated/CompileSlideCallback
${HEADER_PATH}/deprecated/PickEventHandler
${HEADER_PATH}/deprecated/PropertyManager
${HEADER_PATH}/deprecated/KeyEventHandler
${HEADER_PATH}/deprecated/SlideEventHandler
${HEADER_PATH}/deprecated/SlideShowConstructor
${HEADER_PATH}/deprecated/Timeout
${HEADER_PATH}/AnimationMaterial
${HEADER_PATH}/CompileSlideCallback
${HEADER_PATH}/PickEventHandler
${HEADER_PATH}/PropertyManager
${HEADER_PATH}/KeyEventHandler
${HEADER_PATH}/SlideEventHandler
${HEADER_PATH}/SlideShowConstructor
${HEADER_PATH}/Timeout
)
# FIXME: For OS X, need flag for Framework or dylib
SET(TARGET_SRC
Cursor.cpp
deprecated/AnimationMaterial.cpp
deprecated/CompileSlideCallback.cpp
deprecated/PickEventHandler.cpp
deprecated/PropertyManager.cpp
deprecated/KeyEventHandler.cpp
deprecated/SlideEventHandler.cpp
deprecated/SlideShowConstructor.cpp
deprecated/Timeout.cpp
AnimationMaterial.cpp
CompileSlideCallback.cpp
PickEventHandler.cpp
PropertyManager.cpp
KeyEventHandler.cpp
SlideEventHandler.cpp
SlideShowConstructor.cpp
Timeout.cpp
${OPENSCENEGRAPH_VERSIONINFO_RC}
)

View File

@ -10,7 +10,7 @@
* include LICENSE.txt for more details.
*/
#include <osgPresentation/deprecated/CompileSlideCallback>
#include <osgPresentation/CompileSlideCallback>
#include <osgUtil/GLObjectsVisitor>

View File

@ -10,8 +10,8 @@
* include LICENSE.txt for more details.
*/
#include <osgPresentation/deprecated/KeyEventHandler>
#include <osgPresentation/deprecated/SlideEventHandler>
#include <osgPresentation/KeyEventHandler>
#include <osgPresentation/SlideEventHandler>
#include <osgViewer/Viewer>
#include <osg/Notify>

View File

@ -10,8 +10,8 @@
* include LICENSE.txt for more details.
*/
#include <osgPresentation/deprecated/PickEventHandler>
#include <osgPresentation/deprecated/SlideEventHandler>
#include <osgPresentation/PickEventHandler>
#include <osgPresentation/SlideEventHandler>
#include <osgViewer/Viewer>
#include <osg/Notify>

View File

@ -10,7 +10,7 @@
* include LICENSE.txt for more details.
*/
#include <osgPresentation/deprecated/PropertyManager>
#include <osgPresentation/PropertyManager>
#include <osg/io_utils>
using namespace osgPresentation;

View File

@ -10,9 +10,9 @@
* include LICENSE.txt for more details.
*/
#include <osgPresentation/deprecated/SlideEventHandler>
#include <osgPresentation/deprecated/SlideShowConstructor>
#include <osgPresentation/deprecated/AnimationMaterial>
#include <osgPresentation/SlideEventHandler>
#include <osgPresentation/SlideShowConstructor>
#include <osgPresentation/AnimationMaterial>
#include <osg/AnimationPath>
#include <osg/Transform>

View File

@ -10,10 +10,10 @@
* include LICENSE.txt for more details.
*/
#include <osgPresentation/deprecated/SlideShowConstructor>
#include <osgPresentation/deprecated/AnimationMaterial>
#include <osgPresentation/deprecated/PickEventHandler>
#include <osgPresentation/deprecated/KeyEventHandler>
#include <osgPresentation/SlideShowConstructor>
#include <osgPresentation/AnimationMaterial>
#include <osgPresentation/PickEventHandler>
#include <osgPresentation/KeyEventHandler>
#include <osg/Geometry>

View File

@ -11,7 +11,7 @@
* OpenSceneGraph Public License for more details.
*/
#include <osgPresentation/deprecated/Timeout>
#include <osgPresentation/Timeout>
#include <osgUtil/CullVisitor>
#include <osgGA/EventVisitor>