File: Searching-Properties.html

package info (click to toggle)
octave 10.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 145,388 kB
  • sloc: cpp: 335,976; ansic: 82,241; fortran: 20,963; objc: 9,402; sh: 8,756; yacc: 4,392; lex: 4,333; perl: 1,544; java: 1,366; awk: 1,259; makefile: 659; xml: 192
file content (151 lines) | stat: -rw-r--r-- 12,736 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Searching Properties (GNU Octave (version 10.3.0))</title>

<meta name="description" content="Searching Properties (GNU Octave (version 10.3.0))">
<meta name="keywords" content="Searching Properties (GNU Octave (version 10.3.0))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Concept-Index.html" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Graphics-Data-Structures.html" rel="up" title="Graphics Data Structures">
<link href="Managing-Default-Properties.html" rel="next" title="Managing Default Properties">
<link href="Graphics-Object-Properties.html" rel="prev" title="Graphics Object Properties">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
div.example {margin-left: 3.2em}
span:hover a.copiable-link {visibility: visible}
strong.def-name {font-family: monospace; font-weight: bold; font-size: larger}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">


</head>

<body lang="en">
<div class="subsection-level-extent" id="Searching-Properties">
<div class="nav-panel">
<p>
Next: <a href="Managing-Default-Properties.html" accesskey="n" rel="next">Managing Default Properties</a>, Previous: <a href="Graphics-Object-Properties.html" accesskey="p" rel="prev">Graphics Object Properties</a>, Up: <a href="Graphics-Data-Structures.html" accesskey="u" rel="up">Graphics Data Structures</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsection" id="Searching-Properties-1"><span>15.3.4 Searching Properties<a class="copiable-link" href="#Searching-Properties-1"> &para;</a></span></h4>

<a class="anchor" id="XREFfindobj"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-findobj"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">findobj</strong> <code class="def-code-arguments">()</code><a class="copiable-link" href="#index-findobj"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-findobj-1"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">findobj</strong> <code class="def-code-arguments">(<var class="var">prop_name</var>, <var class="var">prop_value</var>, &hellip;)</code><a class="copiable-link" href="#index-findobj-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-findobj-2"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">findobj</strong> <code class="def-code-arguments">(<var class="var">prop_name</var>, <var class="var">prop_value</var>, &quot;-<var class="var">logical_op</var>&quot;, <var class="var">prop_name</var>, <var class="var">prop_value</var>)</code><a class="copiable-link" href="#index-findobj-2"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-findobj-3"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">findobj</strong> <code class="def-code-arguments">(&quot;-property&quot;, <var class="var">prop_name</var>)</code><a class="copiable-link" href="#index-findobj-3"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-findobj-4"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">findobj</strong> <code class="def-code-arguments">(&quot;-regexp&quot;, <var class="var">prop_name</var>, <var class="var">pattern</var>)</code><a class="copiable-link" href="#index-findobj-4"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-findobj-5"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">findobj</strong> <code class="def-code-arguments">(<var class="var">hlist</var>, &hellip;)</code><a class="copiable-link" href="#index-findobj-5"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-findobj-6"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">findobj</strong> <code class="def-code-arguments">(<var class="var">hlist</var>, &quot;flat&quot;, &hellip;)</code><a class="copiable-link" href="#index-findobj-6"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-findobj-7"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">findobj</strong> <code class="def-code-arguments">(<var class="var">hlist</var>, &quot;-depth&quot;, <var class="var">d</var>, &hellip;)</code><a class="copiable-link" href="#index-findobj-7"> &para;</a></span></dt>
<dd><p>Find graphics objects with specified properties.
</p>
<p>When called without arguments, return all graphic objects beginning with the
root object (0) and including all of its descendants.
</p>
<p>The simplest form for narrowing the results is
</p>
<div class="example">
<pre class="example-preformatted">findobj (<var class="var">prop_name</var>, <var class="var">prop_value</var>)
</pre></div>

<p>which returns the handles of all objects which have a property named
<var class="var">prop_name</var> that has the value <var class="var">prop_value</var>.  If multiple
property/value pairs are specified then only objects meeting all of the
conditions (equivalent to <code class="code">-and</code>) are returned.
</p>
<p>The search can be limited to a particular set of objects and their
descendants, by passing a handle or set of handles <var class="var">hlist</var> as the first
argument.
</p>
<p>The depth of the object hierarchy to search can be limited with the
<code class="code">&quot;-depth&quot;</code> argument.  An example of searching through only three
generations of children is:
</p>
<div class="example">
<pre class="example-preformatted">findobj (<var class="var">hlist</var>, &quot;-depth&quot;, 3, <var class="var">prop_name</var>, <var class="var">prop_value</var>)
</pre></div>

