diff --git a/VistaCoreLibs/VistaDeviceDrivers/VistaLeapMotionDriver/VistaLeapMotionCommonShare.h b/VistaCoreLibs/VistaDeviceDrivers/VistaLeapMotionDriver/VistaLeapMotionCommonShare.h index 5701514c6302985bea0130c49bb2b04bf8516f1f..b7f944a29e47ee30e7eaec6982603c96f238c1bc 100644 --- a/VistaCoreLibs/VistaDeviceDrivers/VistaLeapMotionDriver/VistaLeapMotionCommonShare.h +++ b/VistaCoreLibs/VistaDeviceDrivers/VistaLeapMotionDriver/VistaLeapMotionCommonShare.h @@ -176,12 +176,9 @@ namespace VistaLeapMotionMeasures m_ray_scale_x, m_ray_scale_y; + // @TODO: serialization VistaAutoBuffer m_data; }; - - struct ControllerStats - { - }; } diff --git a/VistaCoreLibs/VistaDeviceDrivers/VistaLeapMotionDriver/VistaLeapMotionDriver.cpp b/VistaCoreLibs/VistaDeviceDrivers/VistaLeapMotionDriver/VistaLeapMotionDriver.cpp index 21d9f7c02527d7b27f94c51220e6135792719dd3..6ecded9d6ad72cd09b56778f599aff47eff872d5 100644 --- a/VistaCoreLibs/VistaDeviceDrivers/VistaLeapMotionDriver/VistaLeapMotionDriver.cpp +++ b/VistaCoreLibs/VistaDeviceDrivers/VistaLeapMotionDriver/VistaLeapMotionDriver.cpp @@ -343,9 +343,9 @@ VistaLeapMotionCreationMethod::VistaLeapMotionCreationMethod( IVistaTranscoderFa { RegisterSensorType( "HAND", sizeof( VistaLeapMotionMeasures::HandMeasure ), 120, pMetaFac->CreateFactoryForType( "HAND" ) ); - RegisterSensorType( "FINGERS", sizeof( VistaLeapMotionMeasures::HandMeasure ), + RegisterSensorType( "FINGERS", sizeof( VistaLeapMotionMeasures::FingersMeasure ), 120, pMetaFac->CreateFactoryForType( "FINGERS" ) ); - RegisterSensorType( "TOOLS", sizeof( VistaLeapMotionMeasures::HandMeasure ), + RegisterSensorType( "TOOLS", sizeof( VistaLeapMotionMeasures::ToolsMeasure ), 120, pMetaFac->CreateFactoryForType( "TOOLS" ) ); RegisterSensorType( "KEYTAP", sizeof( VistaLeapMotionMeasures::GestureMeasure ), 120, pMetaFac->CreateFactoryForType( "GESTURE" ) ); @@ -357,6 +357,8 @@ VistaLeapMotionCreationMethod::VistaLeapMotionCreationMethod( IVistaTranscoderFa 120, pMetaFac->CreateFactoryForType( "GESTURE" ) ); RegisterSensorType( "GESTURE", sizeof( VistaLeapMotionMeasures::GestureMeasure ), 120, pMetaFac->CreateFactoryForType( "GESTURE" ) ); + RegisterSensorType( "IMAGE", sizeof( VistaLeapMotionMeasures::ImageMeasure ), + 120, pMetaFac->CreateFactoryForType( "IMAGE" ) ); } IVistaDeviceDriver *VistaLeapMotionCreationMethod::CreateDriver() @@ -536,6 +538,7 @@ VistaLeapMotionDriver::VistaLeapMotionDriver( IVistaDriverCreationMethod* pCreat m_pConfigAspect = new VistaDriverGenericParameterAspect( new TParameterCreate< VistaLeapMotionDriver, VistaLeapMotionDriver::Parameters >(this) ); RegisterAspect( m_pConfigAspect ); + m_pParameters = Vista::assert_cast< Parameters* >( m_pConfigAspect->GetParameterContainer() ); // register sensor type STICK measuring 18 values m_nHandsSensorId = m_pSensors->GetTypeId( "HAND" ); @@ -553,13 +556,10 @@ VistaLeapMotionDriver::VistaLeapMotionDriver( IVistaDriverCreationMethod* pCreat m_nSwipeGestureSensorId = m_pSensors->GetTypeId( "SWIPE" ); assert( m_nSwipeGestureSensorId != ~0u ); m_nCircleGestureSensorId = m_pSensors->GetTypeId( "CIRCLE" ); - assert( m_nCircleGestureSensorId != ~0u ); - + assert( m_nCircleGestureSensorId != ~0u ); m_nImageSensorId = m_pSensors->GetTypeId( "IMAGE" ); assert( m_nImageSensorId != ~0u ); - m_nFrameSensorId = m_pSensors->GetTypeId( "FRAMESTATE" ); - assert( m_nFrameSensorId != ~0u ); RegisterAspect( m_pSensors ); @@ -586,7 +586,7 @@ VistaLeapMotionDriver::~VistaLeapMotionDriver() delete m_pLeapController; delete m_pListener; - delete m_parameters; + delete m_pParameters; } bool VistaLeapMotionDriver::DoSensorUpdate( VistaType::microtime dTs ) @@ -731,12 +731,6 @@ bool VistaLeapMotionDriver::DoSensorUpdate( VistaType::microtime dTs ) } // for each image } // POLICY IMAGES enables - unsigned int nFrameStatsId = m_pSensors->GetSensorId( m_nFrameSensorId, 0 ); - if( nFrameStatsId != VistaDriverSensorMappingAspect::INVALID_ID ) - { - // record frame stats - } - } // valid frame } // while valid_frame @@ -764,7 +758,7 @@ bool VistaLeapMotionDriver::PhysicalEnable( bool bEnable ) if( m_pLeapController == 0 ) return ( bEnable == false ); - VistaMutexLock g( m_connection_guard_mutex ); + VistaMutexLock g( m_oConnectionGuardMutex ); bool bRes = false; if( bEnable ) @@ -859,7 +853,7 @@ bool VistaLeapMotionDriver::DoDisconnect() VistaLeapMotionDriver::Parameters *VistaLeapMotionDriver::GetParameters() const { - return m_parameters; + return m_pParameters; } Leap::Controller *VistaLeapMotionDriver::GetLeapController() const diff --git a/VistaCoreLibs/VistaDeviceDrivers/VistaLeapMotionDriver/VistaLeapMotionDriver.h b/VistaCoreLibs/VistaDeviceDrivers/VistaLeapMotionDriver/VistaLeapMotionDriver.h index 41d333abe3273ea1f65b9f6490f3eb86ff60ec34..8fa4fb92116e4bc88ef29d4c6ffeb583a45106fb 100644 --- a/VistaCoreLibs/VistaDeviceDrivers/VistaLeapMotionDriver/VistaLeapMotionDriver.h +++ b/VistaCoreLibs/VistaDeviceDrivers/VistaLeapMotionDriver/VistaLeapMotionDriver.h @@ -195,16 +195,14 @@ private: unsigned int m_nCircleGestureSensorId; unsigned int m_nScreenTapGestureSensorId; unsigned int m_nKeyTapGestureSensorId; - unsigned int m_nSwipeGestureSensorId; - + unsigned int m_nSwipeGestureSensorId; unsigned int m_nImageSensorId; - unsigned int m_nFrameSensorId; - Parameters *m_parameters; + Parameters* m_pParameters; - VistaMutex m_connection_guard_mutex; + VistaMutex m_oConnectionGuardMutex; }; diff --git a/VistaCoreLibs/VistaDeviceDrivers/VistaLeapMotionDriver/VistaLeapMotionTranscoder.cpp b/VistaCoreLibs/VistaDeviceDrivers/VistaLeapMotionDriver/VistaLeapMotionTranscoder.cpp index 78b53c039d9538af6dadcdb76563ecf6ea432e04..a646d645cb1991de4a14aa45be39e761bb9b0845 100644 --- a/VistaCoreLibs/VistaDeviceDrivers/VistaLeapMotionDriver/VistaLeapMotionTranscoder.cpp +++ b/VistaCoreLibs/VistaDeviceDrivers/VistaLeapMotionDriver/VistaLeapMotionTranscoder.cpp @@ -82,6 +82,17 @@ namespace static std::string GetTypeString() { return "LeapMotionGestureTranscoder"; } }; + class LeapMotionImageTranscoder : public IVistaMeasureTranscode + { + REFL_INLINEIMP( LeapMotionImageTranscoder, IVistaMeasureTranscode ) + public: + LeapMotionImageTranscoder() + { + } + + //@TODO implement getters, how to acces image data? + static std::string GetTypeString() { return "LeapMotionImageTranscoder"; } + }; class LeapMotionHandOrientationGet : public IVistaMeasureTranscode::TTranscodeValueGet< VistaQuaternion > { @@ -675,6 +686,7 @@ namespace m_mapCreators[ "FINGERS" ] = new TCreateTranscoder< LeapMotionFingersTranscoder >(); m_mapCreators[ "TOOLS" ] = new TCreateTranscoder< LeapMotionToolsTranscoder >(); m_mapCreators[ "GESTURE" ] = new TCreateTranscoder< LeapMotionGestureTranscoder >(); + m_mapCreators[ "IMAGE" ] = new TCreateTranscoder< LeapMotionImageTranscoder >(); } static void CleanupCreators( CreatorsMap& m_mapCreators )