def __init__(self, toolbox, table, row): debug.mainthreadTest() pixelinfoGUIplugin.PixelInfoGUIPlugIn.__init__(self, toolbox) self.label = gtk.Label('orientation=') self.label.set_alignment(1.0, 0.5) table.attach(self.label, 0,1, row,row+1, xpadding=5, xoptions=gtk.FILL) self.vbox = gtk.VBox() self.param = parameter.ConvertibleRegisteredParameter( 'dummy', orientationmatrix.Orientation) self.widget = self.param.makeWidget() # RegisteredClassFactory self.widget.makeReadOnly() self.text = gtk.Entry() self.text.set_editable(0) self.vbox.pack_start(self.text, expand=0, fill=0) self.current_mode = 'text' table.attach(self.vbox, 1,2, row,row+1, xpadding=5, xoptions=gtk.EXPAND|gtk.FILL) self.sbcbs = [ switchboard.requestCallbackMain( 'materials changed in microstructure', self.materialchanged), switchboard.requestCallbackMain('OrientationMap changed', self.materialchanged), switchboard.requestCallbackMain('material changed', self.materialchanged), switchboard.requestCallbackMain('prop_added_to_material', self.materialchanged), switchboard.requestCallbackMain('prop_removed_from_material', self.materialchanged), switchboard.requestCallbackMain(self.widget, self.widgetcb) ] self.update(None)
def makeMenu(self, menu): mismenu = menu.addItem(oofmenu.OOFMenuItem('Misorientation')) mismenu.addItem( oofmenu.OOFMenuItem( "Set_Reference", callback=self.setReference, params=[ primitives.PointParameter( 'point', tip="The location of the reference pixel."), parameter.ConvertibleRegisteredParameter( 'orientation', orientationmatrix.Orientation, tip='Calculate misorientations relative to this.') ], help="Set the reference orientation.")) symcmd = mismenu.addItem( oofmenu.OOFMenuItem( "Set_Symmetry", callback=self.setSymmetry, params=[latticesystem.LatticeSymmetryParameter('symmetry')], help="Set lattice symmetry used when comparing orientations")) self.symmetry = symcmd.get_arg('symmetry').value
def makeMenu(self, menu): self.menu = menu dollymenu = menu.addItem(oofmenu.OOFMenuItem("Dolly", cli_only=1)) dollymenu.addItem( oofmenu.OOFMenuItem( "In", callback=self.dollyIn, threadable=oofmenu.UNTHREADABLE, params=[parameter.FloatParameter("factor")])) dollymenu.addItem( oofmenu.OOFMenuItem( "Out", callback=self.dollyOut, threadable=oofmenu.UNTHREADABLE, params=[parameter.FloatParameter("factor")])) dollymenu.addItem( oofmenu.OOFMenuItem("Fill", threadable=oofmenu.UNTHREADABLE, callback=self.dollyFill)) trackmenu = menu.addItem(oofmenu.OOFMenuItem("Track", cli_only=1)) trackmenu.addItem( oofmenu.OOFMenuItem( "Horizontal", callback=self.trackHoriz, threadable=oofmenu.UNTHREADABLE, params=[parameter.FloatParameter("distance")])) trackmenu.addItem( oofmenu.OOFMenuItem( "Vertical", callback=self.trackVert, threadable=oofmenu.UNTHREADABLE, params=[parameter.FloatParameter("distance")])) trackmenu.addItem( oofmenu.OOFMenuItem("Recenter", callback=self.recenter, threadable=oofmenu.UNTHREADABLE)) rotatemenu = menu.addItem(oofmenu.OOFMenuItem("Rotate", cli_only=1)) rotatemenu.addItem( oofmenu.OOFMenuItem("Roll", callback=self.roll, threadable=oofmenu.UNTHREADABLE, params=[parameter.FloatParameter("angle") ])) rotatemenu.addItem( oofmenu.OOFMenuItem("Azimuth", callback=self.azimuth, threadable=oofmenu.UNTHREADABLE, params=[parameter.FloatParameter("angle") ])) rotatemenu.addItem( oofmenu.OOFMenuItem("Elevation", callback=self.elevation, threadable=oofmenu.UNTHREADABLE, params=[parameter.FloatParameter("angle") ])) rotatemenu.addItem( oofmenu.OOFMenuItem("Yaw", callback=self.yaw, threadable=oofmenu.UNTHREADABLE, params=[parameter.FloatParameter("angle") ])) rotatemenu.addItem( oofmenu.OOFMenuItem("Pitch", callback=self.pitch, threadable=oofmenu.UNTHREADABLE, params=[parameter.FloatParameter("angle") ])) zoommenu = menu.addItem(oofmenu.OOFMenuItem("Zoom", cli_only=1)) zoommenu.addItem( oofmenu.OOFMenuItem( "In", callback=self.zoomIn, threadable=oofmenu.UNTHREADABLE, params=[parameter.FloatParameter("factor")])) zoommenu.addItem( oofmenu.OOFMenuItem( "Out", callback=self.zoomOut, threadable=oofmenu.UNTHREADABLE, params=[parameter.FloatParameter("factor")])) zoommenu.addItem( oofmenu.OOFMenuItem("Fill", threadable=oofmenu.UNTHREADABLE, callback=self.zoomFill)) clipmenu = menu.addItem(oofmenu.OOFMenuItem("Clip", cli_only=1)) clipmenu.addItem( oofmenu.OOFMenuItem( "New", callback=self.newClipCB, params=[ parameter.ConvertibleRegisteredParameter( "normal", direction.Direction, direction.DirectionX()), parameter.FloatParameter("offset", 0.0) ])) clipmenu.addItem( oofmenu.OOFMenuItem( "Edit", callback=self.editClipCB, params=[ parameter.IntParameter("plane"), parameter.ConvertibleRegisteredParameter( "normal", direction.Direction), parameter.FloatParameter("offset") ])) clipmenu.addItem( oofmenu.OOFMenuItem("Delete", callback=self.delClipCB, params=[parameter.IntParameter("plane")])) clipmenu.addItem( oofmenu.OOFMenuItem("Enable", callback=self.clipEnableCB, params=[parameter.IntParameter("plane")])) clipmenu.addItem( oofmenu.OOFMenuItem("Disable", callback=self.clipDisableCB, params=[parameter.IntParameter("plane")])) clipmenu.addItem( oofmenu.OOFMenuItem("Flip", callback=self.clipFlipCB, params=[parameter.IntParameter("plane")])) clipmenu.addItem( oofmenu.OOFMenuItem("Unflip", callback=self.clipUnflipCB, params=[parameter.IntParameter("plane")])) clipmenu.addItem( oofmenu.OOFMenuItem("InvertOn", callback=self.clipInvertOnCB)) clipmenu.addItem( oofmenu.OOFMenuItem("InvertOff", callback=self.clipInvertOffCB)) clipmenu.addItem( oofmenu.OOFMenuItem("SuppressOn", callback=self.clipSuppressOnCB)) clipmenu.addItem( oofmenu.OOFMenuItem("SuppressOff", callback=self.clipSuppressOffCB)) clipmenu.addItem( oofmenu.OOFMenuItem("Select", callback=self.clipSelectCB, params=[parameter.IntParameter("plane")])) clipmenu.addItem( oofmenu.OOFMenuItem("Unselect", callback=self.clipUnselectCB)) menu.addItem( oofmenu.OOFMenuItem("Restore_View", callback=self.restoreView, params=[view.ViewParameter("view")])) menu.addItem( oofmenu.OOFMenuItem("Restore_Named_View", callback=self._restoreNamedView, params=[ViewNameParameter("view")])) menu.addItem( oofmenu.OOFMenuItem("Save_View", callback=self.saveView, params=[parameter.StringParameter("name") ])) menu.addItem( oofmenu.OOFMenuItem( "Delete_View", callback=self.deleteView, params=[ ViewNameParameter( "view", tip="The name of the View to delete.") ]))
el2d.bulk_element = el elements.append(el2d) return elements def convertToBulk(self, el2d): return el2d.bulk_element registeredclass.ThreeDOnlyRegistration( "Planar Cross Section", Domain, PlanarCrossSectionDomain, 20, params=[ parameter.ConvertibleRegisteredParameter( "normal", direction.Direction, direction.VectorDirection(1., 0., 0.), "The normal direction to the cross section plane."), parameter.FloatParameter( "offset", 0.0, tip="The distance from the origin to the cross section plane."), enum.EnumParameter( "side", primitives.PlaneOrientation, "FRONT", tip="Evaluate the output with elements on this side of the plane.") ], sampling=(analysissample.ContinuumSampleSet, ), tip="Use a plane through the Mesh as the post-processing domain.") #=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=#
"The Microstructure has no orientation map.") selection.start() selection.clearAndSelect( pixelselectioncouriero.OrientationSelection( orientationmap, self.orientation.corient, self.lattice_symmetry.schoenflies(), self.misorientation)) registeredclass.Registration( 'Orientation Range', pixelselectionmod.SelectionModifier, OrientationRange, ordering=10, params=[ parameter.ConvertibleRegisteredParameter( 'orientation', orientationmatrix.Orientation, tip="Select orientations similar to this."), latticesystem.LatticeSymmetryParameter( 'lattice_symmetry', tip= "Assume the material at each point has this symmetry, making some orientations equivalent." ), parameter.FloatRangeParameter( 'misorientation', (0, 180, 1), 0, tip= "Select orientations with misorientation less than this, relative to the given orientation, in degrees." ) ], tip="Select all pixels whose orientation is in a given range.")