Chaste  Build::
VesselSegment< DIM > Class Template Reference

#include <VesselNode.hpp>

+ Inheritance diagram for VesselSegment< DIM >:
+ Collaboration diagram for VesselSegment< DIM >:

Public Member Functions

 VesselSegment (const VesselSegment< DIM > &rSegment)
 
void CopyDataFromExistingSegment (const boost::shared_ptr< VesselSegment< DIM > > pTargetSegment)
 
std::map< std::string, double > GetOutputData ()
 
units::quantity< unit::length > GetDistance (const DimensionalChastePoint< DIM > &location) const
 
boost::shared_ptr< SegmentFlowProperties< DIM > > GetFlowProperties () const
 
units::quantity< unit::length > GetLength () const
 
DimensionalChastePoint< DIM > GetMidPoint () const
 
boost::shared_ptr< VesselNode< DIM > > GetNode (unsigned index) const
 
boost::shared_ptr< VesselNode< DIM > > GetOppositeNode (boost::shared_ptr< VesselNode< DIM > > pInputNode) const
 
std::pair< boost::shared_ptr< VesselNode< DIM > >, boost::shared_ptr< VesselNode< DIM > > > GetNodes () const
 
DimensionalChastePoint< DIM > GetPointProjection (const DimensionalChastePoint< DIM > &location, bool projectToEnds=false) const
 
c_vector< double, DIM > GetUnitTangent () const
 
boost::shared_ptr< Vessel< DIM > > GetVessel () const
 
bool HasNode (boost::shared_ptr< VesselNode< DIM > > pNode) const
 
bool IsConnectedTo (boost::shared_ptr< VesselSegment< DIM > > pOtherSegment) const
 
void ReplaceNode (unsigned oldNodeIndex, boost::shared_ptr< VesselNode< DIM > > pNewNode)
 
void Remove ()
 
void SetFlowProperties (const SegmentFlowProperties< DIM > &rFlowProperties)
 
- Public Member Functions inherited from AbstractVesselNetworkComponent< DIM >
 AbstractVesselNetworkComponent ()
 
virtual ~AbstractVesselNetworkComponent ()
 
virtual unsigned GetId () const
 
virtual double GetOutputDataValue (const std::string &rKey)
 
virtual std::vector< std::string > GetOutputDataKeys ()
 
virtual units::quantity< unit::length > GetRadius () const
 
virtual void SetId (unsigned id)
 
virtual void SetOutputData (const std::string &rKey, double value)
 
virtual void SetRadius (units::quantity< unit::length > radius)
 

Static Public Member Functions

static boost::shared_ptr< VesselSegment< DIM > > Create (boost::shared_ptr< VesselNode< DIM > > pNode1, boost::shared_ptr< VesselNode< DIM > > pNode2)
 
static boost::shared_ptr< VesselSegment< DIM > > Create (boost::shared_ptr< VesselSegment< DIM > > pSegment)
 

Private Member Functions

 VesselSegment (boost::shared_ptr< VesselNode< DIM > > pNode1, boost::shared_ptr< VesselNode< DIM > > pNode2)
 
boost::shared_ptr< VesselSegment< DIM > > Shared ()
 
void AddVessel (boost::shared_ptr< Vessel< DIM > > pVessel)
 
void RemoveVessel ()
 

Private Attributes

std::pair< boost::shared_ptr< VesselNode< DIM > >, boost::shared_ptr< VesselNode< DIM > > > mNodes
 
boost::weak_ptr< Vessel< DIM > > mVessel
 
boost::shared_ptr< SegmentFlowProperties< DIM > > mpFlowProperties
 

Friends

class Vessel< DIM >
 

Additional Inherited Members

- Protected Attributes inherited from AbstractVesselNetworkComponent< DIM >
std::map< std::string, double > mOutputData
 
unsigned mId
 
units::quantity< unit::length > mRadius
 

Detailed Description

