コード例 #1
0
        // morph.c (1037, 1)
        // selectComposableSels(size, direction, psel1, psel2) as int
        // selectComposableSels(l_int32, l_int32, SEL **, SEL **) as l_int32
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/selectComposableSels/*"/>
        ///   <returns></returns>
        public static int selectComposableSels(
            int size,
            int direction,
            Sel psel1,
            Sel psel2)
        {
            if (psel1 == null)
            {
                throw new ArgumentNullException("psel1 cannot be Nothing");
            }

            if (psel2 == null)
            {
                throw new ArgumentNullException("psel2 cannot be Nothing");
            }

            IntPtr psel1Ptr = IntPtr.Zero;  if (psel1 != null)
            {
                psel1Ptr = psel1.Pointer;
            }
            IntPtr psel2Ptr = IntPtr.Zero;  if (psel2 != null)
            {
                psel2Ptr = psel2.Pointer;
            }
            int _Result = Natives.selectComposableSels(size, direction, psel1Ptr, psel2Ptr);

            return(_Result);
        }
コード例 #2
0
ファイル: sel1.cs プロジェクト: Phreak87/LeptonicaSharp
        // sel1.c (566, 1)
        // selaAddSel(sela, sel, selname, copyflag) as int
        // selaAddSel(SELA *, SEL *, const char *, l_int32) as l_ok
        ///  <summary>
        /// (1) This adds a sel, either inserting or making a copy.<para/>
        ///
        /// (2) Because every sel in a sela must have a name, it copies
        /// the input name if necessary.  You can input NULL for
        /// selname if the sel already has a name.
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/selaAddSel/*"/>
        ///  <param name="sela">[in] - </param>
        ///  <param name="sel">[in] - to be added</param>
        ///  <param name="selname">[in] - ignored if already defined in sel req'd in sel when added to a sela</param>
        ///  <param name="copyflag">[in] - L_INSERT or L_COPY</param>
        ///   <returns>0 if OK 1 on error</returns>
        public static int selaAddSel(
            Sela sela,
            Sel sel,
            String selname,
            int copyflag)
        {
            if (sela == null)
            {
                throw new ArgumentNullException("sela cannot be Nothing");
            }

            if (sel == null)
            {
                throw new ArgumentNullException("sel cannot be Nothing");
            }

            if (selname == null)
            {
                throw new ArgumentNullException("selname cannot be Nothing");
            }

            int _Result = Natives.selaAddSel(sela.Pointer, sel.Pointer, selname, copyflag);

            return(_Result);
        }
コード例 #3
0
ファイル: SRQPersist.cs プロジェクト: Honhone/Plugins
 static void LoadSRQ()
 {
     if (Selection.activeGameObject != null)
     {
         if (SaveHold.Count != 0)
         {
             var SelSet = Selection.activeGameObject.GetComponentsInChildren <SetRenderQueue>();
             if (SelSet.Length > 0)
             {
                 //Debug.Log("Loading in process");
                 foreach (var Sel in SelSet)
                 {
                     if (SaveHold.ContainsKey(Sel.GetInstanceID()))
                     {
                         int value;
                         if (SaveHold.TryGetValue(Sel.GetInstanceID(), out value))
                         {
                             SRQSet(Sel, value);
                         }
                         Debug.Log("Restored Render Queue ID: " + Sel.GetInstanceID() + " | Value: " + value);
                     }
                 }
                 SaveHold.Clear();
             }
         }
         else
         {
             Debug.Log("SRQPersist: Nothing was loaded.");
         }
     }
 }
コード例 #4
0
        // morphapp.c (901, 1)
        // pixaExtendByMorph(pixas, type, niters, sel, include) as Pixa
        // pixaExtendByMorph(PIXA *, l_int32, l_int32, SEL *, l_int32) as PIXA *
        ///  <summary>
        /// (1) This dilates or erodes every pix in %pixas, iteratively,
        /// using the input Sel (or, if null, a 2x2 Sel by default),
        /// and puts the results in %pixad.<para/>
        ///
        /// (2) If %niters smaller or equal 0, this is a no-op it returns a clone of pixas.<para/>
        ///
        /// (3) If %include == 1, the output %pixad contains all the pix
        /// in %pixas.  Otherwise, it doesn't, but pixaJoin() can be
        /// used later to join pixas with pixad.
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/pixaExtendByMorph/*"/>
        ///  <param name="pixas">[in] - </param>
        ///  <param name="type">[in] - L_MORPH_DILATE, L_MORPH_ERODE</param>
        ///  <param name="niters">[in] - </param>
        ///  <param name="sel">[in] - used for dilation, erosion uses 2x2 if null</param>
        ///  <param name="include">[in] - 1 to include a copy of the input pixas in pixad 0 to omit</param>
        ///   <returns>pixad   with derived pix, using all iterations, or NULL on error</returns>
        public static Pixa pixaExtendByMorph(
            Pixa pixas,
            int type,
            int niters,
            Sel sel,
            int include)
        {
            if (pixas == null)
            {
                throw new ArgumentNullException("pixas cannot be Nothing");
            }

            if (sel == null)
            {
                throw new ArgumentNullException("sel cannot be Nothing");
            }

            IntPtr _Result = Natives.pixaExtendByMorph(pixas.Pointer, type, niters, sel.Pointer, include);

            if (_Result == IntPtr.Zero)
            {
                return(null);
            }

            return(new Pixa(_Result));
        }
コード例 #5
0
        // morph.c (263, 1)
        // pixErode(pixd, pixs, sel) as Pix
        // pixErode(PIX *, PIX *, SEL *) as PIX *
        ///  <summary>
        /// (1) This erodes src using hits in Sel.<para/>
        ///
        /// (2) There are three cases:
        /// (a) pixd == null (result into new pixd)
        /// (b) pixd == pixs (in-place writes result back to pixs)
        /// (c) pixd != pixs (puts result into existing pixd)<para/>
        ///
        /// (3) For clarity, if the case is known, use these patterns:
        /// (a) pixd = pixErode(NULL, pixs, ...)
        /// (b) pixErode(pixs, pixs, ...)
        /// (c) pixErode(pixd, pixs, ...)<para/>
        ///
        /// (4) The size of the result is determined by pixs.
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/pixErode/*"/>
        ///  <param name="pixd">[in][optional] - this can be null, equal to pixs, or different from pixs</param>
        ///  <param name="pixs">[in] - 1 bpp</param>
        ///  <param name="sel">[in] - </param>
        ///   <returns>pixd</returns>
        public static Pix pixErode(
            Pix pixd,
            Pix pixs,
            Sel sel)
        {
            if (pixs == null)
            {
                throw new ArgumentNullException("pixs cannot be Nothing");
            }

            if (sel == null)
            {
                throw new ArgumentNullException("sel cannot be Nothing");
            }

            if ((new List <int> {
                1
            }).Contains((int)pixs.d) == false)
            {
                throw new ArgumentException("1 bpp");
            }
            IntPtr pixdPtr = IntPtr.Zero;   if (pixd != null)
            {
                pixdPtr = pixd.Pointer;
            }
            IntPtr _Result = Natives.pixErode(pixdPtr, pixs.Pointer, sel.Pointer);

            if (_Result == IntPtr.Zero)
            {
                return(null);
            }

            return(new Pix(_Result));
        }
コード例 #6
0
        // selgen.c (928, 1)
        // pixDisplayHitMissSel(pixs, sel, scalefactor, hitcolor, misscolor) as Pix
        // pixDisplayHitMissSel(PIX *, SEL *, l_int32, l_uint32, l_uint32) as PIX *
        ///  <summary>
        /// (1) We don't allow scalefactor to be larger than MAX_SEL_SCALEFACTOR<para/>
        ///
        /// (2) The colors are conveniently given as 4 bytes in hex format,
        /// such as 0xff008800.  The least significant byte is ignored.
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/pixDisplayHitMissSel/*"/>
        ///  <param name="pixs">[in] - 1 bpp</param>
        ///  <param name="sel">[in] - hit-miss in general</param>
        ///  <param name="scalefactor">[in] - an integer greater or equal 1 use 0 for default</param>
        ///  <param name="hitcolor">[in] - RGB0 color for center of hit pixels</param>
        ///  <param name="misscolor">[in] - RGB0 color for center of miss pixels</param>
        ///   <returns>pixd RGB showing both pixs and sel, or NULL on error</returns>
        public static Pix pixDisplayHitMissSel(
            Pix pixs,
            Sel sel,
            int scalefactor,
            uint hitcolor,
            uint misscolor)
        {
            if (pixs == null)
            {
                throw new ArgumentNullException("pixs cannot be Nothing");
            }

            if (sel == null)
            {
                throw new ArgumentNullException("sel cannot be Nothing");
            }

            if ((new List <int> {
                1
            }).Contains((int)pixs.d) == false)
            {
                throw new ArgumentException("1 bpp");
            }
            IntPtr _Result = Natives.pixDisplayHitMissSel(pixs.Pointer, sel.Pointer, scalefactor, hitcolor, misscolor);

            if (_Result == IntPtr.Zero)
            {
                return(null);
            }

            return(new Pix(_Result));
        }
コード例 #7
0
        private void button2_Click(object sender, EventArgs e)
        {
            INFITF.Selection Sel;
            Sel = Catia.ActiveDocument.Selection;

            object[] inputObjectType = { "Point" };
            string   Status;

            Sel.Clear();
            Status = Sel.SelectElement2(inputObjectType, "Select an End Point", false);

            if (Status != "Normal")
            {
                label1.Text = "취소됨";
                return;
            }

            if (Sel.Count < 1)
            {
                label1.Text = "선택했나";
                return;
            }

            INFITF.SelectedElement SelItem;
            SelItem = Sel.Item(1);

            PtEnd = Sel.Item(1).Reference;
        }
コード例 #8
0
ファイル: CanvasUI.cs プロジェクト: scumbly/Organ-Grinder
        void CTXOnClipboardPaste()
        {
            // relative position between modules were kept, but take current mouse position as reference!
            Vector2 off = Canvas.MousePosition - Clipboard.Modules[0].Properties.Dimensions.position;

            Sel.Select(Clipboard.PasteModules(Parent.Generator, off));
        }
コード例 #9
0
        public override ListFilter Clone(Map map, FindDescription newOwner)
        {
            ListFilterSelection clone = (ListFilterSelection)base.Clone(map, newOwner);

            clone.Sel = Sel.Clone(map, newOwner);
            //clone.owner = newOwner; //No - MakeFilter sets it.

            return(clone);
        }
コード例 #10
0
ファイル: CanvasState.cs プロジェクト: BoldBigflank/slotcar
        /// <summary>
        /// Processing of Events AFTER Module Window drawing (Beware! Window dragging eats up most events!)
        /// </summary>
        public void EndGUI()
        {
            switch (EV.type)
            {
            case EventType.MouseDrag:
                // Drag canvas (i.e. change scroll offset)
                if (IsCanvasDrag)
                {
                    Scroll.value -= EV.delta;
                }
                break;

            case EventType.KeyDown:
                if (EV.keyCode == KeyCode.Delete)
                {
                    UI.Delete(Sel.SelectedObjects);
                    Sel.Clear();
                }
                break;

            case EventType.MouseUp:
                if (EV.button == 0 &&
                    !IsDragging &&
                    !CurvyProject.Instance.CGAutoModuleDetails &&
                    (!Sel.SelectedLink && !MouseOverLink(Sel.SelectedLink)) &&
                    (!Sel.SelectedModule || !MouseOverModule)
                    )
                {
                    Sel.Select(null);
                }
                if (IsLinkDrag && EV.control)
                {
                    AutoConnectFrom = LinkDragFrom;
                    UI.AddModuleQuickmenu(LinkDragFrom);
                }
                // Multi Selection
                if (IsSelectionRectDrag)
                {
                    HandleMultiSelection();
                    IsSelectionRectDrag = false;
                }

                LinkDragFrom = null;
                IsCanvasDrag = false;
                Parent.StatusBar.Clear();

                break;

            case EventType.DragUpdated:
                UI.HandleDragDropProgress();
                break;

            case EventType.DragPerform:
                UI.HandleDragDropDone();
                break;
            }
        }
コード例 #11
0
        public void LoadProjects()
        {
            if (ps == null)
            {
                return;
            }

            LoadProjects(ps);

            sel = Sel.projects;
        }
コード例 #12
0
ファイル: sel1.cs プロジェクト: Phreak87/LeptonicaSharp
        // sel1.c (685, 1)
        // selGetName(sel) as String
        // selGetName(SEL *) as char *
        ///  <summary>
        /// selGetName()
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/selGetName/*"/>
        ///  <param name="sel">[in] - </param>
        ///   <returns>sel name not copied, or NULL if no name or on error</returns>
        public static String selGetName(
            Sel sel)
        {
            if (sel == null)
            {
                throw new ArgumentNullException("sel cannot be Nothing");
            }

            String _Result = Natives.selGetName(sel.Pointer);

            return(_Result);
        }
コード例 #13
0
ファイル: sel1.cs プロジェクト: Phreak87/LeptonicaSharp
        // sel1.c (710, 1)
        // selSetName(sel, name) as int
        // selSetName(SEL *, const char *) as l_ok
        ///  <summary>
        /// (1) Always frees the existing sel name, if defined.<para/>
        ///
        /// (2) If name is not defined, just clears any existing sel name.
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/selSetName/*"/>
        ///  <param name="sel">[in] - </param>
        ///  <param name="name">[in][optional] - can be null</param>
        ///   <returns>0 if OK, 1 on error</returns>
        public static int selSetName(
            Sel sel,
            String name = "")
        {
            if (sel == null)
            {
                throw new ArgumentNullException("sel cannot be Nothing");
            }

            int _Result = Natives.selSetName(sel.Pointer, name);

            return(_Result);
        }
コード例 #14
0
ファイル: sel1.cs プロジェクト: Phreak87/LeptonicaSharp
        // sel1.c (902, 1)
        // selGetTypeAtOrigin(sel, ptype) as int
        // selGetTypeAtOrigin(SEL *, l_int32 *) as l_ok
        ///  <summary>
        /// selGetTypeAtOrigin()
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/selGetTypeAtOrigin/*"/>
        ///  <param name="sel">[in] - </param>
        ///  <param name="ptype">[out] - SEL_HIT, SEL_MISS, SEL_DONT_CARE</param>
        ///   <returns>0 if OK 1 on error or if origin is not found</returns>
        public static int selGetTypeAtOrigin(
            Sel sel,
            out int ptype)
        {
            if (sel == null)
            {
                throw new ArgumentNullException("sel cannot be Nothing");
            }

            int _Result = Natives.selGetTypeAtOrigin(sel.Pointer, out ptype);

            return(_Result);
        }
コード例 #15
0
        Sel Store.Sel(int key)
        {
            Sel @out;

            sels.TryGetValue(key, out @out);
            if (@out != null)
            {
                return(@out);
            }
            Sel _new = new Sel();

            sels[key] = _new;
            return(_new);
        }
コード例 #16
0
 public override bool DrawSpecial(Rect rect, WidgetRow row)
 {
     if (Sel.degreeDatas.Count > 1 &&
         row.ButtonText(Sel.DataAtDegree(traitDegree).label.CapitalizeFirst()))
     {
         List <FloatMenuOption> options = new List <FloatMenuOption>();
         foreach (TraitDegreeData deg in Sel.degreeDatas)
         {
             options.Add(new FloatMenuOption(deg.label.CapitalizeFirst(), () => traitDegree = deg.degree));
         }
         MainTabWindow_List.DoFloatMenu(options);
     }
     return(false);
 }
コード例 #17
0
ファイル: sel1.cs プロジェクト: Phreak87/LeptonicaSharp
        // sel1.c (880, 1)
        // selSetOrigin(sel, cy, cx) as int
        // selSetOrigin(SEL *, l_int32, l_int32) as l_ok
        ///  <summary>
        /// selSetOrigin()
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/selSetOrigin/*"/>
        ///  <param name="sel">[in] - </param>
        ///  <param name="cy">[in] - </param>
        ///  <param name="cx">[in] - </param>
        ///   <returns>0 if OK 1 on error</returns>
        public static int selSetOrigin(
            Sel sel,
            int cy,
            int cx)
        {
            if (sel == null)
            {
                throw new ArgumentNullException("sel cannot be Nothing");
            }

            int _Result = Natives.selSetOrigin(sel.Pointer, cy, cx);

            return(_Result);
        }
コード例 #18
0
ファイル: sel1.cs プロジェクト: Phreak87/LeptonicaSharp
        // sel1.c (821, 1)
        // selSetElement(sel, row, col, type) as int
        // selSetElement(SEL *, l_int32, l_int32, l_int32) as l_ok
        ///  <summary>
        /// (1) Because we use row and column to index into an array,
        /// they are always non-negative.  The location of the origin
        /// (and the type of operation) determine the actual
        /// direction of the rasterop.
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/selSetElement/*"/>
        ///  <param name="sel">[in] - </param>
        ///  <param name="row">[in] - </param>
        ///  <param name="col">[in] - </param>
        ///  <param name="type">[in] - SEL_HIT, SEL_MISS, SEL_DONT_CARE</param>
        ///   <returns>0 if OK 1 on error</returns>
        public static int selSetElement(
            Sel sel,
            int row,
            int col,
            int type)
        {
            if (sel == null)
            {
                throw new ArgumentNullException("sel cannot be Nothing");
            }

            int _Result = Natives.selSetElement(sel.Pointer, row, col, type);

            return(_Result);
        }
コード例 #19
0
ファイル: sel1.cs プロジェクト: Phreak87/LeptonicaSharp
        // sel1.c (1193, 1)
        // selFindMaxTranslations(sel, pxp, pyp, pxn, pyn) as int
        // selFindMaxTranslations(SEL *, l_int32 *, l_int32 *, l_int32 *, l_int32 *) as l_ok
        ///  <summary>
        /// These are the maximum shifts for the erosion operation.
        /// For example, when j  is smaller cx, the shift of the image
        /// is +x to the cx.  This is a positive xp shift.
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/selFindMaxTranslations/*"/>
        ///  <param name="sel">[in] - </param>
        ///  <param name="pxp">[out] - max shifts</param>
        ///  <param name="pyp">[out] - max shifts</param>
        ///  <param name="pxn">[out] - max shifts</param>
        ///  <param name="pyn">[out] - max shifts</param>
        ///   <returns>0 if OK 1 on error</returns>
        public static int selFindMaxTranslations(
            Sel sel,
            out int pxp,
            out int pyp,
            out int pxn,
            out int pyn)
        {
            if (sel == null)
            {
                throw new ArgumentNullException("sel cannot be Nothing");
            }

            int _Result = Natives.selFindMaxTranslations(sel.Pointer, out pxp, out pyp, out pxn, out pyn);

            return(_Result);
        }
コード例 #20
0
ファイル: sel1.cs プロジェクト: Phreak87/LeptonicaSharp
        // sel1.c (850, 1)
        // selGetParameters(sel, psy, psx, pcy, pcx) as int
        // selGetParameters(SEL *, l_int32 *, l_int32 *, l_int32 *, l_int32 *) as l_ok
        ///  <summary>
        /// selGetParameters()
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/selGetParameters/*"/>
        ///  <param name="sel">[in] - </param>
        ///  <param name="psy">[out][optional] - each can be null</param>
        ///  <param name="psx">[out][optional] - each can be null</param>
        ///  <param name="pcy">[out][optional] - each can be null</param>
        ///  <param name="pcx">[out][optional] - each can be null</param>
        ///   <returns>0 if OK, 1 on error</returns>
        public static int selGetParameters(
            Sel sel,
            out int psy,
            out int psx,
            out int pcy,
            out int pcx)
        {
            if (sel == null)
            {
                throw new ArgumentNullException("sel cannot be Nothing");
            }

            int _Result = Natives.selGetParameters(sel.Pointer, out psy, out psx, out pcy, out pcx);

            return(_Result);
        }
コード例 #21
0
ファイル: CanvasState.cs プロジェクト: BoldBigflank/slotcar
        public void HandleMultiSelection()
        {
            var selectionRect = new Rect().SetBetween(SelectionRectStart, ViewPortMousePosition);

            //if (selectionRect.size != Vector2.zero)
            Sel.Clear();
            //else
            //    Sel.SelectedModules.Clear();
            selectionRect.position -= ClientRectOffset - ViewPort.position;
            foreach (CGModule mod in Parent.Modules)
            {
                if (selectionRect.Overlaps(mod.Properties.Dimensions, true))
                {
                    Sel.MultiSelectModule(mod);
                }
            }
        }
コード例 #22
0
ファイル: sel1.cs プロジェクト: Phreak87/LeptonicaSharp
        // sel1.c (370, 1)
        // selCopy(sel) as Sel
        // selCopy(SEL *) as SEL *
        ///  <summary>
        /// selCopy()
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/selCopy/*"/>
        ///  <param name="sel">[in] - </param>
        ///   <returns>a copy of the sel, or NULL on error</returns>
        public static Sel selCopy(
            Sel sel)
        {
            if (sel == null)
            {
                throw new ArgumentNullException("sel cannot be Nothing");
            }

            IntPtr _Result = Natives.selCopy(sel.Pointer);

            if (_Result == IntPtr.Zero)
            {
                return(null);
            }

            return(new Sel(_Result));
        }
コード例 #23
0
        public override bool DrawOption(Rect rect)
        {
            WidgetRow row = new WidgetRow(rect.x, rect.y);

            if (row.ButtonText(Sel.def.LabelCap))
            {
                List <FloatMenuOption> options = new List <FloatMenuOption>();
                foreach (ListFilterDef def in def.subFilters)
                {
                    options.Add(new FloatMenuOption(def.LabelCap, () => SetSelectedFilter(def)));
                }
                MainTabWindow_List.DoFloatMenu(options);

                return(true);
            }
            rect.xMin += row.FinalX;
            return(Sel.DrawOption(rect));
        }
コード例 #24
0
ファイル: sel1.cs プロジェクト: Phreak87/LeptonicaSharp
        // sel1.c (1526, 1)
        // selWrite(fname, sel) as int
        // selWrite(const char *, SEL *) as l_ok
        ///  <summary>
        /// selWrite()
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/selWrite/*"/>
        ///  <param name="fname">[in] - filename</param>
        ///  <param name="sel">[in] - </param>
        ///   <returns>0 if OK, 1 on error</returns>
        public static int selWrite(
            String fname,
            Sel sel)
        {
            if (fname == null)
            {
                throw new ArgumentNullException("fname cannot be Nothing");
            }

            if (sel == null)
            {
                throw new ArgumentNullException("sel cannot be Nothing");
            }

            int _Result = Natives.selWrite(fname, sel.Pointer);

            return(_Result);
        }
コード例 #25
0
ファイル: sel1.cs プロジェクト: Phreak87/LeptonicaSharp
        // sel1.c (1555, 1)
        // selWriteStream(fp, sel) as int
        // selWriteStream(FILE *, SEL *) as l_ok
        ///  <summary>
        /// selWriteStream()
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/selWriteStream/*"/>
        ///  <param name="fp">[in] - file stream</param>
        ///  <param name="sel">[in] - </param>
        ///   <returns>0 if OK, 1 on error</returns>
        public static int selWriteStream(
            FILE fp,
            Sel sel)
        {
            if (fp == null)
            {
                throw new ArgumentNullException("fp cannot be Nothing");
            }

            if (sel == null)
            {
                throw new ArgumentNullException("sel cannot be Nothing");
            }

            int _Result = Natives.selWriteStream(fp.Pointer, sel.Pointer);

            return(_Result);
        }
コード例 #26
0
ファイル: sel1.cs プロジェクト: Phreak87/LeptonicaSharp
        // sel1.c (337, 1)
        // selDestroy(psel) as Object
        // selDestroy(SEL **) as void
        ///  <summary>
        /// selDestroy()
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/selDestroy/*"/>
        ///  <param name="psel">[in,out] - to be nulled</param>
        public static void selDestroy(
            ref Sel psel)
        {
            IntPtr pselPtr = IntPtr.Zero;   if (psel != null)

            {
                pselPtr = psel.Pointer;
            }

            Natives.selDestroy(ref pselPtr);
            if (pselPtr == IntPtr.Zero)
            {
                psel = null;
            }
            else
            {
                psel = new Sel(pselPtr);
            };
        }
コード例 #27
0
ファイル: sel1.cs プロジェクト: Phreak87/LeptonicaSharp
        // sel1.c (2200, 1)
        // selDisplayInPix(sel, size, gthick) as Pix
        // selDisplayInPix(SEL *, l_int32, l_int32) as PIX *
        ///  <summary>
        /// (1) This gives a visual representation of a general (hit-miss) sel.<para/>
        ///
        /// (2) The empty sel is represented by a grid of intersecting lines.<para/>
        ///
        /// (3) Three different patterns are generated for the sel elements:
        /// ~ hit (solid black circle)
        /// ~ miss (black ring inner radius is radius2)
        /// ~ origin (cross, XORed with whatever is there)
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/selDisplayInPix/*"/>
        ///  <param name="sel">[in] - </param>
        ///  <param name="size">[in] - of grid interiors odd minimum size of 13 is enforced</param>
        ///  <param name="gthick">[in] - grid thickness minimum size of 2 is enforced</param>
        ///   <returns>pix display of sel, or NULL on error</returns>
        public static Pix selDisplayInPix(
            Sel sel,
            int size,
            int gthick)
        {
            if (sel == null)
            {
                throw new ArgumentNullException("sel cannot be Nothing");
            }

            IntPtr _Result = Natives.selDisplayInPix(sel.Pointer, size, gthick);

            if (_Result == IntPtr.Zero)
            {
                return(null);
            }

            return(new Pix(_Result));
        }
コード例 #28
0
        private void txtLine_MouseClick(object sender, MouseEventArgs e)
        {
            Sel = null;

            //카티아가 실행중?
            if (Catia == null)
            {
                //MessageBox.Show("Please run CATIA");
                lblMsg.Text = "Please run CATIA ";
                return;
            }
            //활성 문서가 있는가?
            if (Catia.ActiveDocument == null)
            {
                //MessageBox.Show("활성 문서가 없습니다.");
                lblMsg.Text = "활성 문서가 없습니다.";
                return;
            }
            //Line 선택 기능실행
            //INFITF.Selection Sel = null;
            Sel = Catia.ActiveDocument.Selection;

            object[] InputObjectType = { "Line" };
            string   Status;

            Sel.Clear();
            Status = Sel.SelectElement2(InputObjectType, "Select an line", false);

            if (Status != "Normal")
            {
                //MessageBox.Show("선택한 ....없습니다. ");
                lblMsg.Text = "선택한 ....없습니다. ";
                return;
            }
            if (Sel.Count < 1)
            {
                lblMsg.Text = "선택한 ....없습니다. ";
                return;
            }

            txtLine.Text = ((INFITF.AnyObject)Sel.Item(1).Value).get_Name();
        }
コード例 #29
0
        private void Tab_MouseDown(object sender, MouseEventArgs e)
        {
            if (sender is Tablet)
            {
                Tablet Tab   = sender as Tablet;
                int    Index = int.Parse(Tab.Tag.ToString());
                int    Row   = Index % 10;

                foreach (Tablet Sel in TabList)
                {
                    if (Sel.BackColor != Color.FromArgb(233, 233, 233))
                    {
                        Sel.BackColor = Color.FromArgb(233, 233, 233);
                        Sel.Invalidate();
                    }
                }

                TabList[Row].BackColor      = Color.Silver;
                TabList[10 + Row].BackColor = Color.Silver;
                TabList[20 + Row].BackColor = Color.Silver;
                TabList[30 + Row].BackColor = Color.Silver;
                TabList[Index].BackColor    = Color.MediumSeaGreen;
            }
        }
コード例 #30
0
ファイル: SRQPersist.cs プロジェクト: Honhone/Plugins
 static void SaveSRQ()
 {
     SaveHold.Clear();
     if (Selection.activeGameObject != null)
     {
         var SelSet = Selection.activeGameObject.GetComponentsInChildren <SetRenderQueue>();
         if (SelSet.Length > 0)
         {
             foreach (var Sel in SelSet)
             {
                 SaveHold.Add(Sel.GetInstanceID(), SRQGet(Sel));
                 Debug.Log("Saved Render Queue ID: " + Sel.GetInstanceID() + " | Value: " + SRQGet(Sel));
             }
         }
         else
         {
             Debug.Log("SRQPersist: Nothing was saved.");
         }
     }
     else
     {
         Debug.Log("SRQPersist: Nothing was saved.");
     }
 }
コード例 #31
0
 public void AddSel(Sel sel)
 {
     alSels.Add(sel);
 }