Skip to content

Commit 8102d24

Browse files
authored
Merge pull request #110 from pshriwise/vind-attrs-fix
Moving the llc,urc paramaters to the ViewParams class
2 parents 4f353cc + 27678bc commit 8102d24

1 file changed

Lines changed: 33 additions & 32 deletions

File tree

openmc_plotter/plotmodel.py

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,38 @@ def __init__(self, origin=(0, 0, 0), width=10, height=10):
792792
self.basis = 'xy'
793793
self.color_overlaps = False
794794

795+
@property
796+
def llc(self):
797+
if self.basis == 'xy':
798+
x = self.origin[0] - self.width / 2.0
799+
y = self.origin[1] - self.height / 2.0
800+
z = self.origin[2]
801+
elif self.basis == 'yz':
802+
x = self.origin[0]
803+
y = self.origin[1] - self.width / 2.0
804+
z = self.origin[2] - self.height / 2.0
805+
else:
806+
x = self.origin[0] - self.width / 2.0
807+
y = self.origin[1]
808+
z = self.origin[2] - self.height / 2.0
809+
return x, y, z
810+
811+
@property
812+
def urc(self):
813+
if self.basis == 'xy':
814+
x = self.origin[0] + self.width / 2.0
815+
y = self.origin[1] + self.height / 2.0
816+
z = self.origin[2]
817+
elif self.basis == 'yz':
818+
x = self.origin[0]
819+
y = self.origin[1] + self.width / 2.0
820+
z = self.origin[2] + self.height / 2.0
821+
else:
822+
x = self.origin[0] + self.width / 2.0
823+
y = self.origin[1]
824+
z = self.origin[2] + self.height / 2.0
825+
return x, y, z
826+
795827
def __eq__(self, other):
796828
return repr(self) == repr(other)
797829

@@ -902,37 +934,6 @@ def getColorLimits(self, property):
902934
else:
903935
return self.data_minmax[property]
904936

905-
@property
906-
def llc(self):
907-
if self.basis == 'xy':
908-
x = self.origin[0] - self.width / 2.0
909-
y = self.origin[1] - self.height / 2.0
910-
z = self.origin[2]
911-
elif self.basis == 'yz':
912-
x = self.origin[0]
913-
y = self.origin[1] - self.width / 2.0
914-
z = self.origin[2] - self.height / 2.0
915-
else:
916-
x = self.origin[0] - self.width / 2.0
917-
y = self.origin[1]
918-
z = self.origin[2] - self.height / 2.0
919-
return x, y, z
920-
@property
921-
def urc(self):
922-
if self.basis == 'xy':
923-
x = self.origin[0] + self.width / 2.0
924-
y = self.origin[1] + self.height / 2.0
925-
z = self.origin[2]
926-
elif self.basis == 'yz':
927-
x = self.origin[0]
928-
y = self.origin[1] + self.width / 2.0
929-
z = self.origin[2] + self.height / 2.0
930-
else:
931-
x = self.origin[0] + self.width / 2.0
932-
y = self.origin[1]
933-
z = self.origin[2] + self.height / 2.0
934-
return x, y, z
935-
936937

937938
class PlotView:
938939
"""Setup the view of the model.
@@ -967,7 +968,7 @@ class PlotView:
967968

968969
attrs = ('view_ind', 'view_params', 'cells', 'materials', 'selectedTally')
969970
plotbase_attrs = ('level', 'origin', 'width', 'height',
970-
'h_res', 'v_res', 'basis', 'color_overlaps')
971+
'h_res', 'v_res', 'basis', 'llc', 'urc', 'color_overlaps')
971972

972973
def __init__(self, origin=(0, 0, 0), width=10, height=10, restore_view=None,
973974
restore_domains=False):

0 commit comments

Comments
 (0)