source: trunk/examples/objects/api/cpp/plot @ 1581

Last change on this file since 1581 was 1581, checked in by dkearney, 11 years ago

updates for the rappture objects, object examples, and object apis. small fix for rpunits c interface to check string length. there should probably be more of these checks in the c interface, but units should also be rewritten. added folders to separate out octave2 and octave3 app-fermi examples

File size: 9.5 KB
Line 
1Plot
2
3constructors/destructors
4    Plot()
5    Plot(Library *lib)
6    Plot(const Plot& o);
7    ~Plot ();
8
9methods
10    const char *name() const;
11    void name(const char *val);
12
13    const char *path() const;
14    void path(const char *val);
15
16    const char *label() const;
17    void label(const char *val);
18
19    const char *desc() const;
20    void desc(const char *val);
21
22    const char *hints() const;
23    void hints(const char *val);
24
25    const char *color() const;
26    void color(const char *val);
27
28    const void *property (const char *key) const;
29    void property (const char *key, const void *val, size_t nbytes);
30
31    const char *propstr (const char *key) const;
32    void propstr (const char *key, const char *val);
33
34    void propremove (const char *key);
35
36    Plot& add ( size_t nPts, double *x, double *y,
37                const char *fmt, const char *name);
38
39    Plot& add (Curve *c, const char *name);
40
41    size_t count() const;
42
43    Curve *curve (const char* name) const;
44    Curve *getNthCurve(size_t n) const;
45
46    void vvalue(void *storage, size_t numHints, va_list arg) const;
47
48    void configure(size_t as, ClientData c);
49    void dump(size_t as, ClientData c);
50
51    Outcome &outcome() const;
52
53    const int is() const;
54
55---------------------------------------
56
57const char *name()
58    Purpose: get the id name of the object
59    Input Arguments: None
60    Return Value: the id name stored in the object.
61    Notes: if no name is set, NULL will be returned
62            the id name is used to identify this object from
63            all other objects and should be unique
64    Code Example:
65
66void name(const char *val)
67    Purpose: set the id name of the object
68    Input Arguments: 1
69        1. const char *val - new id name
70    Return Value: None
71    Notes: a copy of the memory location val will be stored
72    Code Example:
73
74const char *path()
75    Purpose: get the path of the object
76    Input Arguments: None
77    Return Value: the path stored in the object.
78    Notes: if no path is set, NULL will be returned
79            the path tells where this object sits in the
80            hierarchy of objects.
81    Code Example:
82
83void path(const char *val)
84    Purpose: set the path of the object
85    Input Arguments: 1
86        1. const char *val - new path
87    Return Value: None
88    Notes: a copy of the memory location val will be stored
89    Code Example:
90
91const char *label()
92    Purpose: get the label of the object
93    Input Arguments: None
94    Return Value: the label stored in the object.
95    Notes: if no label is set, NULL will be returned
96            the label is used by the graphical user interface.
97    Code Example:
98
99void label(const char *val)
100    Purpose: set the label of the object
101    Input Arguments: 1
102        1. const char *val - new label
103    Return Value: None
104    Notes: a copy of the memory location val will be stored
105    Code Example:
106
107const char *desc()
108    Purpose: get the description of the object
109    Input Arguments: None
110    Return Value: the description stored in the object.
111    Notes: if no description is set, NULL will be returned
112            the description is used by the graphical user
113            interface to describe what type of data is being
114            requested and how the input is used.
115    Code Example:
116
117void desc(const char *val)
118    Purpose: set the description of the object
119    Input Arguments: 1
120        1. const char *val - new description
121    Return Value: None
122    Notes: a copy of the memory location val will be stored
123    Code Example:
124
125const char *hints()
126    Purpose: get the hints of the object
127    Input Arguments: None
128    Return Value: the hints stored in the object.
129    Notes: if no hints are set, NULL will be returned
130            the hints are used by the graphical user interface
131    Code Example:
132
133void hints(const char *val)
134    Purpose: set the hints of the object
135    Input Arguments: 1
136        1. const char *val - new hints
137    Return Value: None
138    Notes: a copy of the memory location val will be stored
139    Code Example:
140
141const void *property (const char *key) const;
142    Purpose: get a generic property from the property database
143    Input Arguments: 1
144        1. const char *key - property name
145    Return Value: value of the property
146    Notes: None
147    Code Example:
148
149void property (const char *key, const void *val, size_t nbytes);
150    Purpose: set a generic property in the property database
151    Input Arguments: 3
152        1. const char *key - property name
153        2. const void *val - property value
154        3. size_t nbytes - size (in bytes) of the value
155    Return Value: None
156    Notes: A copy of the memory pointed to by val is stored
157            in the property database
158    Code Example:
159
160const char *propstr (const char *key) const;
161    Purpose: get a string property from the property database
162    Input Arguments: 1
163        1. const char *key - property name
164    Return Value: value of the property
165    Notes: None
166    Code Example:
167
168void propstr (const char *key, const char *val);
169    Purpose: set a string property in the property database
170    Input Arguments: 2
171        1. const char *key - property name
172        2. const char *val - property value
173    Return Value: None
174    Notes: A copy of the memory pointed to by val is stored
175            in the property database
176    Code Example:
177
178void propremove (const char *key);
179    Purpose: remove a property from the property database
180    Input Arguments: 1
181        1. const char *key - property name
182    Return Value: value of the property
183    Notes: None
184    Code Example:
185
186Plot& add (size_t nPts, double *x, double *y,
187           const char *fmt, const char *name);
188    Purpose: add data for an xy curve to the plot
189    Input Arguments: 5
190        1. size_t nPts - number of points in the x and y arrays
191        2. double *x - pointer to array representing the x axis
192        3. double *y - pointer to array representing the y axis
193        4. const char *fmt - format of the line
194        5. const char *name - id of the newly created curve
195    Return Value: reference to a Plot object
196    Notes: format can be something like "g:o" to represent
197            green line, dotted line style, circle marker.
198            this follows matlab's formatting rules.
199    Code Example:
200
201Plot& add (Curve *c, const char *name);
202    Purpose: add a Curve object to this Plot object
203    Input Arguments: 2
204        1. Curve *c - Curve object to add
205        2. const char *name - id of the Curve object
206    Return Value: reference to a Plot object
207    Notes: Curve object should not be deleted by user?
208    Code Example:
209
210size_t count() const;
211    Purpose: retrieve the number of curves in this Plot object
212    Input Arguments: 0
213    Return Value: number of curves stored in the object
214    Notes: None
215    Code Example:
216
217Curve *curve (const char* name) const;
218    Purpose: retrieve the curve with the id matching "name"
219    Input Arguments: 1
220        1. const char *name - id to Curve to be retrieved
221    Return Value: pointer to Curve object matching "name" or NULL
222    Notes: None
223    Code Example:
224
225Curve *getNthCurve(size_t n) const;
226    Purpose: return the n'th curve stored in the object
227    Input Arguments: 1
228        1. size_t n - number of the curve to retrieve
229    Return Value: pointer to the n'th Curve object stored in
230                    the Plot object or NULL
231    Notes: None
232    Code Example:
233
234void vvalue(void *storage, size_t numHints, va_list arg) const;
235    Purpose: return the value of the object after applying a
236                varying number of hints about how the value
237                should be configured
238    Input Arguments: 3
239        1. void *storage - the return value
240        2. size_t numHints - number of hints provided
241        3. va_list arg - list of hints specified as a va_list
242    Return Value: None
243    Notes: vvalue will parse out the recognisable hints from
244                va_list arg. Values stored in the object are
245                not changed.
246    Code Example:
247
248void configure(size_t as, ClientData c);
249    Purpose: configure the object based on the data in "c".
250                use "as" to determine the type of data in "c".
251    Input Arguments: 2
252        1. size_t as - type of data stored in "c".
253                        valid values include:
254                            RPCONFIG_XML
255                            RPCONFIG_TREE
256        2. ClientData c - data to configure the object from.
257                            if as is...     then c should be...
258                            RPCONFIG_XML    const char *xmltext
259                            RPCONFIG_TREE   RP_ParserXML *object
260    Return Value: None
261    Notes: object is configured based on values in "c"
262    Code Example:
263
264void dump(size_t as, ClientData c);
265    Purpose: dump the object values based to the object "c".
266                use "as" to determine how to dump the data.
267    Input Arguments: 2
268        1. size_t as - type of data stored in "c".
269                        valid values include:
270                            RPCONFIG_XML
271                            RPCONFIG_TREE
272        2. ClientData c - data to configure the object from.
273                            if as is...     then c should be...
274                            RPCONFIG_XML    ClientDataXml *object
275                            RPCONFIG_TREE   RP_ParserXML *object
276    Return Value: None
277    Notes: None
278    Code Example:
279
280Outcome &outcome() const;
281    Purpose: return the status of this object as an Outcome.
282    Input Arguments: 0
283    Return Value: status of the object as an Outcome
284    Notes: None
285    Code Example:
286
287const int is() const;
288    Purpose: return an integer tag describing the object.
289    Input Arguments: 0
290    Return Value: integer tag unique to all plot objects
291    Notes: None
292    Code Example:
Note: See TracBrowser for help on using the repository browser.