TAPs 0.7.7.3
TAPsModelLaparoscopicAdjustableGastricBand.cpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsModelLaparoscopicAdjustableGastricBand.cpp
00003 
00004 A specific model for a laparoscopic adjustable gastric band.
00005 
00006 SUKITTI PUNAK   (07/02/2008)
00007 UPDATE          (09/03/2010)
00008 ******************************************************************************/
00009 #include "TAPsModelLaparoscopicAdjustableGastricBand.hpp"
00010 // Using Inclusion Model (i.e. definitions are included in declarations)
00011 //                       (this name.cpp is included in name.hpp)
00012 // Each friend is defined directly inside its declaration.
00013 
00014 BEGIN_NAMESPACE_TAPs__OpenGL
00015 //=============================================================================
00016 //-----------------------------------------------------------------------------
00017 // Default constructor
00018 template <typename T>
00019 ModelLaparoscopicAdjustableGastricBand<T>::ModelLaparoscopicAdjustableGastricBand ()
00020     : ModelStrand<T>( 128, 0.1, 0.1, Vector3<T>(), 0.05 )
00021       //, m_iLevel( 3 )
00022 {
00023     InitHead();
00024     //---------------------------------------------------------------
00025     #ifdef  TAPs_ENABLE_DEBUG
00026     std::cout   << "Default ModelLaparoscopicAdjustableGastricBand<" 
00027                 << typeid(T).name() << "> with:\n"
00028                 << "  " << m_iNoLinks << " links with each link of length "
00029                 << m_tLinkLength << " and weight " << m_tPointWeight << "\n";
00030     #endif//TAPs_DEBUG_MODE
00031 }
00032 //-----------------------------------------------------------------------------
00033 // Constructor
00034 template <typename T>
00035 ModelLaparoscopicAdjustableGastricBand<T>::ModelLaparoscopicAdjustableGastricBand 
00036     (   int iNoLinks, T tLength, T tWeight, 
00037         Vector3<T> & posOfVertex0, T tRadius )
00038     : ModelStrand<T>( iNoLinks, tLength, tWeight, posOfVertex0, tRadius )
00039       //, m_iLevel( 3 )
00040 {
00041     InitHead();
00042     //---------------------------------------------------------------
00043     #ifdef  TAPs_ENABLE_DEBUG
00044     std::cout   << "ModelLaparoscopicAdjustableGastricBand<" 
00045                 << typeid(T).name() << "> with:\n"
00046                 << "  " << m_iNoLinks << " links with each link of length "
00047                 << m_tLinkLength << " and weight " << m_tPointWeight << "\n";
00048     #endif//TAPs_DEBUG_MODE
00049 }
00050 //-----------------------------------------------------------------------------
00051 // Constructor
00052 template <typename T>
00053 ModelLaparoscopicAdjustableGastricBand<T>::ModelLaparoscopicAdjustableGastricBand 
00054     (   int iNoLinks, T tLength, T tWeight, 
00055         Vector3<T> & posOfVertex0, T tRadius, 
00056         const char * head 
00057     )
00058     : ModelStrand<T>( iNoLinks, tLength, tWeight, posOfVertex0, tRadius )
00059       //, m_iLevel( 3 )
00060 {
00061     InitHead( head );
00062     //---------------------------------------------------------------
00063     //#ifdef    TAPs_ENABLE_DEBUG
00064     std::cout << "GastricBand: "    << iNoLinks << ", " 
00065                                     << tLength << ", " 
00066                                     << tWeight << ", " 
00067                                     << posOfVertex0 << ", " 
00068                                     << tRadius << ", " 
00069                                     << head << "\n";
00070 
00071     std::cout   << "ModelLaparoscopicAdjustableGastricBand<" << typeid(T).name() << "> with:\n"
00072                 << "  " << m_iNoLinks << " links with each link of length "
00073                 << m_tLinkLength << " and weight " << m_tPointWeight << "\n";
00074     //#endif//TAPs_DEBUG_MODE
00075 }
00076 //-----------------------------------------------------------------------------
00077 // Constructor
00078 template <typename T>
00079 ModelLaparoscopicAdjustableGastricBand<T>::ModelLaparoscopicAdjustableGastricBand 
00080     (   int iNoLinks, T tLength, T tWeight, 
00081         Vector3<T> & posOfVertex0, T tRadius, 
00082         T tKRatioOfStretchingAllowed,
00083         T tKRatioOfCompressionAllowed,
00084         T tKStretching,
00085         T tKBending,
00086         T tKTwisting,
00087         T tKFriction,
00088         T tKContact,
00089         T tKGravity,
00090         const char * head 
00091     )
00092 
00093     : ModelStrand<T>( iNoLinks, tLength, tWeight, posOfVertex0, tRadius, 
00094             tKRatioOfStretchingAllowed, tKRatioOfCompressionAllowed, 
00095             tKStretching, tKBending, tKTwisting, 
00096             tKFriction, tKContact, tKGravity )
00097       //, m_iLevel( 3 )
00098 {
00099     InitHead ( head );
00100     //---------------------------------------------------------------
00101     #ifdef  TAPs_ENABLE_DEBUG
00102     std::cout   << "ModelLaparoscopicAdjustableGastricBand<" << typeid(T).name() << "> with:\n"
00103                 << "  " << m_iNoLinks << " links with each link of length "
00104                 << m_tLinkLength << " and weight " << m_tPointWeight << "\n";
00105     #endif//TAPs_DEBUG_MODE
00106 }
00107 //-----------------------------------------------------------------------------
00108 // Destructor
00109 template <typename T>
00110 ModelLaparoscopicAdjustableGastricBand<T>::~ModelLaparoscopicAdjustableGastricBand ()
00111 {
00112     //if ( m_pHead )    delete m_pHead;     // ERROR Deleting Object!  FIX IT!
00113     //if ( m_pTail )    delete m_pTail;
00114     //---------------------------------------------------------------
00115     //if ( m_prPickPts )    delete [] m_prPickPts;
00116     //if ( m_prbIsSharp )   delete [] m_prbIsSharp;
00117     //---------------------------------------------------------------
00118     #ifdef  TAPs_ENABLE_DEBUG
00119     std::cout << "ModelLaparoscopicAdjustableGastricBand<" << typeid(T).name() 
00120               << "> Destructor\n";
00121     #endif//TAPs_DEBUG_MODE
00122 }
00123 //-----------------------------------------------------------------------------
00124 // Initialize Head
00125 template <typename T>
00126 void ModelLaparoscopicAdjustableGastricBand<T>::InitHead ()
00127 {
00128     //char fileName1[] = "Data/3dsMax/HeadNeedle.ASE";
00129     //char fileName1[] = "Data/3dsMax/HeadNeedle2.ASE";
00130     char head[] = "Data/3dsMax/HeadNeedle3.ASE";
00131     //char fileName2[] = "Data/3dsMax/HeadNeedle.ASE";
00132     InitHead( head );
00133 }
00134 //-----------------------------------------------------------------------------
00135 // Initialize Head
00136 template <typename T>
00137 void ModelLaparoscopicAdjustableGastricBand<T>::InitHead ( const char * head )
00138 {
00139     //m_pHead   = NULL;
00140     //m_pTail   = NULL;
00141     //---------------------------------------------------------------
00142     m_pHead = new MultiMeshModelWithMBV<T>();
00143     //m_pHead   = new OpenGLHalfEdgeModel<T>();
00144     //m_pTail   = new OpenGLHalfEdgeModel<T>();
00145     //---------------------------------------------------------------
00146 
00147     #ifdef  TAPs_DEBUG_MODE
00148     std::cout << "Create Head of an Adjustable Gastric Band" << std::endl;
00149     #endif//TAPs_DEBUG_MODE
00150 
00151     if ( !ReadModels<Real>::readFile( head, m_pHead ) ) {
00152         std::cout << "ERROR: In File Reading for creating the head of an adjustable gastric band!" << std::endl;
00153         exit ( EXIT_FAILURE );
00154     }
00155     else {
00156         #ifdef  TAPs_DEBUG_MODE
00157         std::cout << "Creating Head of an adjustable gastric band" << std::endl;
00158         #endif//TAPs_DEBUG_MODE
00159     }
00160     //---------------------------------------------------------------
00161     /*
00162 
00163     #ifdef  TAPs_DEBUG_MODE
00164     std::cout << "Create Tail of an adjustable gastric band" << std::endl;
00165     #endif//TAPs_DEBUG_MODE
00166 
00167     if ( !ReadModels<Real>::readFile( tail, m_pTail ) ) {
00168         std::cout << "ERROR: In File Reading for creating the tail of an adjustable gastric band!" << std::endl;
00169         exit ( EXIT_FAILURE );
00170     }
00171     else {
00172         #ifdef  TAPs_DEBUG_MODE
00173         std::cout << "Creating tail of an adjustable gastric band" << std::endl;
00174         #endif//TAPs_DEBUG_MODE
00175 
00176         m_pTail->SetMaterial( OpenGL::Enum::HEAD_NEEDLE );
00177         m_pTail->BuildBVHTree( TAPs::Enum::BVH_TREE_BINARY_SPHERE );
00178     }
00179     //*/
00180     //---------------------------------------------------------------
00181 
00182     //InitHeadPickPts();
00183 
00184     //SetHeadPickPts();
00185 
00186     //InitHeadSharpPts();
00187 
00188     SetHeadPosition();
00189 
00190     //std::cout << "Head of an adjustable gastric band: " << *m_pHead << "\n";
00191 }
00192 //-----------------------------------------------------------------------------
00193 /*
00194 // Initialize Head Pick Points
00195 template <typename T>
00196 void ModelLaparoscopicAdjustableGastricBand<T>::InitHeadPickPts ()
00197 {
00198     // SET Number of Pick Pts HERE! ==> 2^m_iLevel
00199     m_iLevel = 4;
00200     //---------------------------------------------------------------
00201     // Set number of pick able points for head
00202     m_iNoPickPts = pow( 2, m_iLevel ); // * 2;
00203 
00204     #ifdef  TAPs_DEBUG_MODE
00205     std::cout << "Number of pickable points for the head is set at" << m_iNoPickPts << ".\n";
00206     #endif//TAPs_DEBUG_MODE
00207 
00208     m_prPickPts = new Vector3<T>*[ m_iNoPickPts ];
00209     assert( m_prPickPts );
00210     //---------------------------------------------------------------
00211     // Use a recursive function
00212     BVHNode<T> ** L = new BVHNode<T>*[1];
00213     L[0] = m_pHead->GetBVHTree()->Root();
00214     InitHeadPickPts( L, 0 );        // Node List and Level Number
00215     delete [] L;
00216 }
00217 //*/
00218 //-----------------------------------------------------------------------------
00219 /*
00220 // Initialize Head Pick Points
00221 template <typename T>
00222 void ModelLaparoscopicAdjustableGastricBand<T>::InitHeadPickPts ( BVHNode<T> ** node, int level )
00223 {
00224     #ifdef  TAPs_DEBUG_MODE
00225     std::cout << "InitHeadPickPts with LEVEL of " << level << std::endl;
00226     #endif//TAPs_DEBUG_MODE
00227 
00228     if ( level > m_iLevel ) return;
00229     //---------------------------------------------------------------
00230     int size = pow( 2, level );
00231     BVHNode<T> ** L = new BVHNode<T>*[ size*2 ];
00232     for ( int i = 0, j = 0; i < size; ++i, j+=2 ) {
00233         L[j  ] = node[i]->Child(0);
00234         L[j+1] = node[i]->Child(1);
00235     }
00236     InitHeadPickPts( L, ++level );
00237     //---------------------------------------------------------------
00238     if ( level == m_iLevel ) {
00239         //-------------------------------------------------
00240         #ifdef  TAPs_DEBUG_MODE
00241         std::cout << "--------------------   HEAD PICK POINTS   --------------------\n";
00242         #endif//TAPs_DEBUG_MODE
00243 
00244         for ( int i = 0; i < m_iNoPickPts; ++i ) {
00245             m_prPickPts[i] = &(L[i]->GetCenter());
00246 
00247             #ifdef  TAPs_DEBUG_MODE
00248             std::cout << *(m_prPickPts[i]) << "\n";
00249             #endif//TAPs_DEBUG_MODE
00250         }
00251         #ifdef  TAPs_DEBUG_MODE
00252         std::cout << "-------------------- END HEAD PICK POINTS --------------------\n";
00253         #endif//TAPs_DEBUG_MODE
00254     }
00255     delete [] L;
00256 }
00257 //*/
00258 //-----------------------------------------------------------------------------
00259 /*
00260 // SetHeadPickPts
00261 //   Align head with the movement of the strand
00262 template <typename T>
00263 void ModelLaparoscopicAdjustableGastricBand<T>::SetHeadPickPts ()
00264 {
00265     static int i;
00266     static T angle;
00267     static Vector3<T> dir, axis;
00268 
00269     //---------------------------------------------------------------
00270     // Head
00271     i = 0;
00272     dir = m_prVertex[i] - m_prVertex[i+1];
00273     axis = dir ^ (-CGMath<T>::VectorY);
00274     angle = acos( (dir * (-CGMath<T>::VectorY)) / dir.Length() ) 
00275           * Math<T>::RAD_TO_DEG;
00276     // Translation and Rotation
00277     //m_vTransForHead  = m_prVertex[i];
00278     m_pHead->GetTransform().SetTranslation( m_prVertex[i] );
00279     //m_mRotMatForHead = CGMath<T>::CreateRotationMatrix3x3( axis, -angle );
00280     if ( !GetFixStatusOfPtNo( 0 ) )
00281         m_pHead->GetTransform().SetMatrixRotation( CGMath<T>::CreateRotationMatrix3x3( axis, -angle ) );
00282     //std::cout << m_pHead->GetTransform().GetMatrixRotation() << "\n";
00283 }
00284 //*/
00285 
00286 //-----------------------------------------------------------------------------
00287 // SetHeadPosition
00288 //   Align head with the movement of the strand
00289 template <typename T>
00290 void ModelLaparoscopicAdjustableGastricBand<T>::SetHeadPosition ()
00291 {
00292     static int i;
00293     static T angle;
00294     static Vector3<T> dir, axis;
00295 
00296     //---------------------------------------------------------------
00297     // Head
00298     i = 0;
00299     dir = m_prVertex[i] - m_prVertex[i+1];
00300     axis = dir ^ (-CGMath<T>::VectorY);
00301     angle = acos( (dir * (-CGMath<T>::VectorY)) / dir.Length() ) 
00302           * Math<T>::RAD_TO_DEG;
00303     // Translation and Rotation
00304     //m_vTransForHead  = m_prVertex[i];
00305     m_pHead->GetTransform().SetTranslation( m_prVertex[i] );
00306     //m_mRotMatForHead = CGMath<T>::CreateRotationMatrix3x3( axis, -angle );
00307     if ( !GetFixStatusOfPtNo( 0 ) )
00308         m_pHead->GetTransform().SetMatrixRotation( CGMath<T>::CreateRotationMatrix3x3( axis, -angle ) );
00309     //std::cout << m_pHead->GetTransform().GetMatrixRotation() << "\n";
00310 }
00311 
00312 //-----------------------------------------------------------------------------
00313 /*
00314 // InitHeadSharpPts
00315 template <typename T>
00316 void ModelLaparoscopicAdjustableGastricBand<T>::InitHeadSharpPts ()
00317 {
00318     //---------------------------------------------------------------
00319     // For Head
00320     m_prbIsSharp = new bool[ m_iNoPickPts ];
00321     for ( int i = 0; i < m_iNoPickPts; ++i ) {
00322         m_prbIsSharp[i] = false;
00323     }
00324     //---------------------------------------------------------------
00325     int headSharpPt = 0;
00326     T maxDistance = (*(m_prPickPts[0]) - m_prVertex[0]).Length();
00327     T distance;
00328     for ( int i = 1; i < m_iNoPickPts; ++i ) {
00329         distance = (*(m_prPickPts[i]) - m_prVertex[0]).Length();
00330         if ( distance > maxDistance ) {
00331             headSharpPt = i;
00332             maxDistance = distance;
00333         }
00334     }
00335     m_prbIsSharp[headSharpPt] = true;
00336     m_iHeadSharpPt = headSharpPt;
00337 }
00338 //*/
00339 //-----------------------------------------------------------------------------
00340 template <typename T>
00341 inline Vector3<T> ModelLaparoscopicAdjustableGastricBand<T>::GetPointPosition ( int i ) const
00342 {
00343     if ( i <= m_iNoLinks )  return m_prVertex[i];
00344     else                    return GetHeadPosition( i-m_iNoLinks-1 );
00345 }
00346 //-----------------------------------------------------------------------------
00347 template <typename T>
00348 inline Vector3<T> ModelLaparoscopicAdjustableGastricBand<T>::GetHeadPosition ( int i ) const
00349 {
00350     assert( 0 <= i && i < m_iNoPickPts );
00351     // Head
00352     //return m_mRotMatForHead * *(m_prPickPts[i]) + m_vTransForHead;
00353     return /*m_pHead->GetTransform().GetMatrixRotation() * *(m_prPickPts[i]) +*/ m_pHead->GetTransform().GetTranslation();
00354 }
00355 //-----------------------------------------------------------------------------
00356 template <typename T>
00357 inline void ModelLaparoscopicAdjustableGastricBand<T>::SetPointPosition ( 
00358     int i, const Vector3<T> & position )
00359 {
00360     if ( i <= m_iNoLinks )  {
00361         ModelStrand<T>::SetPointPosition( i, position );
00362         //SetHeadPickPts();
00363     }
00364     else {
00365         //SetHeadPosition( i-m_iNoLinks-1, position, m_mRotMatForHead );
00366 
00367         SetHeadPosition( i-m_iNoLinks-1, position, m_pHead->GetTransform().GetMatrixRotation() );
00368 
00369         //ModelStrand<T>::SetPointPosition( 0, m_vTransForHead );
00370 
00371         //ModelStrand<T>::SetPointPosition( 1, position );
00372         ModelStrand<T>::SetPointPosition( 0, m_pHead->GetTransform().GetTranslation() );
00373     }
00374 }
00375 //-----------------------------------------------------------------------------
00376 template <typename T>
00377 inline void ModelLaparoscopicAdjustableGastricBand<T>::SetPointPosition ( 
00378     int i, const Vector3<T> & position, Matrix3x3<T> & rotation, 
00379     //T tMoveDistanceLimit, 
00380     MultiBoundingVolume<T> const * const pMBV, 
00381     TransformationSupport<T> const * const pTransform 
00382 )
00383 {
00384     if ( i <= m_iNoLinks )  {
00385         ModelStrand<T>::SetPointPosition( i, position, pMBV, pTransform );
00386         //SetHeadPickPts();
00387     }
00388     else {
00389         SetHeadPosition( i-m_iNoLinks-1, position, rotation );
00390         //ModelStrand<T>::SetPointPosition( 0, m_vTransForHead );
00391         ModelStrand<T>::SetPointPosition( 0, m_pHead->GetTransform().GetTranslation() );
00392     }
00393 }
00394 //-----------------------------------------------------------------------------
00395 template <typename T>
00396 inline void ModelLaparoscopicAdjustableGastricBand<T>::SetHeadPosition ( 
00397     int i, const Vector3<T> & position, Matrix3x3<T> & rotation )
00398 {
00399     assert( 0 <= i && i < m_iNoPickPts );
00400     //---------------------------------------------------------------
00401     // Head
00402     //m_mRotMatForHead =  rotation;
00403 
00404     //rotation.MakeIdentity();
00405 
00406     // Rotate with the first link of the strand
00407     m_pHead->GetTransform().SetMatrixRotation( rotation );
00408 
00409     Vector3<T> translation = position - GetHeadPosition( i );
00410     //m_vTransForHead += translation;
00411     m_pHead->GetTransform().SetTranslation( 
00412         m_pHead->GetTransform().GetTranslation() + translation
00413     );
00414 }
00415 //-----------------------------------------------------------------------------
00416 //=============================================================================
00417 // Get/Set Fn(s)
00418 //-----------------------------------------------------------------------------
00419 //-----------------------------------------------------------------------------
00420 //=============================================================================
00421 // Helper Fn(s)
00422 //-----------------------------------------------------------------------------
00423 //-----------------------------------------------------------------------------
00424 //=============================================================================
00425 // For Simulation
00426 //-----------------------------------------------------------------------------
00427 // DxDt
00428 template <typename T>
00429 bool ModelLaparoscopicAdjustableGastricBand<T>::DxDt (  
00430     T dt,                           // i/p: time step
00431     Simulation::VectorSet<T> &x,    // i/p: array  x = {pos, vel}
00432     Simulation::VectorSet<T> &xdot, // o/p: array xdot = {vel, accel}
00433     void *userData                  // o/p: array of user data
00434 )
00435 {
00436     return ModelStrand<T>::DxDt( dt, x, xdot, userData );
00437 }
00438 //-----------------------------------------------------------------------------
00439 // StateToArray
00440 template <typename T>
00441 void ModelLaparoscopicAdjustableGastricBand<T>::StateToArray ( T *dst )
00442 {
00443     ModelStrand<T>::StateToArray( dst );
00444 }
00445 //-----------------------------------------------------------------------------
00446 // ArrayToState
00447 template <typename T>
00448 void ModelLaparoscopicAdjustableGastricBand<T>::ArrayToState ( T *src )
00449 {
00450     ModelStrand<T>::ArrayToState( src );
00451 }
00452 //-----------------------------------------------------------------------------
00453 // DdtStateToArray
00454 template <typename T>
00455 void ModelLaparoscopicAdjustableGastricBand<T>::DdtStateToArray ( T *xdot, T dt )
00456 {
00457     ModelStrand<T>::DdtStateToArray( xdot, dt );
00458 }
00459 //-----------------------------------------------------------------------------
00460 // AdvanceSimulation
00461 template <typename T>
00462 void ModelLaparoscopicAdjustableGastricBand<T>::AdvanceSimulation ( T tCurrent, T tNext )
00463 {
00464     ModelStrand<T>::AdvanceSimulation( tCurrent, tNext );
00465     //SetHeadPickPts();
00466 }
00467 //-----------------------------------------------------------------------------
00468 // AdvanceSimulation
00469 template <typename T>
00470 void ModelLaparoscopicAdjustableGastricBand<T>::AdvanceSimulation ( Simulation::SimClock<T> & simClock )
00471 {
00472     ModelStrand<T>::AdvanceSimulation( simClock );
00473     //SetHeadPickPts();
00474 }
00475 //-----------------------------------------------------------------------------
00476 
00477 //=============================================================================
00478 // Collision Detection
00479 //-----------------------------------------------------------------------------
00480 template <typename T>
00481 bool ModelLaparoscopicAdjustableGastricBand<T>::TestOverlapWith ( BVHTree<T> const * const that )
00482 {
00483     m_svCollidedNode.clear();
00484     m_svCollidedNodeThat.clear();
00485     //---------------------------------------------------------------
00486     bool result = GetBVHTree()->TestOverlapWithTillLeafNodes( that );
00487     if ( !result )  return result;
00488     //---------------------------------------------------------------
00489     BVHNode<T> * cylinder;
00490     BVHNode<T> * triangle;
00491     //---------------------------------------------------------------
00492     int size = static_cast<int>( GetBVHTree()->GetListOfCollidedNodes().size() );
00493     //*
00494     int linkNo;
00495     //std::cout << "\n";
00496     for ( int i = 0; i < size; ++i ) {
00497         cylinder = GetBVHTree()->GetListOfCollidedNodes()[i];
00498         triangle = GetBVHTree()->GetListOfCollidedNodesThat()[i];
00499         linkNo = cylinder->GetID();
00500         //std::cout << "Link No: " << linkNo;
00501         HEFace<T> * heFace = triangle->GetAPrimitiveHalfEdgeFace();
00502         std::vector< HEVertex<T> * const > vertices = heFace->GetPtrsToVertices();
00503         //*
00504         result = CGMath<T>::FindIntersectionCylinderTriangle(
00505                     GetPointPosition( linkNo ), GetPointPosition( linkNo+1 ), GetRadius(), 
00506                     vertices[0]->GetPosition(), 
00507                     vertices[1]->GetPosition(), 
00508                     vertices[2]->GetPosition() );
00509         //*/
00510         //result = true;
00511         
00512         if ( result ) {
00513             //-------------------------------------------------------
00514             // Collision Response (roll the link back to its previous position)
00515             //m_prVertex[ linkNo   ] += (m_prVertexPrev[ linkNo   ] - m_prVertex[ linkNo   ]);
00516             //m_prVertex[ linkNo+1 ] += (m_prVertexPrev[ linkNo+1 ] - m_prVertex[ linkNo+1 ]);
00517 //          m_prVertex[ linkNo   ] = m_prVertexPrev[ linkNo-1 ];
00518 //          m_prVertex[ linkNo+1 ] = m_prVertexPrev[ linkNo   ];
00519             //-------------------------------------------------------
00520             //SavePreviousPositions();
00521 //          UpdateBVHTree();
00522             //-------------------------------------------------------
00523             //-------------------------------------------------------
00524 
00525             //std::cout << " ---> in collsions";
00526             m_svCollidedNode.push_back( GetBVHTree()->GetListOfCollidedNodes()[i] );
00527             m_svCollidedNodeThat.push_back( GetBVHTree()->GetListOfCollidedNodesThat()[i] );
00528         }
00529         //std::cout << "\n";
00530     }
00531     //std::cout << "Old Size: " << GetBVHTree()->GetListOfCollidedNodes().size() << " " << GetBVHTree()->GetListOfCollidedNodesThat().size() << "\n";
00532     //std::cout << "New Size: " << m_svCollidedNode.size() << " " << m_svCollidedNodeThat.size() << "\n";
00533     //*/
00534     //---------------------------------------------------------------
00535     if ( static_cast<int>( m_svCollidedNode.size() ) > 0 )  return true;
00536     else                                                    return false;
00537 }
00538 //-----------------------------------------------------------------------------
00539 //=============================================================================
00540 
00541 //-----------------------------------------------------------------------------
00542 // SetupShape Fn
00543 template <typename T>
00544 void ModelLaparoscopicAdjustableGastricBand<T>::SetupShape ( Vector3<T> startPosition )
00545 {
00546     ModelStrand<T>::SetupShape( startPosition );
00547 }
00548 //-----------------------------------------------------------------------------
00549 //=============================================================================
00550 END_NAMESPACE_TAPs__OpenGL
00551 //-----------------------------------------------------------------------------
00552 //34567890123456789012345678901234567890123456789012345678901234567890123456789
00553 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines