MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
vec3drv.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/base/vec3drv.h,v 1.17 2017/01/12 14:46:11 masarati Exp $ */
2 /*
3  * MBDyn (C) is a multibody analysis code.
4  * http://www.mbdyn.org
5  *
6  * Copyright (C) 1996-2017
7  *
8  * Pierangelo Masarati <masarati@aero.polimi.it>
9  * Paolo Mantegazza <mantegazza@aero.polimi.it>
10  *
11  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
12  * via La Masa, 34 - 20156 Milano, Italy
13  * http://www.aero.polimi.it
14  *
15  * Changing this copyright notice is forbidden.
16  *
17  * This program is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation (version 2 of the License).
20  *
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with this program; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */
31 
32 /* Drive con Vec3 */
33 
34 #ifndef VEC3DRV_H
35 #define VEC3DRV_H
36 
37 #include "drive.h"
38 #include "matvec3.h"
39 
40 class Vec3DriveOwner : public DriveOwner {
41  protected:
42  const Vec3 Dir;
43 
44  public:
45  Vec3DriveOwner(const DriveCaller* pDC = NULL, const Vec3& V = Vec3())
46  : DriveOwner(pDC), Dir(V) {
47  NO_OP;
48  };
49 
50  virtual ~Vec3DriveOwner(void) {
51  NO_OP;
52  };
53 
54  virtual ostream& Restart(ostream& out) const {
55  out << "reference, local, eye, ", Dir.Write(out, ", ") << ", ";
56  return pGetDriveCaller()->Restart(out);
57  };
58 
59  virtual Vec3 GetVec(void) const {
60  return Dir*dGet();
61  };
62 
63  virtual Vec3 GetDir(void) const {
64  return Dir;
65  };
66 };
67 
68 #endif
virtual ~Vec3DriveOwner(void)
Definition: vec3drv.h:50
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
Definition: matvec3.cc:738
Definition: matvec3.h:98
doublereal dGet(void) const
Definition: drive.cc:671
virtual Vec3 GetDir(void) const
Definition: vec3drv.h:63
virtual ostream & Restart(ostream &out) const
Definition: vec3drv.h:54
#define NO_OP
Definition: myassert.h:74
virtual std::ostream & Restart(std::ostream &out) const =0
Vec3DriveOwner(const DriveCaller *pDC=NULL, const Vec3 &V=Vec3())
Definition: vec3drv.h:45
DriveCaller * pGetDriveCaller(void) const
Definition: drive.cc:658
virtual Vec3 GetVec(void) const
Definition: vec3drv.h:59
const Vec3 Dir
Definition: vec3drv.h:42