proj home

Files   Classes   Functions   Hierarchy  

halfspaceContainer< HS, PT > Class Template Reference

Half space and a container of integer indexes to points. More...

#include <halfspaceContainer.h>

Collaboration diagram for halfspaceContainer< HS, PT >:

List of all members.

Public Member Functions

 halfspaceContainer (HS const &halfspace_, vector< PT > const &pts_)
 Needs a half space and a reference to the points to be operated on.
void isInsideOrOnBoundary (list< uint > const &target)
 Copies the targets indexes which the half-space can see, or is on the boundary.
void subtractfrom (list< uint > &target)
 Moves the target indexes which the half-space can see into index.

Public Attributes

HS halfspace
 The half space.
list< uintindex
 Indexes into a vector of T.
vector< PT > const & pts
 Global points.


Detailed Description

template<typename HS, typename PT>
class halfspaceContainer< HS, PT >

Half space and a container of integer indexes to points.

Definition at line 15 of file halfspaceContainer.h.


Constructor & Destructor Documentation

template<typename HS , typename PT >
halfspaceContainer< HS, PT >::halfspaceContainer ( HS const &  halfspace_,
vector< PT > const &  pts_ 
) [inline]

Needs a half space and a reference to the points to be operated on.

Definition at line 31 of file halfspaceContainer.h.

00034     : halfspace(halfspace_), pts(pts_) {} 


Member Function Documentation

template<typename HS , typename PT >
void halfspaceContainer< HS, PT >::isInsideOrOnBoundary ( list< uint > const &  target  )  [inline]

Copies the targets indexes which the half-space can see, or is on the boundary.

ie populates index.

Definition at line 68 of file halfspaceContainer.h.

References pts.

Referenced by quickhull2D< PT, D >::quickhull2D(), and quickhull3D< PT, D >::reset().

00071 {
00072   list< uint >::const_iterator i=target.begin();
00073   list< uint >::const_iterator iend=target.end();
00074   for ( ; i!=iend; ++i)
00075   {
00076     if (halfspace.isInsideOrOnBoundary(pts[*i]))
00077       index.push_back(*i);
00078   }
00079 }

template<typename HS , typename PT >
void halfspaceContainer< HS, PT >::subtractfrom ( list< uint > &  target  )  [inline]

Moves the target indexes which the half-space can see into index.

Includes the boundary.

Definition at line 51 of file halfspaceContainer.h.

References pts.

00054 {
00055   list<uint>::iterator i=target.begin();
00056   for ( ; i!=target.end(); ++i)
00057   {
00058     if (halfspace.isInsideOrOnBoundary(pts[*i]))
00059     {
00060       index.push_back(*i);
00061       i=target.erase(i);
00062     }
00063   }
00064 }


Member Data Documentation

template<typename HS , typename PT >
HS halfspaceContainer< HS, PT >::halfspace

The half space.

Definition at line 20 of file halfspaceContainer.h.

template<typename HS , typename PT >
list<uint> halfspaceContainer< HS, PT >::index

Indexes into a vector of T.

Definition at line 23 of file halfspaceContainer.h.

template<typename HS , typename PT >
vector< PT > const& halfspaceContainer< HS, PT >::pts

Global points.

Definition at line 26 of file halfspaceContainer.h.


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

Generated on Fri Mar 4 00:50:02 2011 for Chelton Evans Source by  doxygen 1.5.8