C++ SDK Reference  12.5
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguyGraphicsFile.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 __diguyGraphicsFile_H
35 #define __diguyGraphicsFile_H
36 
37 #ifdef SWIG
38 %module diguyGraphicsFile
39 #else
40 #define CPLUSPLUS_ONLY
41 #endif
42 
43 #ifdef CPLUSPLUS_ONLY
44 #include <diguy_constants.h>
45 
46 class diguyGraphicsFile;
47 class bdiGeometryFile;
48 
49 /****************************************************************************/
50 
51 #endif
52 
53 #include <declspec_diguy.h>
54 
55 /****************************************************************************/
56 class BDI_DECLSPEC_diguy diguyGraphicsFile
57 {
58 
59 public:
60 
61 /*****************************************************************************/
71  /*l
72  *b Description:
73  **
74  ** Returns the filename of the graphics file. This is the filename
75  ** that was passed to load(). The filename may be NULL if load() has
76  ** not been called.
77  **
78  *b Returns:
79  **
80  ** filename of the graphics file
81  **
82  *b Callable From:
83  **
84  *- - C++
85  *- - Script
86  */
87  const char* get_filename();
88 
89 
90 /*****************************************************************************/
102 #ifdef CPLUSPLUS_ONLY
103 
104  /*l
105  *b Description:
106  **
107  ** This function is called when the contents of a geometry file need
108  ** to be loaded.
109  **
110  *i DI-Guy Loader:
111  **
112  ** Implementations using the DI-Guy Loader usually do not override
113  ** this function.
114  **
115  *i External Loader:
116  **
117  ** Implementations using an External Loader must override this
118  ** function.
119  **
120  *b Arguments:
121  **
122  *a filename - the name of the geometry file that needs to
123  *a be loaded
124  *a extension - the extension (usually 3 characters) of the file;
125  *a can help quickly choose an appropriate external
126  *a loader
127  **
128  ** The filename argument includes the full path to the file to
129  ** be loaded.
130  **
131  *b Callable From:
132  **
133  *- - N/A (automatically called by DI-Guy Graphics API during
134  *- the Build Stage)
135  */
136  virtual int load(const char* filename, const char* extension);
137 
138  /*l
139  *b Description:
140  **
141  ** This function does anything necessary to unload assets created
142  ** during the load() call. It will be called after all meshes,
143  ** states, etc., that were extracted from the file have been
144  ** unloaded.
145  **
146  *i DI-Guy Loader:
147  **
148  ** Implementations using the DI-Guy Loader usually do not override
149  ** this function.
150  **
151  *i External Loader:
152  **
153  ** Implementations using an External Loader must override this
154  ** function.
155  **
156  *b Callable From:
157  **
158  *- - N/A (automatically called by DI-Guy Graphics API during
159  *- the Unbuild Stage)
160  */
161  virtual int unload();
162 
163  /*l
164  *b Description:
165  **
166  ** This function needs to find and return an object representing a
167  ** shape in the data loaded during the load() call. Typically this
168  ** is a group-type node above the meshes containing the geometry of
169  ** the shape.
170  **
171  ** The returned object is not used directly by DI-Guy. Instead, it
172  ** will be used in later calls to
173  ** diguyGraphicsShape::get_diguy_graphics_file_part(), during the
174  ** Build Stage.
175  **
176  *b Arguments:
177  **
178  *a part_name - the name of the part that needs to be found
179  **
180  *i DI-Guy Loader:
181  **
182  ** Implementations using the DI-Guy Loader usually do not override
183  ** this function.
184  **
185  *i External Loader:
186  **
187  ** Implementations using an External Loader must override this
188  ** function.
189  **
190  *b Callable From:
191  **
192  *- - N/A (automatically called by DI-Guy Graphics API during
193  *- the Build Stage)
194  */
195  virtual void* find_part(const char* part_name);
196 
197 #endif
198 
199 
200 /****************************************************************************/
201 /****************************************************************************/
202 
207 #ifdef CPLUSPLUS_ONLY
208 
209  bdiGeometryFile* get_scripted_object() {return m_scripted_object;}
211 protected:
212 
213  /*l
214  ** A protected constructor. Constructors are called automatically
215  ** by DI-Guy.
216  */
217  diguyGraphicsFile(void* internal_data);
218 
219  /*l
220  ** A protected destructor. Destructors are called automatically
221  ** by DI-Guy.
222  */
223  virtual ~diguyGraphicsFile();
224 
225 private:
226 
227  /*l
228  ** A pointer to internal data.
229  */
230  bdiGeometryFile* m_scripted_object;
232  friend class bdiGeometryFactory;
233  friend class bdiGeometryFile;
235 #endif
236 
237 };
238 
239 
240 #endif /* __diguyGraphicsFile_H */
241