Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
SoGetBoundingBoxAction(3IV)()			 SoGetBoundingBoxAction(3IV)()

NAME
       SoGetBoundingBoxAction -- computes bounding box of a scene

INHERITS FROM
       SoAction	> SoGetBoundingBoxAction

SYNOPSIS
       #include	<Inventor/actions/SoGetBoundingBoxAction.h>

     enum ResetType {
	  SoGetBoundingBoxAction::TRANSFORM
				       Transformation
	  SoGetBoundingBoxAction::BBOX Bounding	Box
	  SoGetBoundingBoxAction::ALL  Both Transform and Bounding Box
     }

	  Methods from class SoGetBoundingBoxAction:

			       SoGetBoundingBoxAction(const   SbViewportRegion
				    &viewportRegion)
     void		       setViewportRegion(const	      SbViewportRegion
				    &newRegion)
     const SbViewportRegion &  getViewportRegion() const
     SbBox3f		       getBoundingBox()	const
     SbXfBox3f &	       getXfBoundingBox()
     const SbVec3f &	       getCenter() const
     void		       setInCameraSpace(SbBool flag)
     SbBool		       isInCameraSpace() const
     void		       setResetPath(const  SoPath *path, SbBool	reset-
				    Before = TRUE, ResetType what = ALL)
     const SoPath *	       getResetPath() const
     SbBool		       isResetPath() const
     SbBool		       isResetBefore() const
     SoGetBoundingBoxAction::ResetType
			       getWhatReset() const

	  Methods from class SoAction:

     virtual void	 apply(SoNode *node)
     virtual void	 apply(SoPath *path)
     virtual void	 apply(const SoPathList	&pathList, SbBool obeysRules =
			      FALSE)
     static SoType	 getClassTypeId()
     virtual SoType	 getTypeId()
     virtual SbBool	 isOfType(SoType type)
     virtual void	 invalidateState()

DESCRIPTION
       This  class  is used to compute a 3D bounding box enclosing objects de-
       fined by	a scene	graph. The box is a rectangular	prism. The action also
       computes	 the  center point, which is defined differently for different
       objects.	(For example, the center of an SoFaceSet is the	average	of its
       vertices' coordinates.) For a group, the	center point is	defined	as the
       average of the centers of all shapes in it.

       Each bounding box is calculated as a SbXfBox3f, where  the  transforma-
       tion  matrix  is	 defined so that the bounding box can be stored	in the
       object space of the SoShape. When two bounding boxes are	combined by  a
       group  node,  the combination is	performed so as	to produce the smaller
       untransformed box. The result of	the calculation	by the action  can  be
       returned	as an SbXfBox3f	or as a	world-space-aligned SbBox3f.

       To calculate the	bounding box of	a subgraph bounded by two paths, spec-
       ify the left edge of the	subgraph with setResetPath(),  and  apply  the
       action to the path that defines the right edge of the subgraph. The ac-
       cumulated bounding box and transformation will be reset when  the  tail
       of the reset path is traversed.

       If  the	subgraph  being	traversed does not contain any shapes, the re-
       turned bounding box will	be empty (that is, box.isEmpty()  will	return
       TRUE).

METHODS
			       SoGetBoundingBoxAction(const   SbViewportRegion
				    &viewportRegion)
	  Constructor takes viewport region to use for	picking.  Even	though
	  the  bounding	 box computation may not involve a window per se, some
	  nodes	need this information to determine their size and placement.

     void		       setViewportRegion(const	      SbViewportRegion
				    &newRegion)
     const SbViewportRegion &  getViewportRegion() const
	  Sets/returns current viewport	region to use for action.

     SbBox3f		       getBoundingBox()	const
	  Returns computed bounding box	in world space.

     SbXfBox3f &	       getXfBoundingBox()
	  Returns  computed  bounding  box  before  transformation  into world
	  space.

     const SbVec3f &	       getCenter() const
	  Returns computed center point	in world space.

     void		       setInCameraSpace(SbBool flag)
	  Set this flag	to TRUE	if you want the	returned bounding box to be in
	  the  space  of  whatever camera is in	the graph. Camera space	is de-
	  fined	to have	the viewpoint at the origin,  with  the	 direction  of
	  view	along the negative z axis. This	space can be used to determine
	  distances of objects from the	camera.

     SbBool		       isInCameraSpace() const
	  Returns camera space flag.

     void		       setResetPath(const SoPath *path,	SbBool	reset-
				    Before = TRUE, ResetType what = ALL)
	  If  a	non-NULL path is specified, the	action will reset the computed
	  bounding box to be empty and/or the current transformation to	 iden-
	  tity.	 The  resetBefore  flag	indicates whether to perform the reset
	  before or after the tail node	of the path is traversed.

     const SoPath *	       getResetPath() const
	  Returns the current reset path, or NULL.

     SbBool		       isResetPath() const
	  Returns TRUE if the current reset path is not	NULL.

     SbBool		       isResetBefore() const
	  Returns TRUE if the resetBefore flag was  specified  for  the	 reset
	  path.

     SoGetBoundingBoxAction::ResetType
			       getWhatReset() const
	  Returns what flags were specified to be reset	for the	reset path.

SEE ALSO
       SbBox3f,	SbXfBox3f, SoGetMatrixAction

						 SoGetBoundingBoxAction(3IV)()

NAME | INHERITS FROM | SYNOPSIS | DESCRIPTION | METHODS | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=SoGetBoundingBoxAction&sektion=3iv&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help