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 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/freestyle/intern/stroke/AdvancedFunctions1D.h
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff)
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/freestyle/intern/stroke/AdvancedFunctions1D.h')
-rw-r--r--source/blender/freestyle/intern/stroke/AdvancedFunctions1D.h415
1 files changed, 208 insertions, 207 deletions
diff --git a/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.h b/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.h
index 6f5b2f34640..76a70d4f50d 100644
--- a/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.h
+++ b/source/blender/freestyle/intern/stroke/AdvancedFunctions1D.h
@@ -40,46 +40,48 @@ namespace Functions1D {
* The density is evaluated for a set of points along the Interface1D (using the DensityF0D functor) with a
* user-defined sampling and then integrated into a single value using a user-defined integration method.
*/
-class DensityF1D : public UnaryFunction1D<double>
-{
-private:
- float _sampling;
-
-public:
- /*! Builds the functor.
- * \param sigma:
- * Thesigma used in DensityF0D and determining the window size used in each density query.
- * \param iType:
- * The integration method used to compute a single value from a set of values.
- * \param sampling:
- * The resolution used to sample the chain: the corresponding 0D function is evaluated at each sample point and
- * the result is obtained by combining the resulting values into a single one, following the method specified
- * by iType.
- */
- DensityF1D(double sigma = 2, IntegrationType iType = MEAN, float sampling = 2.0f)
- : UnaryFunction1D<double>(iType), _fun(sigma)
- {
- _sampling = sampling;
- }
-
- /*! Destructor */
- virtual ~DensityF1D() {}
-
- /*! Returns the string "DensityF1D"*/
- string getName() const
- {
- return "DensityF1D";
- }
-
- /*! the () operator.*/
- int operator()(Interface1D& inter)
- {
- result = integrate(_fun, inter.pointsBegin(_sampling), inter.pointsEnd(_sampling), _integration);
- return 0;
- }
-
-private:
- Functions0D::DensityF0D _fun;
+class DensityF1D : public UnaryFunction1D<double> {
+ private:
+ float _sampling;
+
+ public:
+ /*! Builds the functor.
+ * \param sigma:
+ * Thesigma used in DensityF0D and determining the window size used in each density query.
+ * \param iType:
+ * The integration method used to compute a single value from a set of values.
+ * \param sampling:
+ * The resolution used to sample the chain: the corresponding 0D function is evaluated at each sample point and
+ * the result is obtained by combining the resulting values into a single one, following the method specified
+ * by iType.
+ */
+ DensityF1D(double sigma = 2, IntegrationType iType = MEAN, float sampling = 2.0f)
+ : UnaryFunction1D<double>(iType), _fun(sigma)
+ {
+ _sampling = sampling;
+ }
+
+ /*! Destructor */
+ virtual ~DensityF1D()
+ {
+ }
+
+ /*! Returns the string "DensityF1D"*/
+ string getName() const
+ {
+ return "DensityF1D";
+ }
+
+ /*! the () operator.*/
+ int operator()(Interface1D &inter)
+ {
+ result = integrate(
+ _fun, inter.pointsBegin(_sampling), inter.pointsEnd(_sampling), _integration);
+ return 0;
+ }
+
+ private:
+ Functions0D::DensityF0D _fun;
};
// LocalAverageDepthF1D
@@ -87,35 +89,34 @@ private:
* The average depth is evaluated for a set of points along the Interface1D (using the LocalAverageDepthF0D functor)
* with a user-defined sampling and then integrated into a single value using a user-defined integration method.
*/
-class LocalAverageDepthF1D : public UnaryFunction1D<double>
-{
-public:
- /*! Builds the functor.
- * \param sigma:
- * The sigma used in DensityF0D and determining the window size used in each density query.
- * \param iType:
- * The integration method used to compute a single value from a set of values.
- */
- LocalAverageDepthF1D(real sigma, IntegrationType iType = MEAN)
- : UnaryFunction1D<double>(iType), _fun(sigma)
- {
- }
-
- /*! Returns the string "LocalAverageDepthF1D" */
- string getName() const
- {
- return "LocalAverageDepthF1D";
- }
-
- /*! the () operator. */
- int operator()(Interface1D& inter)
- {
- result = integrate(_fun, inter.verticesBegin(), inter.verticesEnd(), _integration);
- return 0;
- }
-
-private:
- Functions0D::LocalAverageDepthF0D _fun;
+class LocalAverageDepthF1D : public UnaryFunction1D<double> {
+ public:
+ /*! Builds the functor.
+ * \param sigma:
+ * The sigma used in DensityF0D and determining the window size used in each density query.
+ * \param iType:
+ * The integration method used to compute a single value from a set of values.
+ */
+ LocalAverageDepthF1D(real sigma, IntegrationType iType = MEAN)
+ : UnaryFunction1D<double>(iType), _fun(sigma)
+ {
+ }
+
+ /*! Returns the string "LocalAverageDepthF1D" */
+ string getName() const
+ {
+ return "LocalAverageDepthF1D";
+ }
+
+ /*! the () operator. */
+ int operator()(Interface1D &inter)
+ {
+ result = integrate(_fun, inter.verticesBegin(), inter.verticesEnd(), _integration);
+ return 0;
+ }
+
+ private:
+ Functions0D::LocalAverageDepthF0D _fun;
};
// GetCompleteViewMapDensity
@@ -123,40 +124,39 @@ private:
* The density is evaluated for a set of points along the Interface1D (using the ReadCompleteViewMapPixelF0D functor)
* and then integrated into a single value using a user-defined integration method.
*/
-class GetCompleteViewMapDensityF1D : public UnaryFunction1D<double>
-{
-public:
- /*! Builds the functor.
- * \param level:
- * The level of the pyramid from which
- * the pixel must be read.
- * \param iType:
- * The integration method used to compute
- * a single value from a set of values.
- * \param sampling:
- * The resolution used to sample the chain: the corresponding 0D function
- * is evaluated at each sample point and the result is obtained by
- * combining the resulting values into a single one, following the
- * method specified by iType.
- */
- GetCompleteViewMapDensityF1D(unsigned level, IntegrationType iType = MEAN, float sampling = 2.0f)
- : UnaryFunction1D<double>(iType), _fun(level)
- {
- _sampling = sampling;
- }
-
- /*! Returns the string "GetCompleteViewMapDensityF1D" */
- string getName() const
- {
- return "GetCompleteViewMapDensityF1D";
- }
-
- /*! the () operator. */
- int operator()(Interface1D& inter);
-
-private:
- Functions0D::ReadCompleteViewMapPixelF0D _fun;
- float _sampling;
+class GetCompleteViewMapDensityF1D : public UnaryFunction1D<double> {
+ public:
+ /*! Builds the functor.
+ * \param level:
+ * The level of the pyramid from which
+ * the pixel must be read.
+ * \param iType:
+ * The integration method used to compute
+ * a single value from a set of values.
+ * \param sampling:
+ * The resolution used to sample the chain: the corresponding 0D function
+ * is evaluated at each sample point and the result is obtained by
+ * combining the resulting values into a single one, following the
+ * method specified by iType.
+ */
+ GetCompleteViewMapDensityF1D(unsigned level, IntegrationType iType = MEAN, float sampling = 2.0f)
+ : UnaryFunction1D<double>(iType), _fun(level)
+ {
+ _sampling = sampling;
+ }
+
+ /*! Returns the string "GetCompleteViewMapDensityF1D" */
+ string getName() const
+ {
+ return "GetCompleteViewMapDensityF1D";
+ }
+
+ /*! the () operator. */
+ int operator()(Interface1D &inter);
+
+ private:
+ Functions0D::ReadCompleteViewMapPixelF0D _fun;
+ float _sampling;
};
// GetDirectionalViewMapDensity
@@ -165,124 +165,125 @@ private:
* The density is evaluated for a set of points along the Interface1D (using the ReadSteerableViewMapPixelF0D functor)
* and then integrated into a single value using a user-defined integration method.
*/
-class GetDirectionalViewMapDensityF1D : public UnaryFunction1D<double>
-{
-public:
- /*! Builds the functor.
- * \param iOrientation:
- * The number of the directional map we must work with.
- * \param level:
- * The level of the pyramid from which the pixel must be read.
- * \param iType:
- * The integration method used to compute a single value from a set of values.
- * \param sampling:
- * The resolution used to sample the chain: the corresponding 0D function is evaluated at each sample point and
- * the result is obtained by combining the resulting values into a single one, following the method specified
- * by iType.
- */
- GetDirectionalViewMapDensityF1D(unsigned iOrientation, unsigned level, IntegrationType iType = MEAN,
- float sampling = 2.0f)
- : UnaryFunction1D<double>(iType), _fun(iOrientation, level)
- {
- _sampling = sampling;
- }
-
- /*! Returns the string "GetDirectionalViewMapDensityF1D" */
- string getName() const
- {
- return "GetDirectionalViewMapDensityF1D";
- }
-
- /*! the () operator. */
- int operator()(Interface1D& inter);
-
-private:
- Functions0D::ReadSteerableViewMapPixelF0D _fun;
- float _sampling;
+class GetDirectionalViewMapDensityF1D : public UnaryFunction1D<double> {
+ public:
+ /*! Builds the functor.
+ * \param iOrientation:
+ * The number of the directional map we must work with.
+ * \param level:
+ * The level of the pyramid from which the pixel must be read.
+ * \param iType:
+ * The integration method used to compute a single value from a set of values.
+ * \param sampling:
+ * The resolution used to sample the chain: the corresponding 0D function is evaluated at each sample point and
+ * the result is obtained by combining the resulting values into a single one, following the method specified
+ * by iType.
+ */
+ GetDirectionalViewMapDensityF1D(unsigned iOrientation,
+ unsigned level,
+ IntegrationType iType = MEAN,
+ float sampling = 2.0f)
+ : UnaryFunction1D<double>(iType), _fun(iOrientation, level)
+ {
+ _sampling = sampling;
+ }
+
+ /*! Returns the string "GetDirectionalViewMapDensityF1D" */
+ string getName() const
+ {
+ return "GetDirectionalViewMapDensityF1D";
+ }
+
+ /*! the () operator. */
+ int operator()(Interface1D &inter);
+
+ private:
+ Functions0D::ReadSteerableViewMapPixelF0D _fun;
+ float _sampling;
};
// GetSteerableViewMapDensityF1D
/*! Returns the density of the viewmap for a given Interface1D. The density of each FEdge is evaluated
* in the proper steerable ViewMap depending on its oorientation.
*/
-class GetSteerableViewMapDensityF1D : public UnaryFunction1D<double>
-{
-private:
- int _level;
- float _sampling;
-
-public:
- /*! Builds the functor from the level of the pyramid from which the pixel must be read.
- * \param level:
- * The level of the pyramid from which the pixel must be read.
- * \param iType:
- * The integration method used to compute a single value from a set of values.
- * \param sampling:
- * The resolution used to sample the chain: the corresponding 0D function is evaluated at each sample point and
- * the result is obtained by combining the resulting values into a single one, following the method specified
- * by iType.
- */
- GetSteerableViewMapDensityF1D(int level, IntegrationType iType = MEAN, float sampling = 2.0f)
- : UnaryFunction1D<double>(iType)
- {
- _level = level;
- _sampling = sampling;
- }
-
- /*! Destructor */
- virtual ~GetSteerableViewMapDensityF1D() {}
-
- /*! Returns the string "GetSteerableViewMapDensityF1D" */
- string getName() const
- {
- return "GetSteerableViewMapDensityF1D";
- }
-
- /*! the () operator. */
- int operator()(Interface1D& inter);
+class GetSteerableViewMapDensityF1D : public UnaryFunction1D<double> {
+ private:
+ int _level;
+ float _sampling;
+
+ public:
+ /*! Builds the functor from the level of the pyramid from which the pixel must be read.
+ * \param level:
+ * The level of the pyramid from which the pixel must be read.
+ * \param iType:
+ * The integration method used to compute a single value from a set of values.
+ * \param sampling:
+ * The resolution used to sample the chain: the corresponding 0D function is evaluated at each sample point and
+ * the result is obtained by combining the resulting values into a single one, following the method specified
+ * by iType.
+ */
+ GetSteerableViewMapDensityF1D(int level, IntegrationType iType = MEAN, float sampling = 2.0f)
+ : UnaryFunction1D<double>(iType)
+ {
+ _level = level;
+ _sampling = sampling;
+ }
+
+ /*! Destructor */
+ virtual ~GetSteerableViewMapDensityF1D()
+ {
+ }
+
+ /*! Returns the string "GetSteerableViewMapDensityF1D" */
+ string getName() const
+ {
+ return "GetSteerableViewMapDensityF1D";
+ }
+
+ /*! the () operator. */
+ int operator()(Interface1D &inter);
};
// GetViewMapGradientNormF1D
/*! Returns the density of the viewmap for a given Interface1D. The density of each FEdge is evaluated in
* the proper steerable ViewMap depending on its oorientation.
*/
-class GetViewMapGradientNormF1D : public UnaryFunction1D<double>
-{
-private:
- int _level;
- float _sampling;
- Functions0D::GetViewMapGradientNormF0D _func;
-
-public:
- /*! Builds the functor from the level of the pyramid from which the pixel must be read.
- * \param level:
- * The level of the pyramid from which the pixel must be read.
- * \param iType:
- * The integration method used to compute a single value from a set of values.
- * \param sampling:
- * The resolution used to sample the chain: the corresponding 0D function is evaluated at each sample point and
- * the result is obtained by combining the resulting values into a single one, following the method specified
- * by iType.
- */
- GetViewMapGradientNormF1D(int level, IntegrationType iType = MEAN, float sampling = 2.0f)
- : UnaryFunction1D<double>(iType), _func(level)
- {
- _level = level;
- _sampling = sampling;
- }
-
- /*! Returns the string "GetSteerableViewMapDensityF1D" */
- string getName() const
- {
- return "GetViewMapGradientNormF1D";
- }
-
- /*! the () operator. */
- int operator()(Interface1D& inter);
+class GetViewMapGradientNormF1D : public UnaryFunction1D<double> {
+ private:
+ int _level;
+ float _sampling;
+ Functions0D::GetViewMapGradientNormF0D _func;
+
+ public:
+ /*! Builds the functor from the level of the pyramid from which the pixel must be read.
+ * \param level:
+ * The level of the pyramid from which the pixel must be read.
+ * \param iType:
+ * The integration method used to compute a single value from a set of values.
+ * \param sampling:
+ * The resolution used to sample the chain: the corresponding 0D function is evaluated at each sample point and
+ * the result is obtained by combining the resulting values into a single one, following the method specified
+ * by iType.
+ */
+ GetViewMapGradientNormF1D(int level, IntegrationType iType = MEAN, float sampling = 2.0f)
+ : UnaryFunction1D<double>(iType), _func(level)
+ {
+ _level = level;
+ _sampling = sampling;
+ }
+
+ /*! Returns the string "GetSteerableViewMapDensityF1D" */
+ string getName() const
+ {
+ return "GetViewMapGradientNormF1D";
+ }
+
+ /*! the () operator. */
+ int operator()(Interface1D &inter);
};
-} // end of namespace Functions1D
+} // end of namespace Functions1D
} /* namespace Freestyle */
-#endif // __FREESTYLE_ADVANCED_FUNCTIONS_1D_H__
+#endif // __FREESTYLE_ADVANCED_FUNCTIONS_1D_H__