1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2006 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGCSMVIEWPORT_H_
40 #define _OSGCSMVIEWPORT_H_
45 #include "OSGCSMViewportBase.h"
46 #include "OSGViewport.h"
52 /*! \brief CSMViewport class. See \ref
53 PageContribCSMCSMViewport for a description.
56 class OSG_CONTRIBCSM_DLLMAPPING CSMViewport
: public CSMViewportBase
60 /*========================== PUBLIC =================================*/
64 typedef CSMViewportBase Inherited
;
65 typedef CSMViewport Self
;
67 typedef std::vector
<ViewportUnrecPtr
> ViewportStore
;
68 typedef ViewportStore::iterator ViewportStoreIt
;
69 typedef ViewportStore::const_iterator ViewportStoreConstIt
;
71 /*---------------------------------------------------------------------*/
75 virtual void changed(ConstFieldMaskArg whichField
,
80 /*---------------------------------------------------------------------*/
84 bool init(CSMWindow
*pCSMWin
);
87 /*---------------------------------------------------------------------*/
91 ViewportStoreConstIt
beginViewports(void ) const;
92 ViewportStoreConstIt
endViewports (void ) const;
93 Viewport
*getViewport (UInt32 uiIndex
) const;
96 /*---------------------------------------------------------------------*/
100 bool needsStereoVisual(void);
101 bool pointInside (Real32 x
, Real32 y
) const;
104 /*---------------------------------------------------------------------*/
108 Vec2f
translateWindowViewportAbs(Real32 rX
,
112 /*---------------------------------------------------------------------*/
116 virtual void dump( UInt32 uiIndent
= 0,
117 const BitVector bvFlags
= 0) const;
120 /*========================= PROTECTED ===============================*/
124 ViewportStore _vViewports
;
126 /*---------------------------------------------------------------------*/
127 /*! \name Constructors */
131 CSMViewport(const CSMViewport
&source
);
134 /*---------------------------------------------------------------------*/
135 /*! \name Destructors */
138 virtual ~CSMViewport(void);
141 /*---------------------------------------------------------------------*/
145 virtual void resolveLinks(void);
148 /*---------------------------------------------------------------------*/
152 static void initMethod(InitPhase ePhase
);
155 /*========================== PRIVATE ================================*/
159 friend class FieldContainer
;
160 friend class CSMViewportBase
;
162 // prohibit default functions (move to 'public' if you need one)
163 void operator =(const CSMViewport
&source
);
166 typedef CSMViewport
*CSMViewportP
;
170 #include "OSGCSMViewportBase.inl"
171 #include "OSGCSMViewport.inl"
173 #endif /* _OSGCSMVIEWPORT_H_ */