AdvSimSupport_DS_InteractionSutureAndModel< T > Class Template Reference

#include <TAPsAdvSimSupport_DS.hpp>

Collaboration diagram for AdvSimSupport_DS_InteractionSutureAndModel< T >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 AdvSimSupport_DS_InteractionSutureAndModel (unsigned int vertexIDSuture, DS::SimulationFlags *simFlagsSuture, Vector3< T > *vertexSuture, HEVertex< T > *vertexModel, T forceRatio)
 Constructor.
void ClearConstraint ()
 Clear constraint.
void EnforceConstraint ()
 Enforce constraint.
std::string StrInfo () const
 Return this object info as a string.

Public Attributes

ForceRatio
 force ratio [0-1] (1 means suture's vertex completely dominates model's)
DS::SimulationFlags * SimFlagsSuture
 simulation flags of suture Vector3<T> * VertexSuture; //!< vertex of suture
unsigned int VertexIDSuture
 vertex ID of suture
HEVertex< T > * VertexModel
 vertex of model
Vector3< T > * VertexSuture
 a vertex of suture

Protected Member Functions

void EnforceConstraintSlidable ()
 Enforce slidable constraint.
void EnforceConstraintSlidableWithModelVertexFixed ()
 Enforce slidable constraint with model's vertex fixed.

Friends

std::ostream & operator<< (std::ostream &output, AdvSimSupport_DS_InteractionSutureAndModel< T > const &obj)
 Output Operator <<.


Detailed Description

template<typename T>
class AdvSimSupport_DS_InteractionSutureAndModel< T >

Definition at line 134 of file TAPsAdvSimSupport_DS.hpp.


Constructor & Destructor Documentation

template<typename T>
AdvSimSupport_DS_InteractionSutureAndModel< T >::AdvSimSupport_DS_InteractionSutureAndModel ( unsigned int  vertexIDSuture,
DS::SimulationFlags *  simFlagsSuture,
Vector3< T > *  vertexSuture,
HEVertex< T > *  vertexModel,
forceRatio 
) [inline]

Constructor.

Parameters:
vertexIDSuture  vertex ID of suture
simFlagsSuture  simulation flags of suture
vertexSuture  a vertex of suture
vertexModel  a vertex of model
forceRatio  force ratio between the two vertices [0-1] (1 means suture's vertex completely dominates model's)

Definition at line 148 of file TAPsAdvSimSupport_DS.hpp.

00154       : VertexIDSuture( vertexIDSuture ), SimFlagsSuture( simFlagsSuture ), VertexSuture( vertexSuture ), VertexModel( vertexModel ), ForceRatio( forceRatio )
00155     {}


Member Function Documentation

template<typename T>
void AdvSimSupport_DS_InteractionSutureAndModel< T >::ClearConstraint (  )  [inline]

Clear constraint.

Definition at line 122 of file TAPsAdvSimSupport_DS.cpp.

00123 {
00124     VertexModel->SimFlags.ClearAllSimulationConstraints();
00125     SimFlagsSuture->ClearAllSimulationConstraints();
00126 }

template<typename T>
void AdvSimSupport_DS_InteractionSutureAndModel< T >::EnforceConstraint (  )  [inline]

Enforce constraint.

Definition at line 64 of file TAPsAdvSimSupport_DS.cpp.