template<unsigned DIM>
class VesselSegment< DIM >

Forward declaration to allow segments to manage adding and removing themselves from nodes.

This is a class for vessel segments. They are components of a vessel network. Vessel segments are straight sub-units of vessels, defined by the positions of their end nodes. Nodes cannot be created by the vessel segment class, they are instead managed by the VesselNetwork class. Segments must always have two nodes.

Definition at line 56 of file VesselNode.hpp.

Constructor & Destructor Documentation

template<unsigned DIM>
VesselSegment< DIM >::VesselSegment ( boost::shared_ptr< VesselNode< DIM > >  pNode1,
boost::shared_ptr< VesselNode< DIM > >  pNode2 
)
private

Constructor - This is private as instances of this class must be created with a corresponding shared pointer. This is implemented using the static Create method.

Parameters
pNode1the first node in the segment
pNode2the second node in the segment

Definition at line 44 of file VesselSegment.cpp.

template<unsigned DIM>
VesselSegment< DIM >::VesselSegment ( const VesselSegment< DIM > &  rSegment)

Copy Constructor - This should not be used directly as instances of this class must be created with a corresponding shared pointer. This is implemented using the static Create method. This class can not be made private.

Parameters
rSegmentthe segment to be copied

Definition at line 53 of file VesselSegment.cpp.

References VesselSegment< DIM >::GetFlowProperties(), and VesselSegment< DIM >::SetFlowProperties().

Member Function Documentation

template<unsigned DIM>
void VesselSegment< DIM >::AddVessel ( boost::shared_ptr< Vessel< DIM > >  pVessel)
private

Add an adjoining Vessel to the segment.

Parameters
pVessela vessel to be added to the segment

Definition at line 100 of file VesselSegment.cpp.

References VesselSegment< DIM >::mVessel.

template<unsigned DIM>
void VesselSegment< DIM >::CopyDataFromExistingSegment ( const boost::shared_ptr< VesselSegment< DIM > >  pTargetSegment)

Copy a selection of member data and VasculatureData from the input segment. Convenient alternative to the copy constructor as nodes aren't copied.

Parameters
pTargetSegmentthe segment from which data is to be copied

Definition at line 106 of file VesselSegment.cpp.

References AbstractVesselNetworkComponent< DIM >::mOutputData, VesselSegment< DIM >::SetFlowProperties(), and AbstractVesselNetworkComponent< DIM >::SetRadius().

Referenced by Vessel< DIM >::DivideSegment().

template<unsigned DIM>
boost::shared_ptr< VesselSegment< DIM > > VesselSegment< DIM >::Create ( boost::shared_ptr< VesselNode< DIM > >  pNode1,
boost::shared_ptr< VesselNode< DIM > >  pNode2 
)
static

Construct a new instance of the class and return a shared pointer to it. Also manage the association of segments to nodes by passing self weak pointers to the nodes.

Parameters
pNode1the first node in the segment
pNode2the second node in the segment
Returns
a pointer to the newly created segment

Definition at line 63 of file VesselSegment.cpp.

Referenced by Vessel< DIM >::DivideSegment(), VesselNetwork< DIM >::ExtendVessel(), VesselNetwork< DIM >::FormSprout(), VesselNetworkReader< DIM >::Read(), and VesselNetwork< DIM >::VesselCrossesLineSegment().

template<unsigned DIM>
boost::shared_ptr< VesselSegment< DIM > > VesselSegment< DIM >::Create ( boost::shared_ptr< VesselSegment< DIM > >  pSegment)
static

Construct a new instance of the class and return a shared pointer to it. Also manage the association of segments to nodes by passing self weak pointers to the nodes.

Parameters
pSegmentthe segment to be copied
Returns
a pointer to the newly created segment

Definition at line 80 of file VesselSegment.cpp.

template<unsigned DIM>
units::quantity< unit::length > VesselSegment< DIM >::GetDistance ( const DimensionalChastePoint< DIM > &  location) const

