[Bf-blender-cvs] [ea99efe] master: Code cleanup: indentation
Campbell Barton
noreply at git.blender.org
Tue Apr 15 12:04:42 CEST 2014
Commit: ea99efeb2ca91b108bf3e86f4964e1a4555b46d8
Author: Campbell Barton
Date: Tue Apr 15 19:21:29 2014 +1000
https://developer.blender.org/rBea99efeb2ca91b108bf3e86f4964e1a4555b46d8
Code cleanup: indentation
===================================================================
M source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.cpp
M source/blender/freestyle/intern/stroke/StrokeTesselator.cpp
M source/blender/freestyle/intern/view_map/Functions0D.cpp
M source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
M source/blender/freestyle/intern/winged_edge/WXEdge.cpp
===================================================================
diff --git a/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.cpp b/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.cpp
index d30a75d..274e36a 100644
--- a/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.cpp
+++ b/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.cpp
@@ -301,7 +301,7 @@ void Smoother::computeCurvature()
_curvature[i] = normalCurvature * _normal[i];
if (lba + lbc > M_EPSILON)
- _curvature[i] /= (0.5 * lba + lbc);
+ _curvature[i] /= (0.5 * lba + lbc);
}
_curvature[0] = _curvature[1];
_curvature[_nbVertices - 1] = _curvature[_nbVertices - 2];
@@ -325,7 +325,7 @@ void Smoother::computeCurvature()
_curvature[i] = normalCurvature * _normal[i];
if (lba + lbc > M_EPSILON)
- _curvature[i] /= (0.5 * lba + lbc);
+ _curvature[i] /= (0.5 * lba + lbc);
_normal[_nbVertices - 1] = _normal[0];
_curvature[_nbVertices - 1] = _curvature[0];
diff --git a/source/blender/freestyle/intern/stroke/StrokeTesselator.cpp b/source/blender/freestyle/intern/stroke/StrokeTesselator.cpp
index 443e14b..fb22173 100644
--- a/source/blender/freestyle/intern/stroke/StrokeTesselator.cpp
+++ b/source/blender/freestyle/intern/stroke/StrokeTesselator.cpp
@@ -56,7 +56,7 @@ LineRep *StrokeTesselator::Tesselate(Stroke *iStroke)
}
else {
if (_overloadFrsMaterial)
- line->setFrsMaterial(_FrsMaterial);
+ line->setFrsMaterial(_FrsMaterial);
line->setStyle(LineRep::LINE_STRIP);
diff --git a/source/blender/freestyle/intern/view_map/Functions0D.cpp b/source/blender/freestyle/intern/view_map/Functions0D.cpp
index f95690e..f47e5ff 100644
--- a/source/blender/freestyle/intern/view_map/Functions0D.cpp
+++ b/source/blender/freestyle/intern/view_map/Functions0D.cpp
@@ -182,9 +182,9 @@ int VertexOrientation3DF0D::operator()(Interface0DIterator& iter)
A = Vec3r(iter->getX(), iter->getY(), iter->getZ());
}
else {
- Interface0DIterator previous = iter;
- --previous ;
- A = Vec3r(previous->getX(), previous->getY(), previous->getZ());
+ Interface0DIterator previous = iter;
+ --previous ;
+ A = Vec3r(previous->getX(), previous->getY(), previous->getZ());
}
Interface0DIterator next = iter;
++next ;
diff --git a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
index 6f4f1df..a0a1282 100644
--- a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
@@ -138,28 +138,28 @@ static void findOccludee(FEdge *fe, G& grid, I& occluders, real epsilon, WFace *
if (p->rayIntersect(A, v, t, t_u, t_v)) {
#if LOGGING
- if (_global.debug & G_DEBUG_FREESTYLE) {
- cout << "\t\tRay " << A << " * " << v << " intersects at time " << t << endl;
- cout << "\t\t(v * normal) == " << (v * p->getNormal()) << " for normal " << p->getNormal() << endl;
- }
+ if (_global.debug & G_DEBUG_FREESTYLE) {
+ cout << "\t\tRay " << A << " * " << v << " intersects at time " << t << endl;
+ cout << "\t\t(v * normal) == " << (v * p->getNormal()) << " for normal " << p->getNormal() << endl;
+ }
#endif
- if (fabs(v * p->getNormal()) > 0.0001) {
- if ((t > 0.0)) { // && (t<1.0))
- if (t < mint) {
- *oaWFace = oface;
- mint = t;
- noIntersection = false;
- fe->setOccludeeIntersection(Vec3r(A + t * v));
+ if (fabs(v * p->getNormal()) > 0.0001) {
+ if ((t > 0.0)) { // && (t<1.0))
+ if (t < mint) {
+ *oaWFace = oface;
+ mint = t;
+ noIntersection = false;
+ fe->setOccludeeIntersection(Vec3r(A + t * v));
#if LOGGING
- if (_global.debug & G_DEBUG_FREESTYLE) {
- cout << "\t\tIs occludee" << endl;
- }
+ if (_global.debug & G_DEBUG_FREESTYLE) {
+ cout << "\t\tIs occludee" << endl;
+ }
#endif
+ }
}
}
- }
- occluders.reportDepth(A, v, t);
+ occluders.reportDepth(A, v, t);
}
}
@@ -246,146 +246,146 @@ static int computeVisibility(ViewMap *viewMap, FEdge *fe, G& grid, real epsilon,
I occluders(grid, center, epsilon);
for (occluders.initBeforeTarget(); occluders.validBeforeTarget(); occluders.nextOccluder()) {
- // If we're dealing with an exact silhouette, check whether we must take care of this occluder of not.
- // (Indeed, we don't consider the occluders that share at least one vertex with the face containing this edge).
- //-----------
- oface = occluders.getWFace();
- Polygon3r *p = occluders.getCameraSpacePolygon();
- real t, t_u, t_v;
-#if LOGGING
- if (_global.debug & G_DEBUG_FREESTYLE) {
- cout << "\t\tEvaluating intersection for occluder " << (p->getVertices())[0] << (p->getVertices())[1] <<
- (p->getVertices())[2] << endl << "\t\t\tand ray " << vp << " * " << u << " (center " << center <<
- ")" << endl;
- }
-#endif
-
+ // If we're dealing with an exact silhouette, check whether we must take care of this occluder of not.
+ // (Indeed, we don't consider the occluders that share at least one vertex with the face containing this edge).
+ //-----------
+ oface = occluders.getWFace();
+ Polygon3r *p = occluders.getCameraSpacePolygon();
+ real t, t_u, t_v;
#if LOGGING
- Vec3r v(vp - center);
- real rl = v.norm();
- v.normalize();
- vector<Vec3r> points;
- // Iterate over vertices, storing projections in points
- for (vector<WOEdge*>::const_iterator woe = oface->getEdgeList().begin(), woend = oface->getEdgeList().end();
- woe != woend;
- woe++)
- {
- points.push_back(Vec3r((*woe)->GetaVertex()->GetVertex()));
- }
- Polygon3r p1(points, oface->GetNormal());
- Vec3r v1((p1.getVertices())[0]);
- real d = -(v1 * p->getNormal());
- if (_global.debug & G_DEBUG_FREESTYLE) {
- cout << "\t\tp: " << (p->getVertices())[0] << (p->getVertices())[1] << (p->getVertices())[2] << ", norm: " <<
- p->getNormal() << endl;
- cout << "\t\tp1: " << (p1.getVertices())[0] << (p1.getVertices())[1] << (p1.getVertices())[2] << ", norm: " <<
- p1.getNormal() << endl;
- }
-#else
- real d = -((p->getVertices())[0] * p->getNormal());
+ if (_global.debug & G_DEBUG_FREESTYLE) {
+ cout << "\t\tEvaluating intersection for occluder " << (p->getVertices())[0] << (p->getVertices())[1] <<
+ (p->getVertices())[2] << endl << "\t\t\tand ray " << vp << " * " << u << " (center " << center <<
+ ")" << endl;
+ }
#endif
- if (face) {
#if LOGGING
+ Vec3r v(vp - center);
+ real rl = v.norm();
+ v.normalize();
+ vector<Vec3r> points;
+ // Iterate over vertices, storing projections in points
+ for (vector<WOEdge*>::const_iterator woe = oface->getEdgeList().begin(), woend = oface->getEdgeList().end();
+ woe != woend;
+ woe++)
+ {
+ points.push_back(Vec3r((*woe)->GetaVertex()->GetVertex()));
+ }
+ Polygon3r p1(points, oface->GetNormal());
+ Vec3r v1((p1.getVertices())[0]);
+ real d = -(v1 * p->getNormal());
if (_global.debug & G_DEBUG_FREESTYLE) {
- cout << "\t\tDetermining face adjacency...";
+ cout << "\t\tp: " << (p->getVertices())[0] << (p->getVertices())[1] << (p->getVertices())[2] << ", norm: " <<
+ p->getNormal() << endl;
+ cout << "\t\tp1: " << (p1.getVertices())[0] << (p1.getVertices())[1] << (p1.getVertices())[2] << ", norm: " <<
+ p1.getNormal() << endl;
}
+#else
+ real d = -((p->getVertices())[0] * p->getNormal());
#endif
- skipFace = false;
- if (face == oface) {
+ if (face) {
#if LOGGING
if (_global.debug & G_DEBUG_FREESTYLE) {
- cout << " Rejecting occluder for face concurrency." << endl;
+ cout << "\t\tDetermining face adjacency...";
}
#endif
- continue;
- }
-
+ skipFace = false;
- for (vector<WVertex*>::iterator fv = faceVertices.begin(), fvend = faceVertices.end(); fv != fvend; ++fv) {
- if ((*fv)->isBoundary())
+ if (face == oface) {
+#if LOGGING
+ if (_global.debug & G_DEBUG_FREESTYLE) {
+ cout << " Rejecting occluder for face concurrency." << endl;
+ }
+#endif
continue;
+ }
- WVertex::incoming_edge_iterator iebegin = (*fv)->incoming_edges_begin();
- WVertex::incoming_edge_iterator ieend = (*fv)->incoming_edges_end();
- for (ie = iebegin; ie != ieend; ++ie) {
- if ((*ie) == 0)
+
+ for (vector<WVertex*>::iterator fv = faceVertices.begin(), fvend = faceVertices.end(); fv != fvend; ++fv) {
+ if ((*fv)->isBoundary())
continue;
- WFace *sface = (*ie)->GetbFace();
- //WFace *sfacea = (*ie)->GetaFace();
- //if ((sface == oface) || (sfacea == oface))
- if (sface == oface) {
- skipFace = true;
- break;
+ WVertex::incoming_edge_iterator iebegin = (*fv)->incoming_edges_begin();
+ WVertex::incoming_edge_iterator ieend = (*fv)->incoming_edges_end();
+ for (ie = iebegin; ie != ieend; ++ie) {
+ if ((*ie) == 0)
+ continue;
+
+ WFace *sface = (*ie)->GetbFace();
+ //WFace *sfacea = (*ie)->GetaFace();
+ //if ((sface == oface) || (sfacea == oface))
+ if (sface == oface) {
+ skipFace = true;
+ break;
+ }
}
+ if (skipFace)
+ break;
}
- if (skipFace)
- break;
- }
- if (skipFace) {
+ if (skipFace) {
#if LOGGING
- if (_global.debug & G_DEBUG_FREESTYLE) {
- cout << " Rejecting occluder for face adjacency." << endl;
- }
+ if (_global.debug & G_DEBUG_FREESTYLE) {
+ cout << " Rejecting occluder for face adjacency." << endl;
+ }
#endif
- continue;
+ continue;
+ }
}
- }
- else {
- // check whether the edge and the polygon plane are coincident:
- //-------------------------------------------------------------
- //first let us compute the plane equation.
- if (GeomUtils::COINCIDENT == GeomUtils::intersectRayPlane(origin, edge, p->getNormal(), d, t, epsilon)) {
+ else {
+ // check whether the edge and the polygon plane are coincident:
+ //-------------------------------------------------------------
+ //first let us compute the plane equation.
+ if (GeomUtils::COINCIDENT == GeomUtils::intersectRayPlane(origin, edge, p->getNormal(), d, t, epsilon)) {
#if LOGGING
- if (_global.debug & G_DEBUG_FREESTYLE) {
- cout << "\t\tRejecting occluder for target coincidence." << endl;
- }
+ if (_global.debug & G_DEBUG_FREESTYLE) {
+ cout << "\
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list