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

# viewport.h

Go to the documentation of this file.

    00001 /* -*- c -*- */
    00002 #ifndef INCLUDED_LIB3DS_VIEWPORT_H
    00003 #define INCLUDED_LIB3DS_VIEWPORT_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: viewport.h,v 1.1 2005/03/07 11:16:26 Assassin Exp $
    00024  */
    00025
    00026 #ifndef INCLUDED_LIB3DS_TYPES_H
    00027 #include <lib3ds/types.h>
    00028 #endif
    00029
    00030 #ifdef __cplusplus
    00031 extern "C" {
    00032 #endif
    00033
    00034 /*!
    00035  * Layout view types
    00036  * \ingroup viewport
    00037  */
    00038 typedef enum _Lib3dsViewType {
    00039   LIB3DS_VIEW_TYPE_NOT_USED  =0,
    00040   LIB3DS_VIEW_TYPE_TOP       =1,
    00041   LIB3DS_VIEW_TYPE_BOTTOM    =2,
    00042   LIB3DS_VIEW_TYPE_LEFT      =3,
    00043   LIB3DS_VIEW_TYPE_RIGHT     =4,
    00044   LIB3DS_VIEW_TYPE_FRONT     =5,
    00045   LIB3DS_VIEW_TYPE_BACK      =6,
    00046   LIB3DS_VIEW_TYPE_USER      =7,
    00047   LIB3DS_VIEW_TYPE_SPOTLIGHT =18,
    00048   LIB3DS_VIEW_TYPE_CAMERA    =65535
    00049 } Lib3dsViewType;
    00050
    00051 /*!
    00052  * Layout view settings
    00053  * \ingroup viewport
    00054  */
    00055 typedef struct _Lib3dsView {
    00056     Lib3dsWord type;
    00057     Lib3dsWord axis_lock;
    00058     Lib3dsIntw position[2];
    00059     Lib3dsIntw size[2];
    00060     Lib3dsFloat zoom;
    00061     Lib3dsVector center;
    00062     Lib3dsFloat horiz_angle;
    00063     Lib3dsFloat vert_angle;
    00064     char camera[11];
    00065 } Lib3dsView;
    00066
    00067 /*!
    00068  * Layout styles
    00069  * \ingroup viewport
    00070  */
    00071 typedef enum _Lib3dsLayoutStyle {
    00072   LIB3DS_LAYOUT_SINGLE                  =0,
    00073   LIB3DS_LAYOUT_TWO_PANE_VERT_SPLIT     =1,
    00074   LIB3DS_LAYOUT_TWO_PANE_HORIZ_SPLIT    =2,
    00075   LIB3DS_LAYOUT_FOUR_PANE               =3,
    00076   LIB3DS_LAYOUT_THREE_PANE_LEFT_SPLIT   =4,
    00077   LIB3DS_LAYOUT_THREE_PANE_BOTTOM_SPLIT =5,
    00078   LIB3DS_LAYOUT_THREE_PANE_RIGHT_SPLIT  =6,
    00079   LIB3DS_LAYOUT_THREE_PANE_TOP_SPLIT    =7,
    00080   LIB3DS_LAYOUT_THREE_PANE_VERT_SPLIT   =8,
    00081   LIB3DS_LAYOUT_THREE_PANE_HORIZ_SPLIT  =9,
    00082   LIB3DS_LAYOUT_FOUR_PANE_LEFT_SPLIT    =10,
    00083   LIB3DS_LAYOUT_FOUR_PANE_RIGHT_SPLIT   =11
    00084 } Lib3dsLayoutStyle;
    00085
    00086 /*!
    00087  * Viewport layout settings
    00088  * \ingroup viewport
    00089  */
    00090 typedef struct _Lib3dsLayout {
    00091     Lib3dsWord style;
    00092     Lib3dsIntw active;
    00093     Lib3dsIntw swap;
    00094     Lib3dsIntw swap_prior;
    00095     Lib3dsIntw swap_view;
    00096     Lib3dsWord position[2];
    00097     Lib3dsWord size[2];
    00098     Lib3dsDword views;
    00099     Lib3dsView *viewL;
    00100 } Lib3dsLayout;
    00101
    00102 /*!
    00103  * Default view settings
    00104  * \ingroup viewport
    00105  */
    00106 typedef struct _Lib3dsDefaultView {
    00107     Lib3dsWord type;
    00108     Lib3dsVector position;
    00109     Lib3dsFloat width;
    00110     Lib3dsFloat horiz_angle;
    00111     Lib3dsFloat vert_angle;
    00112     Lib3dsFloat roll_angle;
    00113     char camera[64];
    00114 } Lib3dsDefaultView;
    00115
    00116 /*!
    00117  * Viewport and default view settings
    00118  * \ingroup viewport
    00119  */
    00120 struct _Lib3dsViewport {
    00121     Lib3dsLayout layout;
    00122     Lib3dsDefaultView default_view;
    00123 };
    00124
    00125 extern LIB3DSAPI Lib3dsBool lib3ds_viewport_read(Lib3dsViewport *viewport, Lib3dsIo *io);
    00126 extern LIB3DSAPI void lib3ds_viewport_set_views(Lib3dsViewport *viewport, Lib3dsDword views);
    00127 extern LIB3DSAPI Lib3dsBool lib3ds_viewport_write(Lib3dsViewport *viewport, Lib3dsIo *io);
    00128
    00129 #ifdef __cplusplus
    00130 };
    00131 #endif
    00132 #endif
    00133
    00134
    00135
    00136