Freestyle: minor speed-up by omitting the calculation of the smallest edge size.

BlenderFileLoader tries to find the smallest edge size but the computed value is not used.
This commit is contained in:
Tamito Kajiyama 2015-08-09 23:36:53 +09:00
parent afe3b55483
commit 3e9f6fc281
4 changed files with 20 additions and 1 deletions

View File

@ -106,7 +106,9 @@ Controller::Controller()
_ProgressBar = new ProgressBar;
_SceneNumFaces = 0;
#if 0
_minEdgeSize = DBL_MAX;
#endif
_EPSILON = 1.0e-6;
_bboxDiag = 0;
@ -264,9 +266,11 @@ int Controller::LoadMesh(Render *re, SceneRenderLayer *srl)
}
_SceneNumFaces += loader.numFacesRead();
#if 0
if (loader.minEdgeSize() < _minEdgeSize) {
_minEdgeSize = loader.minEdgeSize();
}
#endif
#if 0 // DEBUG
ScenePrettyPrinter spp;
@ -406,7 +410,9 @@ void Controller::DeleteWingedEdge()
_Grid.clear();
_Scene3dBBox.clear();
_SceneNumFaces = 0;
#if 0
_minEdgeSize = DBL_MAX;
#endif
}
void Controller::DeleteViewMap(bool freeCache)

View File

@ -209,7 +209,9 @@ private:
BBox<Vec3r> _Scene3dBBox;
unsigned int _SceneNumFaces;
#if 0
real _minEdgeSize;
#endif
real _EPSILON;
real _bboxDiag;

View File

@ -38,7 +38,9 @@ BlenderFileLoader::BlenderFileLoader(Render *re, SceneRenderLayer *srl)
_srl = srl;
_Scene = NULL;
_numFacesRead = 0;
#if 0
_minEdgeSize = DBL_MAX;
#endif
_smooth = (srl->freestyleConfig.flags & FREESTYLE_FACE_SMOOTHNESS_FLAG) != 0;
_pRenderMonitor = NULL;
}
@ -262,7 +264,10 @@ void BlenderFileLoader::addTriangle(struct LoaderState *ls, float v1[3], float v
float n1[3], float n2[3], float n3[3],
bool fm, bool em1, bool em2, bool em3)
{
float *fv[3], *fn[3], len;
float *fv[3], *fn[3];
#if 0
float len;
#endif
unsigned int i, j;
IndexedFaceSet::FaceEdgeMark marks = 0;
@ -289,9 +294,11 @@ void BlenderFileLoader::addTriangle(struct LoaderState *ls, float v1[3], float v
ls->maxBBox[j] = ls->pv[j];
}
#if 0
len = len_v3v3(fv[i], fv[(i + 1) % 3]);
if (_minEdgeSize > len)
_minEdgeSize = len;
#endif
*ls->pvi = ls->currentIndex;
*ls->pni = ls->currentIndex;

View File

@ -87,8 +87,10 @@ public:
/*! Gets the number of read faces */
inline unsigned int numFacesRead() {return _numFacesRead;}
#if 0
/*! Gets the smallest edge size read */
inline real minEdgeSize() {return _minEdgeSize;}
#endif
/*! Modifiers */
inline void setRenderMonitor(RenderMonitor *iRenderMonitor) {_pRenderMonitor = iRenderMonitor;}
@ -115,7 +117,9 @@ protected:
SceneRenderLayer *_srl;
NodeGroup *_Scene;
unsigned _numFacesRead;
#if 0
real _minEdgeSize;
#endif
bool _smooth; /* if true, face smoothness is taken into account */
float _viewplane_left;
float _viewplane_right;