]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/models/FGBuoyantForces.h
Merge branch 'next' of http://git.gitorious.org/fg/flightgear into next
[flightgear.git] / src / FDM / JSBSim / models / FGBuoyantForces.h
index 86f5d696f38194ce58bb7dd060b0fcebc1e88c6f..c27566d3788546219e5761dfd28504e51415bc2c 100644 (file)
@@ -4,8 +4,8 @@
  Author:       Anders Gidenstam, Jon S. Berndt
  Date started: 01/21/08
 
- ------------- Copyright (C) 2008  Anders Gidenstam               -------------
- ------------- Copyright (C) 2008  Jon S. Berndt (jsb@hal-pc.org) -------------
+ ------------- Copyright (C) 2008 - 2010  Anders Gidenstam        -------------
+ ------------- Copyright (C) 2008  Jon S. Berndt (jon@jsbsim.org) -------------
 
  This program is free software; you can redistribute it and/or modify it under
  the terms of the GNU Lesser General Public License as published by the Free Software
@@ -39,30 +39,19 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#ifdef FGFS
-#  include <simgear/compiler.h>
-#  ifdef SG_HAVE_STD_INCLUDES
-#    include <vector>
-#    include <map>
-#  else
-#    include <vector.h>
-#    include <map.h>
-#  endif
-#else
-#  include <vector>
-#  include <map>
-#endif
+#include <vector>
+#include <map>
 
 #include "FGModel.h"
 #include "FGGasCell.h"
-#include <math/FGColumnVector3.h>
-#include <input_output/FGXMLFileRead.h>
+#include "math/FGColumnVector3.h"
+#include "input_output/FGXMLFileRead.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#define ID_BUOYANTFORCES "$Id$"
+#define ID_BUOYANTFORCES "$Id: FGBuoyantForces.h,v 1.11 2010/05/07 20:38:34 andgi Exp $"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
@@ -82,6 +71,10 @@ CLASS DOCUMENTATION
 
     @code
     <buoyant_forces>
+
+      <!-- Interface properties -->
+      <property>ballonets/in-flow-ft3ps[0]</property>
+
       <gas_cell type="HYDROGEN">
         <location unit="M">
           <x> 18.8 </x>
@@ -95,7 +88,7 @@ CLASS DOCUMENTATION
         <valve_coefficient unit="M4*SEC/KG"> 0.015 </valve_coefficient>
       </gas_cell>
       
-      ... {other gass cells} ...
+      ... {other gas cells} ...
       
     </buoyant_forces>
     @endcode
@@ -103,7 +96,7 @@ CLASS DOCUMENTATION
     See FGGasCell for the full configuration file format for gas cells.
 
     @author Anders Gidenstam, Jon S. Berndt
-    @version $Id$
+    @version $Id: FGBuoyantForces.h,v 1.11 2010/05/07 20:38:34 andgi Exp $
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -135,11 +128,19 @@ public:
 
   /** Gets the total Buoyant force vector.
       @return a force vector. */
-  FGColumnVector3 GetForces(void) {return vTotalForces;}
+  const FGColumnVector3& GetForces(void) const {return vTotalForces;}
+
+  /** Gets a component of the total Buoyant force vector.
+      @return a component of the force vector. */
+  double GetForces(int idx) const {return vTotalForces(idx);}
 
   /** Gets the total Buoyancy moment vector.
       @return a moment vector. */
-  FGColumnVector3 GetMoments(void) {return vTotalMoments;}
+  const FGColumnVector3& GetMoments(void) const {return vTotalMoments;}
+
+  /** Gets a component of the total Buoyancy moment vector.
+      @return a component of the moment vector. */
+  double GetMoments(int idx) const {return vTotalMoments(idx);}
 
   /** Gets the total gas mass. The gas mass is part of the aircraft's
       inertia.
@@ -148,11 +149,11 @@ public:
 
   /** Gets the total moment from the gas mass.
       @return a moment vector. */
-  FGColumnVector3& GetGasMassMoment(void);
+  const FGColumnVector3& GetGasMassMoment(void);
 
   /** Gets the total moments of inertia for the gas mass.
       @return . */
-  FGMatrix33& GetGasMassInertia(void);
+  const FGMatrix33& GetGasMassInertia(void);
 
   /** Gets the strings for the current set of gas cells.
       @param delimeter either a tab or comma string depending on output type
@@ -179,7 +180,6 @@ private:
   bool NoneDefined;
 
   void bind(void);
-  void unbind(void);
 
   void Debug(int from);
 };