Rebar Addon for FreeCAD
Public Member Functions | Public Attributes | List of all members
BentShapeRebar._BentShapeRebarTaskPanel Class Reference
Collaboration diagram for BentShapeRebar._BentShapeRebarTaskPanel:
Collaboration graph

Public Member Functions

def __init__ (self, Rebar=None)
 
def getOrientation (self)
 
def getStandardButtons (self)
 
def clicked (self, button)
 
def accept (self, signal=None)
 
def amount_radio_clicked (self)
 
def spacing_radio_clicked (self)
 

Public Attributes

 SelectedObj
 
 FaceName
 
 form
 
 Rebar
 

Detailed Description

Definition at line 105 of file BentShapeRebar.py.

Constructor & Destructor Documentation

def BentShapeRebar._BentShapeRebarTaskPanel.__init__ (   self,
  Rebar = None 
)

Definition at line 106 of file BentShapeRebar.py.

106  def __init__(self, Rebar = None):
107  if not Rebar:
108  selected_obj = FreeCADGui.Selection.getSelectionEx()[0]
109  self.SelectedObj = selected_obj.Object
110  self.FaceName = selected_obj.SubElementNames[0]
111  else:
112  self.FaceName = Rebar.Base.Support[0][1][0]
113  self.SelectedObj = Rebar.Base.Support[0][0]
114  self.form = FreeCADGui.PySideUic.loadUi(os.path.splitext(__file__)[0] + ".ui")
115  self.form.setWindowTitle(QtGui.QApplication.translate("RebarAddon", "Bent Shape Rebar", None))
116  self.form.orientation.addItems(["Bottom", "Top", "Right", "Left"])
117  self.form.amount_radio.clicked.connect(self.amount_radio_clicked)
118  self.form.spacing_radio.clicked.connect(self.spacing_radio_clicked)
119  self.form.customSpacing.clicked.connect(lambda: runRebarDistribution(self))
120  self.form.removeCustomSpacing.clicked.connect(lambda: removeRebarDistribution(self))
121  self.form.PickSelectedFace.clicked.connect(lambda: getSelectedFace(self))
122  self.form.orientation.currentIndexChanged.connect(self.getOrientation)
123  self.form.image.setPixmap(QtGui.QPixmap(os.path.split(os.path.abspath(__file__))[0] + "/icons/BentShapeRebar.svg"))
124  self.form.toolButton.setIcon(self.form.toolButton.style().standardIcon(QtGui.QStyle.SP_DialogHelpButton))
125  self.form.toolButton.clicked.connect(lambda: showPopUpImageDialog(os.path.split(os.path.abspath(__file__))[0] + "/icons/BentShapeRebarDetailed.svg"))
126  self.Rebar = Rebar
127 
def getSelectedFace(self)
Definition: Rebarfunc.py:278
def runRebarDistribution(self)
def showPopUpImageDialog(img)
Definition: PopUpImage.py:43
def removeRebarDistribution(self)

Member Function Documentation

def BentShapeRebar._BentShapeRebarTaskPanel.accept (   self,
  signal = None 
)

Definition at line 146 of file BentShapeRebar.py.

