TAPs 0.7.7.3
TAPsInteractionPointGroup.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsInteractionPointGroup.hpp
00003 ******************************************************************************/
00014 /******************************************************************************
00015 SUKITTI PUNAK   (07/23/2010)
00016 UPDATE          (09/21/2010)
00017 ******************************************************************************/
00018 #ifndef TAPs_INTERACTION_POINT_GROUP_HPP
00019 #define TAPs_INTERACTION_POINT_GROUP_HPP
00020 
00021 #include <algorithm>
00022 #include "TAPsInteractionPoint.hpp"
00023 #include "../Physics/TAPsForces.hpp"
00024 
00025 BEGIN_NAMESPACE_TAPs
00026 //=============================================================================
00027 template <typename T>
00028 class InteractionPointGroup {
00029 //=============================================================================
00030 public:
00031     // Member Functions -------------------------------------------------------
00033     friend std::ostream & operator<< ( std::ostream &output, InteractionPointGroup<T> const &obj )
00034     {
00035         output << obj.StrInfo();
00036         return output;
00037     }
00038     //-------------------------------------------------------------------------
00040     InteractionPointGroup ();
00042     InteractionPointGroup ( InteractionPointGroup<T> const &orig );
00044     virtual ~InteractionPointGroup ();
00045     //-------------------------------------------------------------------------
00047     virtual std::string StrInfo () const;
00048     //-------------------------------------------------------------------------
00050     inline InteractionPointGroup<T> & operator= ( InteractionPointGroup<T> const &orig );
00051     //-------------------------------------------------------------------------
00052     // Operations
00053 
00055     inline InteractionPoint<T> const & GetInteractionPointAtIndex ( unsigned int i ) const;
00057     inline InteractionPoint<T> & GetInteractionPointAtIndex ( unsigned int i );
00058 
00060     inline std::vector< InteractionPoint<T> > const & GetTheSetOfInteractionPoints () const;
00062     inline std::vector< InteractionPoint<T> > & GetTheSetOfInteractionPoints ();
00063 
00065     inline unsigned int GetNumOfInteractionPoints () const;
00066     
00068     void AddInteractionPoint (
00069         Vector3<T> const & position,    
00070         typename PointMass<T>::Type typeOfPointMass = PointMass<T>::TYPE_STATIC 
00071     );
00072 
00074     void SortInteractionPointsBasedOnDistanceFromTheOriginPos_LessThan ();
00076     void SortInteractionPointsBasedOnDistanceFromTheOriginPos_GreaterThan ();
00077 
00081     bool CalVolumeAndCentroid ( T & volume, Vector3<T> & centroid );
00082 
00084     inline void TransformedBy ( Matrix4x4<T> const & Trx );
00085 
00087     std::vector< PointForce<T> > const &    RefToCDPointForces () const { return m_CDPointForces; }
00089     std::vector< PointForce<T> > &  RefToCDPointForces ()   { return m_CDPointForces; }
00090 
00091     //-------------------------------------------------------------------------
00092     // Data Members -----------------------------------------------------------
00093 //=============================================================================
00094 protected:
00095     // Member Functions -------------------------------------------------------
00096     // Data Members -----------------------------------------------------------
00097     std::vector< InteractionPoint<T> >  m_IPGroup;          
00098     std::vector< PointForce<T> >        m_CDPointForces;    
00099 //=============================================================================
00100 private:
00101     // Member Functions -------------------------------------------------------
00102     // Data Members -----------------------------------------------------------
00103 //=============================================================================
00104 
00105 
00106 //=============================================================================
00107 // OpenGL
00108 #if defined(__gl_h_) || defined(__GL_H__)
00109 //-----------------------------------------------------------------------------
00110 public:
00111     virtual void Draw () const;
00112 //-----------------------------------------------------------------------------
00113 #endif  // OpenGL
00114 //=============================================================================
00115 
00116 
00117 //=============================================================================
00118 }; // END CLASS InteractionPointGroup
00119 //=============================================================================
00120 END_NAMESPACE_TAPs
00121 //-----------------------------------------------------------------------------
00123 #include "TAPsInteractionPointGroup.cpp"
00124 
00126 // Include definition if TAPs_USE_EXPORT is not defined
00127 //#if !defined( TAPs_USE_EXPORT )
00128 //  #include "TAPsInteractionPointGroup.cpp"
00129 //#endif
00130 //-----------------------------------------------------------------------------
00131 #endif
00132 //34567890123456789012345678901234567890123456789012345678901234567890123456789
00133 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines