📄 attribkernelt.hh
字号:
const StatusInfo& status(HalfedgeHandle _hh) const { return property(halfedge_status_, _hh); } StatusInfo& status(HalfedgeHandle _hh) { return property(halfedge_status_, _hh); } //--------------------------------------------------------------- edge status const StatusInfo& status(EdgeHandle _eh) const { return property(edge_status_, _eh); } StatusInfo& status(EdgeHandle _eh) { return property(edge_status_, _eh); } //--------------------------------------------------------------- face status const StatusInfo& status(FaceHandle _fh) const { return property(face_status_, _fh); } StatusInfo& status(FaceHandle _fh) { return property(face_status_, _fh); } //-------------------------------------------------------------- face normals const Normal& normal(FaceHandle _fh) const { return property(face_normals_, _fh); } void set_normal(FaceHandle _fh, const Normal& _n) { property(face_normals_, _fh) = _n; } //--------------------------------------------------------------- face colors const Color& color(FaceHandle _fh) const { return property(face_colors_, _fh); } void set_color(FaceHandle _fh, const Color& _c) { property(face_colors_, _fh) = _c; } //------------------------------------------------ request / alloc properties void request_vertex_normals() { if (!refcount_vnormals_++) add_property( vertex_normals_, "v:normals" ); } void request_vertex_colors() { if (!refcount_vcolors_++) add_property( vertex_colors_, "v:colors" ); } void request_vertex_texcoords1D() { if (!refcount_vtexcoords1D_++) add_property( vertex_texcoords1D_, "v:texcoords1D" ); } void request_vertex_texcoords2D() { if (!refcount_vtexcoords2D_++) add_property( vertex_texcoords2D_, "v:texcoords2D" ); } void request_vertex_texcoords3D() { if (!refcount_vtexcoords3D_++) add_property( vertex_texcoords3D_, "v:texcoords3D" ); } void request_vertex_status() { if (!refcount_vstatus_++) add_property( vertex_status_, "v:status" ); } void request_halfedge_status() { if (!refcount_hstatus_++) add_property( halfedge_status_, "h:status" ); } void request_edge_status() { if (!refcount_estatus_++) add_property( edge_status_, "e:status" ); } void request_face_normals() { if (!refcount_fnormals_++) add_property( face_normals_, "f:normals" ); } void request_face_colors() { if (!refcount_fcolors_++) add_property( face_colors_, "f:colors" ); } void request_face_status() { if (!refcount_fstatus_++) add_property( face_status_, "f:status" ); } //------------------------------------------------- release / free properties void release_vertex_normals() { if ((refcount_vnormals_ > 0) && (! --refcount_vnormals_)) remove_property(vertex_normals_); } void release_vertex_colors() { if ((refcount_vcolors_ > 0) && (! --refcount_vcolors_)) remove_property(vertex_colors_); } void release_vertex_texcoords1D() { if ((refcount_vtexcoords1D_ > 0) && (! --refcount_vtexcoords1D_)) remove_property(vertex_texcoords1D_); } void release_vertex_texcoords2D() { if ((refcount_vtexcoords2D_ > 0) && (! --refcount_vtexcoords2D_)) remove_property(vertex_texcoords2D_); } void release_vertex_texcoords3D() { if ((refcount_vtexcoords3D_ > 0) && (! --refcount_vtexcoords3D_)) remove_property(vertex_texcoords3D_); } void release_vertex_status() { if ((refcount_vstatus_ > 0) && (! --refcount_vstatus_)) remove_property(vertex_status_); } void release_halfedge_status() { if ((refcount_hstatus_ > 0) && (! --refcount_hstatus_)) remove_property(halfedge_status_); } void release_edge_status() { if ((refcount_estatus_ > 0) && (! --refcount_estatus_)) remove_property(edge_status_); } void release_face_normals() { if ((refcount_fnormals_ > 0) && (! --refcount_fnormals_)) remove_property(face_normals_); } void release_face_colors() { if ((refcount_fcolors_ > 0) && (! --refcount_fcolors_)) remove_property(face_colors_); } void release_face_status() { if ((refcount_fstatus_ > 0) && (! --refcount_fstatus_)) remove_property(face_status_); } //---------------------------------------------- dynamic check for properties bool has_vertex_normals() const { return vertex_normals_.is_valid(); } bool has_vertex_colors() const { return vertex_colors_.is_valid(); } bool has_vertex_texcoords1D() const { return vertex_texcoords1D_.is_valid();} bool has_vertex_texcoords2D() const { return vertex_texcoords2D_.is_valid();} bool has_vertex_texcoords3D() const { return vertex_texcoords3D_.is_valid();} bool has_vertex_status() const { return vertex_status_.is_valid(); } bool has_halfedge_status() const { return halfedge_status_.is_valid(); } bool has_edge_status() const { return edge_status_.is_valid(); } bool has_face_normals() const { return face_normals_.is_valid(); } bool has_face_colors() const { return face_colors_.is_valid(); } bool has_face_status() const { return face_status_.is_valid(); } static bool has_prev_halfedge() { return (HAttribs & Attributes::PrevHalfedge); }public: typedef VPropHandleT<Point> PointsPropertyHandle; typedef VPropHandleT<Normal> VertexNormalsPropertyHandle; typedef VPropHandleT<Color> VertexColorsPropertyHandle; typedef VPropHandleT<TexCoord1D> VertexTexCoords1DPropertyHandle; typedef VPropHandleT<TexCoord2D> VertexTexCoords2DPropertyHandle; typedef VPropHandleT<TexCoord3D> VertexTexCoords3DPropertyHandle; typedef VPropHandleT<StatusInfo> VertexStatusPropertyHandle; typedef HPropHandleT<StatusInfo> HalfedgeStatusPropertyHandle; typedef EPropHandleT<StatusInfo> EdgeStatusPropertyHandle; typedef FPropHandleT<Normal> FaceNormalsPropertyHandle; typedef FPropHandleT<Color> FaceColorsPropertyHandle; typedef FPropHandleT<StatusInfo> FaceStatusPropertyHandle;public: //standard vertex properties PointsPropertyHandle points_pph() const { return points_; } VertexNormalsPropertyHandle vertex_normals_pph() const { return vertex_normals_; } VertexColorsPropertyHandle vertex_colors_pph() const { return vertex_colors_; } VertexTexCoords1DPropertyHandle vertex_texcoords1D_pph() const { return AttribKernel::vertex_tex_coords_; } VertexTexCoords2DPropertyHandle vertex_texcoords2D_pph() const { return AttribKernel::vertex_tex_coords_; } VertexTexCoords3DPropertyHandle vertex_texcoords3D_pph() const { return AttribKernel::vertex_tex_coords_; } VertexStatusPropertyHandle vertex_status_pph() const { return vertex_status_; } //standard halfedge properties HalfedgeStatusPropertyHandle halfedge_status_pph() const { return halfedge_status_; } //standard edge properties EdgeStatusPropertyHandle edge_status_pph() const { return edge_status_; } //standard face properties FaceNormalsPropertyHandle face_normals_pph() const { return face_normals_; } FaceColorsPropertyHandle face_colors_pph() const { return face_colors_; } FaceStatusPropertyHandle face_status_pph() const { return face_status_; }private: //standard vertex properties PointsPropertyHandle points_; VertexNormalsPropertyHandle vertex_normals_; VertexColorsPropertyHandle vertex_colors_; VertexTexCoords1DPropertyHandle vertex_texcoords1D_; VertexTexCoords2DPropertyHandle vertex_texcoords2D_; VertexTexCoords3DPropertyHandle vertex_texcoords3D_; VertexStatusPropertyHandle vertex_status_; //standard halfedge properties HalfedgeStatusPropertyHandle halfedge_status_; //standard edge properties EdgeStatusPropertyHandle edge_status_; //standard face properties FaceNormalsPropertyHandle face_normals_; FaceColorsPropertyHandle face_colors_; FaceStatusPropertyHandle face_status_; unsigned int refcount_vnormals_; unsigned int refcount_vcolors_; unsigned int refcount_vtexcoords1D_; unsigned int refcount_vtexcoords2D_; unsigned int refcount_vtexcoords3D_; unsigned int refcount_vstatus_; unsigned int refcount_hstatus_; unsigned int refcount_estatus_; unsigned int refcount_fnormals_; unsigned int refcount_fcolors_; unsigned int refcount_fstatus_;};//=============================================================================} // namespace OpenMesh//=============================================================================#endif // OPENMESH_ATTRIBKERNEL_HH defined//=============================================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -