--- trunk/OOPSE-3.0/test/brains/StuntDouble.hpp 2004/10/22 23:09:57 1639
+++ trunk/OOPSE-3.0/test/brains/StuntDouble.hpp 2004/10/23 23:09:46 1640
@@ -22,6 +22,14 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
+
+/**
+ * @file StuntDouble.hpp
+ * @author tlin
+ * @date 10/22/2004
+ * @version 1.0
+ */
+
#ifndef _STUNTDOUBLE_HPP_
#define _STUNTDOUBLE_HPP_
@@ -29,28 +37,37 @@
#include
#include
- * @return the euler angles of this stuntdouble
+ * Tests the if this stuntdouble is a linear rigidbody
*
- * @see #setEuler
- */
- virtual Vector3d getEuler() = 0;
+ * @return true if this stuntdouble is a linear rigidbody, otherwise return false
+ * @note atom and directional atom will always return false
+ *
+ * @see #linearAxis
+ */
+ bool isLinear() {
+ return linear_;
+ }
/**
- * Sets the euler angles of this stuntdouble
- *
- * @param e new euler angles
- *
- *
- * e[0] = phi
- * e[1] = theta
- * e[2] = psi
- *
- *
- *
- * @see #setEuler
- */
- virtual void setEuler(Vector3d& e) = 0;
-
- virtual bool isLinear() {return false;}
-
- /**
* Returns the linear axis of the rigidbody, atom and directional atom will always return -1
*
* @return the linear axis of the rigidbody
*
* @see #isLinear
*/
- virtual int linearAxis() {return -1;}
+ int linearAxis() {
+ return linearAxis_;
+ }
- /**
- * Returns the zangle
- *
- * @return the zangle
- *
- * @see #setZangle
- * @see #addZangle
- */
- virtual double getZangle() = 0;
+ /** Returns the mass of this stuntdouble */
+ double getMass() {
+ return mass_;
+ }
- /**
- *
- */
- virtual void setZangle(double zAngle) = 0;
+ /**
+ * Sets the mass of this stuntdoulbe
+ * @param mass the mass to be set
+ */
+ void setMass(double mass) {
+ mass_ = mass;
+ }
- /**
- *
- */
- virtual void addZangle(double zAngle) = 0;
+ /** Returns the name of this stuntdouble */
+ std::string getType();
+
+ /** Sets the name of this stuntdouble*/
+ void setType(const std::string& name);
- /**
- *
+ /**
+ * Converts a lab fixed vector to a body fixed vector
+ * @v lab fixed vector. On return, it will store body fixed vector
+ */
+ void lab2Body(Vector3d& v);
+
+ /**
+ * Converts a body fixed vector to a lab fixed vector
+ * @v body fixed vector. On return, it will store lab fixed vector
+ */
+ void body2Lab(Vector3d& v);
+ /**
*
* The purpose of the Visitor Pattern is to encapsulate an operation that you want to perform on
* the elements of a data structure. In this way, you can change the operation being performed
@@ -520,74 +783,70 @@ namespace oopse{
*/
virtual void accept(BaseVisitor* v) = 0;
- StorageMethod getStorageMethd(){return stMethod;}
- void setStorageMethod(StorageMethod method) {stMethod = method;}
-
//below functions are just forward functions
/**
* Adds property into property map
- *
* @param genData GenericData to be added into PropertyMap
- *
- * @see #removeProperty
- * @see #clearProperties
*/
- void addProperty(GenericData* genData) { properties.addProperty(genData); }
+ void addProperty(GenericData* genData);
/**
* Removes property from PropertyMap by name
- *
* @param propName the name of property to be removed
- *
- * @see #addProperty
- * @see #clearProperties
*/
- void removeProperty(std::string& propName) { properties.removeProperty(); }
+ void removeProperty(std::string& propName);
/**
* clear all of the properties
- *
- * @see #addProperty
- * @see #removeProperty
*/
- void clearProperties() { properties.clearProperties(); }
+ void clearProperties();
/**
* Returns all names of properties
- *
* @return all names of properties
*/
- std::vector getPropertyNames() {return properties.getPropertyNames(); }
+ std::vector getPropertyNames();
/**
* Returns all of the properties in PropertyMap
- *
* @return all of the properties in PropertyMap
- *
- * @see #getPropertyByName
*/
- std::vector getProperties() { return properties.getProperties(); }
+ std::vector getProperties();
/**
* Returns property
- *
* @param propName name of property
- *
* @return a pointer point to property with propName. If no property named propName
* exists, return NULL
- *
- * @see #getProperties
*/
- GenericData* getPropertyByName(std:string& propName) { return properties.getPropertyByName(propName); }
+ GenericData* getPropertyByName(std:string& propName);
- private:
+ protected:
- int globalIndex_;
- int localIndex_;
- PropertyMap properties;
+ StuntDouble();
+
+ StuntDouble(const StuntDouble& sd);
+ StuntDouble& operator=(const StuntDouble& sd);
+
+ ObjectType objType_;
+
+ bool linear_;
+ int linearAxis_;
+
DataStoragePointer storage_;
SnapshotManager* snapshotMan_;
- };
+
+ private:
+
+ int globalIndex_;
+ int localIndex_;
+ std::string name_;
+
+ double mass_;
+
+ PropertyMap properties_;
+ };
+
}//end namespace oopse
#endif //ifndef _STUNTDOUBLE_HPP_