Return the distance between the input point and the segment. If the projection of the point is within the segment the distance is the perpendicular distance to the segment. Otherwise it is the distance to the nearest node.

Parameters
locationthe point the get the distance from
Returns
the distance to the segment

Definition at line 114 of file VesselSegment.cpp.

References VesselSegment< DIM >::mNodes.

template<unsigned DIM>
boost::shared_ptr< SegmentFlowProperties< DIM > > VesselSegment< DIM >::GetFlowProperties ( ) const

Return the flow properties of the component

Returns
the flow properties of the component

Definition at line 120 of file VesselSegment.cpp.

References VesselSegment< DIM >::mpFlowProperties.

Referenced by VesselSegment< DIM >::VesselSegment().

template<unsigned DIM>
units::quantity< unit::length > VesselSegment< DIM >::GetLength ( ) const

Return the dimensional length

Returns
the segment length

Definition at line 126 of file VesselSegment.cpp.

References VesselSegment< DIM >::mNodes.

template<unsigned DIM>
DimensionalChastePoint< DIM > VesselSegment< DIM >::GetMidPoint ( ) const

Return a point mid-way along the vessel segment

Returns
a point midway along the segment

Definition at line 143 of file VesselSegment.cpp.

References VesselSegment< DIM >::mNodes.

template<unsigned DIM>
boost::shared_ptr< VesselNode< DIM > > VesselSegment< DIM >::GetNode ( unsigned  index) const

Return a pointer to the node specified by the index

Parameters
indexthe node index
Returns
a pointer to the node specified by the index

Definition at line 149 of file VesselSegment.cpp.

References VesselSegment< DIM >::mNodes.

Referenced by VesselSegment< DIM >::HasNode(), and VesselSegment< DIM >::IsConnectedTo().

template<unsigned DIM>
std::pair< boost::shared_ptr< VesselNode< DIM > >, boost::shared_ptr< VesselNode< DIM > > > VesselSegment< DIM >::GetNodes ( ) const

Return the segment nodes as a pair

Returns
the segment nodes as a pair

Definition at line 183 of file VesselSegment.cpp.

References VesselSegment< DIM >::mNodes.

template<unsigned DIM>
boost::shared_ptr< VesselNode< DIM > > VesselSegment< DIM >::GetOppositeNode ( boost::shared_ptr< VesselNode< DIM > >  pInputNode) const

Return a pointer to the node on the other side of the segment

Parameters
pInputNodethe node to get the opposite one to
Returns
a pointer to the node on the other side of the segment

Definition at line 166 of file VesselSegment.cpp.

References VesselSegment< DIM >::mNodes.

template<unsigned DIM>
std::map< std::string, double > VesselSegment< DIM >::GetOutputData ( )
virtual
template<unsigned DIM>
DimensionalChastePoint< DIM > VesselSegment< DIM >::GetPointProjection ( const DimensionalChastePoint< DIM > &  location,
bool  projectToEnds = false 
) const

Return the projection of a point onto the segment. If the projection is outside the segment an Exception is thrown.

Parameters
locationthe location to be projected
projectToEndsuse end projection
Returns
the location of the projected point

Definition at line 189 of file VesselSegment.cpp.

References VesselSegment< DIM >::mNodes.

template<unsigned DIM>
c_vector< double, DIM > VesselSegment< DIM >::GetUnitTangent ( ) const

Return a unit vector pointing along the segment. The orientation along the segment is from node0 to node 1.

Returns
a unit vector pointing along the segment

Definition at line 195 of file VesselSegment.cpp.

References VesselSegment< DIM >::mNodes.

template<unsigned DIM>
boost::shared_ptr< Vessel< DIM > > VesselSegment< DIM >::GetVessel ( ) const

Return a pointer to the vessel.

Returns
the vessel attached to the segment

Definition at line 201 of file VesselSegment.cpp.

