amino
Lightweight Robot Utility Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
wavefront.h
1 /* -*- mode: C; c-basic-offset: 4; -*- */
2 /* ex: set shiftwidth=4 tabstop=4 expandtab: */
3 /*
4  * Copyright (c) 2015, Rice University
5  * All rights reserved.
6  *
7  * Author(s): Neil T. Dantam <ntd@rice.edu>
8  *
9  * Redistribution and use in source and binary forms, with or
10  * without modification, are permitted provided that the following
11  * conditions are met:
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * * Neither the name of copyright holder the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
27  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
30  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
31  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  */
37 
38 
39 #ifndef AMINO_RX_WAVEFRONT_H
40 #define AMINO_RX_WAVEFRONT_H
41 
42 /* forward declaration of opaque structure
43  */
44 struct aa_rx_wf_obj;
45 
46 
50 #define AA_RX_WF_OBJ_FACE_NONE -1
51 
52 
56 AA_API void
57 aa_rx_wf_obj_destroy( struct aa_rx_wf_obj * );
58 
59 
63 AA_API size_t
64 aa_rx_wf_obj_mtl_count( struct aa_rx_wf_obj *obj );
65 
69 AA_API const char *
70 aa_rx_wf_obj_get_mtl_filename( struct aa_rx_wf_obj *obj, size_t i );
71 
75 AA_API const struct aa_rx_wf_mtl *
76 aa_rx_wf_obj_get_mtl( struct aa_rx_wf_obj *obj, size_t i );
77 
81 AA_API size_t
82 aa_rx_wf_obj_material_count( struct aa_rx_wf_obj *obj );
83 
87 AA_API const char *
88 aa_rx_wf_obj_get_material_name( struct aa_rx_wf_obj *obj, size_t i );
89 
90 AA_API struct aa_rx_wf_obj *
91 aa_rx_wf_parse(const char *filename);
92 
96 AA_API void
97 aa_rx_wf_obj_get_vertices( const struct aa_rx_wf_obj *obj,
98  const double **verticies, size_t *n );
99 
103 AA_API void
104 aa_rx_wf_obj_get_normals( const struct aa_rx_wf_obj *obj,
105  const double **normals, size_t *n );
106 
110 AA_API void
111 aa_rx_wf_obj_get_vertex_indices( const struct aa_rx_wf_obj *obj,
112  const int32_t **v, size_t *n );
113 
117 AA_API void
118 aa_rx_wf_obj_get_normal_indices( const struct aa_rx_wf_obj *obj,
119  const int32_t **v, size_t *n );
123 AA_API void
124 aa_rx_wf_obj_get_uv_indices( const struct aa_rx_wf_obj *obj,
125  const int32_t **v, size_t *n );
126 
130 AA_API void
131 aa_rx_wf_obj_get_texture_indices( const struct aa_rx_wf_obj *obj,
132  const int32_t **v, size_t *n );
133 
134 
135 /* forward declaration of opaque structure
136  */
137 struct aa_rx_wf_mtl;
138 
139 /* forward declaration of opaque structure
140  */
141 struct aa_rx_wf_material;
142 
143 AA_API struct aa_rx_wf_mtl *
144 aa_rx_wf_mtl_parse(const char *mtl_name );
145 
146 
147 AA_API void
148 aa_rx_wf_mtl_destroy( struct aa_rx_wf_mtl * );
149 
150 AA_API size_t
151 aa_rx_wf_mtl_material_count( const struct aa_rx_wf_mtl * mtl);
152 
153 AA_API struct aa_rx_wf_material *
154 aa_rx_wf_mtl_get_material( const struct aa_rx_wf_mtl * mtl, size_t i);
155 
156 AA_API int
157 aa_rx_wf_material_has_specular_weight( const struct aa_rx_wf_material * material );
158 
159 AA_API int
160 aa_rx_wf_material_has_specular( const struct aa_rx_wf_material * material );
161 
162 AA_API int
163 aa_rx_wf_material_has_ambient( const struct aa_rx_wf_material * material );
164 
165 AA_API int
166 aa_rx_wf_material_has_emission( const struct aa_rx_wf_material * material );
167 
168 AA_API int
169 aa_rx_wf_material_has_diffuse( const struct aa_rx_wf_material * material );
170 
171 AA_API int
172 aa_rx_wf_material_has_alpha( const struct aa_rx_wf_material * material );
173 
174 AA_API int
175 aa_rx_wf_material_has_ior( const struct aa_rx_wf_material * material );
176 
177 AA_API const char*
178 aa_rx_wf_material_get_name( const struct aa_rx_wf_material * material );
179 
180 AA_API const double*
181 aa_rx_wf_material_get_specular( const struct aa_rx_wf_material * material );
182 
183 AA_API const double*
184 aa_rx_wf_material_get_ambient( const struct aa_rx_wf_material * material );
185 
186 AA_API const double*
187 aa_rx_wf_material_get_emission( const struct aa_rx_wf_material * material );
188 
189 AA_API const double*
190 aa_rx_wf_material_get_diffuse( const struct aa_rx_wf_material * material );
191 
192 AA_API double
193 aa_rx_wf_material_get_alpha( const struct aa_rx_wf_material * material );
194 
195 AA_API double
196 aa_rx_wf_material_get_ior( const struct aa_rx_wf_material * material );
197 
198 #endif //AMINO_RX_WAVEFRONT_H
#define AA_API
calling and name mangling convention for functions
Definition: amino.h:86