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

@@ -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>