Skip to content

Commit

Permalink
forgot some files
Browse files Browse the repository at this point in the history
  • Loading branch information
bbean23 committed Jan 28, 2025
1 parent ed97d1a commit 006d181
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 5 deletions.
22 changes: 17 additions & 5 deletions opencsp/common/lib/render_control/RenderControlAxis.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ class RenderControlAxis:
Render control for plot axes.
"""

def __init__(self, x_label='x', y_label='y', z_label='z', p_label='p', q_label='q', w_label='w', grid=True):
def __init__(
self, x_label='x', y_label='y', z_label='z', p_label='p', q_label='q', w_label='w', draw_axes=True, grid=True
):
super(RenderControlAxis, self).__init__()

# Axis control.
Expand All @@ -19,19 +21,27 @@ def __init__(self, x_label='x', y_label='y', z_label='z', p_label='p', q_label='
self.p_label = p_label
self.q_label = q_label
self.w_label = w_label
self.draw_axes = draw_axes
self.grid = grid


def meters(grid=True):
def meters(draw_axes=True, grid=True):
"""
Labels indicating units of meters.
"""
return RenderControlAxis(
x_label='x (m)', y_label='y (m)', z_label='z (m)', p_label='p (m)', q_label='q (m)', w_label='w (m)', grid=grid
x_label='x (m)',
y_label='y (m)',
z_label='z (m)',
p_label='p (m)',
q_label='q (m)',
w_label='w (m)',
draw_axes=draw_axes,
grid=grid,
)


def latlon(decimal_t_degminsecs_f=True, grid=True):
def latlon(decimal_t_degminsecs_f=True, draw_axes=True, grid=True):
"""
Labels indicating units of latitude and longitude.
"""
Expand All @@ -43,11 +53,12 @@ def latlon(decimal_t_degminsecs_f=True, grid=True):
p_label=f"p ({unit})",
q_label=f"q ({unit})",
w_label=f"w ({unit})",
draw_axes=draw_axes,
grid=grid,
)


def image(grid=True):
def image(draw_axes=True, grid=True):
"""
Labels indicating image.
"""
Expand All @@ -58,5 +69,6 @@ def image(grid=True):
p_label='x (pix)',
q_label='y (pix)',
w_label='w N/A',
draw_axes=draw_axes,
grid=grid,
)
10 changes: 10 additions & 0 deletions opencsp/common/lib/render_control/RenderControlFacet.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ def outline(color='k'):
)


def outline_thin(color='k', linewidth=0.5):
return RenderControlFacet(
draw_centroid=False,
draw_outline=True,
outline_style=rcps.outline(color=color, linewidth=linewidth),
draw_surface_normal=False,
draw_name=False,
)


def outline_name(color='k'):
return RenderControlFacet(
draw_centroid=False,
Expand Down
11 changes: 11 additions & 0 deletions opencsp/common/lib/render_control/RenderControlFacetEnsemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,17 @@ def facet_outlines(color='k', **kwargs):
)


def facet_outlines_thin(color='k', linewidth=0.25, **kwargs):
return RenderControlFacetEnsemble(
draw_normal_vector=False,
default_style=rcf.outline_thin(color=color, linewidth=linewidth),
normal_vector_style=rcps.outline(color=color),
normal_vector_base_style=rcps.marker(color=color),
draw_centroid=False,
**kwargs
)


def facet_ensemble_outline(color='k', normal_vector_length=4.0, **kwargs):
return RenderControlFacetEnsemble(
draw_normal_vector=True,
Expand Down
9 changes: 9 additions & 0 deletions opencsp/common/lib/render_control/RenderControlTower.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def __init__(
point_styles: RenderControlPointSeq = None,
wire_frame: RenderControlPointSeq = None,
target: RenderControlPointSeq = None,
bcs: RenderControlPointSeq = None,
) -> None:
"""
Controls for rendering a tower.
Expand Down Expand Up @@ -48,6 +49,8 @@ def __init__(
wire_frame = rcps.outline()
if target is None:
target = rcps.marker(marker='x', color='r', markersize=6)
if bcs is None:
bcs = rcps.marker(marker='+', color='b', markersize=6)

super(RenderControlTower, self).__init__()

Expand All @@ -58,6 +61,7 @@ def __init__(
self.point_styles = point_styles
self.wire_frame = wire_frame
self.target = target
self.bcs = bcs

def style(self, any):
""" "style" is a method commonly used by RenderControlEnsemble.
Expand All @@ -75,3 +79,8 @@ def normal_tower():
def no_target():
# tower outline with no target.
return RenderControlTower(wire_frame=rcps.outline(color='g'), target=False)


def no_bcs():
# tower outline with not bcs.
return RenderControlTower(wire_frame=rcps.outline(color='g'), bcs=False)

0 comments on commit 006d181

Please sign in to comment.