Skip to content

Commit

Permalink
Adding documentation panel per page.
Browse files Browse the repository at this point in the history
  • Loading branch information
marwan-abdellah committed Apr 14, 2020
1 parent e47bcc4 commit f9bc9d9
Show file tree
Hide file tree
Showing 7 changed files with 186 additions and 47 deletions.
4 changes: 2 additions & 2 deletions nmv/interface/ui/about/about_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ def draw(self,

update_button = layout.column()
update_button.operator('update.nmv', emboss=True, icon='NODETREE')
update_button.operator('open.github', emboss=True, icon='URL')
update_button.operator('open.wiki', emboss=True, icon='SCRIPT')
update_button.operator('open.github', emboss=True, icon='SCRIPT')
update_button.operator('open.wiki', emboss=True, icon='URL')


####################################################################################################
Expand Down
51 changes: 37 additions & 14 deletions nmv/interface/ui/edit/edit_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ def draw(self,
# Get a reference to the panel layout
layout = self.layout

# Documentation button
documentation_button = layout.column()
documentation_button.operator('nmv.documentation_editing', icon='URL')
documentation_button.separator()

# Morphology sketching button
if not in_edit_mode:
sketching_morphology_column = layout.column(align=True)
Expand Down Expand Up @@ -303,6 +308,34 @@ def execute(self,
return {'FINISHED'}


####################################################################################################
# @MorphologyEditingDocumentation
####################################################################################################
class MorphologyEditingDocumentation(bpy.types.Operator):
"""Open the documentation page of the Morphology Editing panel."""

# Operator parameters
bl_idname = "nmv.documentation_editing"
bl_label = "Documentation"

################################################################################################
# @execute
################################################################################################
def execute(self,
context):
"""Execute the operator.
:param context:
Blender context
:return:
'FINISHED'
"""

import webbrowser
webbrowser.open('https://github.com/BlueBrain/NeuroMorphoVis/wiki/Morphology-Editing')
return {'FINISHED'}


####################################################################################################
# @register_panel
####################################################################################################
Expand All @@ -313,16 +346,11 @@ def register_panel():
# Morphology analysis panel
bpy.utils.register_class(EditPanel)

# Morphology analysis button
# Buttons
bpy.utils.register_class(MorphologyEditingDocumentation)
bpy.utils.register_class(SketchSkeleton)

# Edit morphology coordinates button
bpy.utils.register_class(EditMorphologyCoordinates)

# Morphology analysis button
bpy.utils.register_class(UpdateMorphologyCoordinates)

# Export morphology as SWC file
bpy.utils.register_class(ExportMorphologySWC)


Expand All @@ -336,14 +364,9 @@ def unregister_panel():
# Morphology analysis panel
bpy.utils.unregister_class(EditPanel)

# Morphology analysis button
# Buttons
bpy.utils.unregister_class(MorphologyEditingDocumentation)
bpy.utils.unregister_class(SketchSkeleton)

# Edit morphology coordinates button
bpy.utils.unregister_class(EditMorphologyCoordinates)

# Update the coordinates
bpy.utils.unregister_class(UpdateMorphologyCoordinates)

# Export the morphology
bpy.utils.unregister_class(ExportMorphologySWC)
35 changes: 35 additions & 0 deletions nmv/interface/ui/io/io_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ def draw(self, context):
# Get a reference to the scene
scene = context.scene

# Documentation button
documentation_button = layout.column()
documentation_button.operator('nmv.documentation_io', icon='URL')
documentation_button.separator()

# Input data options
input_data_options_row = layout.row()
input_data_options_row.label(text='Input Data Options:', icon='LIBRARY_DATA_DIRECT')
Expand Down Expand Up @@ -257,6 +262,34 @@ def execute(self,
return {'FINISHED'}


####################################################################################################
# @InputOutputDocumentation
####################################################################################################
class InputOutputDocumentation(bpy.types.Operator):
"""Open the documentation page of the IO module."""

# Operator parameters
bl_idname = "nmv.documentation_io"
bl_label = "Documentation"

################################################################################################
# @execute
################################################################################################
def execute(self,
context):
"""Execute the operator.
:param context:
Blender context
:return:
'FINISHED'
"""

import webbrowser
webbrowser.open('https://github.com/BlueBrain/NeuroMorphoVis/wiki/Input-&-Output')
return {'FINISHED'}


####################################################################################################
# @register_panel
####################################################################################################
Expand All @@ -267,6 +300,7 @@ def register_panel():
bpy.utils.register_class(IOPanel)

# Buttons
bpy.utils.register_class(InputOutputDocumentation)
bpy.utils.register_class(LoadMorphology)


Expand All @@ -283,4 +317,5 @@ def unregister_panel():
bpy.utils.unregister_class(IOPanel)

# Buttons
bpy.utils.unregister_class(InputOutputDocumentation)
bpy.utils.unregister_class(LoadMorphology)
47 changes: 37 additions & 10 deletions nmv/interface/ui/mesh/mesh_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ def draw(self,
Rendering context.
"""

# Documentation button
documentation_button = self.layout.column()
documentation_button.operator('nmv.documentation_mesh', icon='URL')
documentation_button.separator()

# Meshing options
draw_meshing_options(panel=self, scene=context.scene)

Expand Down Expand Up @@ -573,6 +578,34 @@ def execute(self, context):
return {'FINISHED'}


####################################################################################################
# @InputOutputDocumentation
####################################################################################################
class MeshReconstructionDocumentation(bpy.types.Operator):
"""Open the documentation page of the Mesh Reconstruction panel."""

# Operator parameters
bl_idname = "nmv.documentation_mesh"
bl_label = "Documentation"

################################################################################################
# @execute
################################################################################################
def execute(self,
context):
"""Execute the operator.
:param context:
Blender context
:return:
'FINISHED'
"""

import webbrowser
webbrowser.open('https://github.com/BlueBrain/NeuroMorphoVis/wiki/Mesh-Reconstruction')
return {'FINISHED'}


####################################################################################################
# @register_panel
####################################################################################################
Expand All @@ -582,16 +615,13 @@ def register_panel():
# Mesh reconstruction panel
bpy.utils.register_class(MeshPanel)

# Mesh reconstruction button
# Buttons
bpy.utils.register_class(MeshReconstructionDocumentation)
bpy.utils.register_class(ReconstructNeuronMesh)

# Mesh rendering
bpy.utils.register_class(RenderMeshFront)
bpy.utils.register_class(RenderMeshSide)
bpy.utils.register_class(RenderMeshTop)
bpy.utils.register_class(RenderMesh360)

# Neuron mesh saving operators
bpy.utils.register_class(ExportMesh)


Expand All @@ -604,15 +634,12 @@ def unregister_panel():
# Mesh reconstruction panel
bpy.utils.unregister_class(MeshPanel)

# Mesh reconstruction button
# Buttons
bpy.utils.unregister_class(MeshReconstructionDocumentation)
bpy.utils.unregister_class(ReconstructNeuronMesh)

# Mesh rendering
bpy.utils.unregister_class(RenderMeshFront)
bpy.utils.unregister_class(RenderMeshSide)
bpy.utils.unregister_class(RenderMeshTop)
bpy.utils.unregister_class(RenderMesh360)

# Neuron mesh saving operators
bpy.utils.unregister_class(ExportMesh)

47 changes: 37 additions & 10 deletions nmv/interface/ui/morphology/morphology_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ def draw(self, context):
# Get a reference to the scene
current_scene = context.scene

# Documentation button
documentation_button = layout.column()
documentation_button.operator('nmv.documentation_morphology', icon='URL')
documentation_button.separator()

# Set the reconstruction options
nmv.interface.ui.morphology_panel_ops.set_reconstruction_options(
layout=layout, scene=current_scene, options=nmv.interface.ui_options)
Expand Down Expand Up @@ -835,6 +840,34 @@ def execute(self,
return {'FINISHED'}


####################################################################################################
# @MorphologyReconstructionDocumentation
####################################################################################################
class MorphologyReconstructionDocumentation(bpy.types.Operator):
"""Open the documentation page of the Morphology Reconstruction panel."""

# Operator parameters
bl_idname = "nmv.documentation_morphology"
bl_label = "Documentation"

################################################################################################
# @execute
################################################################################################
def execute(self,
context):
"""Execute the operator.
:param context:
Blender context
:return:
'FINISHED'
"""

import webbrowser
webbrowser.open('https://github.com/BlueBrain/NeuroMorphoVis/wiki/Morphology-Reconstruction')
return {'FINISHED'}


####################################################################################################
# @register_panel
####################################################################################################
Expand All @@ -844,17 +877,14 @@ def register_panel():
# Soma reconstruction panel
bpy.utils.register_class(MorphologyPanel)

# Soma reconstruction operator
# Buttons
bpy.utils.register_class(MorphologyReconstructionDocumentation)
bpy.utils.register_class(ReconstructMorphologyOperator)

# Morphology rendering
bpy.utils.register_class(RenderMorphologyFront)
bpy.utils.register_class(RenderMorphologySide)
bpy.utils.register_class(RenderMorphologyTop)
bpy.utils.register_class(RenderMorphology360)
bpy.utils.register_class(RenderMorphologyProgressive)

# Saving morphology
bpy.utils.register_class(SaveMorphologyBLEND)
bpy.utils.register_class(SaveMorphologySWC)
bpy.utils.register_class(SaveMorphologySegments)
Expand All @@ -869,17 +899,14 @@ def unregister_panel():
# Morphology reconstruction panel
bpy.utils.unregister_class(MorphologyPanel)

# Morphology reconstruction operator
# Buttons
bpy.utils.unregister_class(MorphologyReconstructionDocumentation)
bpy.utils.unregister_class(ReconstructMorphologyOperator)

# Morphology rendering
bpy.utils.unregister_class(RenderMorphologyTop)
bpy.utils.unregister_class(RenderMorphologySide)
bpy.utils.unregister_class(RenderMorphologyFront)
bpy.utils.unregister_class(RenderMorphology360)
bpy.utils.unregister_class(RenderMorphologyProgressive)

# Saving morphology
bpy.utils.unregister_class(SaveMorphologyBLEND)
bpy.utils.unregister_class(SaveMorphologySWC)
bpy.utils.unregister_class(SaveMorphologySegments)
Expand Down
Loading

0 comments on commit f9bc9d9

Please sign in to comment.