C++ SDK Reference  12.5
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguyGraphicsShape.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 /*********************************************************************/
34 #ifndef __diguyGraphicsShape_H
35 #define __diguyGraphicsShape_H
36 
37 #ifdef SWIG
38 %module diguyGraphicsShape
39 #else
40 #define CPLUSPLUS_ONLY
41 #endif
42 
43 #ifdef CPLUSPLUS_ONLY
44 #include <diguy_constants.h>
45 
46 class bdiShape;
47 class diguyCharacter;
48 class diguyGraphicsFile;
49 class diguyGraphicsLink;
50 class diguyGraphicsMesh;
51 class diguyGraphicsShape;
52 class diguyGraphicsState;
53 
54 
55 /****************************************************************************/
56 
57 #endif
58 
59 #include <declspec_diguy.h>
60 
61 /****************************************************************************/
62 class BDI_DECLSPEC_diguy diguyGraphicsShape
63 {
64 
65 public:
66 
67 
68 /*****************************************************************************/
81  /*l
82  *b Description:
83  **
84  ** This function returns the name of the shape. The returned pointer
85  ** will never be NULL.
86  **
87  *b Returns:
88  **
89  ** name of the shape as C string
90  */
91  const char* get_name();
92 
93  /*l
94  *b Description:
95  **
96  ** All shapes are assigned a unique identifier, or uid. This function
97  ** returns this shape's uid.
98  **
99  ** *Note*: unique identifiers can change between DI-Guy runs.
100  **
101  *b Returns:
102  **
103  ** unique identifier of object
104  */
105  long get_uid();
106 
107  /*l
108  *b Description:
109  **
110  ** This function returns a pointer to the diguyCharacter to which this
111  ** shape belongs.
112  **
113  *b Returns:
114  **
115  ** pointer of type diguyCharacter
116  */
117  diguyCharacter* get_character();
118 
119  /*l
120  *b Description:
121  **
122  ** This function returns a 1 if the shape has a translation offset
123  ** from its link, 0 otherwise.
124  **
125  *b Returns:
126  **
127  ** 1 if shape has an offset, 0 if not, -1 on error
128  **
129  *b See Also:
130  **
131  ** get_offset_translation()
132  */
133  int get_has_offset_translation();
134 
135  /*l
136  *b Description:
137  **
138  ** This function returns in the passed variables the translation
139  ** offset of this shape from its link.
140  **
141  ** The offset will always remain fixed once DI-Guy is initialized.
142  **
143  ** Returned values are in meters.
144  **
145  *b Arguments:
146  **
147  *a tx, ty, tz - pointers to floats into which result
148  *a should be placed
149  **
150  *b Returns:
151  **
152  ** 0 on success, -1 on failure
153  **
154  *b See Also:
155  **
156  ** get_has_offset_translation(), get_offset_rotation(),
157  ** get_offset_scale()
158  */
159  int get_offset_translation(float* tx, float* ty, float* tz);
160 
161  /*l
162  *b Description:
163  **
164  ** This function returns a 1 if the shape has a rotation offset from
165  ** its link, 0 otherwise.
166  **
167  *b Returns:
168  **
169  ** 1 if shape has an offset, 0 if not, -1 on error
170  **
171  *b See Also:
172  **
173  ** get_offset_rotation()
174  */
175  int get_has_offset_rotation();
176 
177  /*l
178  *b Description:
179  **
180  ** This function returns in the passed variables the rotational offset
181  ** of this shape from its link.
182  **
183  ** The offset will always remain fixed once DI-Guy is initialized.
184  **
185  ** Returned values are an Euler triple in degrees, and should be
186  ** applied in RZ -> RX -> RY order, after the translation offset.
187  **
188  *b Arguments:
189  **
190  *a rz, rx, ry - pointers to floats into which result
191  *a should be placed
192  **
193  *b Returns:
194  **
195  ** 0 on success, -1 on failure
196  **
197  *b See Also:
198  **
199  ** get_has_offset_rotation(), get_offset_translation(),
200  ** get_offset_scale()
201  */
202  int get_offset_rotation(float* rz, float* rx, float* ry);
203 
204  /*l
205  *b Description:
206  **
207  ** This function returns a 1 if the shape has a scale offset from its
208  ** link, 0 otherwise.
209  **
210  *b Returns:
211  **
212  ** 1 if shape has an offset, 0 if not, -1 on error
213  **
214  *b See Also:
215  **
216  ** get_offset_scale()
217  */
218  int get_has_offset_scale();
219 
220  /*l
221  *b Description:
222  **
223  ** This function returns in the passed variables the scale "offset" of
224  ** this shape from its link.
225  **
226  ** The offset will always remain fixed once DI-Guy is initialized.
227  **
228  ** Returned values are unitless scale factors.
229  **
230  *b Arguments:
231  **
232  *a sz, sx, sy - pointers to floats into which result
233  *a should be placed
234  **
235  *b See Also:
236  **
237  ** get_has_offset_scale(), get_offset_translation(),
238  ** get_offset_rotation()
239  **
240  *b Returns:
241  **
242  ** 0 on success, -1 on failure
243  */
244  int get_offset_scale(float* sx, float* sy, float* sz);
245 
246  /*l
247  *b Description:
248  **
249  ** This function returns the name of the shape set of which this shape
250  ** is a part.
251  **
252  ** A shape set is a collection of shapes that are related, coming from
253  ** a set of related geometry files, sometimes one file per LOD.
254  **
255  ** A shape is a collection of parts each representing the same thing
256  ** at varying levels of detail.
257  **
258  ** For example, in its config files DI-Guy has a shape set named
259  ** "firefighter", which references five OpenFlight files named
260  ** firefighter_LOD1.flt through firefighter_LOD5.flt. The firefighter
261  ** shape set contains separate shapes for the head, arms, legs, etc.,
262  ** at five different levels of detail.
263  **
264  ** Use the function get_shape_set_filename_for_lod() to get the actual
265  ** geometry filenames that should be used for each LOD.
266  **
267  *b Returns:
268  **
269  ** shape set of shape as C string
270  */
271  const char* get_shape_set_name();
272 
273  /*l
274  *b Description:
275  **
276  ** This function returns the name of the shape. This name identifies
277  ** which pieces of geometry out of the shape set should comprise the
278  ** shape.
279  **
280  *b Returns:
281  **
282  ** shape name of shape as C string
283  */
284  const char* get_shape_set_shape_name();
285 
286  /*l
287  *b Description:
288  **
289  ** This function returns the name of the link to which this shape is
290  ** typically attached.
291  **
292  ** Use the function get_link() to get a pointer to the actual link to
293  ** which this shape is attached.
294  **
295  *b Returns:
296  **
297  ** name of recommended attachment link as C string
298  */
299  const char* get_recommended_attachment_link_name();
300 
301  /*l
302  *b Description:
303  **
304  ** This function returns how many LODs this shape has. This will be a
305  ** number between 1 and 7.
306  **
307  *b Returns:
308  **
309  ** number of LODs
310  */
311  int get_num_lods();
312 
313 #ifdef CPLUSPLUS_ONLY
314 
315  /*l
316  *b Description:
317  **
318  ** This function returns the LOD ranges of this shape. The returned
319  ** pointer points to an array of eight floats, which represent ranges
320  ** in meters at which LODs should be shown.
321  **
322  *b Returns:
323  **
324  ** LOD ranges
325  **
326  *b Only Callable From C++
327  */
328  float* get_lod_ranges();
329 
330 #endif
331 
332  /*l
333  *b Description:
334  **
335  ** This function returns the most recent lod setting as set by
336  ** set_graphics_lod(), or as set by
337  ** diguyCharacter::set_graphics_lod().
338  **
339  *b Returns:
340  **
341  ** LOD index; integer from 1 to get_num_lods()
342  */
343  int get_graphics_lod();
344 
345  /*l
346  *b Description:
347  **
348  ** This function returns the filename of the geometry file from which
349  ** the shape is read for a specific LOD.
350  **
351  *b Arguments:
352  **
353  *a lod - level of detail; a number between 1 and get_num_lods()
354  **
355  *b Returns:
356  **
357  ** geometry filename as C string
358  */
359  const char* get_shape_set_filename_for_lod(int lod);
360 
361  /*l
362  *b Description:
363  **
364  ** This function returns the number of low-level geometry meshes that
365  ** comprise this shape.
366  **
367  *b Arguments:
368  **
369  *a lod - level of detail; a number between 1 and get_num_lods()
370  **
371  *b Returns:
372  **
373  ** number of meshes in this shape
374  */
375  int get_num_meshes(int lod);
376 
377  /*l
378  *b Description:
379  **
380  ** This function returns a pointer to one of the low-level geometry
381  ** mesh objects that comprise this shape.
382  **
383  *b Arguments:
384  **
385  *a index - index of mesh; a number between 0 and get_num_meshes() - 1
386  *a lod - level of detail; a number between 1 and get_num_lods()
387  **
388  *b Returns:
389  **
390  ** pointer to object of type diguyGraphicsMesh; NULL on error
391  */
392  diguyGraphicsMesh* get_mesh_at_index_for_lod(int index, int lod);
393 
394  /*l
395  *b Description:
396  **
397  ** This function returns a pointer to the link to which this shape is
398  ** actually attached.
399  **
400  *b Arguments:
401  **
402  *a index - index of mesh; a number between 0 and get_num_meshes() - 1
403  *a lod - level of detail; a number between 1 and get_num_lods()
404  **
405  *b Returns:
406  **
407  ** pointer to object of type diguyGraphicsMesh; NULL on error
408  */
409  diguyGraphicsLink* get_link();
410 
411  /*l
412  *b Description:
413  **
414  ** This function returns the name of the DI-Guy motion data variable
415  ** that controls whether this shape should be visible.
416  **
417  ** The returned pointer will be NULL if there is no associated
418  ** variable.
419  **
420  *b Returns:
421  **
422  ** name of the variable; NULL if there is no variable
423  */
424  const char* get_switch_var_name();
425 
426  /*l
427  *b Description:
428  **
429  ** This function returns the value of the DI-Guy motion data variable
430  ** for which the shape should be visible.
431  **
432  ** Note that the variable in the motion data is a float, but gets cast
433  ** to an integer and compared against this number during shape
434  ** updates.
435  **
436  *b Returns:
437  **
438  ** number representing value for which shape should be visible
439  */
440  int get_switch_value();
441 
442  /*l
443  *b Description:
444  **
445  ** This function returns whether this shape should currently be hidden
446  ** or shown, based on the value of the shape's switch variable (if
447  ** any).
448  **
449  *b Returns:
450  **
451  ** 1 if shape should be hidden, 0 if not
452  */
453  int get_is_hidden();
454 
455  /*l
456  *b Description:
457  **
458  ** This function returns the geometry file from which geometry for the
459  ** shape was read. Each LOD of the shape may potentially come from a
460  ** different file.
461  **
462  ** Note that if a diguyGraphicsFile create function has not been
463  ** registered with a call to diguy_graphics_set_file_create_func(),
464  ** this function will return NULL.
465  **
466  *b Arguments:
467  **
468  *a lod - level of detail; a number between 1 and get_num_lods()
469  **
470  *b Returns:
471  **
472  ** object of type diguyGraphicsFile
473  */
474  diguyGraphicsFile* get_diguy_graphics_file(int lod);
475 
476 #ifdef CPLUSPLUS_ONLY
477 
478  /*l
479  *b Description:
480  **
481  ** This function returns a pointer to an object that represents the
482  ** geometry for the shape. The returned object is an object that has
483  ** been returned by a previous call to diguyGraphicsFile::find_part(),
484  ** and can be safely cast to the type of object that has been so
485  ** returned.
486  **
487  ** Note that if a diguyGraphicsFile create function has not been
488  ** registered with a call to diguy_graphics_set_file_create_func(),
489  ** this function will return NULL.
490  **
491  *b Arguments:
492  **
493  *a lod - level of detail; a number between 1 and get_num_lods()
494  **
495  *b Returns:
496  **
497  ** generic object which must be cast appropriately
498  **
499  *b Only Callable From C++
500  */
501  void* get_diguy_graphics_file_part(int lod);
502 
503 #endif
504 
505  /*l
506  *b Description:
507  **
508  ** Some shapes have meshes that have multiple selectable graphics
509  ** states, including materials and textures. This function returns
510  ** the value that specifies which graphics state to use for meshes of
511  ** this shape.
512  **
513  ** This is different than get_switch_value(), which returns the value
514  ** of the switch that controls whether or not meshes of this state are
515  ** shown.
516  **
517  *b Returns:
518  **
519  ** value of state switch; -1 if there is no state switch
520  */
521  int get_graphics_state_switch_index();
522 
523  /*l
524  *b Description:
525  **
526  ** Returns the number of switched graphics states available to this
527  ** shape. See get_graphics_state_switch_index().
528  **
529  *b Returns:
530  **
531  ** number of switched graphics states
532  */
533  int get_num_switched_graphics_states();
534 
535  /*l
536  *b Description:
537  **
538  ** Returns the graphics state associated with the passed switch value.
539  **
540  *b Returns:
541  **
542  ** pointer to type diguyGraphicsState
543  */
544  diguyGraphicsState* get_switched_graphics_state(int switch_value = -1);
545 
546  /*l
547  *b Description:
548  **
549  ** Returns in the passed pointers the unique color of this shape. All
550  ** shapes in a DI-Guy appearance are assigned a unique RGB color that
551  ** can be used in pick/selection operations.
552  **
553  ** Also see diguyScenario::map_color_to_impact().
554  **
555  ** See programming_examples/diguy_graphics_api/ogl_examples/intersection_test
556  ** for an example of its usage.
557  **
558  *b Returns:
559  **
560  ** 0 on success, -1 on failure
561  */
562  int get_unique_color(unsigned char* r,
563  unsigned char* g,
564  unsigned char* b);
565 
566  /*l
567  *b Description:
568  **
569  ** This function identifies if this shape has skinned data. Scene
570  ** graph renderers will need to know this in the build phase to help
571  ** set up the matrix data shader functionality.
572  **
573  *b Returns:
574  **
575  ** 1 if contains at lease one file with skinned data, 0 if not
576  */
577  int get_contains_skinned_file();
578 
580  /*l
581  *b Description:
582  **
583  ** By default DI-Guy provides three 4 float uniforms at the shape
584  ** level that can be used by end users to customize the appearance of
585  ** characters via shaders and misc textures. You can see a
586  ** demonstration of this in the Exface_sales_demo.dss file where an
587  ** additional texture is used. The uniforms are named:
588  **
589  *- -"ufrm_blood_color"
590  *- -"ufrm_grime_color"
591  *- -"ufrm_glow_color"
592  **
593  *b Example:
594  **
595  *e local character = this_scenario:get_character_at_index(0);
596  *e local link = character:get_link_at_index(0);
597  *e local shape = link:find_shape_by_class_type("head");
598  *e shape:set_material_parameter_4f("ufrm_blood_color",1,.1,.1,.5, 1);
599  */
600  int set_material_parameter_4f(const char* parameter_name,
601  float x, float y, float z, float w,
602  float blend_time = 0.0);
603 
604  /*l
605  *b Description:
606  **
607  ** Allow access to the current values of a material parameter, accounting
608  ** for value blending. Returns -1 if the parameter can't be found.
609  */
610  int get_material_parameter_4f(const char* parameter_name,
611  float* x, float* y, float* z, float* w);
612 
613  /*l
614  *b Description:
615  **
616  ** Returns a char * of length get_variation_texture_size() that represents
617  ** the pixels in a unique per shape texture. Typically a Retained mode
618  ** renderer would need to use this to load a state node with the texture
619  ** see diguyOsgGraphicsShape.cpp for an example. For an immediate mode
620  ** renderer we push the texture to the object via update_variation_texture()
621  */
622  unsigned char * get_variation_texture();
623 
625  int get_variation_texture_size();
626 
627 #ifdef CPLUSPLUS_ONLY
628 
629  /*l
630  *b Description:
631  **
632  ** This function is typically called by scene graph renderers as part
633  ** of diguyGraphicsShape::update(). Scene graph renderers should
634  ** queue up this data to be sent to the graphics card at the
635  ** appropriate time.
636  **
637  ** Note that the format of the data in mat_data will be affected by
638  ** the bdiGraphicsInitGraphicsAPI variable transpose_shader_matrices
639  ** value.
640  **
641  *b Callable From:
642  **
643  *- C++
644  */
645  int get_shader_matrix_data(int* num_matrixes, const float** matrix_data);
646 
647 #endif
648 
649 
650 /*****************************************************************************/
662 #ifdef CPLUSPLUS_ONLY
663 
664  /*l
665  *b Description:
666  **
667  ** This function will be called by DI-Guy when it is time for
668  ** renderer-specific shape objects to be created. All information
669  ** necessary to build the shape should be available via the Accessor
670  ** Functions above when this function is called.
671  **
672  ** The build() function for the link to which a shape is attached
673  ** will be called before the shape's build() function.
674  **
675  *i Immediate Mode:
676  **
677  ** Immediate mode renderers can override this function, to create a
678  ** pre-compiled object that expedites the draw(). Display lists in
679  ** OpenGL are an example of this.
680  **
681  *i Scene Graph:
682  **
683  ** Scene graph renderers usually do override this function, to create
684  ** scene graph nodes that will hold geometry nodes of meshes attached
685  ** to the shape.
686  **
687  ** The following nodes are typically created:
688  **
689  *- - a switch node to control showing and hiding of the shape
690  *- - an LOD node to control which meshes are shown due to
691  *- LOD calculations
692  *- - a geometry parent or group-type object to which mesh
693  *- nodes can be attached
694  **
695  ** The scene graph nodes created by this function should be attached
696  ** to the nodes of the link to which the shape is attached. Use the
697  ** get_link() function to get a pointer to the link.
698  **
699  ** In addition, the scene graph objects of meshes attached to the
700  ** shape should be retrieved and attached to the shape's nodes. Use
701  ** the get_mesh_at_index_for_lod() function to get pointers to the
702  ** meshes.
703  **
704  *b Callable From:
705  **
706  *- - N/A (automatically called by DI-Guy Graphics API during
707  *- the Build Stage)
708  */
709  virtual void build();
710 
711  /*l
712  *b Description:
713  **
714  ** This function will be called by DI-Guy when it is time for the
715  ** renderer-specific shape objects created during the build() call to
716  ** be destroyed.
717  **
718  ** The unbuild() function for the shape will be called before the
719  ** unbuild() function of the link to which the shape is attached.
720  **
721  *i Immediate Mode:
722  **
723  ** Scene graph renderers can override this function, to destroy the
724  ** scene graph nodes created by build().
725  **
726  *i Scene Graph:
727  **
728  ** Scene graph renderers usually do override this function, to
729  ** destroy the scene graph nodes created by build().
730  **
731  *b Callable From:
732  **
733  *- - N/A (automatically called by DI-Guy Graphics API during
734  *- the Unbuild Stage)
735  */
736  virtual void unbuild();
737 
738  /*l
739  *b Description:
740  **
741  ** This function will be called by DI-Guy when it is time for
742  ** renderer-specific shape objects created during the build() call to
743  ** be updated with new data.
744  **
745  ** Shape updates control whether the shape is visible based on motion
746  ** data. The DI-Guy Graphics software looks at the switch value and
747  ** calls show() or hide() as appropriate, so it is likely that this
748  ** function does not need to be overridden in immediate mode.
749  **
750  ** The update() function for the link to which a shape is attached
751  ** will be called before the shape's update() function.
752  **
753  *i Immediate Mode:
754  **
755  ** Immediate mode renderers usually do not override this function.
756  **
757  *i Scene Graph:
758  **
759  ** Scene graph renderers should override this function if they are
760  ** supporting skinned characters. Each skinned shape can potentially
761  ** have different uniforms that need to be sent to the video card; see
762  ** get_shader_matrix_data().
763  **
764  *b Callable From:
765  **
766  *- - N/A (automatically called by DI-Guy Graphics API during
767  *- Update Stage)
768  */
769  virtual void update();
770 
771  /*l
772  *b Description:
773  **
774  ** This function will be called by DI-Guy when the shape should be
775  ** shown, typically due to a change in the motion data that controls
776  ** the switch. See get_switch_var_name() and get_switch_value().
777  **
778  *i Immediate Mode:
779  **
780  ** Immediate mode renderers usually do not override this function.
781  ** DI-Guy does not call the draw() function of hidden shapes.
782  **
783  *i Scene Graph:
784  **
785  ** Scene graph renderers usually do override this function, to update
786  ** the state of the switch node created during the build() call.
787  **
788  *b Callable From:
789  **
790  *- - N/A (automatically called by DI-Guy Graphics API during
791  *- Update Stage)
792  */
793  virtual void show();
794 
795  /*l
796  *b Description:
797  **
798  ** This function will be called by DI-Guy when the shape should be
799  ** hidden, typically due to a change in the motion data that controls
800  ** the switch. See get_switch_var_name() and get_switch_value().
801  **
802  *i Immediate Mode:
803  **
804  ** Immediate mode renderers usually do not override this function.
805  ** DI-Guy does not call the draw() function of hidden shapes.
806  **
807  *i Scene Graph:
808  **
809  ** Scene graph renderers usually do override this function, to update
810  ** the state of the switch node created during the build() call.
811  **
812  *b Callable From:
813  **
814  *- - N/A (automatically called by DI-Guy Graphics API during
815  *- Update Stage)
816  */
817  virtual void hide();
818 
819  /*l
820  *b Description:
821  **
822  ** This function will be called by DI-Guy when it is time for the
823  ** geometry of this shape to be drawn.
824  **
825  *i Immediate Mode:
826  **
827  ** Immediate mode renderers usually do not override this function.
828  ** The actual draw calls happen in diguyGraphicsMesh::draw() calls.
829  **
830  *i Scene Graph:
831  **
832  ** Scene graph renderers usually do not override this function;
833  ** drawing is handled automatically by scene graphs.
834  **
835  *b Callable From:
836  **
837  *- - N/A (automatically called by DI-Guy Graphics API during
838  *- Draw Stage)
839  */
840  virtual void draw(int lod);
841 
842  /*l
843  *b Description:
844  **
845  ** This function will be called by DI-Guy when the LOD ranges of this
846  ** shape need to be updated after the shape has initially been built
847  ** in the Build Stage.
848  **
849  *b Arguments:
850  **
851  *a lod_ranges - new lod ranges for this shape
852  **
853  ** See diguyScenario::set_default_lod_ranges() for a description of
854  ** what will be in the lod_ranges argument.
855  **
856  *i Immediate Mode:
857  **
858  ** Immediate mode renderers usually do not override this function.
859  ** Instead, they use the lod passed into the draw() function.
860  **
861  *i Scene Graph:
862  **
863  ** Scene graph renderers can override this function, to update the
864  ** ranges of LOD nodes created in the Build Stage, if any.
865  **
866  ** If there were LOD-type nodes created in the Build Stage, their
867  ** ranges should be updated based on the passed values.
868  **
869  ** If no LOD-type nodes were created in the Build Stage, this
870  ** function should have no effect.
871  **
872  ** Typically only one of set_graphics_lod_ranges() or
873  ** set_graphics_lod() is implemented.
874  **
875  *b Callable From:
876  **
877  *- - N/A (automatically called by DI-Guy Graphics API when the
878  *- DI-Guy API function diguyCharacter::set_lod_ranges() is
879  *- called)
880  */
881  virtual void set_graphics_lod_ranges(float* ranges);
882 
883  /*l
884  *b Description:
885  **
886  ** This function will be called by DI-Guy when the LOD of this link
887  ** is "manually" set by a diguyCharacter::set_graphics_lod() function
888  ** call.
889  **
890  *i Immediate Mode:
891  **
892  ** Immediate mode renderers usually do not override this function.
893  ** Instead, they use the lod passed into the draw() function.
894  **
895  *i Scene Graph:
896  **
897  ** Scene graph renderers sometimes override this function, to update
898  ** the state of switch nodes created in the Build Stage.
899  **
900  ** Typically only one of set_graphics_lod_ranges() or
901  ** set_graphics_lod() is implemented.
902  **
903  *b Callable From:
904  **
905  *- - N/A (automatically called by DI-Guy Graphics API when the
906  *- DI-Guy API function diguyCharacter::set_graphics_lod() is
907  *- called)
908  */
909  virtual void set_graphics_lod(int lod);
911 
912  /*l
913  *b Description:
914  **
915  ** Pushes a char * pixel buffer of length num_pixels that represents
916  ** the unique per shape texture. Typically a Immediate mode renderer
917  ** would need to use this to create or update a texture
918  ** see diguyOglGraphicsShape.cpp for an example. For an retained mode
919  ** renderer we have get_variation_texture() as an accessor.
920  **
921  *b Callable From:
922  **
923  *- - N/A (automatically called by DI-Guy Graphics API during
924  *- Build Stage)
925  */
926  virtual void update_variation_texture(int num_pixels, unsigned char * pixel_data);
927 
928  /*l
929  *b Description:
930  **
931  ** Returns the unique color of the character links. All links in a
932  ** DI-Guy appearance are assigned a unique RGB color that can be used
933  ** in pick/selection operations. The data returned in color_data is
934  ** an array of length num_colors with 4 floats per entry (r, g, b, a).
935  **
936  ** See programming_examples/diguy_graphics_api/osg_2_examples/intersection_test
937  ** for an example of its usage.
938  **
939  *b Returns:
940  **
941  ** 0 on success, -1 on failure
942  */
943  int get_bind_color_array(int* num_colors, const float** color_data);
944 
945 #endif
946 
947 
948 /****************************************************************************/
949 /****************************************************************************/
950 
955 #ifdef CPLUSPLUS_ONLY
956 
957  bdiShape* get_scripted_object() {return m_scripted_object;}
958 
959 protected:
960 
961  /*l
962  ** A protected constructor. Constructors are called automatically
963  ** by DI-Guy.
964  */
965  diguyGraphicsShape(void* internal_data);
966 
967  /*l
968  ** A protected destructor. Destructors are called automatically
969  ** by DI-Guy.
970  */
971  virtual ~diguyGraphicsShape();
972 
973 private:
974 
975  /*l
976  ** A pointer to internal data.
977  */
978  bdiShape* m_scripted_object;
979 
980  friend class bdiShape;
981  friend class bdiGraphicsFactory;
982 
983 #endif
984 
985 };
986 
987 
988 #endif /* __diguyGraphicsShape_H */
989