33 #ifndef __H__UG__duplicate__
34 #define __H__UG__duplicate__
50 template <
class TAPos>
52 TAPos& aPos,
bool deselectOld =
true,
bool selectNew =
true)
57 UG_LOG(
"ERROR in Duplicate. Given position attachment not attached to vertices.\n");
67 vector<Vertex*> oldVrts;
68 vector<Edge*> oldEdges;
69 vector<Face*> oldFaces;
70 vector<Volume*> oldVols;
73 oldEdges.reserve(sel.
num<
Edge>());
75 oldFaces.reserve(sel.
num<
Face>());
104 for(vector<Vertex*>::iterator iter = oldVrts.begin();
105 iter != oldVrts.end(); ++iter)
109 VecAdd(aaPos[vrt], aaPos[oldVrt], offset);
110 aaInt[oldVrt] = (int)vrts.size();
116 for(
size_t i = 0; i < oldEdges.size(); ++i){
117 Edge* oldElem = oldEdges[i];
119 vrts[aaInt[oldElem->
vertex(1)]]),
126 for(
size_t i = 0; i < oldFaces.size(); ++i){
127 Face* oldElem = oldFaces[i];
140 for(
size_t i = 0; i < oldVols.size(); ++i){
141 Volume* oldElem = oldVols[i];
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
Can be queried for the edges and vertices of a face.
Definition: grid_base_objects.h:684
void set_num_vertices(uint numVertices)
Definition: grid_base_objects.h:705
virtual size_t num_vertices() const
Definition: grid_base_objects.h:703
void set_vertex(uint index, Vertex *vrt)
Definition: grid_base_objects.h:706
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
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
VertexIterator create_by_cloning(Vertex *pCloneMe, GridObject *pParent=NULL)
this method creates a new vertex, which has the same type as pCloneMe.
Definition: grid.cpp:419
bool has_vertex_attachment(IAttachment &attachment)
Definition: grid.h:798
void attach_to_vertices(IAttachment &attachment, bool passOnValues)
Definition: grid.h:728
void enable_selection_inheritance(bool bEnable)
Definition: selector_interface.cpp:195
bool selection_inheritance_enabled()
Definition: selector_interface.h:233
void enable_autoselection(bool bEnable)
Definition: selector_interface.cpp:190
bool autoselection_enabled()
Definition: selector_interface.h:229
specialization of ISelector for a grid of class Grid.
Definition: selector_grid.h:96
VertexIterator vertices_end()
Definition: selector_grid.h:173
virtual void clear()
Definition: selector_grid.cpp:155
VolumeIterator volumes_end()
Definition: selector_grid.h:179
size_t num() const
Definition: selector_grid_impl.hpp:74
VolumeIterator volumes_begin()
Definition: selector_grid.h:178
VertexIterator vertices_begin()
Definition: selector_grid.h:172
EdgeIterator edges_end()
Definition: selector_grid.h:175
EdgeIterator edges_begin()
Definition: selector_grid.h:174
FaceIterator faces_end()
Definition: selector_grid.h:177
FaceIterator faces_begin()
Definition: selector_grid.h:176
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
Holds a set of vertices which represent the corners of a volume element.
Definition: grid_base_objects.h:951
void set_vertex(uint index, Vertex *vrt)
Definition: grid_base_objects.h:967
virtual size_t num_vertices() const
Definition: grid_base_objects.h:964
void set_num_vertices(uint numVertices)
Definition: grid_base_objects.h:966
Volumes are 3-dimensional objects.
Definition: grid_base_objects.h:754
virtual Vertex * vertex(size_t index) const
Definition: grid_base_objects.h:727
virtual size_t num_vertices() const
Definition: grid_base_objects.h:729
void SelectAssociatedGridObjects(TSelector &sel, ISelector::status_t status)
selects associated geometric objects of selected ones on each level.
Definition: selection_util.cpp:221
#define UG_LOG(msg)
Definition: log.h:367
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
Definition: smart_pointer.h:814
bool Duplicate(Grid &grid, Selector &sel, const typename TAPos::ValueType &offset, TAPos &aPos, bool deselectOld=true, bool selectNew=true)
Duplicates the selected part of a grid and translates it by an offset.
Definition: duplicate.h:51