00065 {
00066     if ( SimFlagsSuture->CheckSimulationConstraints( Enum::AddOn::SLIDABLE ) ) {
00067         if ( VertexModel->SimFlags.CheckSimulationConstraints( Enum::AddOn::ATTACHED ) ) { 
00068             Vector3<T> C = ForceRatio*(*VertexSuture) + (1.0 - ForceRatio)*VertexModel->GetPosition();
00069             //*VertexSuture = C;    // Already computed by CUDA
00070             VertexModel->SetPosition( C );
00071         }
00072         else if ( VertexModel->SimFlags.CheckSimulationConstraints( Enum::AddOn::PUNCTURED ) ) { 
00073             Vector3<T> C = ForceRatio*(*VertexSuture) + (1.0 - ForceRatio)*VertexModel->GetPosition();
00074             //*VertexSuture = C;    // Already computed by CUDA
00075             VertexModel->SetPosition( C );
00076         }
00077         else if ( VertexModel->SimFlags.CheckSimulationConstraints( Enum::AddOn::FIXED ) ) {
00078             // Computed by CUDA
00079         }
00080         else if ( VertexModel->SimFlags.CheckSimulationConstraints( Enum::AddOn::SLIDABLE ) ) {
00081             // N/A
00082         }
00083     }
00084     else if ( SimFlagsSuture->CheckSimulationConstraints( Enum::AddOn::ATTACHED ) ) {
00085         if ( VertexModel->SimFlags.CheckSimulationConstraints( Enum::AddOn::ATTACHED ) ) { 
00086             Vector3<T> C = ForceRatio*(*VertexSuture) + (1.0 - ForceRatio)*VertexModel->GetPosition();
00087             //*VertexSuture = C;    // Already computed by CUDA
00088             VertexModel->SetPosition( C );
00089         }
00090         else if ( VertexModel->SimFlags.CheckSimulationConstraints( Enum::AddOn::PUNCTURED ) ) { 
00091             Vector3<T> C = ForceRatio*(*VertexSuture) + (1.0 - ForceRatio)*VertexModel->GetPosition();
00092             //*VertexSuture = C;    // Already computed by CUDA
00093             VertexModel->SetPosition( C );
00094         }
00095         else if ( VertexModel->SimFlags.CheckSimulationConstraints( Enum::AddOn::FIXED ) ) {
00096             // Should be computed by CUDA
00097             *VertexSuture = VertexModel->GetPosition();
00098         }
00099         else if ( VertexModel->SimFlags.CheckSimulationConstraints( Enum::AddOn::SLIDABLE ) ) {
00100             // N/A
00101         }
00102     }
00103     else if ( SimFlagsSuture->CheckSimulationConstraints( Enum::AddOn::FIXED ) ) {
00104         if ( VertexModel->SimFlags.CheckSimulationConstraints( Enum::AddOn::ATTACHED ) ) { 
00105             VertexModel->SetPosition( *VertexSuture );
00106         }
00107         else if ( VertexModel->SimFlags.CheckSimulationConstraints( Enum::AddOn::PUNCTURED ) ) { 
00108             VertexModel->SetPosition( *VertexSuture );
00109         }
00110         else if ( VertexModel->SimFlags.CheckSimulationConstraints( Enum::AddOn::FIXED ) ) {
00111             // N/A
00112         }
00113         else if ( VertexModel->SimFlags.CheckSimulationConstraints( Enum::AddOn::SLIDABLE ) ) {
00114             // N/A
00115         }
00116     }
00117 }

template<typename T>
void AdvSimSupport_DS_InteractionSutureAndModel< T >::EnforceConstraintSlidable (  )  [inline, protected]

Enforce slidable constraint.

Definition at line 131 of file TAPsAdvSimSupport_DS.cpp.

template<typename T>
void AdvSimSupport_DS_InteractionSutureAndModel< T >::EnforceConstraintSlidableWithModelVertexFixed (  )  [inline, protected]

Enforce slidable constraint with model's vertex fixed.

Definition at line 139 of file TAPsAdvSimSupport_DS.cpp.

00140 {
00141     Vector3<T> C = ForceRatio*(*VertexSuture) + (1.0 - ForceRatio)*VertexModel->GetPosition();
00142     //VertexModel->SetPosition( C );
00143 
00144     /*
00145     // The start point of suture
00146     if ( vertexIDSuture >= 0 ) {
00147     }
00148     // The end point of suture
00149     else if ( vertexIDSuture <= 96 ) {
00150     }
00151     // a mid point of suture
00152     else {
00153     }
00154     //*/
00155 }

template<typename T>
std::string AdvSimSupport_DS_InteractionSutureAndModel< T >::StrInfo (  )  const [inline]

Return this object info as a string.

Definition at line 32 of file TAPsAdvSimSupport_DS.cpp.

00033 {
00034     std::stringstream ss;
00035     ss  << "{Suture: ID[" << VertexIDSuture << "] vertex[" << VertexSuture 
00036         << "] with " << *SimFlagsSuture 
00037         << ", Model:" << VertexModel << " with " << VertexModel->SimFlags 
00038         << " with ForceRatio of " << ForceRatio << "}\n";
00039     return ss.str();
00040 }


Friends And Related Function Documentation

template<typename T>
std::ostream& operator<< ( std::ostream &  output,
AdvSimSupport_DS_InteractionSutureAndModel< T > const &  obj 
) [friend]

Output Operator <<.

Definition at line 138 of file TAPsAdvSimSupport_DS.hpp.

00139     {
00140         output << obj.StrInfo();
00141         return output;
00142     }


Member Data Documentation

force ratio [0-1] (1 means suture's vertex completely dominates model's)

Definition at line 172 of file TAPsAdvSimSupport_DS.hpp.

template<typename T>
DS::SimulationFlags* AdvSimSupport_DS_InteractionSutureAndModel< T >::SimFlagsSuture

simulation flags of suture Vector3<T> * VertexSuture; //!< vertex of suture

Definition at line 169 of file TAPsAdvSimSupport_DS.hpp.

template<typename T>
unsigned int AdvSimSupport_DS_InteractionSutureAndModel< T >::VertexIDSuture

vertex ID of suture

Definition at line 168 of file TAPsAdvSimSupport_DS.hpp.

vertex of model

Definition at line 171 of file TAPsAdvSimSupport_DS.hpp.

a vertex of suture

Definition at line 170 of file TAPsAdvSimSupport_DS.hpp.


The documentation for this class was generated from the following files:

Generated on Mon Oct 13 11:43:59 2008 for TAPs by  doxygen 1.5.6