1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 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 \*---------------------------------------------------------------------------*/
40 #ifndef _OSGVIEWPORT_H_
41 #define _OSGVIEWPORT_H_
46 #include "OSGViewportBase.h"
47 #include "OSGWindowDrawTask.h"
51 /*! \brief Viewport base class. See \ref
52 PageSystemWindowViewports for a description.
54 \ingroup GrpSystemWindowBase
55 \ingroup GrpLibOSGSystem
59 class OSG_SYSTEM_DLLMAPPING Viewport
: public ViewportBase
61 /*========================== PUBLIC =================================*/
65 typedef ViewportBase Inherited
;
67 /*---------------------------------------------------------------------*/
71 virtual Int32
calcPixelLeft ( void ) const;
72 virtual Int32
calcPixelRight ( void ) const;
73 virtual Int32
calcPixelBottom ( void ) const;
74 virtual Int32
calcPixelTop ( void ) const;
76 Int32
calcPixelWidth ( void ) const;
77 Int32
calcPixelHeight ( void ) const;
79 virtual bool calcIsFullWindow ( void ) const;
81 Window
*getParent ( void ) const;
83 void calcNormalizedCoordinates( Real32
& normX
,
86 const Int32 vpY
) const;
89 Int32
getPixelLeft ( void ) const;
90 Int32
getPixelRight ( void ) const;
91 Int32
getPixelBottom ( void ) const;
92 Int32
getPixelTop ( void ) const;
94 Int32
getPixelWidth ( void ) const;
95 Int32
getPixelHeight ( void ) const;
97 bool isFullWindow ( void ) const;
100 void getNormalizedCoordinates ( Real32
& normX
,
103 const Int32 vpY
) const;
107 /*---------------------------------------------------------------------*/
108 /*! \name your_category */
111 virtual void activateSize(void );
112 virtual void activate (void );
113 virtual void deactivate (void );
115 virtual void render (RenderActionBase
*action
);
118 /*---------------------------------------------------------------------*/
123 /*---------------------------------------------------------------------*/
128 /*---------------------------------------------------------------------*/
132 virtual void changed(ConstFieldMaskArg whichField
,
137 /*---------------------------------------------------------------------*/
141 virtual void dump( UInt32 uiIndent
= 0,
142 const BitVector bvFlags
= 0) const;
145 /*========================= PROTECTED ===============================*/
149 ViewportDrawTaskRefPtr _pForegroundTask
;
151 /*---------------------------------------------------------------------*/
152 /*! \name Constructors */
156 Viewport(const Viewport
&source
);
159 /*---------------------------------------------------------------------*/
160 /*! \name Destructors */
163 virtual ~Viewport(void);
166 /*---------------------------------------------------------------------*/
167 /*! \name Destructors */
170 static void initMethod(InitPhase ePhase
);
173 /*---------------------------------------------------------------------*/
174 /*! \name MT Construction */
177 void renderForegrounds(Window
*pWin
,
182 /*---------------------------------------------------------------------*/
183 /*! \name MT Construction */
186 void onCreate (const Viewport
*source
= NULL
);
188 void onCreateAspect (const Viewport
*createAspect
,
189 const Viewport
*source
= NULL
);
191 void onDestroy ( UInt32 uiContainerId
);
193 void onDestroyAspect( UInt32 uiContainerId
,
197 /*========================= PRIVATE ===============================*/
201 friend class FieldContainer
;
202 friend class ViewportBase
;
203 friend class ViewportDrawTask
;
205 // prohibit default functions (move to 'public' if you need one)
206 void operator =(const Viewport
&source
);
209 //---------------------------------------------------------------------------
211 //---------------------------------------------------------------------------
213 typedef Viewport
*ViewportP
;
217 #include "OSGViewportBase.inl"
218 #include "OSGViewport.inl"
220 #endif /* _OSGVIEWPORT_H_ */