From cf25f572a6a157c7a460eec53cb7d5d5fcdae0ea Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Tue, 29 May 2012 14:51:59 +0000 Subject: [PATCH] Documentation: improved correctness checking for superclasses --- doc/check_docs2.py | 9 ++++----- modules/python/src2/hdr_parser.py | 4 ++-- modules/stitching/doc/blenders.rst | 10 +++++----- modules/stitching/doc/exposure_compensation.rst | 6 +++--- modules/stitching/doc/matching.rst | 6 +++--- modules/stitching/doc/motion_estimation.rst | 8 ++++---- modules/stitching/doc/warpers.rst | 6 +++--- 7 files changed, 24 insertions(+), 25 deletions(-) diff --git a/doc/check_docs2.py b/doc/check_docs2.py index 6434f91..12696b3 100644 --- a/doc/check_docs2.py +++ b/doc/check_docs2.py @@ -247,12 +247,11 @@ def process_module(module, path): else: # verify base signature = doc.get("class", "") - signature = signature.replace(", public ", " ").replace(" public ", " ") - signature = signature.replace(", protected ", " ").replace(" protected ", " ") - signature = signature.replace(", private ", " ").replace(" private ", " ") + signature = signature.replace(" public ", " ") + namespaceIdx = signature.rfind("::") + signature = ("class " + signature).strip() - #hdrsignature = (cl[0] + " " + cl[1]).replace("class cv.", "class ").replace(".", "::").strip() - hdrsignature = ("class " + name + " " + cl[1]).replace(".", "::").strip() + hdrsignature = ("class " + name + " " + cl[1]).replace(".", "::").replace("cv::","").strip() if signature != hdrsignature: logerror(ERROR_003_INCORRECTBASE, "invalid base class documentation\ndocumented: " + signature + "\nactual: " + hdrsignature, doc) diff --git a/modules/python/src2/hdr_parser.py b/modules/python/src2/hdr_parser.py index 4f9c2c0..8bee6b5 100755 --- a/modules/python/src2/hdr_parser.py +++ b/modules/python/src2/hdr_parser.py @@ -627,7 +627,7 @@ class CppHeaderParser(object): classname = classname[1:] decl = [stmt_type + " " + self.get_dotted_name(classname), "", modlist, []] if bases: - decl[1] = ": " + " ".join(bases) + decl[1] = ": " + ", ".join([b if "::" in b else self.get_dotted_name(b).replace(".","::") for b in bases]) return stmt_type, classname, True, decl if stmt.startswith("class") or stmt.startswith("struct"): @@ -642,7 +642,7 @@ class CppHeaderParser(object): if ("CV_EXPORTS_W" in stmt) or ("CV_EXPORTS_AS" in stmt) or (not self.wrap_mode):# and ("CV_EXPORTS" in stmt)): decl = [stmt_type + " " + self.get_dotted_name(classname), "", modlist, []] if bases: - decl[1] = ": " + " ".join(bases) + decl[1] = ": " + ", ".join([b if "::" in b else self.get_dotted_name(b).replace(".","::") for b in bases]) return stmt_type, classname, True, decl if stmt.startswith("enum"): diff --git a/modules/stitching/doc/blenders.rst b/modules/stitching/doc/blenders.rst index 93c3b1e..031a326 100644 --- a/modules/stitching/doc/blenders.rst +++ b/modules/stitching/doc/blenders.rst @@ -8,7 +8,7 @@ detail::Blender .. ocv:class:: detail::Blender Base class for all blenders. :: - + class CV_EXPORTS Blender { public: @@ -17,7 +17,7 @@ Base class for all blenders. :: enum { NO, FEATHER, MULTI_BAND }; static Ptr createDefault(int type, bool try_gpu = false); - void prepare(const std::vector &corners, const std::vector &sizes); + void prepare(const std::vector &corners, const std::vector &sizes); virtual void prepare(Rect dst_roi); virtual void feed(const Mat &img, const Mat &mask, Point tl); virtual void blend(Mat &dst, Mat &dst_mask); @@ -48,7 +48,7 @@ Processes the image. :param img: Source image :param mask: Source image mask - + :param tl: Source image top-left corners detail::Blender::blend @@ -64,7 +64,7 @@ Blends and returns the final pano. detail::FeatherBlender ---------------------- -.. ocv:class:: detail::FeatherBlender : public Blender +.. ocv:class:: detail::FeatherBlender : public detail::Blender Simple blender which mixes images at its borders. :: @@ -93,7 +93,7 @@ Simple blender which mixes images at its borders. :: detail::MultiBandBlender ------------------------ -.. ocv:class:: detail::MultiBandBlender : public Blender +.. ocv:class:: detail::MultiBandBlender : public detail::Blender Blender which uses multi-band blending algorithm (see [BA83]_). :: diff --git a/modules/stitching/doc/exposure_compensation.rst b/modules/stitching/doc/exposure_compensation.rst index 3e4e203..d27701e 100644 --- a/modules/stitching/doc/exposure_compensation.rst +++ b/modules/stitching/doc/exposure_compensation.rst @@ -54,7 +54,7 @@ Compensate exposure in the specified image. detail::NoExposureCompensator ----------------------------- -.. ocv:class:: detail::NoExposureCompensator : public ExposureCompensator +.. ocv:class:: detail::NoExposureCompensator : public detail::ExposureCompensator Stub exposure compensator which does nothing. :: @@ -70,7 +70,7 @@ Stub exposure compensator which does nothing. :: detail::GainCompensator ----------------------- -.. ocv:class:: detail::GainCompensator : public ExposureCompensator +.. ocv:class:: detail::GainCompensator : public detail::ExposureCompensator Exposure compensator which tries to remove exposure related artifacts by adjusting image intensities, see [BL07]_ and [WJ10]_ for details. :: @@ -90,7 +90,7 @@ Exposure compensator which tries to remove exposure related artifacts by adjusti detail::BlocksGainCompensator ----------------------------- -.. ocv:class:: detail::BlocksGainCompensator : public ExposureCompensator +.. ocv:class:: detail::BlocksGainCompensator : public detail::ExposureCompensator Exposure compensator which tries to remove exposure related artifacts by adjusting image block intensities, see [UES01]_ for details. :: diff --git a/modules/stitching/doc/matching.rst b/modules/stitching/doc/matching.rst index b39d62c..c58eb2c 100644 --- a/modules/stitching/doc/matching.rst +++ b/modules/stitching/doc/matching.rst @@ -74,7 +74,7 @@ This method must implement features finding logic in order to make the wrappers detail::SurfFeaturesFinder -------------------------- -.. ocv:class:: detail::SurfFeaturesFinder : public FeaturesFinder +.. ocv:class:: detail::SurfFeaturesFinder : public detail::FeaturesFinder SURF features finder. :: @@ -92,7 +92,7 @@ SURF features finder. :: detail::OrbFeaturesFinder ------------------------- -.. ocv:class:: detail::OrbFeaturesFinder : public FeaturesFinder +.. ocv:class:: detail::OrbFeaturesFinder : public detail::FeaturesFinder ORB features finder. :: @@ -212,7 +212,7 @@ This method must implement matching logic in order to make the wrappers `detail: detail::BestOf2NearestMatcher ----------------------------- -.. ocv:class:: detail::BestOf2NearestMatcher : public FeaturesMatcher +.. ocv:class:: detail::BestOf2NearestMatcher : public detail::FeaturesMatcher Features matcher which finds two best matches for each feature and leaves the best one only if the ratio between descriptor distances is greater than the threshold ``match_conf``. :: diff --git a/modules/stitching/doc/motion_estimation.rst b/modules/stitching/doc/motion_estimation.rst index 1591689..0c85c2c 100644 --- a/modules/stitching/doc/motion_estimation.rst +++ b/modules/stitching/doc/motion_estimation.rst @@ -55,7 +55,7 @@ This method must implement camera parameters estimation logic in order to make t detail::HomographyBasedEstimator -------------------------------- -.. ocv:class:: detail::HomographyBasedEstimator : public Estimator +.. ocv:class:: detail::HomographyBasedEstimator : public detail::Estimator Homography based rotation estimator. :: @@ -71,7 +71,7 @@ Homography based rotation estimator. :: detail::BundleAdjusterBase -------------------------- -.. ocv:class:: detail::BundleAdjusterBase : public Estimator +.. ocv:class:: detail::BundleAdjusterBase : public detail::Estimator Base class for all camera parameters refinement methods. :: @@ -187,7 +187,7 @@ Gets the refined camera parameters. detail::BundleAdjusterReproj ---------------------------- -.. ocv:class:: detail::BundleAdjusterReproj : public BundleAdjusterBase +.. ocv:class:: detail::BundleAdjusterReproj : public detail::BundleAdjusterBase Implementation of the camera parameters refinement algorithm which minimizes sum of the reprojection error squares. :: @@ -204,7 +204,7 @@ Implementation of the camera parameters refinement algorithm which minimizes sum detail::BundleAdjusterRay ------------------------- -.. ocv:class:: detail::BundleAdjusterRay : public BundleAdjusterBase +.. ocv:class:: detail::BundleAdjusterRay : public detail::BundleAdjusterBase Implementation of the camera parameters refinement algorithm which minimizes sum of the distances between the rays passing through the camera center and a feature. :: diff --git a/modules/stitching/doc/warpers.rst b/modules/stitching/doc/warpers.rst index 31fa7cb..b6826a0 100644 --- a/modules/stitching/doc/warpers.rst +++ b/modules/stitching/doc/warpers.rst @@ -172,7 +172,7 @@ Base class for rotation-based warper using a `detail::ProjectorBase`_ derived cl detail::PlaneWarper ------------------- -.. ocv:class:: detail::PlaneWarper : public RotationWarperBase +.. ocv:class:: detail::PlaneWarper : public detail::RotationWarperBase Warper that maps an image onto the z = 1 plane. :: @@ -209,7 +209,7 @@ Construct an instance of the plane warper class. detail::SphericalWarper ----------------------- -.. ocv:class:: detail::SphericalWarper : public RotationWarperBase +.. ocv:class:: detail::SphericalWarper : public detail::RotationWarperBase Warper that maps an image onto the unit sphere located at the origin. :: @@ -235,7 +235,7 @@ Construct an instance of the spherical warper class. detail::CylindricalWarper ------------------------- -.. ocv:class:: detail::CylindricalWarper : public RotationWarperBase +.. ocv:class:: detail::CylindricalWarper : public detail::RotationWarperBase Warper that maps an image onto the x*x + z*z = 1 cylinder. :: -- 2.7.4