Skip to content

Commit

Permalink
Merge branch 'master' into international-society-biomechanics
Browse files Browse the repository at this point in the history
  • Loading branch information
Alzathar committed Jan 9, 2017
2 parents dec184a + 0760796 commit 45fdf5d
Show file tree
Hide file tree
Showing 9 changed files with 769 additions and 4 deletions.
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ dependencies:
## Customize test commands
test:
override:
- make test
- ctest -VV
6 changes: 3 additions & 3 deletions modules/instrument/include/openma/instrument.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef __openma_body_h
#define __openma_body_h
#ifndef __openma_instrument_h
#define __openma_instrument_h

#include "openma/instrument/enums.h"
#include "openma/instrument/forceplate.h"
Expand All @@ -42,4 +42,4 @@
#include "openma/instrument/forceplatetype4.h"
#include "openma/instrument/forceplatetype5.h"

#endif // __openma_body_h
#endif // __openma_instrument_h
8 changes: 8 additions & 0 deletions modules/io/plugins/trialformats/bsf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SET(OPENMA_IO_BSFPLUGIN_SRCS
plugins/trialformats/bsf/bsfhandler.cpp
plugins/trialformats/bsf/bsfplugin.cpp
)

SET(OPENMA_IO_PLUGIN_NAME "BSFPlugin" CACHE INTERNAL "")
SET(OPENMA_IO_PLUGIN_SRCS ${OPENMA_IO_BSFPLUGIN_SRCS} CACHE INTERNAL "")

385 changes: 385 additions & 0 deletions modules/io/plugins/trialformats/bsf/bsfhandler.cpp

Large diffs are not rendered by default.

67 changes: 67 additions & 0 deletions modules/io/plugins/trialformats/bsf/bsfhandler.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Open Source Movement Analysis Library
* Copyright (C) 2016, Moveck Solution Inc., all rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials
* provided with the distribution.
* * Neither the name(s) of the copyright holders nor the names
* of its contributors may be used to endorse or promote products
* derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef __openma_io_bsfandler_h
#define __openma_io_bsfandler_h

#include "openma/io/handler.h"
#include "openma/base/macros.h" // _OPENMA_CONSTEXPR, _OPENMA_NOEXCEPT

namespace ma
{
namespace io
{
class BSFHandlerPrivate;

class BSFHandler : public Handler
{
public:
BSFHandler();
~BSFHandler() _OPENMA_NOEXCEPT;

BSFHandler(const BSFHandler& ) = delete;
BSFHandler(BSFHandler&& ) _OPENMA_NOEXCEPT = delete;
BSFHandler& operator=(const BSFHandler& ) = delete;
BSFHandler& operator=(const BSFHandler&& ) _OPENMA_NOEXCEPT = delete;

static Signature verifySignature(const Device* const device) _OPENMA_NOEXCEPT;

protected:
virtual Signature verifySignature() const _OPENMA_NOEXCEPT final;
virtual void readDevice(ma::Node* output) final;
};
};
};

#endif // __openma_io_bsfandler_h
80 changes: 80 additions & 0 deletions modules/io/plugins/trialformats/bsf/bsfplugin.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* Open Source Movement Analysis Library
* Copyright (C) 2016, Moveck Solution Inc., all rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials
* provided with the distribution.
* * Neither the name(s) of the copyright holders nor the names
* of its contributors may be used to endorse or promote products
* derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#include "bsfplugin.h"
#include "openma/io/enums.h"

#define _OPENMA_IO_HANDLER_AMTI_BSF_FORMAT "amti.bsf"

namespace ma
{
namespace io
{
std::string BSFPlugin::name() const _OPENMA_NOEXCEPT
{
return "BSFPlugin";
}

std::vector<std::string> BSFPlugin::supportedFormats() const _OPENMA_NOEXCEPT
{
return {_OPENMA_IO_HANDLER_AMTI_BSF_FORMAT};
};

Capability BSFPlugin::capabilities(const std::string& format) const _OPENMA_NOEXCEPT
{
if (format.compare(_OPENMA_IO_HANDLER_AMTI_BSF_FORMAT) != 0)
return Capability::None;
return Capability::CanRead;
};

Signature BSFPlugin::detectSignature(const Device* const device, std::string* format) const _OPENMA_NOEXCEPT
{
Signature detected = Signature::Invalid;
if ((detected = BSFHandler::verifySignature(device)) == Signature::Valid)
{
if (format != nullptr)
*format = _OPENMA_IO_HANDLER_AMTI_BSF_FORMAT;
}
return detected;
};

Handler* BSFPlugin::create(Device* device, const std::string& format)
{
OPENMA_UNUSED(format)
Handler* handler = new BSFHandler;
handler->setDevice(device);
return handler;
};
};
};
62 changes: 62 additions & 0 deletions modules/io/plugins/trialformats/bsf/bsfplugin.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Open Source Movement Analysis Library
* Copyright (C) 2016, Moveck Solution Inc., all rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials
* provided with the distribution.
* * Neither the name(s) of the copyright holders nor the names
* of its contributors may be used to endorse or promote products
* derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef __openma_io_bsfplugin_h
#define __openma_io_bsfplugin_h

#include "bsfhandler.h"
#include "openma/io/handlerplugin.h"

namespace ma
{
namespace io
{
class BSFPlugin : public HandlerPlugin
{
public:
BSFPlugin() : HandlerPlugin() {};

virtual std::string name() const _OPENMA_NOEXCEPT final;

virtual std::vector<std::string> supportedFormats() const _OPENMA_NOEXCEPT final;

virtual Capability capabilities(const std::string& format) const _OPENMA_NOEXCEPT final;
virtual Signature detectSignature(const Device* const device, std::string* format = nullptr) const _OPENMA_NOEXCEPT final;

virtual Handler* create(Device* device, const std::string& format) final;
};
};
};

#endif // __openma_io_bsfplugin_h
1 change: 1 addition & 0 deletions modules/io/test/c++/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ ADD_CXXTEST_TESTDRIVER(openma_io_binarystream binarystreamTest.cpp io)
ADD_CXXTEST_TESTDRIVER(openma_io_buffer bufferTest.cpp io)
ADD_CXXTEST_TESTDRIVER(openma_io_file fileTest.cpp io)
ADD_CXXTEST_TESTDRIVER(openma_io_handlerplugin handlerpluginTest.cpp io)
ADD_CXXTEST_TESTDRIVER(openma_io_handlerplugin_reader_bsf trial/bsfreaderTest.cpp io)
ADD_CXXTEST_TESTDRIVER(openma_io_handlerplugin_reader_c3d trial/c3dreaderTest.cpp io)
ADD_CXXTEST_TESTDRIVER(openma_io_handlerplugin_writer_c3d trial/c3dwriterTest.cpp io)

0 comments on commit 45fdf5d

Please sign in to comment.