예제 #1
0
def createCV_canny():
    print("create CV  canny ...")
    obj = FreeCAD.ActiveDocument.addObject('App::DocumentObjectGroupPython',
                                           'Canny')
    obj.addProperty('App::PropertyFile', 'imageFile',
                    "base").imageFile = '/home/thomas/Bilder/bn_900.png'
    obj.addProperty('App::PropertyLink', 'imageNode', "base")
    obj.addProperty('App::PropertyBool', 'imageFromNode',
                    "base").imageFromNode = False

    obj.addProperty('App::PropertyInteger', 'minVal', "canny").minVal = 100
    obj.addProperty('App::PropertyInteger', 'maxVal', "canny").maxVal = 200

    _CV_canny(obj, '/icons/bounder.png')
    _ViewProviderCV_canny(obj.ViewObject, __dir__ + '/icons/icon1.svg')

    app = MyApp()
    miki2 = miki.Miki()
    miki2.app = app
    app.root = miki2
    app.obj = obj

    obj.ViewObject.Proxy.cmenu.append(["Dialog", lambda: miki2.run(MyApp.s6)])
    obj.ViewObject.Proxy.edit = lambda: miki2.run(MyApp.s6)
    return obj
예제 #2
0
def createCV_demo():
    print "create CV  demo ..."
    obj = FreeCAD.ActiveDocument.addObject('App::DocumentObjectGroupPython',
                                           'Image')
    obj.addProperty('App::PropertyFile', 'imageFile',
                    "base").imageFile = '/home/thomas/Bilder/c1.png'
    obj.addProperty('App::PropertyLink', 'imageNode', "base")
    obj.addProperty('App::PropertyBool', 'imageFromNode',
                    "base").imageFromNode = False

    obj.addProperty('App::PropertyInteger', 'blockSize',
                    "cornerHarris").blockSize = 2
    obj.addProperty('App::PropertyInteger', 'ksize', "cornerHarris").ksize = 3
    obj.addProperty('App::PropertyFloat', 'k', "cornerHarris").k = 1.0

    _CV_demo(obj, '/icons/bounder.png')
    _ViewProviderCV_demo(obj.ViewObject, __dir__ + '/icons/icon1.svg')

    app = MyApp()
    miki2 = miki.Miki()
    miki2.app = app
    app.root = miki2
    app.obj = obj

    obj.ViewObject.Proxy.cmenu.append(["Dialog", lambda: miki2.run(MyApp.s6)])
    obj.ViewObject.Proxy.edit = lambda: miki2.run(MyApp.s6)
    return obj
예제 #3
0
def createCV(base=False):
    print "create CV ..."
    obj = FreeCAD.ActiveDocument.addObject('App::DocumentObjectGroupPython',
                                           'Image')

    obj.addProperty('App::PropertyFile', 'imageFile',
                    "base").imageFile = '/home/thomas/Bilder/c1.png'
    obj.addProperty('App::PropertyLink', 'imageNode', "base")
    obj.addProperty('App::PropertyBool', 'imageFromNode',
                    "base").imageFromNode = False
    obj.addProperty('App::PropertyBool', 'matplotlib',
                    "base").matplotlib = False

    if not base:
        _CV(obj, '/icons/bounder.png')
        _ViewProviderCV(obj.ViewObject, __dir__ + '/icons/icon1.svg')

        app = MyApp()
        miki2 = miki.Miki()
        miki2.app = app
        app.root = miki2
        app.obj = obj

        obj.ViewObject.Proxy.cmenu.append(
            ["Dialog", lambda: miki2.run(MyApp.s6)])
        obj.ViewObject.Proxy.edit = lambda: miki2.run(MyApp.s6)

    return obj
def run():
    global miki
    app = MyApp()
    miki2 = miki.Miki()
    miki2.app = app
    app.root = miki2
    miki2.run(s6)
    app.create()
예제 #5
0
	def createDialog(self):
		app=MyApp()
		miki2=miki.Miki()
		miki2.app=app
		app.root=miki2
		app.obj=self.Object
		self.Object.Proxy.app=app
		self.edit= lambda:miki2.run(MyApp.s6,app.create2)
예제 #6
0
def createMPL(base=False):

	obj=FreeCAD.ActiveDocument.addObject('App::DocumentObjectGroupPython','Plot')
	obj.addProperty('App::PropertyString','mode',"Base")

	obj.addProperty('App::PropertyBool','record',"Base",'true record, false no record data')
	obj.addProperty('App::PropertyInteger','countSources',"Base")
	obj.countSources=0

	# base data time/step
	obj.addProperty('App::PropertyLink','sourceObject',"Time")
	obj.addProperty('App::PropertyString','sourceData',"Time")
	obj.addProperty('App::PropertyFloatList','sourceValues',"Time")

	obj.addProperty('App::PropertyBool','useNumpy',"numpy source" )
	obj.addProperty('App::PropertyLink','sourceNumpy',"numpy source" )

	for i in range(10):
		obj.addProperty('App::PropertyBool','useOut'+str(i),"numpy source" )
		obj.addProperty('App::PropertyFloatList','out'+str(i),"out values")

	obj.addProperty('App::PropertyFloatList','outTime',"out values")

	if not base:
		_MPL(obj)
		#_ViewProviderMPL(obj.ViewObject,__dir__+ '/icons/icon1.svg') 
		
		obj.countSources=1

		app=MyApp()
		miki2=miki.Miki()
		miki2.app=app
		app.root=miki2
		app.obj=obj
		obj.Proxy.app=app

		obj.ViewObject.Proxy.edit= lambda:miki2.run(MyApp.s6,app.create2)
	return obj