details. This command may be put into your &oof2rc; file to set defaults for all &oof2; sessions. </para>""")) meshCrossSectionDisplay = registeredclass.Registration( 'Cross Section', display.DisplayMethod, MeshCrossSectionDisplay, params=[ meshcsparams.MeshCrossSectionSetParameter( 'cross_sections', placeholder.selection, tip="Which cross-section to display?") ] + meshcsdispparams, ordering=5.0, layerordering=display.SemiLinear, whoclasses=('Mesh', ), tip="Determine which cross sections are displayed, and how.", discussion=xmlmenudump.loadFile( 'DISCUSSIONS/engine/reg/meshcsdisplay.xml', )) def defaultMeshCrossSectionDisplay(): return meshCrossSectionDisplay(color=defaultMeshCSColor, linewidth=defaultMeshCSLineWidth) ghostgfxwindow.PredefinedLayer('Mesh', '<contourable>', defaultMeshCrossSectionDisplay)
'Voxel Region Click-and-Drag Editor', display.DisplayMethod, VoxelRegionSelectionDisplay, params=voxelregionselectionparams, ordering=3.1, layerordering=display.Celestial(0.5), whoclasses=('Microstructure'), tip="Display the widget for editing a region containing all the voxels to be selected." ) ######################## from ooflib.common.IO import whoville def predefinedVoxelRegionSelectionLayer(): # When a new graphics window is opened, a # VoxelRegionSelectionDisplay will be automatically created with # the default sizing and coloring options. return VoxelRegionSelectionDisplay( point_size=defaultVoxelRegionSelectionPointSize, line_width=defaultVoxelRegionSelectionLineWidth, line_color=defaultVoxelRegionSelectionLineColor, face_color=defaultVoxelRegionSelectionFaceColor, face_opacity=defaultVoxelRegionSelectionFaceOpacity, other_opacity=defaultVoxelRegionSelectionOtherOpacity, hide_inactive=defaultHideInactive, dim_inactive=defaultDimInactive) ghostgfxwindow.PredefinedLayer('Microstructure', '<topmost>', predefinedVoxelRegionSelectionLayer)
Set default parameters for <link linkend="RegisteredClass-MeshInfoDisplay"><classname>MeshInfoDisplays</classname></link>. See <xref linkend="RegisteredClass-MeshInfoDisplay"/> for the details. This command may be placed in the &oof2rc; file to set a default value for all &oof2; sessions. </para>""")) meshInfoDisplay = registeredclass.Registration( 'Info', display.DisplayMethod, MeshInfoDisplay, params=meshinfoparams, ordering=4.0, layerordering=display.PointLike(100), whoclasses=('Mesh', ), tip= "Set display parameters for the decorations used by the Mesh Info toolbox.", discussion=xmlmenudump.loadFile( 'DISCUSSIONS/engine/reg/meshinfodisplay.xml')) def defaultMeshInfoDisplay(): return meshInfoDisplay(query_color=defaultQueryColor, peek_color=defaultPeekColor, node_size=defaultNodeSize, line_width=defaultLineWidth) ghostgfxwindow.PredefinedLayer('Mesh', '<topmost>', defaultMeshInfoDisplay)
discussion="""<para> Set default parameters governing how the <link linkend="Section-Graphics-MoveNodes">Move Nodes Toolbox</link> displays the moving node in the graphics window. See <xref linkend="RegisteredClass-MoveNodeDisplay"/> for details. This command can be put in the &oof2rc; file to set the defaults for all &oof2; sessions. </para>""")) moveNodeDisplay = registeredclass.Registration( 'Moving Nodes', display.DisplayMethod, MoveNodeDisplay, params=movenodeparams, ordering=3.0, layerordering=display.PointLike(1), whoclasses=('Skeleton', ), tip="Display the node being moved by the Move Node toolbox.", discussion=xmlmenudump.loadFile( 'DISCUSSIONS/engine/reg/movenodedisplay.xml')) def defaultMoveNodeDisplay(): return moveNodeDisplay(color=defaultMoveNodeColor, size=defaultMoveNodeSize) ghostgfxwindow.PredefinedLayer('Skeleton', '<topmost>', defaultMoveNodeDisplay)
Set default parameters for the <xref linkend="RegisteredClass-SkeletonNodeSelectionDisplay"/>, which displays the currently selected &skel; &nodes; in the graphics window. See <xref linkend="RegisteredClass-SkeletonNodeSelectionDisplay"/> for a discussion of the parameters. This command may be put in the &oof2rc; file to set defaults for all &oof2; sessions. </para>""")) nodeSelectDisplay = registeredclass.Registration( 'Selected Nodes', display.DisplayMethod, SkeletonNodeSelectionDisplay, params=nodeselparams, ordering=2.2, layerordering=display.PointLike(3), whoclasses=('Skeleton', ), tip="Display the currently selected nodes.", discussion=xmlmenudump.loadFile( 'DISCUSSIONS/engine/reg/nodeselectdisplay.xml')) def defaultNodeSelectDisplay(): return nodeSelectDisplay(color=defaultNodeSelColor, size=defaultNodeSelSize) ghostgfxwindow.PredefinedLayer('Skeleton', '<topmost>', defaultNodeSelectDisplay)
parameter.FloatRangeParameter('tintOpacity', (0., 1., 0.01), defaultTintOpacity, tip='Opacity of tint of selected pixels.' ' 0 is transparent, 1 is opaque.') ] mainmenu.gfxdefaultsmenu.Pixels.addItem( oofmenu.OOFMenuItem( 'Pixel_Selection', callback=_setDefaultPixelSelectionParams, params=colorparams, help="Set default parameters for displaying selected pixels.", discussion="""<para> Set default parameters for the <xref linkend="RegisteredClass:BitmapOverlayDisplayMethod"/> that is used to display <link linkend="Section:Concepts:Microstructure:PixelSelection">pixel selections</link>. This command can be put in the &oof2rc; file to set defaults for all &oof2; sessions. </para>""")) def predefinedPixelSelectionLayer(): return bitoverlaydisplay.bitmapOverlay(color=defaultPixelSelectionColor, tintOpacity=defaultTintOpacity) ghostgfxwindow.PredefinedLayer('Pixel Selection', '<top microstructure>', predefinedPixelSelectionLayer)
Set the default parameters for the <xref linkend="RegisteredClass-PinnedNodesDisplay"/>, which graphically indicates which &nodes; are <link linkend="Section-Concepts-Pin">pinned</link>. This command may be put in the &oof2rc; file to set defaults for all &oof2; sessions. </para>""")) pinnedNodesDisplay = registeredclass.Registration( 'Pinned Nodes', display.DisplayMethod, PinnedNodesDisplay, params=pinnodeparams, layerordering=display.PointLike(2), ordering=3.1, whoclasses=('Skeleton', ), tip="Display the pinned nodes.", discussion=xmlmenudump.loadFile( 'DISCUSSIONS/engine/reg/pinnodesdisplay.xml')) def defaultPinnedNodesDisplay(): return pinnedNodesDisplay(color=defaultPinNodeColor, size=defaultPinNodeSize) ghostgfxwindow.PredefinedLayer('Skeleton', '<topmost>', defaultPinnedNodesDisplay)
# the WhoClass. from ooflib.common.IO import whoville class TopBitmap(whoville.WhoProxyClass): def resolve(self, proxy, gfxwindow): return gfxwindow.topwho('Microstructure', 'Image') def getTimeStamp(self, proxy, gfxwindow): return gfxwindow.getLayerChangeTimeStamp() TopBitmap('<top bitmap>') whoville.WhoClass('Top Bitmap', ordering=20000, proxyClasses=['<top bitmap>']) def predefinedPixelInfoLayer(): ## if config.dimension() == 2: return pixelInfoDisplay(color=defaultPixelInfoColor, line_width=defaultLineWidth) ## if config.dimension() == 3: ## return pixelInfoDisplay(color=defaultPixelInfoColor, ## opacity=defaultOpacity) ghostgfxwindow.PredefinedLayer('Top Bitmap', '<top bitmap>', predefinedPixelInfoLayer)
'DISCUSSIONS/engine/reg/skeletonbdydisplay.xml') ) selectedSkeletonBoundaryDisplay = registeredclass.Registration( 'Selected Boundary', display.DisplayMethod, SelectedSkeletonBoundaryDisplay, params=skelbdyparams, ordering=2.3, layerordering=display.SemiLinear(2.1), whoclasses=('Skeleton',), tip="Display the currently selected boundary.", discussion = xmlmenudump.loadFile('DISCUSSIONS/engine/reg/skeletonselbdydisplay.xml') ) #=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=# # Predefined display method for the selected boundary def defaultSelectedSkeletonBoundaryDisplay(): return selectedSkeletonBoundaryDisplay( color=defaultSkelBdyColor, linewidth=defaultSkelBdyLineWidth, glyphsize=defaultSkelBdyGlyphSize, resolution=defaultSkelBdyGlyphResolution) ghostgfxwindow.PredefinedLayer('Skeleton', '<topmost>', defaultSelectedSkeletonBoundaryDisplay)
Set default parameters for the <xref linkend="RegisteredClass-SkeletonElementSelectionDisplay"/>, which displays the currently selected &skel; &elems; in the graphics window. See <xref linkend="RegisteredClass-SkeletonElementSelectionDisplay"/> for a discussion of the parameters. This command may be put in the &oof2rc; file to set defaults for all &oof2; sessions. </para>""")) elementSelectDisplay = registeredclass.Registration( 'Selected Elements', display.DisplayMethod, SkeletonElementSelectionDisplay, params=selectedElementParams, ordering=2.0, layerordering=display.SemiPlanar, whoclasses=('Skeleton', ), tip="Display the currently selected elements", discussion=xmlmenudump.loadFile( 'DISCUSSIONS/engine/reg/elementselectdisplay.xml')) def predefinedElemSelLayer(): return elementSelectDisplay(color=defaultSelectedElementColor, opacity=defaultSelectedElementOpacity) ghostgfxwindow.PredefinedLayer('Skeleton', '<topmost>', predefinedElemSelLayer)
layerordering=display.SemiLinear(3), whoclasses=('Skeleton', ), tip="Set parameters for the decorations used by the Skeleton Info toolbox.", discussion=xmlmenudump.loadFile( 'DISCUSSIONS/engine/reg/skeletoninfodisplay.xml')) def defaultSkeletonInfoDisplay(): return skeletonInfoDisplay(query_color=defaultSkelInfoQueryColor, peek_color=defaultSkelInfoPeekColor, node_size=defaultSkelInfoNodeSize, element_width=defaultSkelInfoElemWidth, segment_width=defaultSkelInfoSgmtWidth) ghostgfxwindow.PredefinedLayer('Skeleton', '<topmost>', defaultSkeletonInfoDisplay) ######################################### class SkeletonIllegalElementDisplay(display.DisplayMethod): def __init__(self, color, linewidth): self.color = color self.linewidth = linewidth display.DisplayMethod.__init__(self) def draw(self, gfxwindow, device): skel = self.who().resolve(gfxwindow).getObject() elements = skel.getIllegalElements() if elements: device.set_lineColor(self.color)
oofmenu.OOFMenuItem( 'Pixel_Selection', callback=_setDefaultPixelSelectionParams, params=pixelSelectParams, help="Set default parameters for displaying selected pixels.", discussion="""<para> Set default parameters for the <xref linkend="RegisteredClass:PixelSelectionDisplay"/> that is used to display <link linkend="Section:Concepts:Microstructure:PixelSelection">pixel selections</link>. This command can be put in the &oof2rc; file to set defaults for all &oof2; sessions. </para>""")) # def predefinedPixelSelectionLayer(): # return bitoverlaydisplay.bitmapOverlay(color=defaultPixelSelectionColor, # tintOpacity=defaultTintOpacity) # ghostgfxwindow.PredefinedLayer('Pixel Selection', '<top microstructure>', # predefinedPixelSelectionLayer) def predefinedPixelSelectionLayer(): return pixelSelectionDisplay(color=defaultPixelSelectionColor, opacity=defaultOpacity) ghostgfxwindow.PredefinedLayer('Top Bitmap', '<top bitmap>', predefinedPixelSelectionLayer)
SkeletonElementSelectionDisplay, params=selectedElementParams, ordering=2.0, layerordering=display.SemiPlanar, whoclasses=('Skeleton', ), tip="Display the currently selected elements", discussion=xmlmenudump.loadFile( 'DISCUSSIONS/engine/reg/elementselectdisplay.xml')) def predefinedElemSelLayer(): return elementSelectDisplay(color=defaultSelectedElementColor, opacity=defaultSelectedElementOpacity) ghostgfxwindow.PredefinedLayer('Skeleton', '<topmost>', predefinedElemSelLayer) #=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=# class SkeletonFaceSelectionDisplay(SkeletonSelectionDisplay): def __init__(self, color, opacity): self.color = color self.opacity = opacity SkeletonSelectionDisplay.__init__(self, skeletonselmodebase.getMode("Face")) def newLayer(self): self.setupSignals() return canvaslayers.SimpleFilledCellLayer(self.gfxwindow.oofcanvas, "SkeletonSelectedFace")
ClippingPlaneWidget, params=clipplaneclickanddragparams, ordering=3.0, layerordering=display.Celestial, whoclasses=('Microstructure'), tip= "Display the widget for viewing and click-and-drag editing of clipping planes." ) ######################## from ooflib.common.IO import whoville def predefinedClipPlaneClickAndDragLayer(): # When a new graphics window is opened, a # ClippingPlaneWidget will be automatically created with # the default sizing and coloring options. return ClippingPlaneWidget( arrow_color=defaultClipPlaneClickAndDragArrowColor, arrow_tip_radius=defaultClipPlaneClickAndDragArrowTipRadius, arrow_length=defaultClipPlaneClickAndDragArrowLength, plane_color=defaultClipPlaneClickAndDragColor, plane_opacity=defaultClipPlaneClickAndDragOpacity, hide_inactive=defaultHideInactive, dim_inactive=defaultDimInactive) ghostgfxwindow.PredefinedLayer('Microstructure', '<topmost>', predefinedClipPlaneClickAndDragLayer)