root/OpenSceneGraph/trunk/src/osgPlugins/3ds/viewport.h @ 10076

Revision 10076, 3.5 kB (checked in by robert, 6 years ago)

From Neil Hughes, converted across to use istream for reading data from file to enable reading .3ds files over http (use OSG's libcurl plugin).

From Robert Osfield, ammendments of the above to better support reading of files from local directories.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
RevLine 
[8]1/* -*- c -*- */
2#ifndef INCLUDED_LIB3DS_VIEWPORT_H
3#define INCLUDED_LIB3DS_VIEWPORT_H
4/*
5 * The 3D Studio File Format Library
6 * Copyright (C) 1996-2001 by J.E. Hoffmann <je-h@gmx.net>
7 * All rights reserved.
8 *
9 * This program is  free  software;  you can redistribute it and/or modify it
10 * under the terms of the  GNU Lesser General Public License  as published by
11 * the  Free Software Foundation;  either version 2.1 of the License,  or (at
12 * your option) any later version.
13 *
14 * This  program  is  distributed in  the  hope that it will  be useful,  but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 * or  FITNESS FOR A  PARTICULAR PURPOSE.  See the  GNU Lesser General Public 
17 * License for more details.
18 *
19 * You should  have received  a copy of the GNU Lesser General Public License
20 * along with  this program;  if not, write to the  Free Software Foundation,
21 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 * $Id$
24 */
25
26#ifndef INCLUDED_LIB3DS_TYPES_H
[1563]27#include "types.h"
[8]28#endif
29
[10076]30#include <iostream>
31using namespace std;
32
[8]33#ifdef __cplusplus
34extern "C" {
35#endif
36
37/*!
38 * Layout view types
39 * \ingroup viewport
40 */
41typedef enum _Lib3dsViewType {
42  LIB3DS_VIEW_TYPE_NOT_USED  =0,
43  LIB3DS_VIEW_TYPE_TOP       =1,
44  LIB3DS_VIEW_TYPE_BOTTOM    =2,
45  LIB3DS_VIEW_TYPE_LEFT      =3,
46  LIB3DS_VIEW_TYPE_RIGHT     =4,
47  LIB3DS_VIEW_TYPE_FRONT     =5,
48  LIB3DS_VIEW_TYPE_BACK      =6,
49  LIB3DS_VIEW_TYPE_USER      =7,
50  LIB3DS_VIEW_TYPE_SPOTLIGHT =18,
51  LIB3DS_VIEW_TYPE_CAMERA    =65535
52} Lib3dsViewType;
53
54/*!
55 * Layout view settings
56 * \ingroup viewport
57 */
58typedef struct _Lib3dsView {
59    Lib3dsWord type;
60    Lib3dsWord axis_lock;
61    Lib3dsIntw position[2];
62    Lib3dsIntw size[2];
63    Lib3dsFloat zoom;
64    Lib3dsVector center;
65    Lib3dsFloat horiz_angle;
66    Lib3dsFloat vert_angle;
67    char camera[11];
68} Lib3dsView;
69
70/*!
71 * Layout styles
72 * \ingroup viewport
73 */
74typedef enum _Lib3dsLayoutStyle {
75  LIB3DS_LAYOUT_SINGLE                  =0,
76  LIB3DS_LAYOUT_TWO_PANE_VERT_SPLIT     =1,
77  LIB3DS_LAYOUT_TWO_PANE_HORIZ_SPLIT    =2,
78  LIB3DS_LAYOUT_FOUR_PANE               =3,
79  LIB3DS_LAYOUT_THREE_PANE_LEFT_SPLIT   =4,
80  LIB3DS_LAYOUT_THREE_PANE_BOTTOM_SPLIT =5,
81  LIB3DS_LAYOUT_THREE_PANE_RIGHT_SPLIT  =6,
82  LIB3DS_LAYOUT_THREE_PANE_TOP_SPLIT    =7,
83  LIB3DS_LAYOUT_THREE_PANE_VERT_SPLIT   =8,
84  LIB3DS_LAYOUT_THREE_PANE_HORIZ_SPLIT  =9,
85  LIB3DS_LAYOUT_FOUR_PANE_LEFT_SPLIT    =10,
86  LIB3DS_LAYOUT_FOUR_PANE_RIGHT_SPLIT   =11
87} Lib3dsLayoutStyle;
88
89/*!
90 * Viewport layout settings
91 * \ingroup viewport
92 */
93typedef struct _Lib3dsLayout {
94    Lib3dsWord style;
95    Lib3dsIntw active;
96    Lib3dsIntw swap;
97    Lib3dsIntw swap_prior;
98    Lib3dsIntw swap_view;
99    Lib3dsWord position[2];
100    Lib3dsWord size[2];
101    Lib3dsDword views;
102    Lib3dsView *viewL;
103} Lib3dsLayout;
104
105/*!
106 * Default view settings
107 * \ingroup viewport
108 */
109typedef struct _Lib3dsDefaultView {
110    Lib3dsWord type;
111    Lib3dsVector position;
112    Lib3dsFloat width;
113    Lib3dsFloat horiz_angle;
114    Lib3dsFloat vert_angle;
115    Lib3dsFloat roll_angle;
116    char camera[64];
117} Lib3dsDefaultView;
118
119/*!
120 * Viewport and default view settings
121 * \ingroup viewport
122 */
123struct _Lib3dsViewport {
124    Lib3dsLayout layout;
125    Lib3dsDefaultView default_view;
126};
127
[10076]128extern LIB3DSAPI Lib3dsBool lib3ds_viewport_read(Lib3dsViewport *viewport, iostream *strm);
[8]129extern LIB3DSAPI void lib3ds_viewport_set_views(Lib3dsViewport *viewport, Lib3dsDword views);
[10076]130extern LIB3DSAPI Lib3dsBool lib3ds_viewport_write(Lib3dsViewport *viewport, iostream *strm);
[8]131
132#ifdef __cplusplus
[6461]133}
[8]134#endif
135#endif
136
137
138
Note: See TracBrowser for help on using the browser.