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_DYNAMIC_SIMPLEX_H_
28 #define MPBLOCKS_CLARKSON93_DYNAMIC_SIMPLEX_H_
29 
30 #include <mpblocks/clarkson93.h>
31 
32 namespace mpblocks {
33 namespace clarkson93 {
34 namespace dynamic {
35 
36 
37 namespace simplex {
38 
39 enum Bits
40 {
47  NUM_BITS
49 };
50 
51 } // namespace simplex
52 
54 
55 
58 
78 template <class Traits>
79 struct SimplexBase:
80  BitMember<SimplexBits,simplex::NUM_BITS>
81 {
82  // Typedefs
83  // -----------------------------------------------------------------------
84  typedef unsigned int uint;
85  typedef typename Traits::Scalar Scalar;
86  typedef typename Traits::Point Point;
87  typedef typename Traits::Simplex Simplex;
88  typedef typename Traits::PointRef PointRef;
89  typedef typename Traits::PointDeref PointDeref;
90  typedef typename Traits::idx_t idx_t;
91 
95 
97 
98  // Data Members
99  // -----------------------------------------------------------------------
100  std::vector<PointRef> vertices;
101  std::vector<Simplex*> neighbors;
102 // idx_t inv[NDim+1]; ///< inverse map, my index in my i'th
103 // /// neighbor's neighbor array
104 
107 
108  // Methods
109  // -----------------------------------------------------------------------
112  void calculateConstraint( uint ndim, PointDeref& deref );
113 
116  void orientConstraint( const Point& x, Orientation orient=INSIDE );
117 
120  Scalar normalProjection( const Point& x );
121 
123  bool isInfinite( PointRef antiOrigin );
124 
127  bool isVisible( const Point& x );
128 };
129 
130 
132 template <class Traits>
134  public SimplexBase<Traits>
135 {
136 
137 };
138 
139 
140 } // namespace dynamic
141 } // namespace clarkson93
142 } // namespace mpblocks
143 
144 
145 
146 
147 
148 
149 
150 
151 
152 
153 
154 
155 
156 
157 
158 #endif // SIMPLEX_H_
std::vector< Simplex * > neighbors
simplices which share a facet
Definition: Simplex.h:101
has been queued during the x-visible walk
Definition: Simplex.h:41
default simplex structure which contains no additional functionality
Definition: Simplex.h:133
Scalar normalProjection(const Point &x)
returns the distance of x to the base facet, used in walking the triangulation to x ...
Definition: Simplex.hpp:95
has been expanded during circulation around a a point (i.e. hull enumeration)
Definition: Simplex.h:46
A simplex is the convex hull of d+1 points in general position (IGP), i.e. they do not lie on the sam...
Definition: Simplex.h:79
is queued for expansion during circulation around a point (i.e. hull enumeration) ...
Definition: Simplex.h:44
bool isInfinite(PointRef antiOrigin)
returns true if vertex[0] is the anti origin
Definition: Simplex.hpp:102
void calculateConstraint(uint ndim, 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:38
HorizonRidge< Traits > HorizonRidge_t
Definition: Simplex.h:94
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:108
SimplexBase< Traits > SimplexBase_t
Definition: Simplex.h:92
is queued for expansion in x-visible search
Definition: Simplex.h:43
Scalar c
offset of base facet inequality hyperplane
Definition: Simplex.h:106
simplex::Bits SimplexBits
Definition: Simplex.h:53
void orientConstraint(const Point &x, Orientation orient=INSIDE)
orient the constraint by ensuring that the point x satisfies it (i.e. )
Definition: Simplex.hpp:60
Point n
normal vector of base facet
Definition: Simplex.h:105
A horizon ridge is a d-2 dimensional facet (i.e. a facet of a facet),.
Definition: HorizonRidge.h:39
std::vector< PointRef > vertices
vertices of the simplex
Definition: Simplex.h:100
indicates membership into a number of sets by a bitfield
Definition: BitMember.h:40