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:
Diffstat (limited to 'source/blender/freestyle')
-rw-r--r--source/blender/freestyle/intern/application/Controller.cpp2
-rw-r--r--source/blender/freestyle/intern/geometry/FitCurve.cpp4
-rw-r--r--source/blender/freestyle/intern/geometry/Grid.cpp2
-rw-r--r--source/blender/freestyle/intern/python/BPy_Freestyle.cpp4
-rw-r--r--source/blender/freestyle/intern/python/BPy_Id.cpp2
-rw-r--r--source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp2
-rw-r--r--source/blender/freestyle/intern/stroke/Canvas.cpp2
-rw-r--r--source/blender/freestyle/intern/stroke/ChainingIterators.cpp2
-rw-r--r--source/blender/freestyle/intern/stroke/StrokeRep.cpp6
-rw-r--r--source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp6
-rw-r--r--source/blender/freestyle/intern/view_map/Functions0D.cpp4
-rw-r--r--source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp28
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMap.cpp2
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp10
-rw-r--r--source/blender/freestyle/intern/winged_edge/Curvature.cpp2
-rw-r--r--source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.cpp2
16 files changed, 40 insertions, 40 deletions
diff --git a/source/blender/freestyle/intern/application/Controller.cpp b/source/blender/freestyle/intern/application/Controller.cpp
index 80e58820b37..670482a23a6 100644
--- a/source/blender/freestyle/intern/application/Controller.cpp
+++ b/source/blender/freestyle/intern/application/Controller.cpp
@@ -1004,7 +1004,7 @@ NodeGroup *Controller::BuildRep(vector<ViewEdge *>::iterator vedges_begin,
mat.setDiffuse(1, 1, 0.3, 1);
tesselator2D.setFrsMaterial(mat);
- return (tesselator2D.Tesselate(vedges_begin, vedges_end));
+ return tesselator2D.Tesselate(vedges_begin, vedges_end);
}
void Controller::toggleEdgeTesselationNature(Nature::EdgeNature iNature)
diff --git a/source/blender/freestyle/intern/geometry/FitCurve.cpp b/source/blender/freestyle/intern/geometry/FitCurve.cpp
index 3ea83576e8f..ad9b7dfa5ed 100644
--- a/source/blender/freestyle/intern/geometry/FitCurve.cpp
+++ b/source/blender/freestyle/intern/geometry/FitCurve.cpp
@@ -45,7 +45,7 @@ static double V2SquaredLength(Vector2 *a)
/* returns length of input vector */
static double V2Length(Vector2 *a)
{
- return (sqrt(V2SquaredLength(a)));
+ return sqrt(V2SquaredLength(a));
}
static Vector2 *V2Scale(Vector2 *v, double newlen)
@@ -69,7 +69,7 @@ static double V2DistanceBetween2Points(Vector2 *a, Vector2 *b)
{
double dx = (*a)[0] - (*b)[0];
double dy = (*a)[1] - (*b)[1];
- return (sqrt((dx * dx) + (dy * dy)));
+ return sqrt((dx * dx) + (dy * dy));
}
/* return vector sum c = a+b */
diff --git a/source/blender/freestyle/intern/geometry/Grid.cpp b/source/blender/freestyle/intern/geometry/Grid.cpp
index e0e3af0fe47..a2620aa25d7 100644
--- a/source/blender/freestyle/intern/geometry/Grid.cpp
+++ b/source/blender/freestyle/intern/geometry/Grid.cpp
@@ -36,7 +36,7 @@ void firstIntersectionGridVisitor::examineOccluder(Polygon3r *occ)
// check whether the edge and the polygon plane are coincident:
//-------------------------------------------------------------
// first let us compute the plane equation.
- Vec3r v1(((occ)->getVertices())[0]);
+ Vec3r v1((occ)->getVertices()[0]);
Vec3d normal((occ)->getNormal());
// soc unused - double d = -(v1 * normal);
diff --git a/source/blender/freestyle/intern/python/BPy_Freestyle.cpp b/source/blender/freestyle/intern/python/BPy_Freestyle.cpp
index 96bab8c2028..96887f7a83b 100644
--- a/source/blender/freestyle/intern/python/BPy_Freestyle.cpp
+++ b/source/blender/freestyle/intern/python/BPy_Freestyle.cpp
@@ -200,7 +200,7 @@ static PyObject *Freestyle_evaluateColorRamp(PyObject * /*self*/, PyObject *args
ColorBand *coba;
float in, out[4];
- if (!(PyArg_ParseTuple(args, "O!f", &pyrna_struct_Type, &py_srna, &in))) {
+ if (!PyArg_ParseTuple(args, "O!f", &pyrna_struct_Type, &py_srna, &in)) {
return nullptr;
}
if (!RNA_struct_is_a(py_srna->ptr.type, &RNA_ColorRamp)) {
@@ -239,7 +239,7 @@ static PyObject *Freestyle_evaluateCurveMappingF(PyObject * /*self*/, PyObject *
int cur;
float value;
- if (!(PyArg_ParseTuple(args, "O!if", &pyrna_struct_Type, &py_srna, &cur, &value))) {
+ if (!PyArg_ParseTuple(args, "O!if", &pyrna_struct_Type, &py_srna, &cur, &value)) {
return nullptr;
}
if (!RNA_struct_is_a(py_srna->ptr.type, &RNA_CurveMapping)) {
diff --git a/source/blender/freestyle/intern/python/BPy_Id.cpp b/source/blender/freestyle/intern/python/BPy_Id.cpp
index dc6592769b8..66880d6185c 100644
--- a/source/blender/freestyle/intern/python/BPy_Id.cpp
+++ b/source/blender/freestyle/intern/python/BPy_Id.cpp
@@ -97,7 +97,7 @@ static PyObject *Id_RichCompare(BPy_Id *o1, BPy_Id *o2, int opid)
case Py_GT:
return PyBool_from_bool(!(o1->id->operator<(*(o2->id)) || o1->id->operator==(*(o2->id))));
case Py_GE:
- return PyBool_from_bool(!(o1->id->operator<(*(o2->id))));
+ return PyBool_from_bool(!o1->id->operator<(*(o2->id)));
}
Py_RETURN_NONE;
}
diff --git a/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp b/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp
index 3a6946d1668..4df0bd7b089 100644
--- a/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp
+++ b/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp
@@ -614,7 +614,7 @@ int GuidingLinesShader::shade(Stroke &stroke) const
n[0] = -n[0];
n[1] = -n[1];
}
- float offset = (piece.error()) / 2.0f * _offset;
+ float offset = piece.error() / 2.0f * _offset;
StrokeInternal::StrokeVertexIterator v, vend;
for (v = a, vend = stroke.strokeVerticesEnd(); v != vend; ++v) {
v->setPoint(piece.A.x() + v->u() * u.x() + n.x() * offset,
diff --git a/source/blender/freestyle/intern/stroke/Canvas.cpp b/source/blender/freestyle/intern/stroke/Canvas.cpp
index 82772ebb3a7..af79a8eb4eb 100644
--- a/source/blender/freestyle/intern/stroke/Canvas.cpp
+++ b/source/blender/freestyle/intern/stroke/Canvas.cpp
@@ -173,7 +173,7 @@ void Canvas::InsertStyleModule(uint index, StyleModule *iStyleModule)
{
uint size = _StyleModules.size();
StrokeLayer *layer = new StrokeLayer();
- if ((_StyleModules.empty()) || (index == size)) {
+ if (_StyleModules.empty() || (index == size)) {
_StyleModules.push_back(iStyleModule);
_Layers.push_back(layer);
return;
diff --git a/source/blender/freestyle/intern/stroke/ChainingIterators.cpp b/source/blender/freestyle/intern/stroke/ChainingIterators.cpp
index 453eea58c93..87aabf71636 100644
--- a/source/blender/freestyle/intern/stroke/ChainingIterators.cpp
+++ b/source/blender/freestyle/intern/stroke/ChainingIterators.cpp
@@ -26,7 +26,7 @@ bool AdjacencyIterator::isIncoming() const
int AdjacencyIterator::increment()
{
++_internalIterator;
- while ((!_internalIterator.isEnd()) && (!isValid((*_internalIterator).first))) {
+ while (!_internalIterator.isEnd() && !isValid((*_internalIterator).first)) {
++_internalIterator;
}
return 0;
diff --git a/source/blender/freestyle/intern/stroke/StrokeRep.cpp b/source/blender/freestyle/intern/stroke/StrokeRep.cpp
index 282c72617f0..89567d7e780 100644
--- a/source/blender/freestyle/intern/stroke/StrokeRep.cpp
+++ b/source/blender/freestyle/intern/stroke/StrokeRep.cpp
@@ -837,11 +837,11 @@ void StrokeRep::create()
bool first = true;
bool end = false;
while (v != vend) {
- while ((v != vend) && (!(*v).attribute().isVisible())) {
+ while ((v != vend) && !(*v).attribute().isVisible()) {
++v;
first = false;
}
- while ((v != vend) && ((*v).attribute().isVisible())) {
+ while ((v != vend) && (*v).attribute().isVisible()) {
strip.push_back(&(*v));
++v;
}
@@ -852,7 +852,7 @@ void StrokeRep::create()
else {
end = true;
}
- if ((!strip.empty()) && (strip.size() > 1)) {
+ if (!strip.empty() && (strip.size() > 1)) {
_strips.push_back(new Strip(strip, _hasTex, first, end, _textureStep));
strip.clear();
}
diff --git a/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp b/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp
index b94904d5efb..e455011f187 100644
--- a/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp
+++ b/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp
@@ -318,8 +318,8 @@ void FEdgeXDetector::ProcessSilhouetteEdge(WXEdge *iEdge)
WXFace *fA = (WXFace *)iEdge->GetaOEdge()->GetaFace();
WXFace *fB = (WXFace *)iEdge->GetaOEdge()->GetbFace();
- if ((fA->front()) ^
- (fB->front())) { // fA->visible XOR fB->visible (true if one is 0 and the other is 1)
+ if (fA->front() ^
+ fB->front()) { // fA->visible XOR fB->visible (true if one is 0 and the other is 1)
// The only edges we want to set as silhouette edges in this way are the ones with 2 different
// normals for 1 vertex for these two faces
//--------------------
@@ -627,7 +627,7 @@ void FEdgeXDetector::postProcessSuggestiveContourFace(WXFace *iFace)
real kr(0), kr1(0), kr2(0), t;
for (uint i = 0; i < vertices_nb; ++i) {
- v = (WXVertex *)(iFace->GetVertex(i));
+ v = (WXVertex *)iFace->GetVertex(i);
// v is a singular vertex, skip it.
if (v->isBoundary()) {
diff --git a/source/blender/freestyle/intern/view_map/Functions0D.cpp b/source/blender/freestyle/intern/view_map/Functions0D.cpp
index d05107dc264..2157c533986 100644
--- a/source/blender/freestyle/intern/view_map/Functions0D.cpp
+++ b/source/blender/freestyle/intern/view_map/Functions0D.cpp
@@ -203,11 +203,11 @@ int Curvature2DAngleF0D::operator()(Interface0DIterator &iter)
Interface0DIterator tmp1 = iter, tmp2 = iter;
++tmp2;
uint count = 1;
- while ((!tmp1.isBegin()) && (count < 3)) {
+ while (!tmp1.isBegin() && (count < 3)) {
--tmp1;
++count;
}
- while ((!tmp2.isEnd()) && (count < 3)) {
+ while (!tmp2.isEnd() && (count < 3)) {
++tmp2;
++count;
}
diff --git a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
index dfc5cd0af61..277334d13fd 100644
--- a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
@@ -350,7 +350,7 @@ OWXFaceLayer ViewEdgeXBuilder::FindNextFaceLayer(const OWXFaceLayer &iFaceLayer)
vector<WXFaceLayer *> sameNatureLayers;
nextFace->retrieveSmoothEdgesLayers(iFaceLayer.fl->nature(), sameNatureLayers);
// don't know how to deal with several edges of same nature on a single face
- if ((sameNatureLayers.empty()) || (sameNatureLayers.size() != 1)) {
+ if (sameNatureLayers.empty() || (sameNatureLayers.size() != 1)) {
return OWXFaceLayer(nullptr, true);
}
@@ -431,7 +431,7 @@ OWXFaceLayer ViewEdgeXBuilder::FindPreviousFaceLayer(const OWXFaceLayer &iFaceLa
vector<WXFaceLayer *> sameNatureLayers;
previousFace->retrieveSmoothEdgesLayers(iFaceLayer.fl->nature(), sameNatureLayers);
// don't know how to deal with several edges of same nature on a single face
- if ((sameNatureLayers.empty()) || (sameNatureLayers.size() != 1)) {
+ if (sameNatureLayers.empty() || (sameNatureLayers.size() != 1)) {
return OWXFaceLayer(nullptr, true);
}
@@ -688,23 +688,23 @@ FEdge *ViewEdgeXBuilder::BuildSharpFEdge(FEdge *feprevious, const OWXEdge &iwe)
uint matA(0), matB(0);
bool faceMarkA = false, faceMarkB = false;
if (iwe.order) {
- normalB = (iwe.e->GetbFace()->GetNormal());
- matB = (iwe.e->GetbFace()->frs_materialIndex());
- faceMarkB = (iwe.e->GetbFace()->GetMark());
+ normalB = iwe.e->GetbFace()->GetNormal();
+ matB = iwe.e->GetbFace()->frs_materialIndex();
+ faceMarkB = iwe.e->GetbFace()->GetMark();
if (!(iwe.e->nature() & Nature::BORDER)) {
- normalA = (iwe.e->GetaFace()->GetNormal());
- matA = (iwe.e->GetaFace()->frs_materialIndex());
- faceMarkA = (iwe.e->GetaFace()->GetMark());
+ normalA = iwe.e->GetaFace()->GetNormal();
+ matA = iwe.e->GetaFace()->frs_materialIndex();
+ faceMarkA = iwe.e->GetaFace()->GetMark();
}
}
else {
- normalA = (iwe.e->GetbFace()->GetNormal());
- matA = (iwe.e->GetbFace()->frs_materialIndex());
- faceMarkA = (iwe.e->GetbFace()->GetMark());
+ normalA = iwe.e->GetbFace()->GetNormal();
+ matA = iwe.e->GetbFace()->frs_materialIndex();
+ faceMarkA = iwe.e->GetbFace()->GetMark();
if (!(iwe.e->nature() & Nature::BORDER)) {
- normalB = (iwe.e->GetaFace()->GetNormal());
- matB = (iwe.e->GetaFace()->frs_materialIndex());
- faceMarkB = (iwe.e->GetaFace()->GetMark());
+ normalB = iwe.e->GetaFace()->GetNormal();
+ matB = iwe.e->GetaFace()->frs_materialIndex();
+ faceMarkB = iwe.e->GetaFace()->GetMark();
}
}
// Creates the corresponding feature edge
diff --git a/source/blender/freestyle/intern/view_map/ViewMap.cpp b/source/blender/freestyle/intern/view_map/ViewMap.cpp
index 34eae2ab47e..0ba4850eed5 100644
--- a/source/blender/freestyle/intern/view_map/ViewMap.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewMap.cpp
@@ -770,7 +770,7 @@ ViewShape::~ViewShape()
{
_Vertices.clear();
- if (!(_Edges.empty())) {
+ if (!_Edges.empty()) {
for (vector<ViewEdge *>::iterator e = _Edges.begin(), eend = _Edges.end(); e != eend; e++) {
delete (*e);
}
diff --git a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
index 024a6a82b72..4ef06c0ac96 100644
--- a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
@@ -73,7 +73,7 @@ static void findOccludee(FEdge *fe,
#endif
oface = occluders.getWFace();
Polygon3r *p = occluders.getCameraSpacePolygon();
- real d = -((p->getVertices())[0] * p->getNormal());
+ real d = -(p->getVertices()[0] * p->getNormal());
real t, t_u, t_v;
if (nullptr != face) {
@@ -286,7 +286,7 @@ static int computeVisibility(ViewMap *viewMap,
<< ", norm: " << p1.getNormal() << endl;
}
#else
- real d = -((p->getVertices())[0] * p->getNormal());
+ real d = -(p->getVertices()[0] * p->getNormal());
#endif
if (face) {
@@ -1289,7 +1289,7 @@ void ViewMapBuilder::computeCusps(ViewMap *ioViewMap)
if (_pRenderMonitor && _pRenderMonitor->testBreak()) {
break;
}
- if (!((*ve)->getNature() & Nature::SILHOUETTE) || !((*ve)->fedgeA()->isSmooth())) {
+ if (!((*ve)->getNature() & Nature::SILHOUETTE) || !(*ve)->fedgeA()->isSmooth()) {
continue;
}
FEdge *fe = (*ve)->fedgeA();
@@ -1916,7 +1916,7 @@ void ViewMapBuilder::FindOccludee(FEdge *fe,
//-------------------------------------------------------------
// first let us compute the plane equation.
oface = (WFace *)(*p)->userdata;
- Vec3r v1(((*p)->getVertices())[0]);
+ Vec3r v1((*p)->getVertices()[0]);
Vec3r normal((*p)->getNormal());
real d = -(v1 * normal);
real t, t_u, t_v;
@@ -2115,7 +2115,7 @@ int ViewMapBuilder::ComputeRayCastingVisibility(FEdge *fe,
<< "\t\t\tand ray " << vp << " * " << u << " (center " << center << ")" << endl;
}
#endif
- Vec3r v1(((*p)->getVertices())[0]);
+ Vec3r v1((*p)->getVertices()[0]);
Vec3r normal((*p)->getNormal());
real d = -(v1 * normal);
real t, t_u, t_v;
diff --git a/source/blender/freestyle/intern/winged_edge/Curvature.cpp b/source/blender/freestyle/intern/winged_edge/Curvature.cpp
index 5155f06a1bb..36c06fde78e 100644
--- a/source/blender/freestyle/intern/winged_edge/Curvature.cpp
+++ b/source/blender/freestyle/intern/winged_edge/Curvature.cpp
@@ -80,7 +80,7 @@ static real angle_from_cotan(WVertex *vo, WVertex *v1, WVertex *v2)
/* NOTE(Ray Jones): I assume this is what they mean by using #atan2. */
/* tan = denom/udotv = y/x (see man page for atan2) */
- return (fabs(atan2(denom, udotv)));
+ return fabs(atan2(denom, udotv));
}
bool gts_vertex_mean_curvature_normal(WVertex *v, Vec3r &Kh)
diff --git a/source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.cpp b/source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.cpp
index 6f30f73d086..e8095d89ee1 100644
--- a/source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.cpp
+++ b/source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.cpp
@@ -35,7 +35,7 @@ void WingedEdgeBuilder::visitIndexedFaceSet(IndexedFaceSet &ifs)
void WingedEdgeBuilder::visitNodeShape(NodeShape &ns)
{
// Sets the current material to iShapeode->material:
- _current_frs_material = &(ns.frs_material());
+ _current_frs_material = &ns.frs_material();
}
void WingedEdgeBuilder::visitNodeTransform(NodeTransform &tn)