base class name resolution
fixed find_obj.py
This commit is contained in:
@@ -16,6 +16,7 @@ endforeach(mp)
|
||||
ocv_list_filterout(candidate_deps "^opencv_cud(a|ev)")
|
||||
ocv_list_filterout(candidate_deps "^opencv_matlab$")
|
||||
ocv_list_filterout(candidate_deps "^opencv_ts$")
|
||||
ocv_list_filterout(candidate_deps "^opencv_adas$")
|
||||
|
||||
ocv_add_module(${MODULE_NAME} BINDINGS OPTIONAL ${candidate_deps})
|
||||
|
||||
@@ -35,6 +36,7 @@ ocv_list_filterout(opencv_hdrs ".h$")
|
||||
ocv_list_filterout(opencv_hdrs "cuda")
|
||||
ocv_list_filterout(opencv_hdrs "cudev")
|
||||
ocv_list_filterout(opencv_hdrs "opencv2/objdetect/detection_based_tracker.hpp")
|
||||
ocv_list_filterout(opencv_hdrs "opencv2/ximgproc/structured_edge_detection.hpp")
|
||||
|
||||
set(cv2_generated_hdrs
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pyopencv_generated_include.h"
|
||||
|
||||
@@ -267,7 +267,7 @@ class ClassInfo(object):
|
||||
#return sys.exit(-1)
|
||||
if self.bases and self.bases[0].startswith("cv::"):
|
||||
self.bases[0] = self.bases[0][4:]
|
||||
if self.bases and self.bases[0] == "cv::Algorithm":
|
||||
if self.bases and self.bases[0] == "Algorithm":
|
||||
self.isalgorithm = True
|
||||
for m in decl[2]:
|
||||
if m.startswith("="):
|
||||
@@ -752,8 +752,19 @@ class PythonWrapperGenerator(object):
|
||||
% (classinfo.name, classinfo.cname))
|
||||
sys.exit(-1)
|
||||
self.classes[classinfo.name] = classinfo
|
||||
if classinfo.bases and not classinfo.isalgorithm:
|
||||
classinfo.isalgorithm = self.classes[classinfo.bases[0].replace("::", "_")].isalgorithm
|
||||
|
||||
if classinfo.bases:
|
||||
chunks = classinfo.bases[0].split('::')
|
||||
base = '_'.join(chunks)
|
||||
while base not in self.classes and len(chunks)>1:
|
||||
del chunks[-2]
|
||||
base = '_'.join(chunks)
|
||||
if base not in self.classes:
|
||||
print("Generator error: unable to resolve base %s for %s"
|
||||
% (classinfo.bases[0], classinfo.name))
|
||||
sys.exit(-1)
|
||||
classinfo.bases[0] = "::".join(chunks)
|
||||
classinfo.isalgorithm |= self.classes[base].isalgorithm
|
||||
|
||||
def split_decl_name(self, name):
|
||||
chunks = name.split('.')
|
||||
|
||||
Reference in New Issue
Block a user