[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55185] branches/soc-2008-mxcurioni/source /blender/freestyle/intern: Another big code clean-up patch from Bastien Montagne, thanks again!

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Mon Mar 11 07:56:51 CET 2013


Revision: 55185
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55185
Author:   kjym3
Date:     2013-03-11 06:56:51 +0000 (Mon, 11 Mar 2013)
Log Message:
-----------
Another big code clean-up patch from Bastien Montagne, thanks again!

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/IndexedFaceSet.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/IndexedFaceSet.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/Node.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/NodeGroup.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/OrientedLineRep.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/Rep.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/AdvancedFunctions0D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/BasicStrokeShaders.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Canvas.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Canvas.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Chain.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Chain.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/ChainingIterators.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/ChainingIterators.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/ContextFunctions.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Curve.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Curve.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/CurveAdvancedIterators.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/CurveIterators.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Module.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Operators.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/PSStrokeRenderer.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/PSStrokeRenderer.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Predicates1D.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Stroke.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Stroke.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/StrokeAdvancedIterators.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/StrokeIO.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/StrokeIterators.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/StrokeRenderer.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/StrokeRenderer.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/StrokeRep.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/StrokeRep.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/StrokeTesselator.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/TextStrokeRenderer.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/TextStrokeRenderer.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/system/FreestyleConfig.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/system/RenderMonitor.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/BoxGrid.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/BoxGrid.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/CulledOccluderSource.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/FEdgeXDetector.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/Functions0D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/Functions1D.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/GridDensityProvider.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/Interface0D.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/OccluderSource.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/Silhouette.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/Silhouette.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/SphericalGrid.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/SphericalGrid.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/SteerableViewMap.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/ViewMap.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/ViewMap.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/ViewMapAdvancedIterators.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/ViewMapIO.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/ViewMapIO.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/winged_edge/Curvature.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/winged_edge/WEdge.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/winged_edge/WEdge.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/winged_edge/WXEdge.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/winged_edge/WXEdge.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/winged_edge/WXEdgeBuilder.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/winged_edge/WXEdgeBuilder.h
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.cpp

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/IndexedFaceSet.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/IndexedFaceSet.cpp	2013-03-11 02:19:58 UTC (rev 55184)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/IndexedFaceSet.cpp	2013-03-11 06:56:51 UTC (rev 55185)
@@ -231,8 +231,7 @@
 		_Vertices = NULL;
 	}
 
-	if (NULL != _Normals)
-	{
+	if (NULL != _Normals) {
 		delete[] _Normals;
 		_Normals = NULL;
 	}

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/IndexedFaceSet.h
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/IndexedFaceSet.h	2013-03-11 02:19:58 UTC (rev 55184)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/IndexedFaceSet.h	2013-03-11 06:56:51 UTC (rev 55185)
@@ -185,12 +185,12 @@
 	}
 
 	/*! Accessors */
-	virtual const real * vertices() const
+	virtual const real *vertices() const
 	{
 		return _Vertices;
 	}
 
-	virtual const real * normals() const
+	virtual const real *normals() const
 	{
 		return _Normals;
 	}
@@ -200,7 +200,7 @@
 		return _FrsMaterials;
 	}
 
-	virtual const real* texCoords() const
+	virtual const real *texCoords() const
 	{
 		return _TexCoords;
 	}
@@ -230,37 +230,37 @@
 		return _NumFaces;
 	}
 
-	virtual const unsigned * numVertexPerFaces() const
+	virtual const unsigned *numVertexPerFaces() const
 	{
 		return _NumVertexPerFace;
 	}
 
-	virtual const TRIANGLES_STYLE * trianglesStyle() const
+	virtual const TRIANGLES_STYLE *trianglesStyle() const
 	{
 		return _FaceStyle;
 	}
 
-	virtual const unsigned char * faceEdgeMarks() const
+	virtual const unsigned char *faceEdgeMarks() const
 	{
 		return _FaceEdgeMarks;
 	}
 
-	virtual const unsigned* vindices() const
+	virtual const unsigned *vindices() const
 	{
 		return _VIndices;
 	}
 
-	virtual const unsigned* nindices() const
+	virtual const unsigned *nindices() const
 	{
 		return _NIndices;
 	}
 
-	virtual const unsigned* mindices() const
+	virtual const unsigned *mindices() const
 	{
 		return _MIndices;
 	}
 
