DI-Guy SDK Documentation  13.8
diguyGraphicsFile.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2024 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
6 #ifndef __diguyGraphicsFile_H
7 #define __diguyGraphicsFile_H
8 
9 #ifdef SWIG
10 %module diguyGraphicsFile
11 #else
12 #define CPLUSPLUS_ONLY
13 #endif
14 
15 #ifdef CPLUSPLUS_ONLY
16 #include <diguy_constants.h>
17 
18 class diguyGraphicsFile;
19 class bdiGeometryFile;
20 
21 #endif
22 
23 #include <declspec_diguy.h>
24 
31 
32 class BDI_DECLSPEC_diguy diguyGraphicsFile
33 {
34 
35 public:
36 
37 /*****************************************************************************/
51  /*l
52  *b Description:
53  **
54  ** Returns the filename of the graphics file. This is the filename
55  ** that was passed to load(). The filename may be NULL if load() has
56  ** not been called.
57  **
58  *b Returns:
59  **
60  ** filename of the graphics file
61  */
62  const char* get_filename();
63 
64 
65 /*****************************************************************************/
77 #ifdef CPLUSPLUS_ONLY
78 
79  /*l
80  *b Description:
81  **
82  ** This function is called when the contents of a geometry file need
83  ** to be loaded.
84  **
85  *i DI-Guy Loader:
86  **
87  ** Implementations using the DI-Guy Loader usually do not override
88  ** this function.
89  **
90  *i External Loader:
91  **
92  ** Implementations using an External Loader must override this
93  ** function.
94  **
95  *b Arguments:
96  **
97  *a filename - the name of the geometry file that needs to
98  *a be loaded
99  *a extension - the extension (usually 3 characters) of the file;
100  *a can help quickly choose an appropriate external
101  *a loader
102  **
103  ** The filename argument includes the full path to the file to
104  ** be loaded.
105  **
106  *b Callable From:
107  **
108  *- - N/A (automatically called by DI-Guy Graphics API during
109  *- the Build Stage)
110  */
111  virtual int load(const char* filename, const char* extension);
112 
113  /*l
114  *b Description:
115  **
116  ** This function does anything necessary to unload assets created
117  ** during the load() call. It will be called after all meshes,
118  ** states, etc., that were extracted from the file have been
119  ** unloaded.
120  **
121  *i DI-Guy Loader:
122  **
123  ** Implementations using the DI-Guy Loader usually do not override
124  ** this function.
125  **
126  *i External Loader:
127  **
128  ** Implementations using an External Loader must override this
129  ** function.
130  **
131  *b Callable From:
132  **
133  *- - N/A (automatically called by DI-Guy Graphics API during
134  *- the Unbuild Stage)
135  */
136  virtual int unload();
137 
138  /*l
139  *b Description:
140  **
141  ** This function needs to find and return an object representing a
142  ** shape in the data loaded during the load() call. Typically this
143  ** is a group-type node above the meshes containing the geometry of
144  ** the shape.
145  **
146  ** The returned object is not used directly by DI-Guy. Instead, it
147  ** will be used in later calls to
148  ** diguyGraphicsShape::get_diguy_graphics_file_part(), during the
149  ** Build Stage.
150  **
151  *b Arguments:
152  **
153  *a part_name - the name of the part that needs to be found
154  **
155  *i DI-Guy Loader:
156  **
157  ** Implementations using the DI-Guy Loader usually do not override
158  ** this function.
159  **
160  *i External Loader:
161  **
162  ** Implementations using an External Loader must override this
163  ** function.
164  **
165  *b Callable From:
166  **
167  *- - N/A (automatically called by DI-Guy Graphics API during
168  *- the Build Stage)
169  */
170  virtual void* find_part(const char* part_name);
171 
172 #endif
173 
174 
175 /****************************************************************************/
176 /****************************************************************************/
182 #ifdef CPLUSPLUS_ONLY
183 
184  bdiGeometryFile* get_scripted_object() {return m_scripted_object;}
185 
186 protected:
187 
188  /*l
189  ** A protected constructor. Constructors are called automatically
190  ** by DI-Guy.
191  */
192  diguyGraphicsFile(void* internal_data);
193 
194  /*l
195  ** A protected destructor. Destructors are called automatically
196  ** by DI-Guy.
197  */
198  virtual ~diguyGraphicsFile();
199 
200 private:
202  /*l
203  ** A pointer to internal data.
204  */
205  bdiGeometryFile* m_scripted_object;
206 
207  friend class bdiGeometryFactory;
208  friend class bdiGeometryFile;
209 
210 #endif
211 
212 };
213 
214 
215 #endif /* __diguyGraphicsFile_H */
216 
A wrapper around a geometry file.
Definition: diguyGraphicsFile.h:32