eman2:new3ditem
Differences
This shows you the differences between two versions of the page.
eman2:new3ditem [2025/06/19 21:02] – created steveludtke | eman2:new3ditem [2025/06/19 21:03] (current) – steveludtke | ||
---|---|---|---|
Line 9: | Line 9: | ||
For exmaple: | For exmaple: | ||
- | <code># | + | <code python> |
class EMNewItem(EMItem3D): | class EMNewItem(EMItem3D): | ||
name = " | name = " | ||
Line 34: | Line 34: | ||
First add a static function to generate a dialog box to aid the user in adding an instance of this widget to the scene graph: | First add a static function to generate a dialog box to aid the user in adding an instance of this widget to the scene graph: | ||
- | <code># | + | <code python> |
class EMNewItem(EMItem3D): | class EMNewItem(EMItem3D): | ||
@staticmethod | @staticmethod | ||
Line 52: | Line 52: | ||
Then you need to add another static function to actually generate an instance of this widget. In this example the fist argument to EMNewItem constructor is for this example, but the last argument is mandatory. | Then you need to add another static function to actually generate an instance of this widget. In this example the fist argument to EMNewItem constructor is for this example, but the last argument is mandatory. | ||
- | <code># | + | <code python> |
class EMNewItem(EMItem3D): | class EMNewItem(EMItem3D): | ||
@staticmethod | @staticmethod | ||
Line 61: | Line 61: | ||
Next you need to add a few lines of code to the NodeDialog class in emscene3d.py, | Next you need to add a few lines of code to the NodeDialog class in emscene3d.py, | ||
- | <code># | + | <code python> |
class NodeDialog(QtGui.QDialog): | class NodeDialog(QtGui.QDialog): | ||
def %%__%%init%%__%%(self, | def %%__%%init%%__%%(self, | ||
Line 91: | Line 91: | ||
For Example: | For Example: | ||
- | <code># | + | <code python> |
class EMNewItemInspector(EMInspectorControlShape): | class EMNewItemInspector(EMInspectorControlShape): | ||
def %%__%%init%%__%%(self, | def %%__%%init%%__%%(self, |
eman2/new3ditem.txt · Last modified: by steveludtke