Fix to build with correct two phase name lookup (xcode 4.3 compatibility for OpenMesh). The template base class members are not found otherwise.

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@552 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Jan Möbius
2012-03-02 16:16:30 +00:00
parent a28d019323
commit 03fd666b9b
7 changed files with 138 additions and 187 deletions

View File

@@ -126,7 +126,7 @@ public:
refcount_fcolors_(0), refcount_fcolors_(0),
refcount_ftextureIndex_(0) refcount_ftextureIndex_(0)
{ {
add_property( points_, "v:points" ); this->add_property( points_, "v:points" );
if (VAttribs & Attributes::Normal) if (VAttribs & Attributes::Normal)
request_vertex_normals(); request_vertex_normals();
@@ -184,10 +184,10 @@ public:
//FIXME: data properties might actually cost storage even //FIXME: data properties might actually cost storage even
//if there are no data traits?? //if there are no data traits??
add_property(data_vpph_); this->add_property(data_vpph_);
add_property(data_fpph_); this->add_property(data_fpph_);
add_property(data_hpph_); this->add_property(data_hpph_);
add_property(data_epph_); this->add_property(data_epph_);
} }
virtual ~AttribKernelT() virtual ~AttribKernelT()
@@ -196,55 +196,6 @@ public:
// BaseKernel's destructor anyway... // BaseKernel's destructor anyway...
} }
// Martin: This below does not make any sense, right?
// -------------------------------------------------------- copy & assignment
// AttribKernelT(const AttribKernelT& _rhs)
// : BaseKernel(_rhs)
// { operator=(_rhs); }
//
// AttribKernelT& operator=(const AttribKernelT& _rhs)
// {
// // remove old properties
// remove_property(points_);
// remove_property(vertex_normals_);
// remove_property(vertex_colors_);
// remove_property(vertex_texcoords_);
// remove_property(vertex_status_);
// remove_property(halfedge_status_);
// remove_property(edge_status_);
// remove_property(face_normals_);
// remove_property(face_colors_);
// remove_property(face_status_);
//
// // parent deep-copies properties
// BaseKernel::operator=(_rhs);
//
// // copy property handles
// points_ = _rhs.points_;
// vertex_normals_ = _rhs.vertex_normals_;
// vertex_colors_ = _rhs.vertex_colors_;
// vertex_texcoords_ = _rhs.vertex_texcoords_;
// vertex_status_ = _rhs.vertex_status_;
// halfedge_status_ = _rhs.halfedge_status_;
// edge_status_ = _rhs.edge_status_;
// face_normals_ = _rhs.face_normals_;
// face_colors_ = _rhs.face_colors_;
// face_status_ = _rhs.face_status_;
//
// // copy ref-counts
// refcount_vnormals_ = _rhs.refcount_vnormals_;
// refcount_vcolors_ = _rhs.refcount_vcolors_;
// refcount_vtexcoords_ = _rhs.refcount_vtexcoords_;
// refcount_vstatus_ = _rhs.refcount_vstatus_;
// refcount_hstatus_ = _rhs.refcount_hstatus_;
// refcount_estatus_ = _rhs.refcount_estatus_;
// refcount_fnormals_ = _rhs.refcount_fnormals_;
// refcount_fcolors_ = _rhs.refcount_fcolors_;
// refcount_fstatus_ = _rhs.refcount_fstatus_;
//
// return *this;
// }
/** Assignment from another mesh of \em another type. /** Assignment from another mesh of \em another type.
\note All that's copied is connectivity and vertex positions. \note All that's copied is connectivity and vertex positions.
All other information (like e.g. attributes or additional All other information (like e.g. attributes or additional
@@ -267,270 +218,270 @@ public:
//-------------------------------------------------------------------- points //-------------------------------------------------------------------- points
const Point* points() const const Point* points() const
{ return property(points_).data(); } { return this->property(points_).data(); }
const Point& point(VertexHandle _vh) const const Point& point(VertexHandle _vh) const
{ return property(points_, _vh); } { return this->property(points_, _vh); }
Point& point(VertexHandle _vh) Point& point(VertexHandle _vh)
{ return property(points_, _vh); } { return this->property(points_, _vh); }
void set_point(VertexHandle _vh, const Point& _p) void set_point(VertexHandle _vh, const Point& _p)
{ property(points_, _vh) = _p; } { this->property(points_, _vh) = _p; }
//------------------------------------------------------------ vertex normals //------------------------------------------------------------ vertex normals
const Normal* vertex_normals() const const Normal* vertex_normals() const
{ return property(vertex_normals_).data(); } { return this->property(vertex_normals_).data(); }
const Normal& normal(VertexHandle _vh) const const Normal& normal(VertexHandle _vh) const
{ return property(vertex_normals_, _vh); } { return this->property(vertex_normals_, _vh); }
void set_normal(VertexHandle _vh, const Normal& _n) void set_normal(VertexHandle _vh, const Normal& _n)
{ property(vertex_normals_, _vh) = _n; } { this->property(vertex_normals_, _vh) = _n; }
//------------------------------------------------------------- vertex colors //------------------------------------------------------------- vertex colors
const Color* vertex_colors() const const Color* vertex_colors() const
{ return property(vertex_colors_).data(); } { return this->property(vertex_colors_).data(); }
const Color& color(VertexHandle _vh) const const Color& color(VertexHandle _vh) const
{ return property(vertex_colors_, _vh); } { return this->property(vertex_colors_, _vh); }
void set_color(VertexHandle _vh, const Color& _c) void set_color(VertexHandle _vh, const Color& _c)
{ property(vertex_colors_, _vh) = _c; } { this->property(vertex_colors_, _vh) = _c; }
//------------------------------------------------------- vertex 1D texcoords //------------------------------------------------------- vertex 1D texcoords
const TexCoord1D* texcoords1D() const { const TexCoord1D* texcoords1D() const {
return property(vertex_texcoords1D_).data(); return this->property(vertex_texcoords1D_).data();
} }
const TexCoord1D& texcoord1D(VertexHandle _vh) const { const TexCoord1D& texcoord1D(VertexHandle _vh) const {
return property(vertex_texcoords1D_, _vh); return this->property(vertex_texcoords1D_, _vh);
} }
void set_texcoord1D(VertexHandle _vh, const TexCoord1D& _t) { void set_texcoord1D(VertexHandle _vh, const TexCoord1D& _t) {
property(vertex_texcoords1D_, _vh) = _t; this->property(vertex_texcoords1D_, _vh) = _t;
} }
//------------------------------------------------------- vertex 2D texcoords //------------------------------------------------------- vertex 2D texcoords
const TexCoord2D* texcoords2D() const { const TexCoord2D* texcoords2D() const {
return property(vertex_texcoords2D_).data(); return this->property(vertex_texcoords2D_).data();
} }
const TexCoord2D& texcoord2D(VertexHandle _vh) const { const TexCoord2D& texcoord2D(VertexHandle _vh) const {
return property(vertex_texcoords2D_, _vh); return this->property(vertex_texcoords2D_, _vh);
} }
void set_texcoord2D(VertexHandle _vh, const TexCoord2D& _t) { void set_texcoord2D(VertexHandle _vh, const TexCoord2D& _t) {
property(vertex_texcoords2D_, _vh) = _t; this->property(vertex_texcoords2D_, _vh) = _t;
} }
//------------------------------------------------------- vertex 3D texcoords //------------------------------------------------------- vertex 3D texcoords
const TexCoord3D* texcoords3D() const { const TexCoord3D* texcoords3D() const {
return property(vertex_texcoords3D_).data(); return this->property(vertex_texcoords3D_).data();
} }
const TexCoord3D& texcoord3D(VertexHandle _vh) const { const TexCoord3D& texcoord3D(VertexHandle _vh) const {
return property(vertex_texcoords3D_, _vh); return this->property(vertex_texcoords3D_, _vh);
} }
void set_texcoord3D(VertexHandle _vh, const TexCoord3D& _t) { void set_texcoord3D(VertexHandle _vh, const TexCoord3D& _t) {
property(vertex_texcoords3D_, _vh) = _t; this->property(vertex_texcoords3D_, _vh) = _t;
} }
//.------------------------------------------------------ halfedge 1D texcoords //.------------------------------------------------------ halfedge 1D texcoords
const TexCoord1D* htexcoords1D() const { const TexCoord1D* htexcoords1D() const {
return property(halfedge_texcoords1D_).data(); return this->property(halfedge_texcoords1D_).data();
} }
const TexCoord1D& texcoord1D(HalfedgeHandle _heh) const { const TexCoord1D& texcoord1D(HalfedgeHandle _heh) const {
return property(halfedge_texcoords1D_, _heh); return this->property(halfedge_texcoords1D_, _heh);
} }
void set_texcoord1D(HalfedgeHandle _heh, const TexCoord1D& _t) { void set_texcoord1D(HalfedgeHandle _heh, const TexCoord1D& _t) {
property(halfedge_texcoords1D_, _heh) = _t; this->property(halfedge_texcoords1D_, _heh) = _t;
} }
//------------------------------------------------------- halfedge 2D texcoords //------------------------------------------------------- halfedge 2D texcoords
const TexCoord2D* htexcoords2D() const { const TexCoord2D* htexcoords2D() const {
return property(halfedge_texcoords2D_).data(); return this->property(halfedge_texcoords2D_).data();
} }
const TexCoord2D& texcoord2D(HalfedgeHandle _heh) const { const TexCoord2D& texcoord2D(HalfedgeHandle _heh) const {
return property(halfedge_texcoords2D_, _heh); return this->property(halfedge_texcoords2D_, _heh);
} }
void set_texcoord2D(HalfedgeHandle _heh, const TexCoord2D& _t) { void set_texcoord2D(HalfedgeHandle _heh, const TexCoord2D& _t) {
property(halfedge_texcoords2D_, _heh) = _t; this->property(halfedge_texcoords2D_, _heh) = _t;
} }
//------------------------------------------------------- halfedge 3D texcoords //------------------------------------------------------- halfedge 3D texcoords
const TexCoord3D* htexcoords3D() const { const TexCoord3D* htexcoords3D() const {
return property(halfedge_texcoords3D_).data(); return this->property(halfedge_texcoords3D_).data();
} }
const TexCoord3D& texcoord3D(HalfedgeHandle _heh) const { const TexCoord3D& texcoord3D(HalfedgeHandle _heh) const {
return property(halfedge_texcoords3D_, _heh); return this->property(halfedge_texcoords3D_, _heh);
} }
void set_texcoord3D(HalfedgeHandle _heh, const TexCoord3D& _t) { void set_texcoord3D(HalfedgeHandle _heh, const TexCoord3D& _t) {
property(halfedge_texcoords3D_, _heh) = _t; this->property(halfedge_texcoords3D_, _heh) = _t;
} }
//------------------------------------------------------------- edge colors //------------------------------------------------------------- edge colors
const Color* edge_colors() const const Color* edge_colors() const
{ return property(edge_colors_).data(); } { return this->property(edge_colors_).data(); }
const Color& color(EdgeHandle _eh) const const Color& color(EdgeHandle _eh) const
{ return property(edge_colors_, _eh); } { return this->property(edge_colors_, _eh); }
void set_color(EdgeHandle _eh, const Color& _c) void set_color(EdgeHandle _eh, const Color& _c)
{ property(edge_colors_, _eh) = _c; } { this->property(edge_colors_, _eh) = _c; }
//------------------------------------------------------------- halfedge normals //------------------------------------------------------------- halfedge normals
const Normal& normal(HalfedgeHandle _heh) const const Normal& normal(HalfedgeHandle _heh) const
{ return property(halfedge_normals_, _heh); } { return this->property(halfedge_normals_, _heh); }
void set_normal(HalfedgeHandle _heh, const Normal& _n) void set_normal(HalfedgeHandle _heh, const Normal& _n)
{ property(halfedge_normals_, _heh) = _n; } { this->property(halfedge_normals_, _heh) = _n; }
//------------------------------------------------------------- halfedge colors //------------------------------------------------------------- halfedge colors
const Color* halfedge_colors() const const Color* halfedge_colors() const
{ return property(halfedge_colors_).data(); } { return this->property(halfedge_colors_).data(); }
const Color& color(HalfedgeHandle _heh) const const Color& color(HalfedgeHandle _heh) const
{ return property(halfedge_colors_, _heh); } { return this->property(halfedge_colors_, _heh); }
void set_color(HalfedgeHandle _heh, const Color& _c) void set_color(HalfedgeHandle _heh, const Color& _c)
{ property(halfedge_colors_, _heh) = _c; } { this->property(halfedge_colors_, _heh) = _c; }
//-------------------------------------------------------------- face normals //-------------------------------------------------------------- face normals
const Normal& normal(FaceHandle _fh) const const Normal& normal(FaceHandle _fh) const
{ return property(face_normals_, _fh); } { return this->property(face_normals_, _fh); }
void set_normal(FaceHandle _fh, const Normal& _n) void set_normal(FaceHandle _fh, const Normal& _n)
{ property(face_normals_, _fh) = _n; } { this->property(face_normals_, _fh) = _n; }
//-------------------------------------------------------------- per Face Texture index //-------------------------------------------------------------- per Face Texture index
const TextureIndex& texture_index(FaceHandle _fh) const const TextureIndex& texture_index(FaceHandle _fh) const
{ return property(face_texture_index_, _fh); } { return this->property(face_texture_index_, _fh); }
void set_texture_index(FaceHandle _fh, const TextureIndex& _t) void set_texture_index(FaceHandle _fh, const TextureIndex& _t)
{ property(face_texture_index_, _fh) = _t; } { this->property(face_texture_index_, _fh) = _t; }
//--------------------------------------------------------------- face colors //--------------------------------------------------------------- face colors
const Color& color(FaceHandle _fh) const const Color& color(FaceHandle _fh) const
{ return property(face_colors_, _fh); } { return this->property(face_colors_, _fh); }
void set_color(FaceHandle _fh, const Color& _c) void set_color(FaceHandle _fh, const Color& _c)
{ property(face_colors_, _fh) = _c; } { this->property(face_colors_, _fh) = _c; }
//------------------------------------------------ request / alloc properties //------------------------------------------------ request / alloc properties
void request_vertex_normals() void request_vertex_normals()
{ {
if (!refcount_vnormals_++) if (!refcount_vnormals_++)
add_property( vertex_normals_, "v:normals" ); this->add_property( vertex_normals_, "v:normals" );
} }
void request_vertex_colors() void request_vertex_colors()
{ {
if (!refcount_vcolors_++) if (!refcount_vcolors_++)
add_property( vertex_colors_, "v:colors" ); this->add_property( vertex_colors_, "v:colors" );
} }
void request_vertex_texcoords1D() void request_vertex_texcoords1D()
{ {
if (!refcount_vtexcoords1D_++) if (!refcount_vtexcoords1D_++)
add_property( vertex_texcoords1D_, "v:texcoords1D" ); this->add_property( vertex_texcoords1D_, "v:texcoords1D" );
} }
void request_vertex_texcoords2D() void request_vertex_texcoords2D()
{ {
if (!refcount_vtexcoords2D_++) if (!refcount_vtexcoords2D_++)
add_property( vertex_texcoords2D_, "v:texcoords2D" ); this->add_property( vertex_texcoords2D_, "v:texcoords2D" );
} }
void request_vertex_texcoords3D() void request_vertex_texcoords3D()
{ {
if (!refcount_vtexcoords3D_++) if (!refcount_vtexcoords3D_++)
add_property( vertex_texcoords3D_, "v:texcoords3D" ); this->add_property( vertex_texcoords3D_, "v:texcoords3D" );
} }
void request_halfedge_texcoords1D() void request_halfedge_texcoords1D()
{ {
if (!refcount_htexcoords1D_++) if (!refcount_htexcoords1D_++)
add_property( halfedge_texcoords1D_, "h:texcoords1D" ); this->add_property( halfedge_texcoords1D_, "h:texcoords1D" );
} }
void request_halfedge_texcoords2D() void request_halfedge_texcoords2D()
{ {
if (!refcount_htexcoords2D_++) if (!refcount_htexcoords2D_++)
add_property( halfedge_texcoords2D_, "h:texcoords2D" ); this->add_property( halfedge_texcoords2D_, "h:texcoords2D" );
} }
void request_halfedge_texcoords3D() void request_halfedge_texcoords3D()
{ {
if (!refcount_htexcoords3D_++) if (!refcount_htexcoords3D_++)
add_property( halfedge_texcoords3D_, "h:texcoords3D" ); this->add_property( halfedge_texcoords3D_, "h:texcoords3D" );
} }
void request_edge_colors() void request_edge_colors()
{ {
if (!refcount_ecolors_++) if (!refcount_ecolors_++)
add_property( edge_colors_, "e:colors" ); this->add_property( edge_colors_, "e:colors" );
} }
void request_halfedge_normals() void request_halfedge_normals()
{ {
if (!refcount_henormals_++) if (!refcount_henormals_++)
add_property( halfedge_normals_, "h:normals" ); this->add_property( halfedge_normals_, "h:normals" );
} }
void request_halfedge_colors() void request_halfedge_colors()
{ {
if (!refcount_hecolors_++) if (!refcount_hecolors_++)
add_property( halfedge_colors_, "h:colors" ); this->add_property( halfedge_colors_, "h:colors" );
} }
void request_face_normals() void request_face_normals()
{ {
if (!refcount_fnormals_++) if (!refcount_fnormals_++)
add_property( face_normals_, "f:normals" ); this->add_property( face_normals_, "f:normals" );
} }
void request_face_colors() void request_face_colors()
{ {
if (!refcount_fcolors_++) if (!refcount_fcolors_++)
add_property( face_colors_, "f:colors" ); this->add_property( face_colors_, "f:colors" );
} }
void request_face_texture_index() void request_face_texture_index()
{ {
if (!refcount_ftextureIndex_++) if (!refcount_ftextureIndex_++)
add_property( face_texture_index_, "f:textureindex" ); this->add_property( face_texture_index_, "f:textureindex" );
} }
//------------------------------------------------- release / free properties //------------------------------------------------- release / free properties
@@ -538,79 +489,79 @@ public:
void release_vertex_normals() void release_vertex_normals()
{ {
if ((refcount_vnormals_ > 0) && (! --refcount_vnormals_)) if ((refcount_vnormals_ > 0) && (! --refcount_vnormals_))
remove_property(vertex_normals_); this->remove_property(vertex_normals_);
} }
void release_vertex_colors() void release_vertex_colors()
{ {
if ((refcount_vcolors_ > 0) && (! --refcount_vcolors_)) if ((refcount_vcolors_ > 0) && (! --refcount_vcolors_))
remove_property(vertex_colors_); this->remove_property(vertex_colors_);
} }
void release_vertex_texcoords1D() { void release_vertex_texcoords1D() {
if ((refcount_vtexcoords1D_ > 0) && (! --refcount_vtexcoords1D_)) if ((refcount_vtexcoords1D_ > 0) && (! --refcount_vtexcoords1D_))
remove_property(vertex_texcoords1D_); this->remove_property(vertex_texcoords1D_);
} }
void release_vertex_texcoords2D() { void release_vertex_texcoords2D() {
if ((refcount_vtexcoords2D_ > 0) && (! --refcount_vtexcoords2D_)) if ((refcount_vtexcoords2D_ > 0) && (! --refcount_vtexcoords2D_))
remove_property(vertex_texcoords2D_); this->remove_property(vertex_texcoords2D_);
} }
void release_vertex_texcoords3D() { void release_vertex_texcoords3D() {
if ((refcount_vtexcoords3D_ > 0) && (! --refcount_vtexcoords3D_)) if ((refcount_vtexcoords3D_ > 0) && (! --refcount_vtexcoords3D_))
remove_property(vertex_texcoords3D_); this->remove_property(vertex_texcoords3D_);
} }
void release_halfedge_texcoords1D() { void release_halfedge_texcoords1D() {
if ((refcount_htexcoords1D_ > 0) && (! --refcount_htexcoords1D_)) if ((refcount_htexcoords1D_ > 0) && (! --refcount_htexcoords1D_))
remove_property(halfedge_texcoords1D_); this->remove_property(halfedge_texcoords1D_);
} }
void release_halfedge_texcoords2D() { void release_halfedge_texcoords2D() {
if ((refcount_htexcoords2D_ > 0) && (! --refcount_htexcoords2D_)) if ((refcount_htexcoords2D_ > 0) && (! --refcount_htexcoords2D_))
remove_property(halfedge_texcoords2D_); this->remove_property(halfedge_texcoords2D_);
} }
void release_halfedge_texcoords3D() { void release_halfedge_texcoords3D() {
if ((refcount_htexcoords3D_ > 0) && (! --refcount_htexcoords3D_)) if ((refcount_htexcoords3D_ > 0) && (! --refcount_htexcoords3D_))
remove_property(halfedge_texcoords3D_); this->remove_property(halfedge_texcoords3D_);
} }
void release_edge_colors() void release_edge_colors()
{ {
if ((refcount_ecolors_ > 0) && (! --refcount_ecolors_)) if ((refcount_ecolors_ > 0) && (! --refcount_ecolors_))
remove_property(edge_colors_); this->remove_property(edge_colors_);
} }
void release_halfedge_normals() void release_halfedge_normals()
{ {
if ((refcount_henormals_ > 0) && (! --refcount_henormals_)) if ((refcount_henormals_ > 0) && (! --refcount_henormals_))
remove_property(halfedge_normals_); this->remove_property(halfedge_normals_);
} }
void release_halfedge_colors() void release_halfedge_colors()
{ {
if ((refcount_hecolors_ > 0) && (! --refcount_hecolors_)) if ((refcount_hecolors_ > 0) && (! --refcount_hecolors_))
remove_property(halfedge_colors_); this->remove_property(halfedge_colors_);
} }
void release_face_normals() void release_face_normals()
{ {
if ((refcount_fnormals_ > 0) && (! --refcount_fnormals_)) if ((refcount_fnormals_ > 0) && (! --refcount_fnormals_))
remove_property(face_normals_); this->remove_property(face_normals_);
} }
void release_face_colors() void release_face_colors()
{ {
if ((refcount_fcolors_ > 0) && (! --refcount_fcolors_)) if ((refcount_fcolors_ > 0) && (! --refcount_fcolors_))
remove_property(face_colors_); this->remove_property(face_colors_);
} }
void release_face_texture_index() void release_face_texture_index()
{ {
if ((refcount_ftextureIndex_ > 0) && (! --refcount_ftextureIndex_)) if ((refcount_ftextureIndex_ > 0) && (! --refcount_ftextureIndex_))
remove_property(face_texture_index_); this->remove_property(face_texture_index_);
} }
//---------------------------------------------- dynamic check for properties //---------------------------------------------- dynamic check for properties
@@ -702,28 +653,28 @@ public:
{ return face_texture_index_; } { return face_texture_index_; }
VertexData& data(VertexHandle _vh) VertexData& data(VertexHandle _vh)
{ return property(data_vpph_, _vh); } { return this->property(data_vpph_, _vh); }
const VertexData& data(VertexHandle _vh) const const VertexData& data(VertexHandle _vh) const
{ return property(data_vpph_, _vh); } { return this->property(data_vpph_, _vh); }
FaceData& data(FaceHandle _fh) FaceData& data(FaceHandle _fh)
{ return property(data_fpph_, _fh); } { return this->property(data_fpph_, _fh); }
const FaceData& data(FaceHandle _fh) const const FaceData& data(FaceHandle _fh) const
{ return property(data_fpph_, _fh); } { return this->property(data_fpph_, _fh); }
EdgeData& data(EdgeHandle _eh) EdgeData& data(EdgeHandle _eh)
{ return property(data_epph_, _eh); } { return this->property(data_epph_, _eh); }
const EdgeData& data(EdgeHandle _eh) const const EdgeData& data(EdgeHandle _eh) const
{ return property(data_epph_, _eh); } { return this->property(data_epph_, _eh); }
HalfedgeData& data(HalfedgeHandle _heh) HalfedgeData& data(HalfedgeHandle _heh)
{ return property(data_hpph_, _heh); } { return this->property(data_hpph_, _heh); }
const HalfedgeData& data(HalfedgeHandle _heh) const const HalfedgeData& data(HalfedgeHandle _heh) const
{ return property(data_hpph_, _heh); } { return this->property(data_hpph_, _heh); }
private: private:
//standard vertex properties //standard vertex properties

View File

@@ -94,12 +94,12 @@ PolyMeshT<Kernel>::
calc_face_normal(FaceHandle _fh) const calc_face_normal(FaceHandle _fh) const
{ {
assert(halfedge_handle(_fh).is_valid()); assert(halfedge_handle(_fh).is_valid());
ConstFaceVertexIter fv_it(cfv_iter(_fh)); ConstFaceVertexIter fv_it(this->cfv_iter(_fh));
Point p0 = point(fv_it); Point p0 = this->point(fv_it);
Point p0i = p0; //save point of vertex 0 Point p0i = p0; //save point of vertex 0
++fv_it; ++fv_it;
Point p1 = point(fv_it); Point p1 = this->point(fv_it);
Point p1i = p1; //save point of vertex 1 Point p1i = p1; //save point of vertex 1
++fv_it; ++fv_it;
Point p2; Point p2;
@@ -108,7 +108,7 @@ calc_face_normal(FaceHandle _fh) const
Normal n(0,0,0); Normal n(0,0,0);
for(; fv_it; ++fv_it) for(; fv_it; ++fv_it)
{ {
p2 = point(fv_it); p2 = this->point(fv_it);
n += vector_cast<Normal>(calc_face_normal(p0, p1, p2)); n += vector_cast<Normal>(calc_face_normal(p0, p1, p2));
p0 = p1; p0 = p1;
p1 = p2; p1 = p2;
@@ -170,9 +170,9 @@ calc_face_centroid(FaceHandle _fh, Point& _pt) const
{ {
_pt.vectorize(0); _pt.vectorize(0);
uint valence = 0; uint valence = 0;
for (ConstFaceVertexIter cfv_it = cfv_iter(_fh); cfv_it; ++cfv_it, ++valence) for (ConstFaceVertexIter cfv_it = this->cfv_iter(_fh); cfv_it; ++cfv_it, ++valence)
{ {
_pt += point(cfv_it); _pt += this->point(cfv_it);
} }
_pt /= valence; _pt /= valence;
} }
@@ -201,7 +201,7 @@ update_face_normals()
FaceIter f_it(Kernel::faces_begin()), f_end(Kernel::faces_end()); FaceIter f_it(Kernel::faces_begin()), f_end(Kernel::faces_end());
for (; f_it != f_end; ++f_it) for (; f_it != f_end; ++f_it)
set_normal(f_it.handle(), calc_face_normal(f_it.handle())); this->set_normal(f_it.handle(), calc_face_normal(f_it.handle()));
} }
@@ -216,7 +216,7 @@ update_halfedge_normals(const double _feature_angle)
HalfedgeIter h_it(Kernel::halfedges_begin()), h_end(Kernel::halfedges_end()); HalfedgeIter h_it(Kernel::halfedges_begin()), h_end(Kernel::halfedges_end());
for (; h_it != h_end; ++h_it) for (; h_it != h_end; ++h_it)
set_normal(h_it.handle(), calc_halfedge_normal(h_it.handle(), _feature_angle)); this->set_normal(h_it.handle(), calc_halfedge_normal(h_it.handle(), _feature_angle));
} }
@@ -324,8 +324,8 @@ void PolyMeshT<Kernel>::
calc_vertex_normal_fast(VertexHandle _vh, Normal& _n) const calc_vertex_normal_fast(VertexHandle _vh, Normal& _n) const
{ {
_n.vectorize(0.0); _n.vectorize(0.0);
for (ConstVertexFaceIter vf_it=cvf_iter(_vh); vf_it; ++vf_it) for (ConstVertexFaceIter vf_it=this->cvf_iter(_vh); vf_it; ++vf_it)
_n += normal(vf_it.handle()); _n += this->normal(vf_it.handle());
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -370,8 +370,8 @@ calc_vertex_normal_loop(VertexHandle _vh, Normal& _n) const
for (ConstVertexOHalfedgeIter cvoh_it = cvoh_iter(_vh); cvoh_it; ++cvoh_it, ++i) for (ConstVertexOHalfedgeIter cvoh_it = cvoh_iter(_vh); cvoh_it; ++cvoh_it, ++i)
{ {
VertexHandle r1_v(to_vertex_handle(cvoh_it)); VertexHandle r1_v(to_vertex_handle(cvoh_it));
t_v += (typename Point::value_type)(loop_scheme_mask__.tang0_weight(vh_val, i))*point(r1_v); t_v += (typename Point::value_type)(loop_scheme_mask__.tang0_weight(vh_val, i))*this->point(r1_v);
t_w += (typename Point::value_type)(loop_scheme_mask__.tang1_weight(vh_val, i))*point(r1_v); t_w += (typename Point::value_type)(loop_scheme_mask__.tang1_weight(vh_val, i))*this->point(r1_v);
} }
_n = cross(t_w, t_v);//hack: should be cross(t_v, t_w), but then the normals are reversed? _n = cross(t_w, t_v);//hack: should be cross(t_v, t_w), but then the normals are reversed?
} }
@@ -387,7 +387,7 @@ update_vertex_normals()
VertexIter v_it(Kernel::vertices_begin()), v_end(Kernel::vertices_end()); VertexIter v_it(Kernel::vertices_begin()), v_end(Kernel::vertices_end());
for (; v_it!=v_end; ++v_it) for (; v_it!=v_end; ++v_it)
set_normal(v_it.handle(), calc_vertex_normal(v_it.handle())); this->set_normal(v_it.handle(), calc_vertex_normal(v_it.handle()));
} }
//============================================================================= //=============================================================================

View File

@@ -192,7 +192,7 @@ public:
inline VertexHandle new_vertex(const Point& _p) inline VertexHandle new_vertex(const Point& _p)
{ {
VertexHandle vh(Kernel::new_vertex()); VertexHandle vh(Kernel::new_vertex());
set_point(vh, _p); this->set_point(vh, _p);
return vh; return vh;
} }
@@ -211,7 +211,7 @@ public:
/// Update normal for face _fh /// Update normal for face _fh
void update_normal(FaceHandle _fh) void update_normal(FaceHandle _fh)
{ set_normal(_fh, calc_face_normal(_fh)); } { this->set_normal(_fh, calc_face_normal(_fh)); }
/** Update normal vectors for all faces. /** Update normal vectors for all faces.
\attention Needs the Attributes::Normal attribute for faces. */ \attention Needs the Attributes::Normal attribute for faces. */
@@ -228,7 +228,7 @@ public:
/// Update normal for halfedge _heh /// Update normal for halfedge _heh
void update_normal(HalfedgeHandle _heh, const double _feature_angle = 0.8) void update_normal(HalfedgeHandle _heh, const double _feature_angle = 0.8)
{ set_normal(_heh, calc_halfedge_normal(_heh)); } { this->set_normal(_heh, calc_halfedge_normal(_heh)); }
/** Update normal vectors for all halfedges. /** Update normal vectors for all halfedges.
\attention Needs the Attributes::Normal attribute for faces. */ \attention Needs the Attributes::Normal attribute for faces. */
@@ -245,7 +245,7 @@ public:
/// Update normal for vertex _vh /// Update normal for vertex _vh
void update_normal(VertexHandle _vh) void update_normal(VertexHandle _vh)
{ set_normal(_vh, calc_vertex_normal(_vh)); } { this->set_normal(_vh, calc_vertex_normal(_vh)); }
/** \brief Update normal vectors for all vertices. /** \brief Update normal vectors for all vertices.

View File

@@ -72,11 +72,11 @@ TriMeshT<Kernel>::
calc_face_normal(FaceHandle _fh) const calc_face_normal(FaceHandle _fh) const
{ {
assert(halfedge_handle(_fh).is_valid()); assert(halfedge_handle(_fh).is_valid());
ConstFaceVertexIter fv_it(cfv_iter(_fh)); ConstFaceVertexIter fv_it(this->cfv_iter(_fh));
const Point& p0(point(fv_it)); ++fv_it; const Point& p0(this->point(fv_it)); ++fv_it;
const Point& p1(point(fv_it)); ++fv_it; const Point& p1(this->point(fv_it)); ++fv_it;
const Point& p2(point(fv_it)); const Point& p2(this->point(fv_it));
return PolyMesh::calc_face_normal(p0, p1, p2); return PolyMesh::calc_face_normal(p0, p1, p2);
} }

View File

@@ -104,16 +104,16 @@ compute_new_positions_C0()
for (v_it=Base::mesh_.vertices_begin(); v_it!=v_end; ++v_it) for (v_it=Base::mesh_.vertices_begin(); v_it!=v_end; ++v_it)
{ {
if (is_active(v_it)) if (this->is_active(v_it))
{ {
// compute umbrella // compute umbrella
u = zero; u = zero;
for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it; ++vv_it) for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it; ++vv_it)
{ {
w = weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle())); w = this->weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle()));
u += vector_cast<typename Mesh::Normal>(Base::mesh_.point(vv_it)) * w; u += vector_cast<typename Mesh::Normal>(Base::mesh_.point(vv_it)) * w;
} }
u *= weight(v_it); u *= this->weight(v_it);
u -= vector_cast<typename Mesh::Normal>(Base::mesh_.point(v_it)); u -= vector_cast<typename Mesh::Normal>(Base::mesh_.point(v_it));
// damping // damping
@@ -122,7 +122,7 @@ compute_new_positions_C0()
// store new position // store new position
p = vector_cast<typename Mesh::Normal>(Base::mesh_.point(v_it)); p = vector_cast<typename Mesh::Normal>(Base::mesh_.point(v_it));
p += u; p += u;
set_new_position(v_it, p); this->set_new_position(v_it, p);
} }
} }
} }
@@ -148,10 +148,10 @@ compute_new_positions_C1()
u = zero; u = zero;
for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it; ++vv_it) for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it; ++vv_it)
{ {
w = weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle())); w = this->weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle()));
u -= vector_cast<typename Mesh::Normal>(Base::mesh_.point(vv_it))*w; u -= vector_cast<typename Mesh::Normal>(Base::mesh_.point(vv_it))*w;
} }
u *= weight(v_it); u *= this->weight(v_it);
u += vector_cast<typename Mesh::Normal>(Base::mesh_.point(v_it)); u += vector_cast<typename Mesh::Normal>(Base::mesh_.point(v_it));
Base::mesh_.property(umbrellas_, v_it) = u; Base::mesh_.property(umbrellas_, v_it) = u;
@@ -161,18 +161,18 @@ compute_new_positions_C1()
// 2nd pass: compute updates // 2nd pass: compute updates
for (v_it=Base::mesh_.vertices_begin(); v_it!=v_end; ++v_it) for (v_it=Base::mesh_.vertices_begin(); v_it!=v_end; ++v_it)
{ {
if (is_active(v_it)) if (this->is_active(v_it))
{ {
uu = zero; uu = zero;
diag = 0.0; diag = 0.0;
for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it; ++vv_it) for (vv_it=Base::mesh_.cvv_iter(v_it); vv_it; ++vv_it)
{ {
w = weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle())); w = this->weight(Base::mesh_.edge_handle(vv_it.current_halfedge_handle()));
uu -= Base::mesh_.property(umbrellas_, vv_it); uu -= Base::mesh_.property(umbrellas_, vv_it);
diag += (w * weight(vv_it) + 1.0) * w; diag += (w * this->weight(vv_it) + 1.0) * w;
} }
uu *= weight(v_it); uu *= this->weight(v_it);
diag *= weight(v_it); diag *= this->weight(v_it);
uu += Base::mesh_.property(umbrellas_, v_it); uu += Base::mesh_.property(umbrellas_, v_it);
if (diag) uu *= 1.0/diag; if (diag) uu *= 1.0/diag;
@@ -182,7 +182,7 @@ compute_new_positions_C1()
// store new position // store new position
p = vector_cast<typename Mesh::Normal>(Base::mesh_.point(v_it)); p = vector_cast<typename Mesh::Normal>(Base::mesh_.point(v_it));
p -= uu; p -= uu;
set_new_position(v_it, p); this->set_new_position(v_it, p);
} }
} }
} }

View File

@@ -98,7 +98,7 @@ Tvv3<M>::raise(typename M::FaceHandle& _fh, state_t _target_state)
{ {
if (MOBJ(_fh).state() < _target_state) if (MOBJ(_fh).state() < _target_state)
{ {
update(_fh, _target_state); this->update(_fh, _target_state);
typename M::VertexVertexIter vv_it; typename M::VertexVertexIter vv_it;
typename M::FaceVertexIter fv_it; typename M::FaceVertexIter fv_it;
@@ -314,7 +314,7 @@ void Tvv3<M>::raise(typename M::VertexHandle& _vh, state_t _target_state) {
if (MOBJ(_vh).state() < _target_state) { if (MOBJ(_vh).state() < _target_state) {
update(_vh, _target_state); this->update(_vh, _target_state);
// multiply old position by 3 // multiply old position by 3
MOBJ(_vh).set_position(_target_state, MOBJ(_vh).position(_target_state - 1) * 3.0); MOBJ(_vh).set_position(_target_state, MOBJ(_vh).position(_target_state - 1) * 3.0);
@@ -336,7 +336,7 @@ Tvv4<M>::raise(typename M::FaceHandle& _fh, state_t _target_state)
if (MOBJ(_fh).state() < _target_state) { if (MOBJ(_fh).state() < _target_state) {
update(_fh, _target_state); this->update(_fh, _target_state);
typename M::FaceVertexIter fv_it; typename M::FaceVertexIter fv_it;
typename M::VertexHandle temp_vh; typename M::VertexHandle temp_vh;
@@ -638,7 +638,7 @@ Tvv4<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
if (MOBJ(_vh).state() < _target_state) if (MOBJ(_vh).state() < _target_state)
{ {
update(_vh, _target_state); this->update(_vh, _target_state);
// multiply old position by 4 // multiply old position by 4
MOBJ(_vh).set_position(_target_state, MOBJ(_vh).position(_target_state - 1) * 4.0); MOBJ(_vh).set_position(_target_state, MOBJ(_vh).position(_target_state - 1) * 4.0);
@@ -654,7 +654,7 @@ Tvv4<M>::raise(typename M::EdgeHandle& _eh, state_t _target_state)
{ {
if (MOBJ(_eh).state() < _target_state) if (MOBJ(_eh).state() < _target_state)
{ {
update(_eh, _target_state); this->update(_eh, _target_state);
typename M::FaceHandle fh(Base::mesh_.FH(Base::mesh_.HEH(_eh, 0))); typename M::FaceHandle fh(Base::mesh_.FH(Base::mesh_.HEH(_eh, 0)));
@@ -815,7 +815,7 @@ void VF<M>::raise(typename M::FaceHandle& _fh, state_t _target_state)
{ {
if (MOBJ(_fh).state() < _target_state) { if (MOBJ(_fh).state() < _target_state) {
update(_fh, _target_state); this->update(_fh, _target_state);
// raise all neighbour vertices to level x-1 // raise all neighbour vertices to level x-1
typename M::FaceVertexIter fv_it; typename M::FaceVertexIter fv_it;
@@ -872,7 +872,7 @@ void FF<M>::raise(typename M::FaceHandle& _fh, state_t _target_state) {
if (MOBJ(_fh).state() < _target_state) { if (MOBJ(_fh).state() < _target_state) {
update(_fh, _target_state); this->update(_fh, _target_state);
// raise all neighbour faces to level x-1 // raise all neighbour faces to level x-1
typename M::FaceFaceIter ff_it; typename M::FaceFaceIter ff_it;
@@ -936,7 +936,7 @@ void FFc<M>::raise(typename M::FaceHandle& _fh, state_t _target_state)
{ {
if (MOBJ(_fh).state() < _target_state) { if (MOBJ(_fh).state() < _target_state) {
update(_fh, _target_state); this->update(_fh, _target_state);
// raise all neighbour faces to level x-1 // raise all neighbour faces to level x-1
typename M::FaceFaceIter ff_it(Base::mesh_.ff_iter(_fh)); typename M::FaceFaceIter ff_it(Base::mesh_.ff_iter(_fh));
@@ -1001,7 +1001,7 @@ void FV<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
if (MOBJ(_vh).state() < _target_state) { if (MOBJ(_vh).state() < _target_state) {
update(_vh, _target_state); this->update(_vh, _target_state);
// raise all neighbour vertices to level x-1 // raise all neighbour vertices to level x-1
typename M::VertexFaceIter vf_it(Base::mesh_.vf_iter(_vh)); typename M::VertexFaceIter vf_it(Base::mesh_.vf_iter(_vh));
@@ -1070,7 +1070,7 @@ void FVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
{ {
if (MOBJ(_vh).state() < _target_state) { if (MOBJ(_vh).state() < _target_state) {
update(_vh, _target_state); this->update(_vh, _target_state);
typename M::VertexOHalfedgeIter voh_it; typename M::VertexOHalfedgeIter voh_it;
typename M::FaceHandle fh; typename M::FaceHandle fh;
@@ -1245,7 +1245,7 @@ void VV<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
{ {
if (MOBJ(_vh).state() < _target_state) if (MOBJ(_vh).state() < _target_state)
{ {
update(_vh, _target_state); this->update(_vh, _target_state);
// raise all neighbour vertices to level x-1 // raise all neighbour vertices to level x-1
typename M::VertexVertexIter vv_it(Base::mesh_.vv_iter(_vh)); typename M::VertexVertexIter vv_it(Base::mesh_.vv_iter(_vh));
@@ -1315,7 +1315,7 @@ void VVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
{ {
if (MOBJ(_vh).state() < _target_state) { if (MOBJ(_vh).state() < _target_state) {
update(_vh, _target_state); this->update(_vh, _target_state);
// raise all neighbour vertices to level x-1 // raise all neighbour vertices to level x-1
typename M::VertexVertexIter vv_it(Base::mesh_.vv_iter(_vh)); typename M::VertexVertexIter vv_it(Base::mesh_.vv_iter(_vh));
@@ -1390,7 +1390,7 @@ void VE<M>::raise(typename M::EdgeHandle& _eh, state_t _target_state)
{ {
if (MOBJ(_eh).state() < _target_state) { if (MOBJ(_eh).state() < _target_state) {
update(_eh, _target_state); this->update(_eh, _target_state);
// raise all neighbour vertices to level x-1 // raise all neighbour vertices to level x-1
typename M::VertexHandle vh; typename M::VertexHandle vh;
@@ -1432,7 +1432,7 @@ void VdE<M>::raise(typename M::EdgeHandle& _eh, state_t _target_state)
{ {
if (MOBJ(_eh).state() < _target_state) if (MOBJ(_eh).state() < _target_state)
{ {
update(_eh, _target_state); this->update(_eh, _target_state);
// raise all neighbour vertices to level x-1 // raise all neighbour vertices to level x-1
typename M::VertexHandle vh; typename M::VertexHandle vh;
@@ -1509,7 +1509,7 @@ VdEc<M>::raise(typename M::EdgeHandle& _eh, state_t _target_state)
{ {
if (MOBJ(_eh).state() < _target_state) if (MOBJ(_eh).state() < _target_state)
{ {
update(_eh, _target_state); this->update(_eh, _target_state);
// raise all neighbour vertices to level x-1 // raise all neighbour vertices to level x-1
typename M::VertexHandle vh; typename M::VertexHandle vh;
@@ -1585,7 +1585,7 @@ void EV<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
{ {
if (MOBJ(_vh).state() < _target_state) { if (MOBJ(_vh).state() < _target_state) {
update(_vh, _target_state); this->update(_vh, _target_state);
// raise all neighbour vertices to level x-1 // raise all neighbour vertices to level x-1
typename M::VertexEdgeIter ve_it(Base::mesh_.ve_iter(_vh)); typename M::VertexEdgeIter ve_it(Base::mesh_.ve_iter(_vh));
@@ -1661,7 +1661,7 @@ void EVc<M>::raise(typename M::VertexHandle& _vh, state_t _target_state)
{ {
if (MOBJ(_vh).state() < _target_state) if (MOBJ(_vh).state() < _target_state)
{ {
update(_vh, _target_state); this->update(_vh, _target_state);
// raise all neighbour vertices to level x-1 // raise all neighbour vertices to level x-1
typename M::VertexOHalfedgeIter voh_it; typename M::VertexOHalfedgeIter voh_it;
@@ -1783,7 +1783,7 @@ EF<M>::raise(typename M::FaceHandle& _fh, state_t _target_state) {
if (MOBJ(_fh).state() < _target_state) { if (MOBJ(_fh).state() < _target_state) {
update(_fh, _target_state); this->update(_fh, _target_state);
// raise all neighbour edges to level x-1 // raise all neighbour edges to level x-1
typename M::FaceEdgeIter fe_it(Base::mesh_.fe_iter(_fh)); typename M::FaceEdgeIter fe_it(Base::mesh_.fe_iter(_fh));
@@ -1853,7 +1853,7 @@ FE<M>::raise(typename M::EdgeHandle& _eh, state_t _target_state) {
if (MOBJ(_eh).state() < _target_state) { if (MOBJ(_eh).state() < _target_state) {
update(_eh, _target_state); this->update(_eh, _target_state);
// raise all neighbour faces to level x-1 // raise all neighbour faces to level x-1
typename M::FaceHandle fh; typename M::FaceHandle fh;
@@ -1898,7 +1898,7 @@ EdE<M>::raise(typename M::EdgeHandle& _eh, state_t _target_state) {
if (MOBJ(_eh).state() < _target_state) { if (MOBJ(_eh).state() < _target_state) {
update(_eh, _target_state); this->update(_eh, _target_state);
// raise all neighbour faces and edges to level x-1 // raise all neighbour faces and edges to level x-1
typename M::HalfedgeHandle hh1, hh2; typename M::HalfedgeHandle hh1, hh2;
@@ -1955,7 +1955,7 @@ EdEc<M>::raise(typename M::EdgeHandle& _eh, state_t _target_state)
{ {
if (MOBJ(_eh).state() < _target_state) { if (MOBJ(_eh).state() < _target_state) {
update(_eh, _target_state); this->update(_eh, _target_state);
// raise all neighbour faces and edges to level x-1 // raise all neighbour faces and edges to level x-1
typename M::HalfedgeHandle hh1, hh2; typename M::HalfedgeHandle hh1, hh2;

View File

@@ -172,7 +172,7 @@ public:
/// insert the entry _h /// insert the entry _h
void insert(HeapEntry _h) void insert(HeapEntry _h)
{ {
push_back(_h); this->push_back(_h);
upheap(size()-1); upheap(size()-1);
} }