diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-07-25 08:26:24 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2015-07-20 00:17:54 +0300 |
commit | 67057865405700572b29e1e3ba1f660c9be39152 (patch) | |
tree | ee1e43069eab9beb6b77de29d8175697b551243d /source/blender/freestyle/intern/winged_edge/WEdge.cpp | |
parent | 431cee2ba0ee8d45e0c0104c72bb1ad3d1f0d238 (diff) |
Freestyle: minor optimization for space from mesh importing to feature edge detection.
Several class member variables were removed (at the cost of computing their values
when retrieved) or changed to a type of smaller size. Also fixed whitespace.
Diffstat (limited to 'source/blender/freestyle/intern/winged_edge/WEdge.cpp')
-rw-r--r-- | source/blender/freestyle/intern/winged_edge/WEdge.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/winged_edge/WEdge.cpp b/source/blender/freestyle/intern/winged_edge/WEdge.cpp index de166531d8b..261aac67c9d 100644 --- a/source/blender/freestyle/intern/winged_edge/WEdge.cpp +++ b/source/blender/freestyle/intern/winged_edge/WEdge.cpp @@ -472,8 +472,10 @@ WShape::WShape(WShape& iBrother) _Id = iBrother.GetId(); _Name = iBrother._Name; _FrsMaterials = iBrother._FrsMaterials; +#if 0 _meanEdgeSize = iBrother._meanEdgeSize; iBrother.bbox(_min, _max); +#endif vector<WVertex *>& vertexList = iBrother.getVertexList(); vector<WVertex *>::iterator v = vertexList.begin(), vend = vertexList.end(); for (; v != vend; ++v) { @@ -681,8 +683,10 @@ WFace *WShape::MakeFace(vector<WVertex *>& iVertexList, vector<bool>& iFaceEdgeM // means that we just created a new edge and that we must add it to the shape's edges list edge->setId(_EdgeList.size()); AddEdge(edge); +#if 0 // compute the mean edge value: _meanEdgeSize += edge->GetaOEdge()->GetVec().norm(); +#endif } edge->setMark(*mit); @@ -696,4 +700,16 @@ WFace *WShape::MakeFace(vector<WVertex *>& iVertexList, vector<bool>& iFaceEdgeM return face; } +real WShape::ComputeMeanEdgeSize() const +{ + real meanEdgeSize = 0.0; + for (vector<WEdge *>::const_iterator it = _EdgeList.begin(), itend = _EdgeList.end(); + it != itend; + it++) + { + meanEdgeSize += (*it)->GetaOEdge()->GetVec().norm(); + } + return meanEdgeSize / _EdgeList.size(); +} + } /* namespace Freestyle */ |