33 #ifndef __H__UG4__LIB_GRID__TRIANGLE_FILL_SWEEP_LINE_IMPL__
34 #define __H__UG4__LIB_GRID__TRIANGLE_FILL_SWEEP_LINE_IMPL__
38 template <
class TIterator>
46 UG_LOG(
"position attachment missing in TriangleFill_SweepLine");
51 UG_LOG(
"int attachment missing in TriangleFill_SweepLine");
60 std::vector<Vertex*> vrtPtrs;
61 std::vector<vector3> vrts;
62 std::vector<int> edges;
65 for(TIterator iter = edgesBegin; iter != edgesEnd; ++iter)
69 for(
size_t i = 0; i < 2; ++i){
72 aaInt[vrt] = (int)vrts.size();
73 vrts.push_back(aaPos[vrt]);
75 vrtPtrs.push_back(vrt);
79 edges.push_back(aaInt[vrt]);
85 size_t numInitialEdges = edges.size();
86 std::vector<int> faces;
90 for(
size_t i = 0; i < faces.size(); i+=3){
92 vrtPtrs[faces[i + 1]],
93 vrtPtrs[faces[i + 2]]));
105 for(
size_t i = numInitialEdges; i < edges.size(); i+=2){
A generic specialization of IAttachment.
Definition: attachment_pipe.h:263
Can be used to store information about an edge and to construct an edge.
Definition: grid_base_objects.h:464
Base-class for edges.
Definition: grid_base_objects.h:397
virtual Vertex * vertex(size_t index) const
Definition: grid_base_objects.h:366
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
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
bool has_vertex_attachment(IAttachment &attachment)
Definition: grid.h:798
geometry_traits< TGeomObj >::iterator create(GridObject *pParent=NULL)
create a custom element.
Definition: grid_impl.hpp:69
Partitions elements of a grid into several subsets.
Definition: subset_handler_grid.h:53
void assign_subset(Vertex *elem, int subsetIndex)
assigns a vertex to a subset.
Definition: subset_handler_grid.cpp:204
Edges connect two vertices.
Definition: grid_objects_1d.h:66
only used to initialize a triangle. for all other tasks you should use FaceDescriptor.
Definition: grid_objects_2d.h:78
the most simple form of a face
Definition: grid_objects_2d.h:174
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
#define UG_LOG(msg)
Definition: log.h:367
bool TriangleFill_SweepLine(vector< int > &facesOut, const vector< vector2 > &srcVrtsOrig, vector< int > &srcEdges)
Performs triangulation of a polygon and resoves additional inner edges.
Definition: triangle_fill_sweep_line.cpp:942