Skip to content

Commit

Permalink
Added docstrings for initial preview.
Browse files Browse the repository at this point in the history
  • Loading branch information
senthurayyappan committed Aug 27, 2020
1 parent bba0112 commit b5c1511
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 24 deletions.
6 changes: 2 additions & 4 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@
Anton_OT_Initializer, Anton_OT_DirectionUpdater, Anton_OT_Definer]

def register():
"""
Registers Preferences, Installer, Panel, PropertyGroup, ForcePropertyGroup,
"""Registers Preferences, Installer, Panel, PropertyGroup, ForcePropertyGroup,
ForceUpdater, Initializer, DirectionUpdater, Definer, Processor, and
Visualizer classes and instantiates scene variables load, forced_magnitudes
and forced_direction_signs that are used by Processor.
Expand All @@ -69,8 +68,7 @@ def register():
bpy.types.Scene.forceprop = bpy.props.CollectionProperty(type=ForcePropertyGroup)

def unregister():
"""
Unregisters Preferences, Installer, Panel, PropertyGroup, ForcePropertyGroup,
"""Unregisters Preferences, Installer, Panel, PropertyGroup, ForcePropertyGroup,
ForceUpdater, Initializer, DirectionUpdater, Definer, Processor, and
Visualizer classes and deletes all the scene variables used by Processor.
"""
Expand Down
58 changes: 38 additions & 20 deletions properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,24 @@ class ForcePropertyGroup(bpy.types.PropertyGroup):


class AntonPropertyGroup(bpy.types.PropertyGroup):
"""Base class for dynamically defined sets of properties that are acessed
from :class: `Anton_PT_Panel` and used by all the operator classes.
Attributes:
initialized (BoolProperty): A boolean property to check if the problem has been initialzed.
forced (BoolProperty): A boolean property to check if all the forces acting on the model has been defined.
force_directioned (BoolProperty): A boolean property to check if directions for all the specified forces has been defined.
defined (BoolProperty): A boolean property to check if the problem has been defined.
filename (StringProperty): A string property that stores the active object's name.
workspace_path (StringProperty): A string property that points at the workspace path
in which temporary variables are created/stored. Defaults to /tmp/
mode (EnumProperty): A enum property that defines the design space. Choose `Shape` to use existing geometry as is
for the design space definition or choose `HULL` to form a geometry around the existing objects. Existing objects are considered
as obstacles and are not included in the design space definition. Defaults to `Shape`.
number_of_forces (IntProperty): An integer property that defines the number of forces acting on the model.
"""

initialized : BoolProperty(default=False)
forced : BoolProperty(default=False)
Expand All @@ -20,6 +38,26 @@ class AntonPropertyGroup(bpy.types.PropertyGroup):

filename : StringProperty()

workspace_path : StringProperty(
name="",
description="Path for the results",
default='/tmp/',
subtype='DIR_PATH')

mode : EnumProperty(
name='mode',
items=[
('SHAPE', 'Shape', 'Defined design space'),
('HULL', 'Hull', 'Undefined design space')],
default='SHAPE'
)

number_of_forces : IntProperty(
name="Forces",
default=1,
min=1,
description="Number of forces acting on the model")

include_fixed : BoolProperty(
name='Fixed',
default=False,
Expand Down Expand Up @@ -88,12 +126,6 @@ class AntonPropertyGroup(bpy.types.PropertyGroup):
precision=2,
description="Sensitivity of metaballs")

workspace_path : StringProperty(
name="",
description="Path for the results",
default='/tmp/',
subtype='DIR_PATH')

volumina_ratio : FloatProperty(
name="",
default=0.4,
Expand All @@ -110,12 +142,6 @@ class AntonPropertyGroup(bpy.types.PropertyGroup):
precision=3,
description="Exponent for the penalty function by using SIMP method")

number_of_forces : IntProperty(
name="Forces",
default=1,
min=1,
description="Number of forces acting on the model")

number_of_iterations : IntProperty(
name="",
default=30,
Expand Down Expand Up @@ -146,14 +172,6 @@ class AntonPropertyGroup(bpy.types.PropertyGroup):
min=5,
description="Number of nearest neighbours for filtering")

mode : EnumProperty(
name='mode',
items=[
('SHAPE', 'Shape', 'Defined design space'),
('HULL', 'Hull', 'Undefined design space')],
default='SHAPE'
)

material : EnumProperty(
name='',
items=[
Expand Down

0 comments on commit b5c1511

Please sign in to comment.