Skip to content

Commit a449af7

Browse files
author
Onur Rauf Bingol
committed
Add set_plot_types method to surface vis modules
1 parent 025f007 commit a449af7

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

geomdl/Abstract.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,6 +1655,31 @@ def plot_types(self):
16551655
"""
16561656
return self._plot_types
16571657

1658+
def set_plot_type(self, plot_type, type_value):
1659+
""" Sets the plot type.
1660+
1661+
By default, the following plot types are possible: *ctrlpts*, *evalpts*
1662+
1663+
By default, the following plot type values are possible:
1664+
1665+
* For control points (*ctrlpts*): points, quads
1666+
* For surface points (*evalpts*): points, quads, triangles
1667+
1668+
:param plot_type: plot type
1669+
:type plot_type: str
1670+
:param type_value: type value
1671+
:type type_value: str
1672+
:return:
1673+
"""
1674+
if not isinstance(plot_type, str) or not isinstance(type_value, str):
1675+
raise TypeError("Plot type and its value should be string type")
1676+
1677+
if plot_type not in self._plot_types.keys():
1678+
raise KeyError(plot_type + " is not a type. Possible types: " +
1679+
", ".join([k for k in self._plot_types.keys()]))
1680+
1681+
self._plot_types[plot_type] = type_value
1682+
16581683
def set_ctrlpts_offset(self, offset_value):
16591684
""" Sets an offset for the control points grid plot.
16601685

0 commit comments

Comments
 (0)