26 #include "../Rocblas/include/Rocblas.h"
27 #include "../Rocsurf/include/Generic_element_2.h"
28 #include "../Rocsurf/include/Rocsurf.h"
33 compute_angle_based_vertex_centers() {
35 "Angle-based smoothing supports only serial runs now");
37 double zero = 0., eps = 1.e-100;
42 std::vector< COM::Pane*>::iterator it =
_panes.begin();
43 Manifold::PM_iterator pm_it=
_surf->pm_begin();
44 for (
int i=0, local_npanes =
_panes.size();
45 i<local_npanes; ++
i, ++it, ++pm_it) {
46 COM::Pane *pane = *it;
49 (pane->attribute(
COM_NC)->pointer());
50 const char *tranks =
reinterpret_cast<const char*
>
51 ( pane->attribute(
_tangranks->id())->pointer());
53 ( pane->attribute(
_eigvecs->id())->pointer());
55 ( pane->attribute(
_vnormals->id())->pointer());
58 ( pane->attribute(
_vcenters->id())->pointer());
59 double *ws =
reinterpret_cast<double*
>
60 ( pane->attribute(
_weights->id())->pointer());
64 for (
int j=0,
nj=pane->size_of_real_elements();
j<
nj; ++
j, ene.next()) {
65 int ne = ene.size_of_edges();
68 for (
int k=0;
k<ne; ++
k) {
72 Vector_3 dirs[2] = { es[3*vindex+1], es[3*vindex+2] };
74 switch ( tranks[vindex]) {
81 Point_3 pv = h.origin().point();
82 Vector_3 ds[3] = { h.opposite().prev().origin().point()-pv,
83 h.destination().point() - pv,
84 h.next().destination().point() - pv};
96 double w = 1/(alpha1+alpha2)/(alpha1+alpha2);
100 double beta = 0.5*(alpha2-alpha1);
103 p1[1]-p1[0]*sinb-p1[1]*cosb);
105 vcnts[vindex] += w*(
pnt[0]*dirs[0]+
pnt[1]*dirs[1]);
An adaptor for enumerating node IDs of an element.
#define PROP_END_NAMESPACE
#define PROP_BEGIN_NAMESPACE
#define COM_assertion_msg(EX, msg)
COM::Attribute * _vcenters
This class encapsulate a halfedge over a window manifold.
COM::Attribute * _tangranks
int COMMPI_Comm_size(MPI_Comm c)
std::vector< COM::Pane * > _panes
Point object that represents a single point.
COM::Attribute * _eigvecs
COM::Attribute * _weights
static void div(const Attribute *x, const Attribute *y, Attribute *z)
Operation wrapper for division.
static Vector_3 cross_product(const Vector_3 &v, const Vector_3 &w)
static void copy_scalar(const void *x, Attribute *y)
Operation wrapper for copy (x is a scalar pointer).
COM::Attribute * _vnormals
CImg< _cimg_Tfloat > acos(const CImg< T > &instance)
Some basic geometric data types.
static Vector_2 proj(const Vector_3 &v, const Vector_3 &d1, const Vector_3 &d2)