33 #ifndef __H__UG_cylinder_projector_new
34 #define __H__UG_cylinder_projector_new
132 template <
class TElem>
137 typename TElem::ConstVertexArray vrts = parent->vertices();
138 size_t numVrts = parent->num_vertices();
146 vector3 parentCenter (0, 0, 0);
148 for(
size_t i = 0; i < numVrts; ++i){
154 avDist /= (
number)numVrts;
161 if(len >
SMALL * avDist){
179 return clip<number>(1 - (len -
m_radius) / dist, 0, 1);
191 template <
class Archive>
192 void serialize( Archive& ar,
const unsigned int version)
195 ar & make_nvp(
"axis",
m_axis);
#define UG_EMPTY_BASE_CLASS_SERIALIZATION(clsDerived, clsBase)
Definition: boost_serialization.h:51
Projects new vertices onto a sphere during refinement.
Definition: cylinder_projector.h:49
virtual number new_vertex(Vertex *vrt, Volume *parent)
called when a new vertex was created from an old volume.
Definition: cylinder_projector.h:125
void set_axis(const vector3 &axis)
Definition: cylinder_projector.h:103
vector3 m_center
Definition: cylinder_projector.h:201
void set_radius(number radius)
Definition: cylinder_projector.h:106
void serialize(Archive &ar, const unsigned int version)
Definition: cylinder_projector.h:192
vector3 m_axis
Definition: cylinder_projector.h:202
CylinderProjector(const vector3 ¢er, const vector3 &axis, number radius)
Definition: cylinder_projector.h:66
number radius() const
Definition: cylinder_projector.h:107
virtual ~CylinderProjector()
Definition: cylinder_projector.h:98
const vector3 & center() const
Definition: cylinder_projector.h:101
CylinderProjector()
Definition: cylinder_projector.h:51
virtual number new_vertex(Vertex *vrt, Face *parent)
called when a new vertex was created from an old face.
Definition: cylinder_projector.h:119
number influence_radius() const
Definition: cylinder_projector.h:110
virtual number new_vertex(Vertex *vrt, Edge *parent)
called when a new vertex was created from an old edge.
Definition: cylinder_projector.h:113
CylinderProjector(SPIGeometry3d geometry, const vector3 ¢er, const vector3 &axis, number radius, number influenceRadius)
Definition: cylinder_projector.h:86
const vector3 & axis() const
Definition: cylinder_projector.h:104
friend class boost::serialization::access
Definition: cylinder_projector.h:189
number m_radius
Definition: cylinder_projector.h:203
number m_influenceRadius
Definition: cylinder_projector.h:204
CylinderProjector(const vector3 ¢er, const vector3 &axis, number radius, number influenceRadius)
Definition: cylinder_projector.h:75
number perform_projection(Vertex *vrt, TElem *parent)
Definition: cylinder_projector.h:133
void set_influence_radius(number influenceRadius)
Definition: cylinder_projector.h:109
void set_center(const vector3 ¢er)
Definition: cylinder_projector.h:100
CylinderProjector(const vector3 ¢er, const vector3 &axis)
Definition: cylinder_projector.h:58
Base-class for edges.
Definition: grid_base_objects.h:397
Faces are 2-dimensional objects.
Definition: grid_base_objects.h:510
Adjusts vertex coordinates during refinement.
Definition: refinement_projector.h:55
void set_pos(Vertex *v, const vector3 &p)
Definition: refinement_projector.h:157
vector3 pos(Vertex *v) const
Definition: refinement_projector.h:149
virtual SPIGeometry3d geometry() const
Definition: refinement_projector.h:81
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
Volumes are 3-dimensional objects.
Definition: grid_base_objects.h:754
double number
Definition: types.h:124
number DistancePointToRay(const vector_t &v, const vector_t &from, const vector_t &dir)
calculates the distance of a point to a ray
Definition: math_util_impl.hpp:225
number ProjectPointToRay(vector_t &vOut, const vector_t &v, const vector_t &from, const vector_t &dir)
finds the projection of v onto the ray defined by from and dir
Definition: math_util_impl.hpp:160
vector_t::value_type VecLength(const vector_t &v)
returns the length of v. Slower than VecLengthSq.
Definition: math_vector_functions_common_impl.hpp:341
void VecSubtract(vector_t &vOut, const vector_t &v1, const vector_t &v2)
subtracts v2 from v1 and stores the result in a vOut
Definition: math_vector_functions_common_impl.hpp:226
MathVector< 3, number > vector3
a 3d vector
Definition: ugmath_types.h:72
void VecScale(vector_t &vOut, const vector_t &v, typename vector_t::value_type s)
scales a MathVector<N>
Definition: math_vector_functions_common_impl.hpp:252
const number SMALL
Definition: math_constants.h:41