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