All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
generalized_constraint.h
1 /* Copyright (C) 2004-2016 MBSim Development Team
2  * This library is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU Lesser General Public
4  * License as published by the Free Software Foundation; either
5  * version 2.1 of the License, or (at your option) any later version.
6  *
7  * This library is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10  * Lesser General Public License for more details.
11  *
12  * You should have received a copy of the GNU Lesser General Public
13  * License along with this library; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15  *
16  * Contact: martin.o.foerg@googlemail.com
17  */
18 
19 #ifndef _GENERALIZED_CONSTRAINT_H
20 #define _GENERALIZED_CONSTRAINT_H
21 
22 #include "constraint.h"
23 #include "mbsim/utils/boost_parameters.h"
24 #include "mbsim/utils/openmbv_utils.h"
25 
26 namespace MBSim {
27 
33  protected:
34  Frame *support;
35 
36  std::shared_ptr<OpenMBV::Arrow> FArrow, MArrow;
37 
38  public:
39  GeneralizedConstraint(const std::string &name) : Constraint(name), support(NULL) { }
40 
41  void init(InitStage stage);
42 
43  virtual void setSupportFrame(Frame *frame) { support = frame; }
44 
45  void initializeUsingXML(xercesc::DOMElement * element);
46 
48  BOOST_PARAMETER_MEMBER_FUNCTION( (void), enableOpenMBVForce, tag, (optional (scaleLength,(double),1)(scaleSize,(double),1)(referencePoint,(OpenMBV::Arrow::ReferencePoint),OpenMBV::Arrow::toPoint)(diffuseColor,(const fmatvec::Vec3&),"[-1;1;1]")(transparency,(double),0))) {
49  OpenMBVArrow ombv(diffuseColor,transparency,OpenMBV::Arrow::toHead,referencePoint,scaleLength,scaleSize);
50  FArrow=ombv.createOpenMBV();
51  }
52 
54  BOOST_PARAMETER_MEMBER_FUNCTION( (void), enableOpenMBVMoment, tag, (optional (scaleLength,(double),1)(scaleSize,(double),1)(referencePoint,(OpenMBV::Arrow::ReferencePoint),OpenMBV::Arrow::toPoint)(diffuseColor,(const fmatvec::Vec3&),"[-1;1;1]")(transparency,(double),0))) {
55  OpenMBVArrow ombv(diffuseColor,transparency,OpenMBV::Arrow::toDoubleHead,referencePoint,scaleLength,scaleSize);
56  MArrow=ombv.createOpenMBV();
57  }
58 
59  private:
60  std::string saved_DependentBody, saved_supportFrame;
61  };
62 
63 }
64 
65 #endif
Definition: openmbv_utils.h:54
BOOST_PARAMETER_MEMBER_FUNCTION((void), enableOpenMBVMoment, tag,(optional(scaleLength,(double), 1)(scaleSize,(double), 1)(referencePoint,(OpenMBV::Arrow::ReferencePoint), OpenMBV::Arrow::toPoint)(diffuseColor,(const fmatvec::Vec3 &),"[-1;1;1]")(transparency,(double), 0)))
Visualize a moment arrow.
Definition: generalized_constraint.h:54
BOOST_PARAMETER_MEMBER_FUNCTION((void), enableOpenMBVForce, tag,(optional(scaleLength,(double), 1)(scaleSize,(double), 1)(referencePoint,(OpenMBV::Arrow::ReferencePoint), OpenMBV::Arrow::toPoint)(diffuseColor,(const fmatvec::Vec3 &),"[-1;1;1]")(transparency,(double), 0)))
Visualize a force arrow acting on frame2.
Definition: generalized_constraint.h:48
InitStage
The stages of the initialization.
Definition: element.h:97
std::string name
name of element
Definition: element.h:298
void init(InitStage stage)
plots time series header
Definition: generalized_constraint.cc:30
Class for constraints between generalized coordinates of objects.
Definition: constraint.h:30
cartesian frame on bodies used for application of e.g. links and loads
Definition: frame.h:37
Class for generalized constraints.
Definition: generalized_constraint.h:32

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML