Provided by: libcoin80-doc_3.1.4~abc9f50-4ubuntu2_all

**NAME**

SbDPViewVolume - TheSbDPViewVolumeclass is a double precision viewing volume in 3D space. This class contains the necessary information for storing a view volume. It has methods for projection of primitives from or into the 3D volume, doing camera transforms, view volume transforms etc.

**SYNOPSIS**

PublicTypesenumProjectionType{ORTHOGRAPHIC= 0,PERSPECTIVE= 1 }PublicMemberFunctionsSbDPViewVolume(void)~SbDPViewVolume(void) voidgetMatrices(SbDPMatrix&affine,SbDPMatrix&proj) constSbDPMatrixgetMatrix(void) constSbDPMatrixgetCameraSpaceMatrix(void) const voidprojectPointToLine(constSbVec2d&pt,SbDPLine&line) const voidprojectPointToLine(constSbVec2d&pt,SbVec3d&line0,SbVec3d&line1) const voidprojectToScreen(constSbVec3d&src,SbVec3d&dst) constSbPlanegetPlane(const double distFromEye) constSbVec3dgetSightPoint(const double distFromEye) constSbVec3dgetPlanePoint(const double distFromEye, constSbVec2d&normPoint) constSbDPRotationgetAlignRotation(SbBool rightAngleOnly=FALSE) const doublegetWorldToScreenScale(constSbVec3d&worldCenter, double normRadius) constSbVec2dprojectBox(constSbBox3f&box) constSbDPViewVolumenarrow(double left, double bottom, double right, double top) constSbDPViewVolumenarrow(constSbBox3f&box) const voidortho(double left, double right, double bottom, double top, double nearval, double farval) voidperspective(double fovy, double aspect, double nearval, double farval) voidfrustum(double left, double right, double bottom, double top, double nearval, double farval) voidrotateCamera(constSbDPRotation&q) voidtranslateCamera(constSbVec3d&v)SbVec3dzVector(void) constSbDPViewVolumezNarrow(double nearval, double farval) const voidscale(double factor) voidscaleWidth(double ratio) voidscaleHeight(double ratio)ProjectionTypegetProjectionType(void) const constSbVec3d&getProjectionPoint(void) const constSbVec3d&getProjectionDirection(void) const doublegetNearDist(void) const doublegetWidth(void) const doublegetHeight(void) const doublegetDepth(void) const voidgetViewVolumePlanes(SbPlaneplanes[6]) const voidtransform(constSbDPMatrix&matrix)SbVec3dgetViewUp(void) const voidcopyValues(SbViewVolume&vv)

**Detailed** **Description**

TheSbDPViewVolumeclass is a double precision viewing volume in 3D space. This class contains the necessary information for storing a view volume. It has methods for projection of primitives from or into the 3D volume, doing camera transforms, view volume transforms etc. Be aware that this class is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.SeeAlso:SbViewportRegionSince:Coin 2.0

**Member** **Enumeration** **Documentation**

enumSbDPViewVolume::ProjectionTypeAnSbDPViewVolumeinstance can represent either an orthogonal projection volume or a perspective projection volume.SeeAlso:ortho(),perspective(),getProjectionType().EnumeratorORTHOGRAPHICOrthographic projection.PERSPECTIVEPerspective projection.

**Constructor** **&** **Destructor** **Documentation**

SbDPViewVolume::SbDPViewVolume(void)Constructor. Note that theSbDPViewVolumeinstance will be uninitialized until you explicitly callortho()orperspective().SeeAlso:ortho(),perspective().SbDPViewVolume::~SbDPViewVolume(void)Destructor.

**Member** **Function** **Documentation**

