Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00046
00047
00048
00049
00050
00051
00052 #ifndef OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITETRAITS_HH
00053 #define OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITETRAITS_HH
00054
00055
00056
00057
00058
00059
00060 #include <OpenMesh/Core/Mesh/Traits.hh>
00061 #include <OpenMesh/Core/Mesh/Attributes.hh>
00062
00063
00064
00065
00066 namespace OpenMesh {
00067 namespace Subdivider {
00068 namespace Uniform {
00069
00070
00071
00072
00073
00077 struct CompositeTraits : public OpenMesh::DefaultTraits
00078 {
00079 FaceAttributes( OpenMesh::Attributes::Normal );
00080
00081 VertexAttributes( OpenMesh::Attributes::Normal );
00082
00083
00084
00085 FaceTraits
00086 {
00087 private:
00088 typedef typename Refs::HalfedgeHandle HalfedgeHandle;
00089 typedef typename Refs::Scalar Scalar;
00090 typedef typename Refs::Point Point;
00091 HalfedgeHandle red_halfedge_handle_;
00092 unsigned int generation_;
00093 bool red_;
00094 Scalar quality_;
00095 Point midpoint_;
00096 Point position_;
00097
00098 public:
00099 const unsigned int& generation() { return generation_; }
00100 void set_generation(const unsigned int& _g) { generation_ = _g; }
00101 void inc_generation() { ++generation_; }
00102 void set_red() { red_ = 1; }
00103 void set_green() {red_ = 0; }
00104 bool is_red() { return red_; }
00105 bool is_green() { return !red_; }
00106 void set_red_halfedge_handle(HalfedgeHandle& _heh)
00107 { red_halfedge_handle_ = _heh; }
00108 HalfedgeHandle& red_halfedge_handle() { return red_halfedge_handle_; }
00109 void set_quality(Scalar& _q) { quality_ = _q; }
00110 Scalar& quality() { return quality_; }
00111 const Point& midpoint() const { return midpoint_; }
00112 void set_midpoint(const Point& _p) { midpoint_ = _p; }
00113 const Point& position() const { return position_; }
00114 void set_position(const Point& _p) { position_ = _p; }
00115 };
00116
00117 EdgeTraits
00118 {
00119 private:
00120 typedef typename Refs::Point Point;
00121 typedef typename Refs::Scalar Scalar;
00122 Point midpoint_;
00123 Scalar length_;
00124 Point position_;
00125 public:
00126 const Point& midpoint() const { return midpoint_; }
00127 void set_midpoint(const Point& _vh) { midpoint_ = _vh; }
00128 const Scalar& length() const { return length_; }
00129 void set_length(const Scalar& _s) { length_ = _s; }
00130 const Point& position() const { return position_; }
00131 void set_position(const Point& _p) { position_ = _p; }
00132 };
00133
00134 VertexTraits
00135 {
00136 private:
00137 typedef typename Refs::Point Point;
00138 Point new_pos_;
00139 Point orig_pos_;
00140 Point position_;
00141 unsigned int generation_;
00142 public:
00143 const Point& new_pos() const { return new_pos_; }
00144 void set_new_pos(const Point& _p) { new_pos_ = _p; }
00145 const unsigned int& generation() const { return generation_; }
00146 void set_generation(const unsigned int& _i) { generation_ = _i; }
00147 const Point& orig_pos() const { return orig_pos_; }
00148 void set_orig_pos(const Point& _p) { orig_pos_ = _p; }
00149 const Point& position() const { return position_; }
00150 void set_position(const Point& _p) { position_ = _p; }
00151 };
00152 };
00153
00154
00155 }
00156 }
00157 }
00158
00159 #endif // OPENMESH_SUBDIVIDER_UNIFORM_COMPOSITETRAITS_HH defined
00160
00161