def rejectCallback(): """Action called when click on Cancel""" for i in range(len(LIST_SHAPE_NAME)): if LIST_SHAPE_NAME[i] == DEFAULT_SHAPE_NAME: dialogWithApply.reject() if previewShapeEntry[i] is not None: deletePreviewShape(LIST_SHAPE_NAME, activeStudy, previewShapeEntry, DEFAULT_SHAPE_NAME)
def acceptCallback(): """Action called when click on Ok""" for i in range(len(LIST_SHAPE_NAME)): if LIST_SHAPE_NAME[i] == DEFAULT_SHAPE_NAME: dialogWithApply.accept() if previewShapeEntry[i] is not None: deletePreviewShape(LIST_SHAPE_NAME, activeStudy, previewShapeEntry, DEFAULT_SHAPE_NAME) PFONx, PFONy, PFONz, DTANx, DTANy, DTANz = dialogWithApply.getData( ) shape = fissbuilder.createGeometryHalfline(activeStudy, PFONx, PFONy, PFONz, DTANx, DTANy, DTANz) previewShapeEntry[i] = xalome.addToStudy( activeStudy, shape, DEFAULT_CRACK_TYPE + " : " + DEFAULT_SHAPE_NAME, DEFAULT_FOLDER_NAME) xalome.displayShape(previewShapeEntry[i]) LIST = [PFONx, PFONy, PFONz, DTANx, DTANy, DTANz]
def applyCallback(): """Action called when click on Apply""" for i in range(len(LIST_SHAPE_NAME)): if LIST_SHAPE_NAME[i] == DEFAULT_SHAPE_NAME: # We first have to destroy the currently displayed preview shape. if previewShapeEntry[i] is not None: deletePreviewShape(LIST_SHAPE_NAME, activeStudy, previewShapeEntry, DEFAULT_SHAPE_NAME) # Then we can create the new shape with the new parameter values PFONx, PFONy, PFONz, NORMx, NORMy, NORMz, DTANx, DTANy, DTANz = dialogWithApply.getData( ) shape = fissbuilder.createGeometryHalfplane( activeStudy, PFONx, PFONy, PFONz, NORMx, NORMy, NORMz, DTANx, DTANy, DTANz) # We apply a specific color on the shape for the preview state shape.SetColor(PREVIEW_COLOR) previewShapeEntry[i] = xalome.addToStudy(activeStudy, shape, PREVIEW_SHAPE_NAME, DEFAULT_FOLDER_NAME) xalome.displayShape(previewShapeEntry[i])
def acceptCallback(): """Action called when click on Ok""" for i in range(len(LIST_SHAPE_NAME)): if LIST_SHAPE_NAME[i] == DEFAULT_SHAPE_NAME: dialogWithApply.accept() if previewShapeEntry[i] is not None: deletePreviewShape(LIST_SHAPE_NAME, activeStudy, previewShapeEntry, DEFAULT_SHAPE_NAME) rmaj, rmin, centerx, centery, centerz, vectXx, vectXy, vectXz, vectYx, vectYy, vectYz = dialogWithApply.getData( ) shape = fissbuilder.createGeometryRectangle( activeStudy, rmaj, rmin, centerx, centery, centerz, vectXx, vectXy, vectXz, vectYx, vectYy, vectYz) previewShapeEntry[i] = xalome.addToStudy( activeStudy, shape, DEFAULT_CRACK_TYPE + " : " + DEFAULT_SHAPE_NAME, DEFAULT_FOLDER_NAME) xalome.displayShape(previewShapeEntry[i]) LIST = [ rmaj, rmin, centerx, centery, centerz, vectXx, vectXy, vectXz, vectYx, vectYy, vectYz ]
def applyCallback(): """Action called when click on Apply""" for i in range(len(LIST_SHAPE_NAME)): if LIST_SHAPE_NAME[i] == DEFAULT_SHAPE_NAME: # We first have to destroy the currently displayed preview shape. if previewShapeEntry[i] is not None: deletePreviewShape(LIST_SHAPE_NAME, activeStudy, previewShapeEntry, DEFAULT_SHAPE_NAME) # Then we can create the new shape with the new parameter values rmaj, rmin, centerx, centery, centerz, vectXx, vectXy, vectXz, vectYx, vectYy, vectYz = dialogWithApply.getData( ) shape = fissbuilder.createGeometryCylinder(activeStudy, rmaj, rmin, centerx, centery, centerz, vectXx, vectXy, vectXz, vectYx, vectYy, vectYz) # We apply a specific color on the shape for the preview state shape.SetColor(PREVIEW_COLOR) previewShapeEntry[i] = xalome.addToStudy(activeStudy, shape, PREVIEW_SHAPE_NAME, DEFAULT_FOLDER_NAME) xalome.displayShape(previewShapeEntry[i])