33 #ifndef __H__UG__SUBDIVISION_RULES_PIECEWISE_LOOP__
34 #define __H__UG__SUBDIVISION_RULES_PIECEWISE_LOOP__
80 {
return vector3(0.75, 0.125, 0.125);}
83 {
return vector4(0.375, 0.375, 0.125, 0.125);}
95 assert(creaseValence > 2 &&
"Bad crease valence. Underlying grid is not a surface grid.");
96 if(creaseValence == 4)
99 return vector4(0.75 - gamma, gamma, 0.125, 0.125);
109 {
return 1.0 - (
number)valence / (0.375 /
get_beta(valence) + valence);}
112 {
return 1.0 / (0.375 /
get_beta(valence) + valence);}
115 {
return vector3(2./3., 1./6., 1./6.);}
126 for(
size_t i = 0; i < numNbrs; ++i)
129 for(
size_t i = 0; i < numNbrs; ++i){
131 vector4 oddWeights(0.5, 0.5, 0, 0);
141 nbrWgtsOut[i] += oddWeights.x() * wnbrProj;
142 centerWgtOut += oddWeights.y() * wnbrProj;
143 nbrWgtsOut[
next_ind(i, numNbrs)] += oddWeights.z() * wnbrProj;
144 nbrWgtsOut[
prev_ind(i, numNbrs)] += oddWeights.w() * wnbrProj;
150 for(
size_t i = 0; i < numNbrs; ++i)
225 inline size_t next_ind(
size_t ind,
size_t numInds)
const {
return (ind + 1) % numInds;}
227 inline size_t prev_ind(
size_t ind,
size_t numInds)
const {
return (ind + numInds - 1) % numInds;}
A singleton that stores all rules for a piecewise-loop subdivision surface.
Definition: subdivision_rules_piecewise_loop.h:48
number proj_inner_nbr_weight(size_t valence) const
Definition: subdivision_rules_piecewise_loop.h:111
vector4 ref_odd_inner_weights() const
Definition: subdivision_rules_piecewise_loop.h:82
std::vector< number > m_betas
Definition: subdivision_rules_piecewise_loop.h:231
SubdivRules_PLoop & operator=(const SubdivRules_PLoop &src)
private assignment operator prohibits assignment.
Definition: subdivision_rules_piecewise_loop.cpp:59
size_t next_ind(size_t ind, size_t numInds) const
returns the next index in a cyclic index set
Definition: subdivision_rules_piecewise_loop.h:225
number calculate_beta(size_t valency) const
calculates beta as it is used in the subdivision masks.
Definition: subdivision_rules_piecewise_loop.cpp:76
number ref_even_inner_center_weight(size_t valence) const
Definition: subdivision_rules_piecewise_loop.h:72
SubdivRules_PLoop()
private constructor prohibits multiple instantiation.
Definition: subdivision_rules_piecewise_loop.cpp:42
number proj_inner_center_weight(size_t valence) const
Definition: subdivision_rules_piecewise_loop.h:108
void proj_inner_crease_nbr_weights(number ¢erWgtOut, number *nbrWgtsOut, NeighborInfo *nbrInfos, size_t numNbrs) const
Definition: subdivision_rules_piecewise_loop.h:118
vector4 ref_odd_inner_weights(size_t creaseValence) const
weights of an odd vertex on an inner edge that is connected to a crease.
Definition: subdivision_rules_piecewise_loop.h:93
size_t prev_ind(size_t ind, size_t numInds) const
returns the previous index in a cyclic index set
Definition: subdivision_rules_piecewise_loop.h:227
vector3 ref_even_crease_weights() const
returns weights for center, nbr1 and nbr2.
Definition: subdivision_rules_piecewise_loop.h:79
vector2 ref_odd_crease_weights() const
Definition: subdivision_rules_piecewise_loop.h:105
number get_beta(size_t valency) const
returns beta as it is used in the subdivision masks.
Definition: subdivision_rules_piecewise_loop.cpp:67
static SubdivRules_PLoop & inst()
returns the only instance to this singleton.
Definition: subdivision_rules_piecewise_loop.h:64
vector3 proj_crease_weights() const
Definition: subdivision_rules_piecewise_loop.h:114
number ref_even_inner_nbr_weight(size_t valence) const
Definition: subdivision_rules_piecewise_loop.h:75
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
double number
Definition: types.h:124
MathVector< 2, number > vector2
a 2d vector
Definition: ugmath_types.h:69
MathVector< 3, number > vector3
a 3d vector
Definition: ugmath_types.h:72
MathVector< 4, number > vector4
a 4d vector
Definition: ugmath_types.h:75
const number PI
Definition: math_constants.h:45
Definition: subdivision_rules_piecewise_loop.h:50
NeighborInfo()
Definition: subdivision_rules_piecewise_loop.h:51
Vertex * nbr
Definition: subdivision_rules_piecewise_loop.h:55
NeighborInfo(Vertex *n, size_t cval)
Definition: subdivision_rules_piecewise_loop.h:52
size_t creaseValence
Definition: subdivision_rules_piecewise_loop.h:59