/// <summary> /// 权限检查,如果strAppID为空,则根据strTableName的ID查询strAppID后判断权限 /// </summary> /// <param name="strUserID">用户的GUID</param> /// <param name="strAppID">应用的ID</param> /// <param name="funcName">功能标志</param> /// <param name="strFuncMsg">功能名称</param> /// <param name="strTableName">表名称</param> /// <param name="strID"></param> private void CheckPermission(string strAppID, FunctionNames funcName, string strFuncMsg, string strTableName, string strID) { if (strAppID == string.Empty) { string strSQL = "SELECT APP_ID FROM " + TSqlBuilder.Instance.CheckQuotationMark(strTableName, false) + " WHERE ID = " + TSqlBuilder.Instance.CheckQuotationMark(strID, true); DataSet ds = InnerCommon.ExecuteDataset(strSQL); if (ds.Tables[0].Rows.Count != 0) strAppID = ds.Tables[0].Rows[0]["APP_ID"].ToString(); } CheckPermission(strAppID, funcName, strFuncMsg); }
/// <summary> /// Returns a CSS representation of the transformation. /// </summary> /// <returns>The CSS value string.</returns> public String ToCss() { return(FunctionNames.Build(FunctionNames.Rotate, _angle.ToCss())); }
private void CheckPermission(string strAppID, FunctionNames funcName, string strFuncMsg) { ExceptionHelper.FalseThrow<ApplicationException>( SecurityCheck.DoesUserHasPermissions(this.LogOnUserInfo.UserGuid, new Guid(strAppID), funcName.ToString(), UserValueType.Guid), "没有" + strFuncMsg + "的权限"); }
/** * Gets the function name * @param ws the workbook settings * @return the function name */ public string getName(WorkbookSettings ws) { FunctionNames fn = ws.getFunctionNames(); return(fn.getName(this)); }
/// <summary> /// Returns a CSS representation of the transformation. /// </summary> /// <returns>The CSS value string.</returns> public String ToCss() { return(FunctionNames.Build(FunctionNames.Translate3d, _x.ToCss(), _y.ToCss(), _z.ToCss())); }
public override String ToCss() { return(FunctionNames.Build(FunctionNames.Translate, _x.CssText, _y.CssText)); }
public PSO(FunctionNames functionName, int populationSize, int generation) : base(functionName, populationSize, generation) { }
public override String ToCss() { return(FunctionNames.Build(FunctionNames.Skew, _alpha.ToCss(), _beta.ToCss())); }
public override String ToCss() { return(FunctionNames.Build(FunctionNames.SkewY, _angle.ToCss())); }
public override String ToCss() { return(FunctionNames.Build(FunctionNames.Scale3d, _sx.ToString(CultureInfo.InvariantCulture), _sy.ToString(CultureInfo.InvariantCulture), _sz.ToString(CultureInfo.InvariantCulture))); }
public override String ToCss() { return(FunctionNames.Build(FunctionNames.Matrix, _matrix.M11.ToString(CultureInfo.InvariantCulture), _matrix.M12.ToString(CultureInfo.InvariantCulture), _matrix.M21.ToString(CultureInfo.InvariantCulture), _matrix.M22.ToString(CultureInfo.InvariantCulture), _matrix.Tx.ToString(CultureInfo.InvariantCulture), _matrix.Ty.ToString(CultureInfo.InvariantCulture))); }
public override String ToCss() { return(FunctionNames.Build(FunctionNames.Rotate3d, _x.ToString(CultureInfo.InvariantCulture), _y.ToString(CultureInfo.InvariantCulture), _z.ToString(CultureInfo.InvariantCulture), _angle.ToCss())); }
/// <summary> /// A new sketch is created: if the user clicked on the face of a solid, that face's normal is used as axis for the new sketch, otherwise /// the default axis with position (0,0,0) and direction (0,0,1) is used. /// </summary> /// <param name="mouseData"></param> protected override void OnMouseDownAction(Mouse3DPosition mouseData) { base.OnMouseDownAction(mouseData); Log.Info("StartSketch - OnMouseDownAction"); //var checkSketch = new SketchCreator(Document, false); //if (checkSketch.CurrentSketch != null) return; Log.Info("StartSketch - OnMouseDownAction - current sketch null"); var sketchCreator = new SketchCreator(Document); var currentSketch = sketchCreator.CurrentSketch; var sketchNodeBuilder = new NodeBuilder(currentSketch); Inputs[InputNames.SelectionContainerPipe].Send(NotificationNames.BuildSelections, mouseData); var entities = Inputs[InputNames.SelectionContainerPipe].GetData(NotificationNames.GetEntities).Get <List <SceneSelectedEntity> >(); var selectedFace = (SelectionInfo)Inputs[InputNames.Mouse3DEventsPipe].GetData(NotificationNames.GetFace).Data; Document.Transact(); var transformationInfo = new TransformationInfo(); transformationInfo.SketchIndex = sketchNodeBuilder.Node.Index; Log.InfoFormat("StartSketch - OnMouseDownAction - selected entities count {0}", entities.Count); var normalOnPlane = new Axis(new Point3D(0, 0, 0), new Point3D(0, 0, 1)).GpAxis; if (Inputs[InputNames.Mouse3DEventsPipe].GetData(NotificationNames.GetPlane).Data != null) { normalOnPlane.Location = ((gpPln)Inputs[InputNames.Mouse3DEventsPipe].GetData(NotificationNames.GetPlane).Data).Axis.Location; normalOnPlane.Direction = ((gpPln)Inputs[InputNames.Mouse3DEventsPipe].GetData(NotificationNames.GetPlane).Data).Axis.Direction; if (selectedFace != null) { var _3DShapesFunctions = new List <string>(); _3DShapesFunctions.AddRange(new[] { FunctionNames.Sphere, FunctionNames.Box, FunctionNames.Cylinder, FunctionNames.Torus, FunctionNames.Cone, FunctionNames.Plane }); var nb = new NodeBuilder(selectedFace.selectedNode); if (nb.FunctionName == string.Empty || _3DShapesFunctions.Contains(nb.FunctionName)) { transformationInfo.RefSketchIndex = -1; } else { transformationInfo.RefSketchIndex = nb.Dependency[0].Reference.Index; var faces = GeomUtils.ExtractFaces(nb.Shape); var face = faces[selectedFace.face]; var orientation = face.Orientation(); if (orientation == TopAbsOrientation.TopAbs_REVERSED) { normalOnPlane.Direction = normalOnPlane.Direction.Reversed; } } } else { transformationInfo.RefSketchIndex = -1; } } else { var plane = new gpPln(new gpAx3()); Inputs[InputNames.Mouse3DEventsPipe].Send(NotificationNames.SetPlane, plane); transformationInfo.RefSketchIndex = -1; } if (selectedFace != null) { var nb = new NodeBuilder(selectedFace.selectedNode); if (nb.FunctionName != FunctionNames.Plane) { sketchNodeBuilder[2].Reference = nb.Node; sketchNodeBuilder[3].Integer = selectedFace.face; } } _sketchButton.Block(); sketchNodeBuilder[0].TransformedAxis3D = new Axis(new Point3D(0, 0, 0), new Point3D(0, 0, 1)).GpAxis; var transformation = sketchNodeBuilder.Node.Set <TransformationInterpreter>(); if (selectedFace != null) { var solids = new List <string> { string.Empty }; solids.AddRange(FunctionNames.GetSolids()); if (solids.Contains(new NodeBuilder(selectedFace.selectedNode).FunctionName)) { var oldSystemAxis = new gpAx3(new gpPnt(0, 0, 0), new gpDir(0, 0, 1)); var newSystemAxis = new gpAx3(normalOnPlane.Location, normalOnPlane.Direction); gpTrsf T = new gpTrsf(); T.SetTransformation(oldSystemAxis, newSystemAxis); transformation.CurrTransform = T.Inverted; } else { var allTrsfs = NodeBuilderUtils.GetTransformedAxis( new NodeBuilder(selectedFace.selectedNode).Dependency[0].ReferenceBuilder); gpTrsf T = new gpTrsf(); var oldSystemAxis = new gpAx3(new gpPnt(0, 0, 0), new gpDir(0, 0, 1)); // var oldSystemAxis = new gpAx3(allTrsfs.Location, allTrsfs.Direction); normalOnPlane.Direction = NodeBuilderUtils.RoundToPrecision(normalOnPlane.Direction); var newSystemAxis = new gpAx3(normalOnPlane.Location, normalOnPlane.Direction); // T.SetDisplacement(oldSystemAxis, newSystemAxis); T.SetTransformation(oldSystemAxis, newSystemAxis); transformation.CurrTransform = T.Inverted; } transformationInfo.Transformation = transformation.CurrTransform; } else { transformation.TranslateWith(new Point3D(normalOnPlane.Location)); transformationInfo.Transformation = transformation.CurrTransform; } transformationInfo.TrsfIndex = TransformationInfo.maxTrsfIndex; TransformationInfo.maxTrsfIndex++; TransformationInterpreter.Transformations.Add(transformationInfo); sketchNodeBuilder.ExecuteFunction(); AddNodeToTree(sketchNodeBuilder.Node); NodeBuilderUtils.HidePlanes(Document); HighlightCurrentSketchNodes(sketchNodeBuilder.Node); Document.Commit("sketch created"); BackToNeutralModifier(); }
public override String ToCss() { return(FunctionNames.Build(FunctionNames.Calc, String.Concat(_origin.ToCss(), " + ", _shift.ToCss()))); }