Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

rdGBody.h

00001 // rdGBody.h
00002 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00003 // Copyright 2002 Realistic Dynamics, Inc.
00004 // All rights reserved.
00005 //
00006 // Please do not read, copy, distribute, or use without permission.
00007 // Contact: Frank C. Anderson, fca@RealisticDynamics.com
00008 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00009 #ifndef __rdGBody_h__
00010 #define __rdGBody_h__
00011 
00012 
00013 // INCLUDES
00014 #include "rdTools.h"
00015 #include "rdObject.h"
00016 #include "rdVertices.h"
00017 #include "rdEdges.h"
00018 #include "rdTriangles.h"
00019 
00020 
00021 // DECLARATIONS
00022 class rdGBodies;
00023 
00024 
00025 //=============================================================================
00026 //=============================================================================
00030 class RDTOOLS_API rdGBody : public rdObject
00031 {
00032 //=============================================================================
00033 // DATA
00034 //=============================================================================
00035 private:
00037    double _origin[3];
00039    double _x[3];
00041    double _y[3];
00043    double _z[3];
00046    double _px[3];
00049    double _py[3];
00052    double _pz[3];
00054    rdVertices *_vertices;
00056    rdEdges *_edges;
00058    rdTriangles *_triangles;
00060    rdGBodies *_bodies;
00062    double _lower[3];
00064    double _upper[3];
00065    // INERTIAL PROPERTIES
00067    double _density;
00069    double _mass;
00071    double _com[3];
00073    double _inertia[3][3];
00074 
00075 //=============================================================================
00076 // METHODS
00077 //=============================================================================
00078 public:
00079    //--------------------------------------------------------------------------
00080    // CONSTRUCTION
00081    //--------------------------------------------------------------------------
00082    rdGBody();
00083    rdGBody(IDOM_Element *aElement);
00084    virtual ~rdGBody();
00085 private:
00086    void setNull();
00087 
00088    //--------------------------------------------------------------------------
00089    // GET AND SET
00090    //--------------------------------------------------------------------------
00091 public:
00092    void setOrigin(double aX,double aY,double aZ);
00093    void getOrigin(double rP[3]) const;
00094    void setPX(double aX,double aY,double aZ);
00095    void setPY(double aX,double aY,double aZ);
00096    void setPZ(double aX,double aY,double aZ);
00097    void setDensity(double aDensity);
00098    double getDensity() const;
00099    void setMass(double aMass);
00100    double getMass() const;
00101    void setCenterOfMass(const double aCOM[3]);
00102    void getCenterOfMass(double rCOM[3]) const;
00103    void setInertiaTensor(const double aI[6]);
00104    void getInertiaTensor(double rI[9]) const;
00105 
00106    //--------------------------------------------------------------------------
00107    // OPERATIONS
00108    //--------------------------------------------------------------------------
00109    void translate(double aX,double aY,double aZ);
00110    void rotate(int aXYZ,double aRadians);
00111    void rotate(int aXYZ,double aRadians,const double aP[3]);
00112 
00113    //--------------------------------------------------------------------------
00114    // UTILITIES
00115    //--------------------------------------------------------------------------
00116    bool isInside(const double aPoint[3]) const;
00117    void estimateInertialProperties(double aCubeSize=0.0);
00118    void computeNewFrame();
00119    void updateEdgeIndices();
00120    void updateTriangleIndices();
00121    void computeUpperBounds();
00122    void computeLowerBounds();
00123    void computeBounds();
00124    void printBoneFile(const char *aFileName=NULL);
00125 
00126    //--------------------------------------------------------------------------
00127    // XML
00128    //--------------------------------------------------------------------------
00129    virtual void updateObject(bool aDeep=true);
00130    virtual void updateNode(bool aDeep=true);
00131    void updateData();
00132 
00133 //=============================================================================
00134 }; // END class rdGBody
00135 //=============================================================================
00136 //=============================================================================
00137 
00138 #endif  // __rdGBody_h__

Generated on Wed Aug 20 02:17:06 2003 for Simulation Software by doxygen1.3