Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-04-17 09:24:14 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 09:24:14 +0300
commit41d4a1986548e66a652221e4a68c52900474eeff (patch)
tree26acf937ea0b762977f89adcc4e74a3ec9ecee62 /source/blender/freestyle/intern/view_map
parent108045faa01849115c54190ebed788faf36dcb56 (diff)
ClangFormat: format '#if 0' code in source/
Diffstat (limited to 'source/blender/freestyle/intern/view_map')
-rw-r--r--source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp27
-rw-r--r--source/blender/freestyle/intern/view_map/FEdgeXDetector.h2
-rw-r--r--source/blender/freestyle/intern/view_map/Silhouette.cpp14
-rw-r--r--source/blender/freestyle/intern/view_map/Silhouette.h18
-rw-r--r--source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp3
-rw-r--r--source/blender/freestyle/intern/view_map/SteerableViewMap.cpp2
-rw-r--r--source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMap.cpp2
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMap.h4
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMapAdvancedIterators.h5
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp22
11 files changed, 54 insertions, 49 deletions
diff --git a/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp b/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp
index bb2b95be84e..1de4a87886c 100644
--- a/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp
+++ b/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp
@@ -425,8 +425,7 @@ void FEdgeXDetector::ProcessRidgeFace(WXFace *iFace)
if (flayer->nPosDotP() != numVertices) {
if ((fabs(flayer->dotP(0)) < threshold) && (fabs(flayer->dotP(1)) < threshold) &&
- (fabs(flayer->dotP(2)) < threshold))
- {
+ (fabs(flayer->dotP(2)) < threshold)) {
flayer->ReplaceDotP(0, 0);
flayer->ReplaceDotP(1, 0);
flayer->ReplaceDotP(2, 0);
@@ -443,7 +442,7 @@ void FEdgeXDetector::ProcessRidgeFace(WXFace *iFace)
WVertex *v;
Vec3r v1v2;
real t;
- vector<WXFaceLayer*> SmoothLayers;
+ vector<WXFaceLayer *> SmoothLayers;
WXFaceLayer *faceLayer;
Face_Curvature_Info *layer_info;
real K1_a(0), K1_b(0);
@@ -451,7 +450,7 @@ void FEdgeXDetector::ProcessRidgeFace(WXFace *iFace)
// find the ridge layer of the face
iFace->retrieveSmoothLayers(Nature::RIDGE, SmoothLayers);
- if ( SmoothLayers.size()!=1 )
+ if (SmoothLayers.size() != 1)
return;
faceLayer = SmoothLayers[0];
// retrieve the curvature info of this layer
@@ -461,27 +460,28 @@ void FEdgeXDetector::ProcessRidgeFace(WXFace *iFace)
for (int i = 0; i < numVertices; i++) {
v = iFace->GetVertex(i);
// vec_curvature_info[i] contains the curvature info of this vertex
- Vec3r e2 = layer_info->vec_curvature_info[i]->K2*layer_info->vec_curvature_info[i]->e2;
- Vec3r e1 = layer_info->vec_curvature_info[i]->K1*layer_info->vec_curvature_info[i]->e1;
+ Vec3r e2 = layer_info->vec_curvature_info[i]->K2 * layer_info->vec_curvature_info[i]->e2;
+ Vec3r e1 = layer_info->vec_curvature_info[i]->K1 * layer_info->vec_curvature_info[i]->e1;
e2.normalize();
WVertex::face_iterator fit = v->faces_begin();
WVertex::face_iterator fitend = v->faces_end();
for (; fit != fitend; ++fit) {
- WXFace *wxf = dynamic_cast<WXFace*>(*fit);
+ WXFace *wxf = dynamic_cast<WXFace *>(*fit);
WOEdge *oppositeEdge;
if (!(wxf->getOppositeEdge(v, oppositeEdge)))
continue;
v1v2 = oppositeEdge->GetbVertex()->GetVertex() - oppositeEdge->GetaVertex()->GetVertex();
GeomUtils::intersection_test res;
- res = GeomUtils::intersectRayPlane(oppositeEdge->GetaVertex()->GetVertex(), v1v2, e2, -(v->GetVertex()*e2),
- t, 1.0e-06);
+ res = GeomUtils::intersectRayPlane(
+ oppositeEdge->GetaVertex()->GetVertex(), v1v2, e2, -(v->GetVertex() * e2), t, 1.0e-06);
if ((res == GeomUtils::DO_INTERSECT) && (t >= 0.0) && (t <= 1.0)) {
- vector<WXFaceLayer*> second_ridge_layer;
+ vector<WXFaceLayer *> second_ridge_layer;
wxf->retrieveSmoothLayers(Nature::RIDGE, second_ridge_layer);
if (second_ridge_layer.size() != 1)
continue;
- Face_Curvature_Info *second_layer_info = (Face_Curvature_Info*)second_ridge_layer[0]->userdata;
+ Face_Curvature_Info *second_layer_info =
+ (Face_Curvature_Info *)second_ridge_layer[0]->userdata;
unsigned index1 = wxf->GetIndex(oppositeEdge->GetaVertex());
unsigned index2 = wxf->GetIndex(oppositeEdge->GetbVertex());
@@ -566,10 +566,9 @@ void FEdgeXDetector::ProcessSuggestiveContourFace(WXFace *iFace)
#if 0 // FIXME: find a more clever way to compute the threshold
real threshold = _meanKr;
- if (faceLayer->nPosDotP()!=numVertices) {
+ if (faceLayer->nPosDotP() != numVertices) {
if ((fabs(faceLayer->dotP(0)) < threshold) && (fabs(faceLayer->dotP(1)) < threshold) &&
- (fabs(faceLayer->dotP(2)) < threshold))
- {
+ (fabs(faceLayer->dotP(2)) < threshold)) {
faceLayer->ReplaceDotP(0, 0);
faceLayer->ReplaceDotP(1, 0);
faceLayer->ReplaceDotP(2, 0);
diff --git a/source/blender/freestyle/intern/view_map/FEdgeXDetector.h b/source/blender/freestyle/intern/view_map/FEdgeXDetector.h
index 61e0c9267a1..fafc391aa8f 100644
--- a/source/blender/freestyle/intern/view_map/FEdgeXDetector.h
+++ b/source/blender/freestyle/intern/view_map/FEdgeXDetector.h
@@ -209,7 +209,7 @@ class FEdgeXDetector {
protected:
Vec3f _Viewpoint;
#if 0
- real _bbox_diagonal; // diagonal of the current processed shape bbox
+ real _bbox_diagonal; // diagonal of the current processed shape bbox
#endif
//oldtmp values
bool _computeViewIndependent;
diff --git a/source/blender/freestyle/intern/view_map/Silhouette.cpp b/source/blender/freestyle/intern/view_map/Silhouette.cpp
index 73bf38107cd..af97efa1406 100644
--- a/source/blender/freestyle/intern/view_map/Silhouette.cpp
+++ b/source/blender/freestyle/intern/view_map/Silhouette.cpp
@@ -294,7 +294,7 @@ real FEdge::z_discontinuity() const
#if 0
real result;
z_discontinuity_functor<SVertex> _functor;
- Evaluate<SVertex, z_discontinuity_functor<SVertex> >(&_functor, iCombination, result);
+ Evaluate<SVertex, z_discontinuity_functor<SVertex>>(&_functor, iCombination, result);
#endif
Vec3r middle((_VertexB->point3d() - _VertexA->point3d()));
middle /= 2;
@@ -306,7 +306,7 @@ real FEdge::z_discontinuity() const
}
#if 0
-float FEdge::local_average_depth(int iCombination ) const
+float FEdge::local_average_depth(int iCombination) const
{
float result;
local_average_depth_functor<SVertex> functor;
@@ -315,7 +315,7 @@ float FEdge::local_average_depth(int iCombination ) const
return result;
}
-float FEdge::local_depth_variance(int iCombination ) const
+float FEdge::local_depth_variance(int iCombination) const
{
float result;
@@ -326,7 +326,7 @@ float FEdge::local_depth_variance(int iCombination ) const
return result;
}
-real FEdge::local_average_density( float sigma, int iCombination) const
+real FEdge::local_average_density(float sigma, int iCombination) const
{
float result;
@@ -337,7 +337,7 @@ real FEdge::local_average_density( float sigma, int iCombination) const
return result;
}
-Vec3r FEdge::normal(int& oException /* = Exception::NO_EXCEPTION */)
+Vec3r FEdge::normal(int &oException /* = Exception::NO_EXCEPTION */)
{
Vec3r Na = _VertexA->normal(oException);
if (oException != Exception::NO_EXCEPTION)
@@ -352,7 +352,7 @@ Vec3r FEdge::curvature2d_as_vector(int iCombination) const
{
Vec3r result;
curvature2d_as_vector_functor<SVertex> _functor;
- Evaluate<Vec3r, curvature2d_as_vector_functor<SVertex> >(&_functor, iCombination, result);
+ Evaluate<Vec3r, curvature2d_as_vector_functor<SVertex>>(&_functor, iCombination, result);
return result;
}
@@ -360,7 +360,7 @@ real FEdge::curvature2d_as_angle(int iCombination) const
{
real result;
curvature2d_as_angle_functor<SVertex> _functor;
- Evaluate<real, curvature2d_as_angle_functor<SVertex> >(&_functor, iCombination, result);
+ Evaluate<real, curvature2d_as_angle_functor<SVertex>>(&_functor, iCombination, result);
return result;
}
#endif
diff --git a/source/blender/freestyle/intern/view_map/Silhouette.h b/source/blender/freestyle/intern/view_map/Silhouette.h
index 510aedf6cbf..b9f84e7077f 100644
--- a/source/blender/freestyle/intern/view_map/Silhouette.h
+++ b/source/blender/freestyle/intern/view_map/Silhouette.h
@@ -333,12 +333,12 @@ class SVertex : public Interface0D {
_directionFredo = d;
}
- real curvatureFredo ()
+ real curvatureFredo()
{
return _curvatureFredo;
}
- const Vec2r directionFredo ()
+ const Vec2r directionFredo()
{
return _directionFredo;
}
@@ -657,7 +657,7 @@ class FEdge : public Interface1D {
int invisibility() const;
#if 0
- inline const vector<Polygon3r>& occluders() const
+ inline const vector<Polygon3r> &occluders() const
{
return _Occluders;
}
@@ -765,7 +765,7 @@ class FEdge : public Interface1D {
}
#if 0
- inline void AddOccluder(Polygon3r& iPolygon)
+ inline void AddOccluder(Polygon3r &iPolygon)
{
_Occluders.push_back(iPolygon);
}
@@ -783,12 +783,12 @@ class FEdge : public Interface1D {
_hasVisibilityPoint = iBool;
}
- inline void setVisibilityPointA(const Vec3r& iPoint)
+ inline void setVisibilityPointA(const Vec3r &iPoint)
{
_VisibilityPointA = iPoint;
}
- inline void setVisibilityPointB(const Vec3r& iPoint)
+ inline void setVisibilityPointB(const Vec3r &iPoint)
{
_VisibilityPointB = iPoint;
}
@@ -891,7 +891,7 @@ class FEdge : public Interface1D {
const SShape *occluded_shape() const;
#if 0
- inline const bool occludee_empty() const
+ inline const bool occludee_empty() const
{
return _occludeeEmpty;
}
@@ -904,7 +904,9 @@ class FEdge : public Interface1D {
inline float local_average_depth(int iCombination = 0) const;
inline float local_depth_variance(int iCombination = 0) const;
inline real local_average_density(float sigma = 2.3f, int iCombination = 0) const;
- inline Vec3r shaded_color(int iCombination = 0) const {}
+ inline Vec3r shaded_color(int iCombination = 0) const
+ {
+ }
#endif
int viewedge_nature() const;
diff --git a/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp b/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp
index 7d105a662b8..eeec347efc6 100644
--- a/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp
+++ b/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp
@@ -262,7 +262,8 @@ real SilhouetteGeomEngine::ImageToWorldParameter(FEdge *fe, real t)
}
#if 0
if (G.debug & G_DEBUG_FREESTYLE) {
- cout << "SilhouetteGeomEngine::ImageToWorldParameter(): #iters = " << i << ", dist = " << dist << "\n";
+ cout << "SilhouetteGeomEngine::ImageToWorldParameter(): #iters = " << i
+ << ", dist = " << dist << "\n";
}
#endif
if (i == max_iters && G.debug & G_DEBUG_FREESTYLE) {
diff --git a/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp b/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp
index 94541b2c312..d9258a05ebd 100644
--- a/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp
+++ b/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp
@@ -279,7 +279,7 @@ void SteerableViewMap::saveSteerableViewMap() const
GrayImage *img = _imagesPyramids[i]->getLevel(j);
int ow = img->width();
int oh = img->height();
- float coeff = 1.0f; // 100 * 255; // * pow(2, j);
+ float coeff = 1.0f; // 100 * 255; // * pow(2, j);
QImage qtmp(ow, oh, 32);
for (unsigned int y = 0; y < oh; ++y) {
for (unsigned int x = 0; x < ow; ++x) {
diff --git a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
index 8896918e60d..629ec3d5d77 100644
--- a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
@@ -229,7 +229,7 @@ ViewEdge *ViewEdgeXBuilder::BuildSharpViewEdge(const OWXEdge &iWEdge)
while (!stopSharpViewEdge(currentWEdge.e)) {
edgesChain.push_back(currentWEdge);
++size;
- currentWEdge.e->userdata = (void *)1; // processed
+ currentWEdge.e->userdata = (void *)1; // processed
// Find the next edge!
currentWEdge = FindNextWEdge(currentWEdge);
}
@@ -239,7 +239,7 @@ ViewEdge *ViewEdgeXBuilder::BuildSharpViewEdge(const OWXEdge &iWEdge)
while (!stopSharpViewEdge(currentWEdge.e)) {
edgesChain.push_front(currentWEdge);
++size;
- currentWEdge.e->userdata = (void *)1; // processed
+ currentWEdge.e->userdata = (void *)1; // processed
// Find the previous edge!
currentWEdge = FindPreviousWEdge(currentWEdge);
}
diff --git a/source/blender/freestyle/intern/view_map/ViewMap.cpp b/source/blender/freestyle/intern/view_map/ViewMap.cpp
index 7c72e44fc10..d859f83079c 100644
--- a/source/blender/freestyle/intern/view_map/ViewMap.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewMap.cpp
@@ -271,7 +271,7 @@ ViewVertex *ViewMap::InsertViewVertex(SVertex *iVertex, vector<ViewEdge *> &newV
}
#if 0
-FEdge *ViewMap::Connect(FEdge *ioEdge, SVertex *ioVertex, vector<ViewEdge*>& oNewVEdges)
+FEdge *ViewMap::Connect(FEdge *ioEdge, SVertex *ioVertex, vector<ViewEdge *> &oNewVEdges)
{
SShape *sshape = ioEdge->shape();
FEdge *newFEdge = sshape->SplitEdgeIn2(ioEdge, ioVertex);
diff --git a/source/blender/freestyle/intern/view_map/ViewMap.h b/source/blender/freestyle/intern/view_map/ViewMap.h
index b25e13d990f..96c9c3c0b4a 100644
--- a/source/blender/freestyle/intern/view_map/ViewMap.h
+++ b/source/blender/freestyle/intern/view_map/ViewMap.h
@@ -1761,7 +1761,7 @@ inline Vec3r ViewEdge::orientation2d(int iCombination) const
return edge_orientation2d_function<ViewEdge>(*this, iCombination);
}
-inline Vec3r ViewEdge::orientation3d(int iCombination) const
+inline Vec3r ViewEdge::orientation3d(int iCombination) const
{
return edge_orientation3d_function<ViewEdge>(*this, iCombination);
}
@@ -1771,7 +1771,7 @@ inline real ViewEdge::z_discontinuity(int iCombination) const
return z_discontinuity_edge_function<ViewEdge>(*this, iCombination);
}
-inline float ViewEdge::local_average_depth(int iCombination ) const
+inline float ViewEdge::local_average_depth(int iCombination) const
{
return local_average_depth_edge_function<ViewEdge>(*this, iCombination);
}
diff --git a/source/blender/freestyle/intern/view_map/ViewMapAdvancedIterators.h b/source/blender/freestyle/intern/view_map/ViewMapAdvancedIterators.h
index 2c09bde487b..6af70120832 100644
--- a/source/blender/freestyle/intern/view_map/ViewMapAdvancedIterators.h
+++ b/source/blender/freestyle/intern/view_map/ViewMapAdvancedIterators.h
@@ -168,8 +168,9 @@ class edge_iterator_base : public IteratorBase<Traits, InputIteratorTag_Traits>
//protected://FIXME
public:
#if 0
- inline edge_iterator_base(value_type ifeA, value_type ifeB, value_type ibeA, value_type ibeB, value_type iter)
- : parent_class()
+ inline edge_iterator_base(
+ value_type ifeA, value_type ifeB, value_type ibeA, value_type ibeB, value_type iter)
+ : parent_class()
{
_Nature = Nature::T_VERTEX;
_feA = ifeA;
diff --git a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
index ed0f5c9b0bd..44d840c2cc5 100644
--- a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
@@ -1431,7 +1431,7 @@ void ViewMapBuilder::ComputeEdgesVisibility(ViewMap *ioViewMap,
real epsilon)
{
#if 0
- iAlgo = ray_casting; // for testing algorithms equivalence
+ iAlgo = ray_casting; // for testing algorithms equivalence
#endif
switch (iAlgo) {
case ray_casting:
@@ -1780,7 +1780,7 @@ void ViewMapBuilder::ComputeFastRayCastingVisibility(ViewMap *ioViewMap, real ep
++p;
#if 0
for (; p != pend; ++p) {
- WFace *f = (WFace*)((*p)->userdata);
+ WFace *f = (WFace *)((*p)->userdata);
ViewShape *vs = ioViewMap->viewShape(f->GetVertex(0)->shape()->GetId());
if (vs != vshape) {
sameShape = false;
@@ -2030,9 +2030,9 @@ int ViewMapBuilder::ComputeRayCastingVisibility(FEdge *fe,
Vec3r B(fe->vertexB()->point2d());
int viewport[4];
SilhouetteGeomEngine::retrieveViewport(viewport);
- if ((A.x() < viewport[0]) || (A.x() > viewport[2]) || (A.y() < viewport[1]) || (A.y() > viewport[3]) ||
- (B.x() < viewport[0]) || (B.x() > viewport[2]) || (B.y() < viewport[1]) || (B.y() > viewport[3]))
- {
+ if ((A.x() < viewport[0]) || (A.x() > viewport[2]) || (A.y() < viewport[1]) ||
+ (A.y() > viewport[3]) || (B.x() < viewport[0]) || (B.x() > viewport[2]) ||
+ (B.y() < viewport[1]) || (B.y() > viewport[3])) {
cerr << "Warning: point is out of the grid for fedge " << fe->getId() << endl;
//return 0;
}
@@ -2206,10 +2206,10 @@ void ViewMapBuilder::ComputeIntersections(ViewMap *ioViewMap,
}
#if 0
if (_global.debug & G_DEBUG_FREESTYLE) {
- ViewMap::viewvertices_container& vvertices = ioViewMap->ViewVertices();
+ ViewMap::viewvertices_container &vvertices = ioViewMap->ViewVertices();
for (ViewMap::viewvertices_container::iterator vv = vvertices.begin(), vvend = vvertices.end();
- vv != vvend; ++vv)
- {
+ vv != vvend;
+ ++vv) {
if ((*vv)->getNature() == Nature::T_VERTEX) {
TVertex *tvertex = (TVertex *)(*vv);
cout << "TVertex " << tvertex->getId() << " has :" << endl;
@@ -2295,8 +2295,10 @@ void ViewMapBuilder::ComputeSweepLineIntersections(ViewMap *ioViewMap, real epsi
unsigned fEdgesSize = ioViewMap->FEdges().size();
#if 0
if (_global.debug & G_DEBUG_FREESTYLE) {
- ViewMap::fedges_container& fedges = ioViewMap->FEdges();
- for (ViewMap::fedges_container::const_iterator f = fedges.begin(), end = fedges.end(); f != end; ++f) {
+ ViewMap::fedges_container &fedges = ioViewMap->FEdges();
+ for (ViewMap::fedges_container::const_iterator f = fedges.begin(), end = fedges.end();
+ f != end;
+ ++f) {
cout << (*f)->aMaterialIndex() << "-" << (*f)->bMaterialIndex() << endl;
}
}