References VesselSegment< DIM >::mVessel.

template<unsigned DIM>
bool VesselSegment< DIM >::HasNode ( boost::shared_ptr< VesselNode< DIM > >  pNode) const

Return whether the node is in the segment.

Parameters
pNodethe query node
Returns
whether the node is in the segment

Definition at line 214 of file VesselSegment.cpp.

References VesselSegment< DIM >::GetNode().

template<unsigned DIM>
bool VesselSegment< DIM >::IsConnectedTo ( boost::shared_ptr< VesselSegment< DIM > >  pOtherSegment) const

Return whether the segment is connected to another segment.

Parameters
pOtherSegmentthe segment to check connectivity with
Returns
whether the segment is connected to the input segment

Definition at line 220 of file VesselSegment.cpp.

References VesselSegment< DIM >::GetNode().

template<unsigned DIM>
void VesselSegment< DIM >::Remove ( )

Remove the segment from its nodes.

Definition at line 239 of file VesselSegment.cpp.

References VesselSegment< DIM >::mNodes, VesselSegment< DIM >::RemoveVessel(), and VesselSegment< DIM >::Shared().

template<unsigned DIM>
void VesselSegment< DIM >::RemoveVessel ( )
private

Remove an adjoining vessel from the segment.

Definition at line 233 of file VesselSegment.cpp.

References VesselSegment< DIM >::mVessel.

Referenced by VesselSegment< DIM >::Remove().

template<unsigned DIM>
void VesselSegment< DIM >::ReplaceNode ( unsigned  oldNodeIndex,
boost::shared_ptr< VesselNode< DIM > >  pNewNode 
)

Replace the node at the specified index with the passed in node.

Parameters
oldNodeIndexthe index of the node to be replaced
pNewNodethe node to be added to the segment

Definition at line 247 of file VesselSegment.cpp.

References VesselSegment< DIM >::mNodes, VesselSegment< DIM >::mVessel, and VesselSegment< DIM >::Shared().

template<unsigned DIM>
void VesselSegment< DIM >::SetFlowProperties ( const SegmentFlowProperties< DIM > &  rFlowProperties)

Set the flow properties of the segment

Parameters
rFlowPropertiesthe flow properties to be set

Definition at line 273 of file VesselSegment.cpp.

References VesselSegment< DIM >::mpFlowProperties.

Referenced by VesselSegment< DIM >::CopyDataFromExistingSegment(), and VesselSegment< DIM >::VesselSegment().

template<unsigned DIM>
boost::shared_ptr< VesselSegment< DIM > > VesselSegment< DIM >::Shared ( )
private

Return a boost::shared_ptr to this object

Returns
a shared pointer to the segment

Definition at line 279 of file VesselSegment.cpp.

Referenced by VesselSegment< DIM >::Remove(), and VesselSegment< DIM >::ReplaceNode().

Friends And Related Function Documentation

template<unsigned DIM>
friend class Vessel< DIM >
friend

Allow vessels to manage adding and removing themselves from segments.

Definition at line 67 of file VesselSegment.hpp.

Member Data Documentation

template<unsigned DIM>
boost::shared_ptr<SegmentFlowProperties<DIM> > VesselSegment< DIM >::mpFlowProperties
private

A flow property collection for the segment

Definition at line 84 of file VesselSegment.hpp.

Referenced by VesselSegment< DIM >::GetFlowProperties(), VesselSegment< DIM >::GetOutputData(), and VesselSegment< DIM >::SetFlowProperties().

template<unsigned DIM>
boost::weak_ptr<Vessel<DIM> > VesselSegment< DIM >::mVessel
private

Weak pointer to the vessel owning this segment

Definition at line 79 of file VesselSegment.hpp.

Referenced by VesselSegment< DIM >::AddVessel(), VesselSegment< DIM >::GetVessel(), VesselSegment< DIM >::RemoveVessel(), and VesselSegment< DIM >::ReplaceNode().


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