voidSbDPViewVolume::getMatrices(SbDPMatrix&affine,SbDPMatrix&proj)constReturns the view volume's affine matrix and projection matrix.SeeAlso:getMatrix(),getCameraSpaceMatrix()SbDPMatrixSbDPViewVolume::getMatrix(void)constReturns the combined affine and projection matrix.SeeAlso:getMatrices(),getCameraSpaceMatrix()SbDPMatrixSbDPViewVolume::getCameraSpaceMatrix(void)constReturns a matrix which will translate the view volume camera back to origo, and rotate the camera so it'll point along the negative z axis. Note that the matrix willnotinclude the rotation necessary to make the camera up vector point along the positive y axis (i.e. camera roll is not accounted for).SeeAlso:getMatrices(),getMatrix()voidSbDPViewVolume::projectPointToLine(constSbVec2d&pt,SbDPLine&line)constProject the given 2D point from the projection plane into a 3D line.ptcoordinates should be normalized to be within [0, 1].voidSbDPViewVolume::projectPointToLine(constSbVec2d&pt,SbVec3d&line0,SbVec3d&line1)constProject the given 2D point from the projection plane into two points defining a 3D line. The first point,line0, will be the corresponding point for the projection on the near plane, whileline1will be the line endpoint, lying in the far plane.voidSbDPViewVolume::projectToScreen(constSbVec3d&src,SbVec3d&dst)constProject thesrcpoint to a normalized set of screen coordinates in the projection plane and place the result indst. It is safe to letsrcand be the sameSbVec3dinstance. The z-coordinate ofdstis monotonically increasing for points closer to the far plane. Note however that this is not a linear relationship, thedstz-coordinate is calculated as follows: Orthogonal view: DSTz = (-2 * SRCz - far - near) / (far - near), Perspective view: DSTz = (-SRCz * (far - near) - 2*far*near) / (far - near) The returned coordinates (dst) are normalized to be in range [0, 1].SbPlaneSbDPViewVolume::getPlane(constdoubledistFromEye)constReturns anSbPlaneinstance which has a normal vector in the opposite direction of which the camera is pointing. This means the plane will be parallel to the near and far clipping planes.SeeAlso:getSightPoint()SbVec3dSbDPViewVolume::getSightPoint(constdoubledistFromEye)constReturns the point on the center line-of-sight from the camera position with the given distance.SeeAlso:getPlane()SbVec3dSbDPViewVolume::getPlanePoint(constdoubledistFromEye,constSbVec2d&normPoint)constReturn the 3D point which projects tonormPointand lies on the plane perpendicular to the camera direction anddistFromEyedistance away from the camera position.normPointshould be given in normalized coordinates, where the visible render canvas is covered by the range [0.0, 1.0].SbDPRotationSbDPViewVolume::getAlignRotation(SbBoolrightangleonly=FALSE)constReturns a rotation that aligns an object so that its positive x-axis is to the right and its positive y-axis is up in the view volume. If rightangleonly is TRUE, it will create a rotation that aligns the x and y-axis with the closest orthogonal axes to right and up.doubleSbDPViewVolume::getWorldToScreenScale(constSbVec3d&worldCenter,doublenormRadius)constGiven a sphere with center inworldCenterand an initial radius of1.0, return the scale factor needed to make this sphere have anormRadiusradius when projected onto the near clipping plane.SbVec2dSbDPViewVolume::projectBox(constSbBox3f&box)constProjects the given box onto the projection plane and returns the normalized screen space it occupies.SbDPViewVolumeSbDPViewVolume::narrow(doubleleft,doublebottom,doubleright,doubletop)constReturns a narrowed version of the view volume which is within the given [0, 1] normalized coordinates. The coordinates are taken to be corner points of a normalized 'view window' on the near clipping plane. I.e.: SbDPViewVolume view; view.ortho(0, 100, 0, 100, 0.1, 1000); view = view.narrow(0.25, 0.5, 0.75, 1.0); ..will give a view volume with corner points <25, 75> and <50, 100>.SeeAlso:scale(),scaleWidth(),scaleHeight()SbDPViewVolumeSbDPViewVolume::narrow(constSbBox3f&box)constReturns a narrowed version of the view volume which is within the given [0, 1] normalized coordinates. The box x and y coordinates are taken to be corner points of a normalized 'view window' on the near clipping plane. The box z coordinates are used to adjust the near and far clipping planes, and should be relative to the current clipping planes. A value of 1.0 is at the current near plane. A value of 0.0 is at the current far plane.voidSbDPViewVolume::ortho(doubleleft,doubleright,doublebottom,doubletop,doublenearval,doublefarval)Set up the view volume as a rectangular box for orthographic parallel projections. The line of sight will be along the negative z axis, through the center of the plane defined by the point <(right+left)/2, (top+bottom)/2, 0>.SeeAlso:perspective().voidSbDPViewVolume::perspective(doublefovy,doubleaspect,doublenearval,doublefarval)Set up the view volume for perspective projections. The line of sight will be through origo along the negative z axis.SeeAlso:ortho().voidSbDPViewVolume::frustum(doubleleft,doubleright,doublebottom,doubletop,doublenearval,doublefarval)Set up the frustum for perspective projection. This is an alternative toperspective()that lets you specify any kind of view volumes (e.g. off center volumes). It has the same arguments and functionality as the corresponding OpenGL glFrustum() function.SeeAlso:perspective()voidSbDPViewVolume::rotateCamera(constSbDPRotation&q)Rotate the direction which the camera is pointing in.SeeAlso:translateCamera().voidSbDPViewVolume::translateCamera(constSbVec3d&v)Translate the camera position of the view volume.SeeAlso:rotateCamera().SbVec3dSbDPViewVolume::zVector(void)constReturn the vector pointing from the center of the view volume towards the camera. This is just the vector pointing in the opposite direction ofgetProjectionDirection().SeeAlso:getProjectionDirection().SbDPViewVolumeSbDPViewVolume::zNarrow(doublenearval,doublefarval)constReturn a copySbDPViewVolumewith narrowed depth by supplying parameters for new near and far clipping planes.nearvaland should be relative to the current clipping planes. A value of 1.0 is at the current near plane. A value of 0.0 is at the current far plane.SeeAlso:zVector().voidSbDPViewVolume::scale(doublefactor)Scale width and height of viewing frustum by the given ratio around the projection plane center axis.SeeAlso:scaleWidth(),scaleHeight().voidSbDPViewVolume::scaleWidth(doubleratio)Scale width of viewing frustum by the given ratio around the vertical center axis in the projection plane.SeeAlso:scale(),scaleHeight().voidSbDPViewVolume::scaleHeight(doubleratio)Scale height of viewing frustum by the given ratio around the horizontal center axis in the projection plane.SeeAlso:scale(),scaleWidth().SbDPViewVolume::ProjectionTypeSbDPViewVolume::getProjectionType(void)constReturn current view volume projection type, which can be eitherORTHOGRAPHICorPERSPECTIVE.SeeAlso:SbDPViewVolume::ProjectionTypeconstSbVec3d&SbDPViewVolume::getProjectionPoint(void)constReturns coordinates of center point in the projection plane.constSbVec3d&SbDPViewVolume::getProjectionDirection(void)constReturns the direction of projection, i.e. the direction the camera is pointing.SeeAlso:getNearDist().doubleSbDPViewVolume::getNearDist(void)constReturns distance from projection plane to near clipping plane.SeeAlso:getProjectionDirection().doubleSbDPViewVolume::getWidth(void)constReturns width of viewing frustum in the projection plane.SeeAlso:getHeight(),getDepth().doubleSbDPViewVolume::getHeight(void)constReturns height of viewing frustum in the projection plane.SeeAlso:getWidth(),getDepth().doubleSbDPViewVolume::getDepth(void)constReturns depth of viewing frustum, i.e. the distance from the near clipping plane to the far clipping plane.SeeAlso:getWidth(),getHeight().voidSbDPViewVolume::print(FILE*fp)constDump the state of this object to thefilestream. Only works in debug version of library, method does nothing in an optimized compile.voidSbDPViewVolume::getViewVolumePlanes(SbPlaneplanes[6])constReturns the six planes defining the view volume in the following order: left, bottom, right, top, near, far. Plane normals are directed into the view volume. This method is an extension for Coin, and is not available in the original Open Inventor.voidSbDPViewVolume::transform(constSbDPMatrix&matrix)Transform the viewing volume bymatrix.SbVec3dSbDPViewVolume::getViewUp(void)constReturns the view up vector for this view volume. It's a vector which is perpendicular to the projection direction, and parallel and oriented in the same direction as the vector from the lower left corner to the upper left corner of the near plane.

**Author**

Generated automatically by Doxygen for Coin from the source code.