20#ifndef _MAXWELL_CONTACT_OBSERVER_H__
21#define _MAXWELL_CONTACT_OBSERVER_H__
23#include "mbsim/observers/single_contact_observer.h"
25#include <mbsim/utils/boost_parameters.h>
26#include <mbsim/utils/openmbv_utils.h>
34 std::vector<std::vector<SingleContactObserver>> contactObserver;
37 std::string saved_link;
44 std::shared_ptr<OpenMBVInteractionArrow> ombvForce, ombvMoment, ombvContact;
45 std::shared_ptr<OpenMBVFrictionArrow> ombvFriction;
50 void setOutputFrame(
Frame *outputFrame_) { outputFrame = outputFrame_; }
52 void init(
InitStage stage,
const InitConfigSet &config)
override;
54 void initializeUsingXML(xercesc::DOMElement *element)
override;
57 std::shared_ptr<OpenMBV::Group> getObserversOpenMBVGrp()
override {
return getOpenMBVGrp(); }
60 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVForce, tag, (optional (sideOfInteraction,(OpenMBVInteractionArrow::SideOfInteraction),OpenMBVInteractionArrow::action)(scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::toPoint)(colorRepresentation,(OpenMBVArrow::ColorRepresentation),OpenMBVArrow::none)(minimalColorValue,(
double),0)(maximalColorValue,(
double),1)(diffuseColor,(
const fmatvec::Vec3&),fmatvec::Vec3(std::vector<double>{-1,1,1}))(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
61 ombvForce = std::shared_ptr<OpenMBVInteractionArrow>(
new OpenMBVInteractionArrow(sideOfInteraction,scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
64 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVMoment, tag, (optional (sideOfInteraction,(OpenMBVInteractionArrow::SideOfInteraction),OpenMBVInteractionArrow::action)(scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::toPoint)(colorRepresentation,(OpenMBVInteractionArrow::ColorRepresentation),OpenMBVArrow::none)(minimalColorValue,(
double),0)(maximalColorValue,(
double),1)(diffuseColor,(
const fmatvec::Vec3&),fmatvec::Vec3(std::vector<double>{-1,1,1}))(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
65 ombvMoment = std::shared_ptr<OpenMBVInteractionArrow>(
new OpenMBVInteractionArrow(sideOfInteraction,scaleLength,scaleSize,OpenMBVArrow::toDoubleHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
74 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVContactPoints, tag, (optional (size,(
double),1)(offset,(
double),1)(
path,(
bool),
false)(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
75 OpenMBVFrame ombv(size,offset,
path,fmatvec::Vec3(std::vector<double>{-1,1,1}),transparency,pointSize,lineWidth);
84 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVNormalForce, tag, (optional (sideOfInteraction,(OpenMBVInteractionArrow::SideOfInteraction),OpenMBVInteractionArrow::action)(scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::toPoint)(colorRepresentation,(OpenMBVArrow::ColorRepresentation),OpenMBVArrow::none)(minimalColorValue,(
double),0)(maximalColorValue,(
double),1)(diffuseColor,(
const fmatvec::Vec3&),fmatvec::Vec3(std::vector<double>{-1,1,1}))(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
85 ombvContact = std::shared_ptr<OpenMBVInteractionArrow>(
new OpenMBVInteractionArrow(sideOfInteraction,scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
95 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVTangentialForce, tag, (optional (sideOfInteraction,(OpenMBVInteractionArrow::SideOfInteraction),OpenMBVInteractionArrow::action)(scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBVArrow::ReferencePoint),OpenMBVArrow::toPoint)(colorRepresentation,(OpenMBVFrictionArrow::ColorRepresentation),OpenMBVFrictionArrow::none)(minimalColorValue,(
double),0)(maximalColorValue,(
double),1)(diffuseColor,(
const fmatvec::Vec3&),fmatvec::Vec3(std::vector<double>{-1,1,1}))(transparency,(
double),0)(pointSize,(
double),0)(lineWidth,(
double),0))) {
96 ombvFriction = std::shared_ptr<OpenMBVFrictionArrow>(
new OpenMBVFrictionArrow(sideOfInteraction,scaleLength,scaleSize,OpenMBVArrow::toHead,referencePoint,colorRepresentation,minimalColorValue,maximalColorValue,diffuseColor,transparency,pointSize,lineWidth));
99 Frame *outputFrame {
nullptr };
100 std::string saved_outputFrame;
InitStage
The stages of the initialization.
Definition: element.h:62
H5::GroupBase * getPlotGroup()
Definition: element.h:139
std::string path
The path of this object. Is set during the init stage reorganizeHierarchy. Before this the path is ca...
Definition: element.h:267
std::string name
name of element
Definition: element.h:260
cartesian frame on bodies used for application of e.g. links and loads
Definition: frame.h:39
Definition: observer.h:26
Definition: openmbv_utils.h:150
Definition: openmbv_utils.h:128
Definition: openmbv_utils.h:111
namespace MBSim
Definition: bilateral_constraint.cc:30