C++ SDK Reference  12.5
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguyCrowdProfile.h
Go to the documentation of this file.
1 
2 /*
3  * Copyright (C) 1992-2013 Boston Dynamics
4  * ALL RIGHTS RESERVED.
5  *
6  * These coded instructions, statements, and computer programs
7  * contain unpublished proprietary information of Boston Dynamics
8  * and are protected by Copyright Laws of the United States.
9  * They may not be used, duplicated, or disclosed in any form, in
10  * whole or in part, without the prior written consent from Boston
11  * Dynamics.
12  *
13  * RESTRICTED RIGHTS LEGEND
14  * Use, duplication, or disclosure by the government is subject
15  * to restrictions as set forth in FAR 52.227.19(c)(2) or
16  * subparagraph (c)(1)(ii) of the Rights in Technical Data and
17  * Computer Software clause at DFARS 252.227-7013 and/or in
18  * similar or successor clauses in the FAR, or the DOD or NASA
19  * FAR Supplement, or to subparagraphs (c)(1) and (c)(2) of the
20  * Commercial Computer Software--Restricted Rights at 48 CFR
21  * 52.227-19, as applicable. Unpublished-rights reserved under
22  * the Copyright Laws of the United States.
23  * Contractor/Manufacturer is:
24  * Boston Dynamics/78 Fourth Avenue/Waltham MA 02451.
25  */
26 
27 
28 /*********************************************************************
29  **
30  *t diguyCrowdProfile
31  **
32  */
33 
34 #ifndef __diguyCrowdProfile_H
35 #define __diguyCrowdProfile_H
36 
37 
38 #ifdef SWIG
39 %module diguyCrowdProfile
40 #else
41 #define CPLUSPLUS_ONLY
42 #endif
43 
44 #ifdef CPLUSPLUS_ONLY
45 class bdiScenarioCrowdProfile;
46 class diguyAgentParams;
47 class diguyCharacter;
48 class diguyCrowd;
49 #endif
50 
51 
52 #include <declspec_diguy.h>
53 
54 /****************************************************************************/
55 class BDI_DECLSPEC_diguy diguyCrowdProfile
56 {
57 
58 public:
59 
60  /*l
61  *b Returns:
62  **
63  ** name of this object; this value will never be NULL
64  **
65  *b Callable From:
66  **
67  *- - C++
68  *- - Script
69  */
70  const char* get_name();
71 
72  /*l
73  *b Description:
74  **
75  ** This function sets the name of this object.
76  **
77  *b Returns:
78  **
79  ** 0 on success, -1 on failure
80  **
81  *b Callable From:
82  **
83  *- - C++
84  *- - Script
85  */
86  int set_name(const char* name);
87 
88  /*l
89  *b Returns:
90  **
91  ** type name of the object; this value will never be NULL
92  **
93  *b Callable From:
94  **
95  *- - C++
96  *- - Script
97  */
98  const char* get_type_name();
99 
100  /*l
101  *b Description:
102  **
103  ** This function creates a new crowd profile entry. The entry is
104  ** initialized with the passed parameters.
105  **
106  *b Returns:
107  **
108  ** the index of the created entry; -1 if no entry created
109  **
110  *b Arguments:
111  **
112  *a character_type - see set_character_type()
113  *a appearance - see set_appearance()
114  *a proportion - see set_proportion()
115  **
116  ** If NULL is passed for character_type, the set_character_type()
117  ** function must be called with a valid character type before this
118  ** new entry is valid.
119  **
120  *b Callable From:
121  **
122  *- - C++
123  *- - Script
124  */
125  int create_entry(const char* character_type = NULL,
126  const char* appearance = NULL,
127  float proportion = 1.0f);
128 
129  /*l
130  *b Description:
131  **
132  ** This function destroys the crowd profile entry at the specified
133  ** index.
134  **
135  *b Callable From:
136  **
137  *- - C++
138  *- - Script
139  */
140  void destroy_entry(int entry_index);
141 
142  /*l
143  *b Returns:
144  **
145  ** number of entries in this crowd profile
146  **
147  *b Callable From:
148  **
149  *- - C++
150  *- - Script
151  */
152  int get_num_entries();
153 
154  /*l
155  *b Returns:
156  **
157  ** a random entry index from all entries in this profile; entries
158  ** with higher proportions are more likely to be returned
159  **
160  *b Callable From:
161  **
162  *- - C++
163  *- - Script
164  */
165  int get_random_entry_index();
166 
167  /*l
168  *b Description:
169  **
170  ** This function sets the character type of the given entry. This
171  ** character type will be used for some characters in crowds created
172  ** using this crowd profile.
173  **
174  ** On creation, the character type is set to "(none)".
175  **
176  *b Returns:
177  **
178  ** 0 on success, -1 on failure
179  **
180  *b Arguments:
181  **
182  *a entry_index - index of entry to be modified as returned by
183  *a create_entry()
184  *a character_type - string identifying character type to be associated
185  *a with this entry; valid values are the same as
186  *a those that can be passed to
187  *a diguyScenario::create_character()
188  **
189  *b Callable From:
190  **
191  *- - C++
192  *- - Script
193  */
194  int set_character_type(int entry_index, const char* character_type);
195 
196  /*l
197  *b Returns:
198  **
199  ** the character type of the specified entry; "(none)" if there is no
200  ** such entry, or if the specified entry has not yet had its character
201  ** type set
202  **
203  *b Arguments:
204  **
205  *a entry_index - index of entry to be queried as returned by
206  *a create_entry()
207  **
208  *b Callable From:
209  **
210  *- - C++
211  *- - Script
212  */
213  const char* get_character_type(int entry_index);
214 
215  /*l
216  *b Description:
217  **
218  ** This function sets the appearance of the given entry. This
219  ** appearance will be used for some characters in crowds created
220  ** using this crowd profile.
221  **
222  ** On creation, the appearance is set to "default".
223  **
224  *b Returns:
225  **
226  ** 0 on success, -1 on failure
227  **
228  *b Arguments:
229  **
230  *a entry_index - index of entry to be modified as returned by
231  *a create_entry()
232  *a appearance - appearance to be associated with the new entry;
233  *a passing NULL sets appearance to "default"
234  **
235  *b Callable From:
236  **
237  *- - C++
238  *- - Script
239  */
240  int set_appearance(int entry_index, const char* appearance);
241 
242  /*l
243  *b Returns:
244  **
245  ** the appearance of the specified entry; NULL will be returned if
246  ** there is no such entry
247  **
248  *b Arguments:
249  **
250  *a entry_index - index of entry to be queried as returned by
251  *a create_entry()
252  **
253  *b Callable From:
254  **
255  *- - C++
256  *- - Script
257  */
258  const char* get_appearance(int entry_index);
259 
260 
261  /*l
262  *b Description:
263  **
264  ** This function sets the mind of the given entry. This
265  ** mind will be used for some characters in crowds created
266  ** using this crowd profile.
267  **
268  ** On creation, the mind is set to "none".
269  **
270  *b Returns:
271  **
272  ** 0 on success, -1 on failure
273  **
274  *b Arguments:
275  **
276  *a entry_index - index of entry to be modified as returned by
277  *a create_entry()
278  *a mind - mind to be associated with the new entry;
279  *a passing NULL sets the mind to none
280  **
281  *b Callable From:
282  **
283  *- - C++
284  *- - Script
285  */
286  int set_mind_base_class(int entry_index, const char* mind);
287 
288 
289  /*l
290  *b Returns:
291  **
292  ** the mind of the specified entry; NULL will be returned if
293  ** there is no such entry
294  **
295  *b Arguments:
296  **
297  *a entry_index - index of entry to be queried as returned by
298  *a create_entry()
299  **
300  *b Callable From:
301  **
302  *- - C++
303  *- - Script
304  */
305  const char* get_mind_base_class(int entry_index);
306 
307  /*l
308  *b Description:
309  **
310  ** This function sets the proportion of the given entry. The
311  ** proportion affects show often the specified entry will be
312  ** chosen for get_random_entry_index() calls. Entries with
313  ** higher proportions will be chosen more often than those with
314  ** lower proportions.
315  **
316  ** The default proportion for a new entry is 1.0.
317  **
318  *b Returns:
319  **
320  ** 0 on success, -1 on failure
321  **
322  *b Arguments:
323  **
324  *a entry_index - index of entry to be modified as returned by
325  *a create_entry()
326  *a proportion - how often the new entry should be chosen relative
327  *a to other entries
328  **
329  *b Callable From:
330  **
331  *- - C++
332  *- - Script
333  */
334  int set_proportion(int entry_index, float proportion);
335 
336  /*l
337  *b Returns:
338  **
339  ** the proportion of the specified entry; 0.0 will be returned if
340  ** there is no such entry
341  **
342  *b Arguments:
343  **
344  *a entry_index - index of entry to be queried as returned by
345  *a create_entry()
346  **
347  *b Callable From:
348  **
349  *- - C++
350  *- - Script
351  */
352  float get_proportion(int entry_index);
353 
354  /*l
355  *b Description:
356  **
357  ** This function sets the default crowd size (i.e., number of
358  ** characters) of a crowd that is created using this profile.
359  ** The default crowd size of a crowd profile is 20.
360  **
361  *b Returns:
362  **
363  ** 0 on success, -1 on failure
364  **
365  *b Arguments:
366  **
367  *a default_crowd_size - recommended number of characters that should
368  *a be in a crowd based on this profile
369  **
370  *b Callable From:
371  **
372  *- - C++
373  *- - Script
374  */
375  int set_default_crowd_size(int default_crowd_size);
376 
377  /*l
378  *b Returns:
379  **
380  ** the default crowd size of a crowd based on this profile
381  **
382  *b Callable From:
383  **
384  *- - C++
385  *- - Script
386  */
387  int get_default_crowd_size();
388 
389  /*l
390  *b Returns:
391  **
392  ** the default agent parameters that will be used for crowd members
393  ** of crowds created using this profile; the parameters can be
394  ** modified using function calls of the diguyAgentParams class
395  **
396  *b Callable From:
397  **
398  *- - C++
399  *- - Script
400  */
401  diguyAgentParams* get_default_agent_params();
402 
403  /*l
404  *b Returns:
405  **
406  ** a character that's been created from this profiles template and
407  ** added to the crowd specified.
408  **
409  *b Callable From:
410  **
411  *- - C++
412  *- - Script
413  */
414  diguyCharacter * create_character(diguyCrowd * crowd, int is_temporary = 0);
415 
416 /****************************************************************************/
420  // Can be 0 or 1 currently
421  const char* get_mind_init_argument(int entry_index, int arg);
422 
423 /****************************************************************************/
424 /****************************************************************************/
435 /****************************************************************************/
436 /****************************************************************************/
437 
438  /*l
439  ** Deprecated as of 8.6.3; pass desired character_type and
440  ** appearance to create_entry() function instead, or call
441  ** set_character_type() and set_appearance() separately.
442  */
443  int set_character_type_and_appearance(int entry_index,
444  const char* character_type,
445  const char* appearance);
446 
447  /*l
448  ** Deprecated as of 8.6.3; call create_entry() instead.
449  */
450  int add_entry(const char* character_type, const char* appearance);
451 
456 #ifdef CPLUSPLUS_ONLY
457 
458  bdiScenarioCrowdProfile* get_scripted_object() {return m_scripted_object;}
459 
460 private:
461 
462  /*l
463  ** A private constructor.
464  */
465  diguyCrowdProfile(bdiScenarioCrowdProfile* scripted_object);
466 
467  /*l
468  ** A private destructor.
469  */
470  virtual ~diguyCrowdProfile();
471 
472  /*l
473  ** A pointer to internal data.
474  */
475  bdiScenarioCrowdProfile* m_scripted_object;
476 
477  friend class bdiScenarioCrowdProfile;
478 
479 #endif
480 
481 };
482 
483 
484 #endif /* __diguyCrowdProfile_H */
485 
486 
487 /*
488  * Copyright (C) 1992-2013 Boston Dynamics
489  * ALL RIGHTS RESERVED.
490  *
491  * These coded instructions, statements, and computer programs
492  * contain unpublished proprietary information of Boston Dynamics
493  * and are protected by Copyright Laws of the United States.
494  * They may not be used, duplicated, or disclosed in any form, in
495  * whole or in part, without the prior written consent from Boston
496  * Dynamics.
497  *
498  * RESTRICTED RIGHTS LEGEND
499  * Use, duplication, or disclosure by the government is subject
500  * to restrictions as set forth in FAR 52.227.19(c)(2) or
501  * subparagraph (c)(1)(ii) of the Rights in Technical Data and
502  * Computer Software clause at DFARS 252.227-7013 and/or in
503  * similar or successor clauses in the FAR, or the DOD or NASA
504  * FAR Supplement, or to subparagraphs (c)(1) and (c)(2) of the
505  * Commercial Computer Software--Restricted Rights at 48 CFR
506  * 52.227-19, as applicable. Unpublished-rights reserved under
507  * the Copyright Laws of the United States.
508  * Contractor/Manufacturer is:
509  * Boston Dynamics/78 Fourth Avenue/Waltham MA 02451.
510  */
511