cheshirekow  v0.1.0
Simplex.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Josh Bialkowski (jbialk@mit.edu)
3  *
4  * This file is part of mpblocks.
5  *
6  * mpblocks is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * mpblocks is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with mpblocks. If not, see <http://www.gnu.org/licenses/>.
18  */
27 #ifndef MPBLOCKS_CLARKSON93_SIMPLEX_H_
28 #define MPBLOCKS_CLARKSON93_SIMPLEX_H_
29 
30 #include <mpblocks/clarkson93.h>
31 
32 namespace mpblocks {
33 namespace clarkson93 {
34 
35 
36 namespace simplex {
37 
38 enum Bits
39 {
42  HULL,
46  S_WALK,
54 };
55 
56 } // namespace simplex
57 
59 
60 
63 
64 
67 
87 template <class Traits>
88 struct SimplexBase:
89  BitMember<SimplexBits,simplex::NUM_BITS>
90 {
91  // Typedefs
92  // -----------------------------------------------------------------------
93  static const unsigned int NDim = Traits::NDim;
94  typedef typename Traits::Scalar Scalar;
95  typedef typename Traits::Point Point;
96  typedef typename Traits::Simplex Simplex;
97  typedef typename Traits::PointRef PointRef;
98  typedef typename Traits::PointDeref PointDeref;
99  typedef typename Traits::idx_t idx_t;
100 
104 
106 
107  // Data Members
108  // -----------------------------------------------------------------------
110  Simplex* N[NDim+1];
111 
114 
115  // Methods
116  // -----------------------------------------------------------------------
119  void calculateConstraint( PointDeref& deref );
120 
123  void orientConstraint( const Point& x, Orientation orient=INSIDE );
124 
127  Scalar normalProjection( const Point& x );
128 
130  bool isInfinite( PointRef antiOrigin );
131 
134  bool isVisible( const Point& x );
135 
136 };
137 
138 
140 template <class Traits>
142  public SimplexBase<Traits>
143 {
144 
145 };
146 
147 
148 
149 } // namespace clarkson93
150 } // namespace mpblocks
151 
152 
153 
154 
155 
156 
157 
158 
159 
160 
161 
162 
163 
164 
165 
166 #endif // SIMPLEX_H_
not used internally, can be used for searches
Definition: Simplex.h:52
is a member of the horizon set
Definition: Simplex.h:44
Scalar o
offset of base facet inequality hyperplane
Definition: Simplex.h:113
simplex::Bits SimplexBits
Definition: Simplex.h:58
HorizonRidge< Traits > HorizonRidge_t
Definition: Simplex.h:103
void calculateConstraint(PointDeref &deref)
calculate the normal and offset of the constraint given the d vertices on it's base facet (does not c...
Definition: Simplex.hpp:37
used in hull enumeration
Definition: Simplex.h:43
Traits::PointRef PointRef
Definition: Simplex.h:97
simplices encountered in walk around a common (NDim-1) edge
Definition: Simplex.h:47
not used internally, for enumerating the hull
Definition: Simplex.h:49
Simplex * N[NDim+1]
simplices which share a facet
Definition: Simplex.h:110
Scalar normalProjection(const Point &x)
returns the distance of x to the base facet, used in walking the triangulation to x ...
Definition: Simplex.hpp:94
is x-visible and hull
Definition: Simplex.h:41
bool isInfinite(PointRef antiOrigin)
returns true if vertex[0] is the anti origin
Definition: Simplex.hpp:101
SimplexBase< Traits > SimplexBase_t
Definition: Simplex.h:101
default simplex structure which contains no additional functionality
Definition: Simplex.h:141
The derived type to use for simplices.
Traits::PointDeref PointDeref
Definition: Simplex.h:98
is a member of the set of simplices created to fill the empty horizon wedge
Definition: Simplex.h:45
has been queued during the x-visible walk
Definition: Simplex.h:40
static const unsigned int NDim
Definition: Simplex.h:93
SimplexBase< Traits > This_t
Definition: Simplex.h:102
not used internally, can be used for searches
Definition: Simplex.h:51
used in hull enumeration
Definition: Simplex.h:42
PointRef V[NDim+1]
vertices of the simplex
Definition: Simplex.h:109
void orientConstraint(const Point &x, Orientation orient=INSIDE)
orient the constraint by ensuring that the point x satisfies it (i.e. )
Definition: Simplex.hpp:59
not used internally, for enumerating the hull
Definition: Simplex.h:50
bool isVisible(const Point &x)
returns true if x is on the inside of the base facet (i.e. x is in the same half space as the simplex...
Definition: Simplex.hpp:107
A horizon ridge is a d-2 dimensional facet (i.e. a facet of a facet),.
Definition: HorizonRidge.h:39
Point n
normal vector of base facet
Definition: Simplex.h:112
proves a means of turning a PointRef into a Point&
encapsulates a vertex, simplex pair where the simplex is the neighbor across from the specified verte...
Definition: Simplex.h:88
indicates membership into a number of sets by a bitfield
Definition: BitMember.h:40