Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# file.h

Go to the documentation of this file.

    00001 /* -*- c -*- */
    00002 #ifndef INCLUDED_LIB3DS_FILE_H
    00003 #define INCLUDED_LIB3DS_FILE_H
    00004 /*
    00005  * The 3D Studio File Format Library
    00006  * Copyright (C) 1996-2001 by J.E. Hoffmann <je-h@gmx.net>
    00007  * All rights reserved.
    00008  *
    00009  * This program is  free  software;  you can redistribute it and/or modify it
    00010  * under the terms of the  GNU Lesser General Public License  as published by
    00011  * the  Free Software Foundation;  either version 2.1 of the License,  or (at
    00012  * your option) any later version.
    00013  *
    00014  * This  program  is  distributed in  the  hope that it will  be useful,  but
    00015  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    00016  * or  FITNESS FOR A  PARTICULAR PURPOSE.  See the  GNU Lesser General Public
    00017  * License for more details.
    00018  *
    00019  * You should  have received  a copy of the GNU Lesser General Public License
    00020  * along with  this program;  if not, write to the  Free Software Foundation,
    00021  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00022  *
    00023  * $Id: file.h,v 1.1 2005/03/07 11:16:26 Assassin Exp $
    00024  */
    00025
    00026 #ifndef INCLUDED_LIB3DS_BACKGROUND_H
    00027 #include <lib3ds/background.h>
    00028 #endif
    00029 #ifndef INCLUDED_LIB3DS_ATMOSPHERE_H
    00030 #include <lib3ds/atmosphere.h>
    00031 #endif
    00032 #ifndef INCLUDED_LIB3DS_SHADOW_H
    00033 #include <lib3ds/shadow.h>
    00034 #endif
    00035 #ifndef INCLUDED_LIB3DS_VIEWPORT_H
    00036 #include <lib3ds/viewport.h>
    00037 #endif
    00038
    00039 #ifdef __cplusplus
    00040 extern "C" {
    00041 #endif
    00042
    00043 /*!
    00044  * 3ds file structure
    00045  * \ingroup file
    00046  */
    00047 struct _Lib3dsFile {
    00048     Lib3dsDword mesh_version;
    00049     Lib3dsWord keyf_revision;
    00050     char name[12+1];
    00051     Lib3dsFloat master_scale;
    00052     Lib3dsVector construction_plane;
    00053     Lib3dsRgb ambient;
    00054     Lib3dsShadow shadow;
    00055     Lib3dsBackground background;
    00056     Lib3dsAtmosphere atmosphere;
    00057     Lib3dsViewport viewport;
    00058     Lib3dsViewport viewport_keyf;
    00059     Lib3dsIntd frames;
    00060     Lib3dsIntd segment_from;
    00061     Lib3dsIntd segment_to;
    00062     Lib3dsIntd current_frame;
    00063     Lib3dsMaterial *materials;
    00064     Lib3dsMesh *meshes;
    00065     Lib3dsCamera *cameras;
    00066     Lib3dsLight *lights;
    00067     Lib3dsNode *nodes;
    00068 };
    00069
    00070 extern LIB3DSAPI Lib3dsFile* lib3ds_file_load(const char *filename);
    00071 extern LIB3DSAPI Lib3dsBool lib3ds_file_save(Lib3dsFile *file, const char *filename);
    00072 extern LIB3DSAPI Lib3dsFile* lib3ds_file_new();
    00073 extern LIB3DSAPI void lib3ds_file_free(Lib3dsFile *file);
    00074 extern LIB3DSAPI void lib3ds_file_eval(Lib3dsFile *file, Lib3dsFloat t);
    00075 extern LIB3DSAPI Lib3dsBool lib3ds_file_read(Lib3dsFile *file, Lib3dsIo *io);
    00076 extern LIB3DSAPI Lib3dsBool lib3ds_file_write(Lib3dsFile *file, Lib3dsIo *io);
    00077 extern LIB3DSAPI void lib3ds_file_insert_material(Lib3dsFile *file, Lib3dsMaterial *material);
    00078 extern LIB3DSAPI void lib3ds_file_remove_material(Lib3dsFile *file, Lib3dsMaterial *material);
    00079 extern LIB3DSAPI Lib3dsMaterial* lib3ds_file_material_by_name(Lib3dsFile *file, const char *name);
    00080 extern LIB3DSAPI void lib3ds_file_dump_materials(Lib3dsFile *file);
    00081 extern LIB3DSAPI void lib3ds_file_insert_mesh(Lib3dsFile *file, Lib3dsMesh *mesh);
    00082 extern LIB3DSAPI void lib3ds_file_remove_mesh(Lib3dsFile *file, Lib3dsMesh *mesh);
    00083 extern LIB3DSAPI Lib3dsMesh* lib3ds_file_mesh_by_name(Lib3dsFile *file, const char *name);
    00084 extern LIB3DSAPI void lib3ds_file_dump_meshes(Lib3dsFile *file);
    00085 extern LIB3DSAPI void lib3ds_file_dump_instances(Lib3dsFile *file);
    00086 extern LIB3DSAPI void lib3ds_file_insert_camera(Lib3dsFile *file, Lib3dsCamera *camera);
    00087 extern LIB3DSAPI void lib3ds_file_remove_camera(Lib3dsFile *file, Lib3dsCamera *camera);
    00088 extern LIB3DSAPI Lib3dsCamera* lib3ds_file_camera_by_name(Lib3dsFile *file, const char *name);
    00089 extern LIB3DSAPI void lib3ds_file_dump_cameras(Lib3dsFile *file);
    00090 extern LIB3DSAPI void lib3ds_file_insert_light(Lib3dsFile *file, Lib3dsLight *light);
    00091 extern LIB3DSAPI void lib3ds_file_remove_light(Lib3dsFile *file, Lib3dsLight *light);
    00092 extern LIB3DSAPI Lib3dsLight* lib3ds_file_light_by_name(Lib3dsFile *file, const char *name);
    00093 extern LIB3DSAPI void lib3ds_file_dump_lights(Lib3dsFile *file);
    00094 extern LIB3DSAPI Lib3dsNode* lib3ds_file_node_by_name(Lib3dsFile *file, const char* name,
    00095   Lib3dsNodeTypes type);
    00096 extern LIB3DSAPI Lib3dsNode* lib3ds_file_node_by_id(Lib3dsFile *file, Lib3dsWord node_id);
    00097 extern LIB3DSAPI void lib3ds_file_insert_node(Lib3dsFile *file, Lib3dsNode *node);
    00098 extern LIB3DSAPI Lib3dsBool lib3ds_file_remove_node(Lib3dsFile *file, Lib3dsNode *node);
    00099 extern LIB3DSAPI void lib3ds_file_dump_nodes(Lib3dsFile *file);
    00100
    00101 #ifdef __cplusplus
    00102 };
    00103 #endif
    00104 #endif
    00105