1 //#***************************************************************************************
2 //# filename:     elementdataaccess.h
3 //#
4 //# author:				Yury Vetyukov, Johannes Gerstmayr
5 //#
6 //# generated:
7 //# description:
8 //#
9 //# comments:
10 //#
11 //# Copyright (c) 2003-2013 Johannes Gerstmayr, Linz Center of Mechatronics GmbH, Austrian
12 //# Center of Competence in Mechatronics GmbH, Institute of Technical Mechanics at the
13 //# Johannes Kepler Universitaet Linz, Austria. All rights reserved.
14 //#
15 //# This file is part of HotInt.
16 //# HotInt is free software: you can redistribute it and/or modify it under the terms of
17 //# the HOTINT license. See folder 'licenses' for more details.
18 //#
19 //# bug reports are welcome!!!
20 //# WWW:		www.hotint.org
21 //# email:	bug_reports@hotint.org or support@hotint.org
22 //#***************************************************************************************
23 
24 
25 #pragma once
26 
27 class MathFunction;
28 
29 void SetElemDataVector2D(ElementDataContainer& edc, const Vector2D& v, const char* name, const char* tooltiptext="");
30 void SetElemDataVector3D(ElementDataContainer& edc, const Vector3D& v, const char* name, const char* tooltiptext="");
31 void SetElemDataIVector(ElementDataContainer& edc, const IVector& v, const char* name, const char* tooltiptext="");
32 void SetElemDataVector(ElementDataContainer& edc, const Vector& v, const char* name, const char* tooltiptext="");
33 void SetElemDataMatrix(ElementDataContainer& edc, const Matrix& v, const char* name, const char* tooltiptext="");
34 void SetElemDataMathFunc(ElementDataContainer& edc, MathFunction& mathfunc, const mystr& funcname);
35 
36 //JG2012-01: added new access functions based on ed, not edc:
37 void SetElemDataVector2D(ElementData& ed, const Vector2D& v, const char* name);
38 void SetElemDataVector3D(ElementData& ed, const Vector3D& v, const char* name);
39 void SetElemDataIVector(ElementData& ed, const IVector& v, const char* name);
40 void SetElemDataVector(ElementData& ed, const Vector& v, const char* name);
41 void SetElemDataMatrix(ElementData& ed, const Matrix& v, const char* name);
42 
43 //improved access functions for elementdata
44 //flag&1 --> needed value
45 int GetElemDataBool(MBS* mbs, const ElementDataContainer& edc, const char* name, int& v, int flag = 1);
46 int GetElemDataInt(MBS* mbs, const ElementDataContainer& edc, const char* name, int& v, int flag = 1);
47 int GetElemDataDouble(MBS* mbs, const ElementDataContainer& edc, const char* name, double& v, int flag = 1);
48 int GetElemDataText(MBS* mbs, const ElementDataContainer& edc, const char* name, mystr& str, int flag = 1);
49 int GetElemDataVector2D(MBS* mbs, const ElementDataContainer& edc, const char* name, Vector2D& v, int flag = 1);
50 int GetElemDataVector3D(MBS* mbs, const ElementDataContainer& edc, const char* name, Vector3D& v, int flag = 1);
51 int GetElemDataVector2D(MBS* mbs, const ElementDataContainer& edc, const char* name, double& v1, double& v2, int flag = 1);
52 int GetElemDataVector3D(MBS* mbs, const ElementDataContainer& edc, const char* name, double& v1, double& v2, double& v3, int flag = 1);
53 int GetElemDataVector(MBS* mbs, const ElementDataContainer& edc, const char* name, Vector& v, int flag = 1);
54 int GetElemDataIVector(MBS* mbs, const ElementDataContainer& edc, const char* name, IVector& v, int flag = 1);
55 int GetElemDataMatrix(MBS* mbs, const ElementDataContainer& edc, const char* name, Matrix& v, int flag = 1);
56 int GetElemDataMathFunc(MBS* mbs, const ElementDataContainer& edc, const mystr& funcname, MathFunction& mathfunc, int flag = 1);
57 
58 //find element, assume that it is Vector3D; if not exists use default value
59 Vector3D EDCTreeGetVector3D(ElementDataContainer& edc, const char* name, Vector3D default_val = Vector3D(0.));
60 //find element, assume that it is Vector; if not exists use default value
61 Vector EDCTreeGetVector(ElementDataContainer& edc, const char* name, Vector default_val = Vector(1));
62 
63 mystr GetRotUnitStr(int type); //0=rad, 1=degree