mbsimflexiblebody  4.0.0
MBSim Flexible Body Module
external_flexible_ffr_body.h
1/* Copyright (C) 2004-2022 MBSim Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 *
17 * Contact: martin.o.foerg@googlemail.com
18 */
19
20#ifndef _EXTERNAL_FLEXIBLE_FFR_BODY_H_
21#define _EXTERNAL_FLEXIBLE_FFR_BODY_H_
22
23#include "mbsimFlexibleBody/flexible_body/generic_flexible_ffr_body.h"
24#include "mbsim/utils/boost_parameters.h"
25
26namespace MBSim {
27
28 BOOST_PARAMETER_NAME(visualization)
29}
30
31namespace MBSimFlexibleBody {
32
38
39 public:
40 ExternalFlexibleFfrBody(const std::string &name="") : GenericFlexibleFfrBody(name) { }
41
42 void setInputDataFile(const std::string& inputDataFile_) { inputDataFile = inputDataFile_; }
43
44 void init(InitStage stage, const MBSim::InitConfigSet &config) override;
45 void initializeUsingXML(xercesc::DOMElement *element) override;
46
47 BOOST_PARAMETER_MEMBER_FUNCTION( (void), enableOpenMBV, MBSim::tag, (optional (visualization,(OpenMBVExternalFlexibleFfrBody::Visualization),OpenMBVExternalFlexibleFfrBody::points)(colorRepresentation,(OpenMBVFlexibleBody::ColorRepresentation),OpenMBVFlexibleBody::none)(minimalColorValue,(double),0)(maximalColorValue,(double),1)(diffuseColor,(const fmatvec::Vec3&),"[-1;1;1]")(transparency,(double),0)(pointSize,(double),0)(lineWidth,(double),0))) {
48 ombvBody = std::shared_ptr<OpenMBVExternalFlexibleFfrBody>(new OpenMBVExternalFlexibleFfrBody(visualization,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
49 }
50 void setOpenMBVNodeNumbers(const std::vector<int> &visuNodes_) { visuNodes = visuNodes_; }
51 void setPlotNodeNumbers(const std::vector<int> &plotNodes_) { plotNodes = plotNodes_; }
52
53 private:
54 std::string inputDataFile;
55 std::shared_ptr<OpenMBVExternalFlexibleFfrBody> ombvBody;
56 void importData();
57 std::vector<int> ombvIndices;
58 };
59
60}
61
62#endif
Flexible body using a floating frame of reference formulation. The model is created externally and sa...
Definition: external_flexible_ffr_body.h:37
Generic flexible body using a floating frame of reference formulation.
Definition: generic_flexible_ffr_body.h:62
std::string name