<p>Specifying a depth <var class="var">d</var> of 0 limits the search to the set of objects
passed in <var class="var">hlist</var>.  A depth of 0 is also equivalent to the
<code class="code">&quot;flat&quot;</code> argument.  The default depth value is <code class="code">Inf</code> which
includes all descendants.
</p>
<p>A specified logical operator may be used between <var class="var">prop_name</var>,
<var class="var">prop_value</var> pairs.  The supported logical operators are:
<code class="code">&quot;-and&quot;</code>, <code class="code">&quot;-or&quot;</code>, <code class="code">&quot;-xor&quot;</code>, <code class="code">&quot;-not&quot;</code>.  Example code
to locate all figure and axes objects is
</p>
<div class="example">
<pre class="example-preformatted">findobj (&quot;type&quot;, &quot;figure&quot;, &quot;-or&quot;, &quot;type&quot;, &quot;axes&quot;)
</pre></div>

<p>Objects may also be matched by comparing a regular expression to the
property values, where property values that match
<code class="code">regexp (<var class="var">prop_value</var>, <var class="var">pattern</var>)</code> are returned.
</p>
<p>Finally, objects which have a property name can be found with the
<code class="code">&quot;-property&quot;</code> option.  For example, code to locate objects with a
<code class="code">&quot;meshstyle&quot;</code> property is
</p>
<div class="example">
<pre class="example-preformatted">findobj (&quot;-property&quot;, &quot;meshstyle&quot;)
</pre></div>

<p>Implementation Note: The search only includes objects with visible
handles (HandleVisibility<!-- /@w --> = <code class="code">&quot;on&quot;</code>).
See <a class="xref" href="#XREFfindall"><code class="code">findall</code></a>, to search for all objects including
hidden ones.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFfindall">findall</a>, <a class="ref" href="Handle-Functions.html#XREFallchild">allchild</a>, <a class="ref" href="Handle-Functions.html#XREFget">get</a>, <a class="ref" href="Handle-Functions.html#XREFset">set</a>.
</p></dd></dl>


<a class="anchor" id="XREFfindall"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-findall"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">findall</strong> <code class="def-code-arguments">()</code><a class="copiable-link" href="#index-findall"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-findall-1"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">findall</strong> <code class="def-code-arguments">(<var class="var">prop_name</var>, <var class="var">prop_value</var>, &hellip;)</code><a class="copiable-link" href="#index-findall-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-findall-2"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">findall</strong> <code class="def-code-arguments">(<var class="var">prop_name</var>, <var class="var">prop_value</var>, &quot;-<var class="var">logical_op</var>&quot;, <var class="var">prop_name</var>, <var class="var">prop_value</var>)</code><a class="copiable-link" href="#index-findall-2"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-findall-3"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">findall</strong> <code class="def-code-arguments">(&quot;-property&quot;, <var class="var">prop_name</var>)</code><a class="copiable-link" href="#index-findall-3"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-findall-4"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">findall</strong> <code class="def-code-arguments">(&quot;-regexp&quot;, <var class="var">prop_name</var>, <var class="var">pattern</var>)</code><a class="copiable-link" href="#index-findall-4"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-findall-5"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">findall</strong> <code class="def-code-arguments">(<var class="var">hlist</var>, &hellip;)</code><a class="copiable-link" href="#index-findall-5"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-findall-6"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">findall</strong> <code class="def-code-arguments">(<var class="var">hlist</var>, &quot;flat&quot;, &hellip;)</code><a class="copiable-link" href="#index-findall-6"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-findall-7"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">findall</strong> <code class="def-code-arguments">(<var class="var">hlist</var>, &quot;-depth&quot;, <var class="var">d</var>, &hellip;)</code><a class="copiable-link" href="#index-findall-7"> &para;</a></span></dt>
<dd><p>Find graphics object, including hidden ones, with specified properties.
</p>
<p>The return value <var class="var">h</var> is a list of handles to the found graphic objects.
</p>
<p><code class="code">findall</code> performs the same search as <code class="code">findobj</code>, but it
includes hidden objects (HandleVisibility = <code class="code">&quot;off&quot;</code>).  For full
documentation, see <a class="pxref" href="#XREFfindobj"><code class="code">findobj</code></a>.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFfindobj">findobj</a>, <a class="ref" href="Handle-Functions.html#XREFallchild">allchild</a>, <a class="ref" href="Handle-Functions.html#XREFget">get</a>, <a class="ref" href="Handle-Functions.html#XREFset">set</a>.
</p></dd></dl>

</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="Managing-Default-Properties.html">Managing Default Properties</a>, Previous: <a href="Graphics-Object-Properties.html">Graphics Object Properties</a>, Up: <a href="Graphics-Data-Structures.html">Graphics Data Structures</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>