public SpatialEditDeformOpSOBehavior(FContext context, BaseSO sourceSO, DMeshSO legSO, IVectorDisplacementSourceOp op) : base(context)
        {
            this.sourceSO = sourceSO;
            this.legSO    = legSO;
            this.op       = op;

            this.WantsCaptureF  = wants_capture;
            base.BeginCaptureF  = begin_capture;
            base.UpdateCaptureF = update_capture;
        }
Beispiel #2
0
        public DataTable Query(string sql, object module)
        {
            SQLParser parser = new SQLParser();

            parser.Parse(sql, module);

            string limitSql = parser.AsSql();

            string[] paramNames  = parser.GetSqlParameterNames();
            object[] paramValues = parser.GetSqlParameterValues();

            BaseSO so = module as BaseSO;

            if (so != null && so.PageIndex != BaseSO.PAGE_INDEX_NO_PAGE)
            {
                TransactionContext tranContext = TransactionContext.get();
                this.dbType = tranContext.dbType;

                Dialect dialect = Dialect.GetDialect(dbType);

                if (so.PageIndex != BaseSO.PAGE_INDEX_NO_TOTAL)
                {
                    string countSql = dialect.GetCountSql(limitSql);

                    so.Total = GetLong(countSql, paramNames, paramValues);
                }

                limitSql = dialect.GetLimitSql(limitSql, so.PageIndex, so.PageSize);

                string[] limitParamNames  = dialect.GetLimitParamNames(so.PageIndex, so.PageSize);
                object[] limitParamValues = dialect.GetLimitParamValues(so.PageIndex, so.PageSize);

                string[] tempParamNames  = new string[limitParamNames.Length + paramNames.Length];
                object[] tempParamValues = new object[tempParamNames.Length];

                paramNames.CopyTo(tempParamNames, 0);
                limitParamNames.CopyTo(tempParamNames, paramNames.Length);
                paramNames = tempParamNames;

                paramValues.CopyTo(tempParamValues, 0);
                limitParamValues.CopyTo(tempParamValues, paramValues.Length);
                paramValues = tempParamValues;
            }

            return(Query(limitSql, paramNames, paramValues));
        }
Beispiel #3
0
 static void add_input_behaviors_for_mouse(BaseSO so, IVectorDisplacementSourceOp op)
 {
     if (op is EnclosedRegionOffsetOp)
     {
         EnclosedRegionOffsetOp deformOp = op as EnclosedRegionOffsetOp;
         so.InputBehaviors.Add(
             new RightMouseClickDragBehavior()
         {
             WantsCaptureF  = (input) => { return(input.bCtrlKeyDown); },
             UpdateCaptureF = (input, lastInput) => {
                 deformOp.PushPullDistance += input.vMouseDelta2D.x * 0.1;
             }
         });
     }
     else if (op is EnclosedRegionSmoothOp)
     {
         EnclosedRegionSmoothOp deformOp = op as EnclosedRegionSmoothOp;
         so.InputBehaviors.Add(
             new RightMouseClickDragBehavior()
         {
             WantsCaptureF  = (input) => { return(input.bCtrlKeyDown); },
             UpdateCaptureF = (input, lastInput) => {
                 deformOp.OffsetDistance += input.vMouseDelta2D.x * 0.1;
                 deformOp.SmoothAlpha    += input.vMouseDelta2D.y * 0.1;
             }
         });
     }
     else if (op is PlaneBandExpansionOp)
     {
         PlaneBandExpansionOp deformOp = op as PlaneBandExpansionOp;
         so.InputBehaviors.Add(
             new RightMouseClickDragBehavior()
         {
             WantsCaptureF  = (input) => { return(input.bCtrlKeyDown); },
             UpdateCaptureF = (input, lastInput) => {
                 deformOp.PushPullDistance += input.vMouseDelta2D.x * 0.1;
                 deformOp.BandDistance     += input.vMouseDelta2D.y * 0.1;
             }
         });
     }
 }