OpenSceneGraph/doc/doc++/osg/Viewport.html
2003-10-02 14:28:30 +00:00

280 lines
13 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>class SG_EXPORT osg::Viewport</TITLE>
<META NAME="GENERATOR" CONTENT="DOC++ 3.4.10">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H2>class SG_EXPORT <A HREF="#DOC.DOCU">osg::Viewport</A></H2></H2><BLOCKQUOTE>Encapsulte OpenGL glViewport</BLOCKQUOTE>
<HR>
<H2>Inheritance:</H2>
<APPLET CODE="ClassGraph.class" WIDTH=600 HEIGHT=125>
<param name=classes value="CReferenced,MReferenced.html,CObject,MObject.html,CStateAttribute,MStateAttribute.html,CViewport,MViewport.html">
<param name=before value="M,M,M,M">
<param name=after value="Md_SPSP,Md_SP,Md_,M">
<param name=indent value="0,1,2,3">
<param name=arrowdir value="down">
</APPLET>
<HR>
<DL>
<P><DL>
<DT><H3>Public Methods</H3><DD><DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif> <B><A HREF="#DOC.2.233.1">Viewport</A></B>()
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif> <B><A HREF="#DOC.2.233.2">Viewport</A></B>(int <!1><A HREF="Viewport.html#DOC.2.233.8">x</A>, int <!1><A HREF="Viewport.html#DOC.2.233.9">y</A>, int <!1><A HREF="Viewport.html#DOC.2.233.10">width</A>, int <!1><A HREF="Viewport.html#DOC.2.233.11">height</A>)
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif> <B><A HREF="#DOC.2.233.3">Viewport</A></B>(const <!1><A HREF="Viewport.html#DOC.2.233.3">Viewport</A>&amp; vp, const <!1><A HREF="CopyOp.html">CopyOp</A>&amp; copyop=CopyOp::SHALLOW_COPY)
<DD><I>Copy constructor using CopyOp to manage deep vs shallow copy</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif> <B><A HREF="#DOC.2.233.4">META_StateAttribute</A></B>(<!1><A HREF="osg.html">osg</A>, <!1><A HREF="Viewport.html">Viewport</A>, <!1><A HREF="StateAttribute.html#DOC.2.195.6.33">VIEWPORT</A>)
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>virtual int <B><A HREF="#DOC.2.233.5">compare</A></B>(const <!1><A HREF="StateAttribute.html">StateAttribute</A>&amp; sa) const
<DD><I>return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline void <B><A HREF="#DOC.2.233.6">setViewport</A></B>(int <!1><A HREF="Viewport.html#DOC.2.233.8">x</A>, int <!1><A HREF="Viewport.html#DOC.2.233.9">y</A>, int <!1><A HREF="Viewport.html#DOC.2.233.10">width</A>, int <!1><A HREF="Viewport.html#DOC.2.233.11">height</A>)
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>void <B><A HREF="#DOC.2.233.7">getViewport</A></B>(int&amp; <!1><A HREF="Viewport.html#DOC.2.233.8">x</A>, int&amp; <!1><A HREF="Viewport.html#DOC.2.233.9">y</A>, int&amp; <!1><A HREF="Viewport.html#DOC.2.233.10">width</A>, int&amp; <!1><A HREF="Viewport.html#DOC.2.233.11">height</A>) const
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline int <B><A HREF="#DOC.2.233.8">x</A></B>() const
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline int <B><A HREF="#DOC.2.233.9">y</A></B>() const
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline int <B><A HREF="#DOC.2.233.10">width</A></B>() const
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline int <B><A HREF="#DOC.2.233.11">height</A></B>() const
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline bool <B><A HREF="#DOC.2.233.12">valid</A></B>() const
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline float <B><A HREF="#DOC.2.233.13">aspectRatio</A></B>() const
<DD><I>Return the aspcetRatio of the viewport, which is equal to width/height.</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>inline const <!1><A HREF="osg.html#DOC.2.102">osg::Matrix</A> <B><A HREF="#DOC.2.233.14">computeWindowMatrix</A></B>() const
<DD><I>Compute the Window Matrix which takes projected coords into Window coordinates.</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>virtual void <B><A HREF="#DOC.2.233.15">apply</A></B>(<!1><A HREF="State.html">State</A>&amp; state) const
</DL></P>
<P><DL>
<DT><H3>Protected Fields</H3><DD><DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>int <B><A HREF="#DOC.2.233.17">_x</A></B>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>int <B><A HREF="#DOC.2.233.18">_y</A></B>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>int <B><A HREF="#DOC.2.233.19">_width</A></B>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>int <B><A HREF="#DOC.2.233.20">_height</A></B>
</DL></P>
<P><DL>
<DT><H3>Protected Methods</H3><DD><DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>virtual <B><A HREF="#DOC.2.233.16">~Viewport</A></B>()
</DL></P>
</DL>
<HR><H3>Inherited from <A HREF="StateAttribute.html">StateAttribute</A>:</H3>
<DL>
<P><DL>
<DT><H3>Public Methods</H3><DD><DT>
<IMG ALT="o" SRC=icon2.gif>virtual <!1><A HREF="Object.html">Object</A>* <B>cloneType</B>() const
<DT>
<IMG ALT="o" SRC=icon2.gif>virtual <!1><A HREF="Object.html">Object</A>* <B>clone</B>(const <!1><A HREF="CopyOp.html">CopyOp</A>&amp;) const
<DT>
<IMG ALT="o" SRC=icon2.gif>virtual bool <B>isSameKindAs</B>(const <!1><A HREF="Object.html">Object</A>* obj) const
<DT>
<IMG ALT="o" SRC=icon2.gif>virtual const char* <B>libraryName</B>() const
<DT>
<IMG ALT="o" SRC=icon2.gif>virtual const char* <B>className</B>() const
<DT>
<IMG ALT="o" SRC=icon2.gif>virtual <!1><A HREF="StateAttribute.html#DOC.2.195.5">Type</A> <B>getType</B>() const
<DT>
<IMG ALT="o" SRC=icon2.gif>virtual bool <B>isTextureAttribute</B>() const
<DT>
<IMG ALT="o" SRC=icon2.gif>bool <B>operator < </B>(const <!1><A HREF="StateAttribute.html">StateAttribute</A>&amp; rhs) const
<DT>
<IMG ALT="o" SRC=icon2.gif>bool <B>operator == </B>(const <!1><A HREF="StateAttribute.html">StateAttribute</A>&amp; rhs) const
<DT>
<IMG ALT="o" SRC=icon2.gif>bool <B>operator != </B>(const <!1><A HREF="StateAttribute.html">StateAttribute</A>&amp; rhs) const
<DT>
<IMG ALT="o" SRC=icon2.gif>virtual void <B>getAssociatedModes</B>(std::vector&lt;<!1><A HREF="StateAttribute.html#DOC.2.195.1">GLMode</A>&gt;&amp; ) const
<DT>
<IMG ALT="o" SRC=icon2.gif>virtual void <B>compile</B>(<!1><A HREF="State.html">State</A>&amp;) const
</DL></P>
<P><DL>
<DT><H3>Public Members</H3><DD><DT>
<IMG ALT="o" SRC=icon2.gif>typedef GLenum <B>GLMode</B>
<DT>
<IMG ALT="o" SRC=icon2.gif>typedef unsigned int <B>GLModeValue</B>
<DT>
<IMG ALT="o" SRC=icon2.gif>typedef unsigned int <B>OverrideValue</B>
<DT>
<IMG ALT="o" SRC=icon2.gif>enum <B>Values</B>
<DT>
<IMG ALT="o" SRC=icon2.gif>typedef unsigned int <B>Type</B>
<DT>
<IMG ALT="o" SRC=icon2.gif>enum <B>Types</B>
</DL></P>
</DL>
<HR><H3>Inherited from <A HREF="Object.html">Object</A>:</H3>
<DL>
<P><DL>
<DT><H3>Public Methods</H3><DD><DT>
<IMG ALT="o" SRC=icon2.gif>inline void <B>setDataVariance</B>(<!1><A HREF="Object.html#DOC.2.136.8">DataVariance</A> dv)
<DT>
<IMG ALT="o" SRC=icon2.gif>inline <!1><A HREF="Object.html#DOC.2.136.8">DataVariance</A> <B>getDataVariance</B>() const
<DT>
<IMG ALT="o" SRC=icon2.gif>inline void <B>setUserData</B>(<!1><A HREF="Referenced.html">Referenced</A>* obj)
<DT>
<IMG ALT="o" SRC=icon2.gif>inline <!1><A HREF="Referenced.html">Referenced</A>* <B>getUserData</B>()
<DT>
<IMG ALT="o" SRC=icon2.gif>inline const <!1><A HREF="Referenced.html">Referenced</A>* <B>getUserData</B>() const
</DL></P>
<P><DL>
<DT><H3>Public Members</H3><DD><DT>
<IMG ALT="o" SRC=icon2.gif>enum <B>DataVariance</B>
</DL></P>
<P><DL>
<DT><H3>Protected Fields</H3><DD><DT>
<IMG ALT="o" SRC=icon2.gif><!1><A HREF="Object.html#DOC.2.136.8">DataVariance</A> <B>_dataVariance</B>
<DT>
<IMG ALT="o" SRC=icon2.gif><!1><A HREF="ref_ptr.html">ref_ptr</A>&lt;<!1><A HREF="Referenced.html">Referenced</A>&gt; <B>_userData</B>
</DL></P>
</DL>
<HR><H3>Inherited from <A HREF="Referenced.html">Referenced</A>:</H3>
<DL>
<P><DL>
<DT><H3>Public Methods</H3><DD><DT>
<IMG ALT="o" SRC=icon2.gif>inline <!1><A HREF="Referenced.html">Referenced</A>&amp; <B>operator = </B>(<!1><A HREF="Referenced.html">Referenced</A>&amp;)
<DT>
<IMG ALT="o" SRC=icon2.gif>static void <B>setDeleteHandler</B>(<!1><A HREF="DeleteHandler.html">DeleteHandler</A>* handler)
<DT>
<IMG ALT="o" SRC=icon2.gif>static <!1><A HREF="DeleteHandler.html">DeleteHandler</A>* <B>getDeleteHandler</B>()
<DT>
<IMG ALT="o" SRC=icon2.gif>inline void <B>ref</B>() const
<DT>
<IMG ALT="o" SRC=icon2.gif>inline void <B>unref_nodelete</B>() const
<DT>
<IMG ALT="o" SRC=icon2.gif>inline int <B>referenceCount</B>() const
<DT>
<IMG ALT="o" SRC=icon2.gif>inline void <B>unref</B>() const
</DL></P>
<P><DL>
<DT><H3>Protected Fields</H3><DD><DT>
<IMG ALT="o" SRC=icon2.gif>mutable int <B>_refCount</B>
</DL></P>
</DL>
<A NAME="DOC.DOCU"></A>
<HR>
<H2>Documentation</H2>
<BLOCKQUOTE>Encapsulte OpenGL glViewport</BLOCKQUOTE>
<DL>
<A NAME="Viewport"></A>
<A NAME="DOC.2.233.1"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> Viewport()</B></TT>
<DL><DT><DD></DL><P>
<A NAME="Viewport"></A>
<A NAME="DOC.2.233.2"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> Viewport(int <!1><A HREF="Viewport.html#DOC.2.233.8">x</A>, int <!1><A HREF="Viewport.html#DOC.2.233.9">y</A>, int <!1><A HREF="Viewport.html#DOC.2.233.10">width</A>, int <!1><A HREF="Viewport.html#DOC.2.233.11">height</A>)</B></TT>
<DL><DT><DD></DL><P>
<A NAME="Viewport"></A>
<A NAME="DOC.2.233.3"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> Viewport(const <!1><A HREF="Viewport.html#DOC.2.233.3">Viewport</A>&amp; vp, const <!1><A HREF="CopyOp.html">CopyOp</A>&amp; copyop=CopyOp::SHALLOW_COPY)</B></TT>
<DD>Copy constructor using CopyOp to manage deep vs shallow copy
<DL><DT><DD></DL><P>
<A NAME="META_StateAttribute"></A>
<A NAME="DOC.2.233.4"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> META_StateAttribute(<!1><A HREF="osg.html">osg</A>, <!1><A HREF="Viewport.html">Viewport</A>, <!1><A HREF="StateAttribute.html#DOC.2.195.6.33">VIEWPORT</A>)</B></TT>
<DL><DT><DD></DL><P>
<A NAME="compare"></A>
<A NAME="DOC.2.233.5"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>virtual int compare(const <!1><A HREF="StateAttribute.html">StateAttribute</A>&amp; sa) const </B></TT>
<DD>return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs
<DL><DT><DD></DL><P>
<A NAME="setViewport"></A>
<A NAME="DOC.2.233.6"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline void setViewport(int <!1><A HREF="Viewport.html#DOC.2.233.8">x</A>, int <!1><A HREF="Viewport.html#DOC.2.233.9">y</A>, int <!1><A HREF="Viewport.html#DOC.2.233.10">width</A>, int <!1><A HREF="Viewport.html#DOC.2.233.11">height</A>)</B></TT>
<DL><DT><DD></DL><P>
<A NAME="getViewport"></A>
<A NAME="DOC.2.233.7"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void getViewport(int&amp; <!1><A HREF="Viewport.html#DOC.2.233.8">x</A>, int&amp; <!1><A HREF="Viewport.html#DOC.2.233.9">y</A>, int&amp; <!1><A HREF="Viewport.html#DOC.2.233.10">width</A>, int&amp; <!1><A HREF="Viewport.html#DOC.2.233.11">height</A>) const </B></TT>
<DL><DT><DD></DL><P>
<A NAME="x"></A>
<A NAME="DOC.2.233.8"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline int x() const </B></TT>
<DL><DT><DD></DL><P>
<A NAME="y"></A>
<A NAME="DOC.2.233.9"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline int y() const </B></TT>
<DL><DT><DD></DL><P>
<A NAME="width"></A>
<A NAME="DOC.2.233.10"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline int width() const </B></TT>
<DL><DT><DD></DL><P>
<A NAME="height"></A>
<A NAME="DOC.2.233.11"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline int height() const </B></TT>
<DL><DT><DD></DL><P>
<A NAME="valid"></A>
<A NAME="DOC.2.233.12"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline bool valid() const </B></TT>
<DL><DT><DD></DL><P>
<A NAME="aspectRatio"></A>
<A NAME="DOC.2.233.13"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline float aspectRatio() const </B></TT>
<DD>Return the aspcetRatio of the viewport, which is equal to width/height.
If height is zero, the potental division by zero is avoid by simply returning 1.0f.
<DL><DT><DD></DL><P>
<A NAME="computeWindowMatrix"></A>
<A NAME="DOC.2.233.14"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>inline const <!1><A HREF="osg.html#DOC.2.102">osg::Matrix</A> computeWindowMatrix() const </B></TT>
<DD>Compute the Window Matrix which takes projected coords into Window coordinates.
To converted local coodinates into window coordinates use v_window = v_local * MVPW matrix,
where the MVPW matrix is ModelViewMatrix * ProjectionMatrix * WindowMatrix, the later supplied by
viewport::computeWindowMatrix(), the ModelView and Projection Matrix can either be sourced from the
current osg::State object, via osgUtil::SceneView or CullVisitor.
<DL><DT><DD></DL><P>
<A NAME="apply"></A>
<A NAME="DOC.2.233.15"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>virtual void apply(<!1><A HREF="State.html">State</A>&amp; state) const </B></TT>
<DL><DT><DD></DL><P>
<A NAME="~Viewport"></A>
<A NAME="DOC.2.233.16"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>virtual ~Viewport()</B></TT>
<DL><DT><DD></DL><P>
<A NAME="_x"></A>
<A NAME="DOC.2.233.17"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int _x</B></TT>
<DL><DT><DD></DL><P>
<A NAME="_y"></A>
<A NAME="DOC.2.233.18"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int _y</B></TT>
<DL><DT><DD></DL><P>
<A NAME="_width"></A>
<A NAME="DOC.2.233.19"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int _width</B></TT>
<DL><DT><DD></DL><P>
<A NAME="_height"></A>
<A NAME="DOC.2.233.20"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int _height</B></TT>
<DL><DT><DD></DL><P></DL>
<HR><DL><DT><B>This class has no child classes.</B></DL>
<DL><DT><DD></DL><P><P><I><A HREF="index.html">Alphabetic index</A></I> <I><A HREF="HIER.html">HTML hierarchy of classes</A> or <A HREF="HIERjava.html">Java</A></I></P><HR>
<BR>
This page was generated with the help of <A HREF="http://docpp.sourceforge.net">DOC++</A>.
</BODY>
</HTML>