-	virtual const unsigned* tindices() const
+	virtual const unsigned *tindices() const
 	{
 		return _TIndices;
 	}

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/Node.h
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/Node.h	2013-03-11 02:19:58 UTC (rev 55184)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/Node.h	2013-03-11 06:56:51 UTC (rev 55185)
@@ -57,7 +57,7 @@
 		_BBox = iBrother.bbox();
 	}
 
-	virtual ~Node(){}
+	virtual ~Node() {}
 
 	/*! Accept the corresponding visitor
 	 *  Each inherited node must overload this method
@@ -85,10 +85,10 @@
 	/*! Makes the union of _BBox and iBox */
 	virtual void AddBBox(const BBox<Vec3r>& iBox)
 	{
-		if(iBox.empty())
+		if (iBox.empty())
 			return;
 
-		if(_BBox.empty())
+		if (_BBox.empty())
 			_BBox = iBox;
 		else
 			_BBox += iBox;

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/NodeGroup.h
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/NodeGroup.h	2013-03-11 02:19:58 UTC (rev 55184)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/NodeGroup.h	2013-03-11 06:56:51 UTC (rev 55185)
@@ -48,7 +48,7 @@
 {
 public:
 	inline NodeGroup(): Node() {}
-	virtual ~NodeGroup(){}
+	virtual ~NodeGroup() {}
 
 	/*! Adds a child. Makes a addRef on the iChild reference counter */
 	virtual void AddChild(Node *iChild);

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/OrientedLineRep.h
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/OrientedLineRep.h	2013-03-11 02:19:58 UTC (rev 55184)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/OrientedLineRep.h	2013-03-11 06:56:51 UTC (rev 55185)
@@ -49,7 +49,7 @@
 	 *  v2
 	 *    second vertex
 	 */
-	inline OrientedLineRep(const Vec3r& v1, const Vec3r& v2) : LineRep(v1,v2) {}
+	inline OrientedLineRep(const Vec3r& v1, const Vec3r& v2) : LineRep(v1, v2) {}
 
 	/*! Builds a line rep from a vertex chain */
 	inline OrientedLineRep(const vector<Vec3r>& vertices) : LineRep(vertices) {}

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/Rep.h
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/Rep.h	2013-03-11 02:19:58 UTC (rev 55184)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/Rep.h	2013-03-11 06:56:51 UTC (rev 55185)
@@ -70,10 +70,10 @@
 
 	inline void swap(Rep& ioOther)
 	{
-		std::swap(_BBox,ioOther._BBox);
+		std::swap(_BBox, ioOther._BBox);
 		std::swap(_Id, ioOther._Id);
 		std::swap(_Name, ioOther._Name);
-		std::swap(_FrsMaterial,ioOther._FrsMaterial);
+		std::swap(_FrsMaterial, ioOther._FrsMaterial);
 	}
 
 	Rep& operator=(const Rep& iBrother)
@@ -137,7 +137,7 @@
 		return _Name;
 	}
 
-	inline const FrsMaterial * frs_material() const
+	inline const FrsMaterial *frs_material() const
 	{
 		return _FrsMaterial;
 	}

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/AdvancedFunctions0D.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/AdvancedFunctions0D.cpp	2013-03-11 02:19:58 UTC (rev 55184)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/AdvancedFunctions0D.cpp	2013-03-11 06:56:51 UTC (rev 55185)
@@ -43,11 +43,12 @@
 
 int DensityF0D::operator()(Interface0DIterator& iter)
 {
-	Canvas* canvas = Canvas::getInstance();
+	Canvas *canvas = Canvas::getInstance();
 	int bound = _filter.getBound();
 
-	if ((iter->getProjectedX()-bound < 0) || (iter->getProjectedX()+bound>canvas->width()) ||
-	    (iter->getProjectedY()-bound < 0) || (iter->getProjectedY()+bound>canvas->height())) {
+	if ((iter->getProjectedX() - bound < 0) || (iter->getProjectedX() + bound>canvas->width()) ||
+	    (iter->getProjectedY() - bound < 0) || (iter->getProjectedY() + bound>canvas->height()))
+	{
 		result = 0.0;
 		return 0;
 	}
@@ -63,17 +64,18 @@
 
 int LocalAverageDepthF0D::operator()(Interface0DIterator& iter)
 {
-	Canvas * iViewer = Canvas::getInstance();
+	Canvas *iViewer = Canvas::getInstance();
 	int bound = _filter.getBound();
 
-	if ((iter->getProjectedX()-bound < 0) || (iter->getProjectedX()+bound>iViewer->width()) ||
-	    (iter->getProjectedY()-bound < 0) || (iter->getProjectedY()+bound>iViewer->height())) {
+	if ((iter->getProjectedX() - bound < 0) || (iter->getProjectedX() + bound>iViewer->width()) ||
+	    (iter->getProjectedY() - bound < 0) || (iter->getProjectedY() + bound>iViewer->height()))
+	{
 		result = 0.0;
 		return 0;
 	}
 
 	GrayImage image;
-	iViewer->readDepthPixels((int)iter->getProjectedX() - bound, (int)iter->getProjectedY()-bound,
+	iViewer->readDepthPixels((int)iter->getProjectedX() - bound, (int)iter->getProjectedY() - bound,
 	                         _filter.maskSize(), _filter.maskSize(), image);
 	result = _filter.getSmoothedPixel(&image, (int)iter->getProjectedX(), (int)iter->getProjectedY());
 
@@ -82,7 +84,7 @@
 
 int ReadMapPixelF0D::operator()(Interface0DIterator& iter)
 {
-	Canvas * canvas = Canvas::getInstance();
+	Canvas *canvas = Canvas::getInstance();
 	result = canvas->readMapPixel(_mapName, _level, (int)iter->getProjectedX(), (int)iter->getProjectedY());
 	return 0;
 }
@@ -98,7 +100,7 @@
 int ReadCompleteViewMapPixelF0D::operator()(Interface0DIterator& iter)
 {
 	SteerableViewMap *svm = Canvas::getInstance()->getSteerableViewMap();
-	result = svm->readCompleteViewMapPixel(_level,(int)iter->getProjectedX(), (int)iter->getProjectedY());
+	result = svm->readCompleteViewMapPixel(_level, (int)iter->getProjectedX(), (int)iter->getProjectedY());
 	return 0;
 }
 
@@ -106,10 +108,10 @@
 {
 	SteerableViewMap *svm = Canvas::getInstance()->getSteerableViewMap();
 	float pxy = svm->readCompleteViewMapPixel(_level, (int)iter->getProjectedX(), (int)iter->getProjectedY());
-	float gx = svm->readCompleteViewMapPixel(_level, (int)iter->getProjectedX() + _step, (int)iter->getProjectedY())
-	           - pxy;
-	float gy = svm->readCompleteViewMapPixel(_level, (int)iter->getProjectedX(), (int)iter->getProjectedY() + _step)
-	           - pxy;
+	float gx = svm->readCompleteViewMapPixel(_level, (int)iter->getProjectedX() + _step,
+	                                         (int)iter->getProjectedY()) - pxy;
+	float gy = svm->readCompleteViewMapPixel(_level, (int)iter->getProjectedX(),
+	                                         (int)iter->getProjectedY() + _step) - pxy;
 	result = Vec2f(gx, gy).norm();
 	return 0;
 }

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.cpp	2013-03-11 02:19:58 UTC (rev 55184)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.cpp	2013-03-11 06:56:51 UTC (rev 55185)
@@ -43,7 +43,7 @@
 
 int GetSteerableViewMapDensityF1D::operator()(Interface1D& inter)
 {
-	SteerableViewMap * svm = Canvas::getInstance()->getSteerableViewMap();
+	SteerableViewMap *svm = Canvas::getInstance()->getSteerableViewMap();
 	Interface0DIterator it = inter.pointsBegin(_sampling);
 	Interface0DIterator itnext = it;
 	++itnext;
@@ -56,8 +56,8 @@
 		Interface0D& i0Dnext = (*itnext);
 		fe = i0D.getFEdge(i0Dnext);
 		if (fe == 0) {
-			cerr << "GetSteerableViewMapDensityF1D warning: no FEdge between " << i0D.getId() << " and "
-			     << i0Dnext.getId() << endl;
+			cerr << "GetSteerableViewMapDensityF1D warning: no FEdge between " << i0D.getId() << " and " <<
+			        i0Dnext.getId() << endl;
 			// compute the direction between these two ???
 			Vec2f dir = i0Dnext.getPoint2D() - i0D.getPoint2D();
 			nSVM = svm->getSVMNumber(dir);


@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list