33 #ifndef __H__REMESHING__SIMPLE_GRID_IMPL__
34 #define __H__REMESHING__SIMPLE_GRID_IMPL__
44 template <
class TPosAcc,
class TIntAcc,
class TNormAcc>
47 TPosAcc& aaPos, TNormAcc& aaNorm,
52 static std::vector<Vertex*> vVrts;
64 vVrts.push_back(vrt1);
65 vVrts.push_back(vrt2);
80 iter != iterEnd; ++iter)
86 for(
uint j = 0; j < 3; ++j){
95 if(!vUnmarked)
goto bail_out;
97 aaInt[vUnmarked] = vVrts.size();
98 vVrts.push_back(vUnmarked);
109 for(
size_t i = nextVrt; i < vVrts.size(); ++i)
113 for(
size_t i = 0; i < size; ++i)
115 for(; nextVrt < vrtsEnd; ++nextVrt)
117 Vertex* vrt = vVrts[nextVrt];
121 iter != iterEnd; ++iter)
127 for(
uint j = 0; j < 3; ++j){
131 vVrts.push_back(f->
vertex(j));
144 vrtsEnd = vVrts.size();
148 for(
size_t i = 0; i < vVrts.size(); ++i)
150 sgOut.
vertices.push_back(aaPos[vVrts[i]]);
167 template <
class TPosAcc,
class TIntAcc,
class TNormAcc>
169 Edge* e,
size_t size,
170 TPosAcc& aaPos, TNormAcc& aaNorm,
178 std::vector<Face*> faces;
183 typename TPosAcc::ValueType n;
192 for(
size_t i_face = 0; i_face < faces.size(); ++i_face){
193 Face* f = faces[i_face];
210 for(
size_t i = 0; i < 3; ++i){
224 aaInt[v] = (int)sgOut.
vertices.size() - 1;
Base-class for edges.
Definition: grid_base_objects.h:397
virtual Vertex * vertex(size_t index) const
Definition: grid_base_objects.h:366
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
size_t size() const
returns the number of vertices.
Definition: grid_base_objects.h:492
virtual Vertex * vertex(size_t index) const
Definition: grid_base_objects.h:486
virtual size_t num_vertices() const
Definition: grid_base_objects.h:488
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
void end_marking()
ends a marking sequence. Call this method when you're done with marking.
Definition: grid.cpp:1285
AssociatedFaceIterator associated_faces_begin(Vertex *vrt)
DO NOT INVOKE! Subject to change.
Definition: grid.cpp:944
bool is_marked(GridObject *obj) const
returns true if the object is marked, false if not.
Definition: grid_impl.hpp:843
void mark(GridObject *obj)
marks the object. Calls are only valid between calls to Grid::begin_marking and Grid::end_marking.
Definition: grid_impl.hpp:773
void begin_marking()
begin marking.
Definition: grid.cpp:1262
AssociatedFaceIterator associated_faces_end(Vertex *vrt)
DO NOT INVOKE! Subject to change.
Definition: grid.cpp:954
FaceContainer::iterator AssociatedFaceIterator
used to iterate over associated faces of vertices, edges and volumes
Definition: grid.h:251
Definition: simple_grid.h:45
std::vector< vector3 > vertices
Definition: simple_grid.h:48
std::vector< int > triangles
Definition: simple_grid.h:50
std::vector< vector3 > vertexNormals
Definition: simple_grid.h:49
void clear()
Definition: simple_grid.cpp:42
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
void CollectNeighborhood(std::vector< Face * > &facesOut, Grid &grid, Vertex *vrt, size_t range, bool clearContainer)
Collects all neighbors in a given neighborhood of a vertex.
Definition: neighborhood.cpp:415
unsigned int uint
Definition: types.h:114
void CalculateCenter(vector_t ¢erOut, const vector_t *pointSet, size_t numPoints)
calculates the center of a point-set
Definition: math_util_impl.hpp:98
void VecNormalize(vector_t &vOut, const vector_t &v)
scales a vector_t to unit length
Definition: math_vector_functions_common_impl.hpp:501
void VecAdd(vector_t &vOut, const vector_t &v1, const vector_t &v2)
adds two MathVector<N>s and stores the result in a third one
Definition: math_vector_functions_common_impl.hpp:185
void CalculateTriangleNormals(SimpleGrid &sg)
resizes sg.triangleNormals and calculates them
Definition: simple_grid.cpp:90
bool ObtainSimpleGrid_CollapseEdge(SimpleGrid &sgOut, Grid &grid, Edge *e, size_t size, TPosAcc &aaPos, TNormAcc &aaNorm, TIntAcc &aaInt)
returns a neighbourhood of the edge e after e has been collapsed.
Definition: simple_grid_impl.hpp:168
bool ObtainSimpleGrid(SimpleGrid &sgOut, Grid &grid, Vertex *vrt1, Vertex *vrt2, size_t size, TPosAcc &aaPos, TNormAcc &aaNorm, TIntAcc &aaInt)
returns a neighbourhood of the edge defined by vrt1 and vrt2 in a SimpleGrid.
Definition: simple_grid_impl.hpp:45