146  def accept(self, signal = None):
147  f_cover = self.form.frontCover.text()
148  f_cover = FreeCAD.Units.Quantity(f_cover).Value
149  b_cover = self.form.bottomCover.text()
150  b_cover = FreeCAD.Units.Quantity(b_cover).Value
151  l_cover = self.form.l_sideCover.text()
152  l_cover = FreeCAD.Units.Quantity(l_cover).Value
153  r_cover = self.form.r_sideCover.text()
154  r_cover = FreeCAD.Units.Quantity(r_cover).Value
155  t_cover = self.form.topCover.text()
156  t_cover = FreeCAD.Units.Quantity(t_cover).Value
157  bentLength = self.form.bentLength.text()
158  bentLength = FreeCAD.Units.Quantity(bentLength).Value
159  bentAngle = self.form.bentAngle.value()
160  diameter = self.form.diameter.text()
161  diameter = FreeCAD.Units.Quantity(diameter).Value
162  rounding = self.form.rounding.value()
163  orientation = self.form.orientation.currentText()
164  amount_check = self.form.amount_radio.isChecked()
165  spacing_check = self.form.spacing_radio.isChecked()
166  if not self.Rebar:
167  if amount_check:
168  amount = self.form.amount.value()
169  rebar = makeBentShapeRebar(f_cover, b_cover, l_cover, r_cover, diameter, t_cover, bentLength, bentAngle, rounding, True, amount, orientation, self.SelectedObj, self.FaceName)
170  elif spacing_check:
171  spacing = self.form.spacing.text()
172  spacing = FreeCAD.Units.Quantity(spacing).Value
173  rebar = makeBentShapeRebar(f_cover, b_cover, l_cover, r_cover, diameter, t_cover, bentLength, bentAngle, rounding, False, spacing, orientation, self.SelectedObj, self.FaceName)
174  else:
175  if amount_check:
176  amount = self.form.amount.value()
177  rebar = editBentShapeRebar(self.Rebar, f_cover, b_cover, l_cover, r_cover, diameter, t_cover, bentLength, bentAngle, rounding, True, amount, orientation, self.SelectedObj, self.FaceName)
178  elif spacing_check:
179  spacing = self.form.spacing.text()
180  spacing = FreeCAD.Units.Quantity(spacing).Value
181  rebar = editBentShapeRebar(self.Rebar, f_cover, b_cover, l_cover, r_cover, diameter, t_cover, bentLength, bentAngle, rounding, False, spacing, orientation, self.SelectedObj, self.FaceName)
182  if self.CustomSpacing:
183  rebar.CustomSpacing = self.CustomSpacing
184  FreeCAD.ActiveDocument.recompute()
185  self.Rebar = rebar
186  if signal == int(QtGui.QDialogButtonBox.Apply):
187  pass
188  else:
189  FreeCADGui.Control.closeDialog(self)
190 
def editBentShapeRebar(Rebar, f_cover, b_cover, l_cover, r_cover, diameter, t_cover, bentLength, bentAngle, rounding, amount_spacing_check, amount_spacing_value, orientation, structure=None, facename=None)
def makeBentShapeRebar(f_cover, b_cover, l_cover, r_cover, diameter, t_cover, bentLength, bentAngle, rounding, amount_spacing_check, amount_spacing_value, orientation="Bottom Left", structure=None, facename=None)

Here is the call graph for this function:

Here is the caller graph for this function:

def BentShapeRebar._BentShapeRebarTaskPanel.amount_radio_clicked (   self)

Definition at line 191 of file BentShapeRebar.py.

192  self.form.spacing.setEnabled(False)
193  self.form.amount.setEnabled(True)
194 
def BentShapeRebar._BentShapeRebarTaskPanel.clicked (   self,
  button 
)

Definition at line 142 of file BentShapeRebar.py.

142  def clicked(self, button):
143  if button == int(QtGui.QDialogButtonBox.Apply):
144  self.accept(button)
145 

Here is the call graph for this function:

def BentShapeRebar._BentShapeRebarTaskPanel.getOrientation (   self)

Definition at line 128 of file BentShapeRebar.py.

128  def getOrientation(self):
129  orientation = self.form.orientation.currentText()
130  #if orientation == "Bottom":
131  # self.form.image.setPixmap(QtGui.QPixmap(os.path.split(os.path.abspath(__file__))[0] + "/icons/LShapeRebarBR.svg"))
132  #elif orientation == "Top":
133  # self.form.image.setPixmap(QtGui.QPixmap(os.path.split(os.path.abspath(__file__))[0] + "/icons/LShapeRebarBL.svg"))
134  #elif orientation == "Right":
135  # self.form.image.setPixmap(QtGui.QPixmap(os.path.split(os.path.abspath(__file__))[0] + "/icons/LShapeRebarTR.svg"))
136  #else:
137  # self.form.image.setPixmap(QtGui.QPixmap(os.path.split(os.path.abspath(__file__))[0] + "/icons/LShapeRebarTL.svg"))
138 
def BentShapeRebar._BentShapeRebarTaskPanel.getStandardButtons (   self)

Definition at line 139 of file BentShapeRebar.py.

140  return int(QtGui.QDialogButtonBox.Ok) | int(QtGui.QDialogButtonBox.Apply) | int(QtGui.QDialogButtonBox.Cancel)
141 
def BentShapeRebar._BentShapeRebarTaskPanel.spacing_radio_clicked (   self)

Definition at line 195 of file BentShapeRebar.py.

196  self.form.amount.setEnabled(False)
197  self.form.spacing.setEnabled(True)
198 
199 

Member Data Documentation

BentShapeRebar._BentShapeRebarTaskPanel.FaceName

Definition at line 110 of file BentShapeRebar.py.

BentShapeRebar._BentShapeRebarTaskPanel.form

Definition at line 114 of file BentShapeRebar.py.

BentShapeRebar._BentShapeRebarTaskPanel.Rebar

Definition at line 126 of file BentShapeRebar.py.

BentShapeRebar._BentShapeRebarTaskPanel.SelectedObj

Definition at line 109 of file BentShapeRebar.py.


The documentation for this class was generated from the following file: