Coin Logo http://www.sim.no
http://www.coin3d.org

SoGetBoundingBoxAction.h
1 #ifndef COIN_SOGETBOUNDINGBOXACTION_H
2 #define COIN_SOGETBOUNDINGBOXACTION_H
3 
4 /**************************************************************************\
5  *
6  * This file is part of the Coin 3D visualization library.
7  * Copyright (C) 1998-2007 by Systems in Motion. All rights reserved.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * ("GPL") version 2 as published by the Free Software Foundation.
12  * See the file LICENSE.GPL at the root directory of this source
13  * distribution for additional information about the GNU GPL.
14  *
15  * For using Coin with software that can not be combined with the GNU
16  * GPL, and for taking advantage of the additional benefits of our
17  * support services, please contact Systems in Motion about acquiring
18  * a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
23  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24  *
25 \**************************************************************************/
26 
27 #include <Inventor/actions/SoAction.h>
28 #include <Inventor/actions/SoSubAction.h>
29 #include <Inventor/SbViewportRegion.h>
30 #include <Inventor/SbBox3f.h>
31 #include <Inventor/SbXfBox3f.h>
32 
33 
34 class COIN_DLL_API SoGetBoundingBoxAction : public SoAction {
35  typedef SoAction inherited;
36 
37  SO_ACTION_HEADER(SoGetBoundingBoxAction);
38 
39 public:
41  virtual ~SoGetBoundingBoxAction();
42 
43  static void initClass(void);
44 
45  enum ResetType { TRANSFORM = 0x1, BBOX = 0x2, ALL = TRANSFORM | BBOX };
46 
47  void setViewportRegion(const SbViewportRegion & newregion);
48  const SbViewportRegion & getViewportRegion(void) const;
49 
50  SbBox3f getBoundingBox(void) const;
51  SbXfBox3f & getXfBoundingBox(void);
52 
53  const SbVec3f & getCenter(void) const;
54 
55  void setInCameraSpace(const SbBool flag);
56  SbBool isInCameraSpace(void) const;
57 
58  void setResetPath(const SoPath * path, const SbBool resetbefore = TRUE,
59  const ResetType what = ALL);
60  const SoPath * getResetPath(void) const;
61  SbBool isResetPath(void) const;
62  SbBool isResetBefore(void) const;
63  SoGetBoundingBoxAction::ResetType getWhatReset(void) const;
64 
65 
66  void checkResetBefore(void);
67  void checkResetAfter(void);
68 
69  void extendBy(const SbBox3f & box);
70  void extendBy(const SbXfBox3f & box);
71 
72  void setCenter(const SbVec3f & center, const SbBool transformcenter);
73  SbBool isCenterSet(void) const;
74  void resetCenter(void);
75 
76 protected:
77  virtual void beginTraversal(SoNode * node);
78 
79 private:
80  enum { CENTER_SET = 0x1, CAMERA_SPACE = 0x2, RESET_BEFORE= 0x4 };
81 
82  SbXfBox3f bbox;
83  SbVec3f center;
84  SbViewportRegion vpregion;
85  ResetType resettype;
86  const SoPath * resetpath;
87  unsigned int flags;
88 };
89 
90 #endif // !COIN_SOGETBOUNDINGBOXACTION_H
SoGetBoundingBoxAction::isResetPath
SbBool isResetPath(void) const
Definition: SoGetBoundingBoxAction.cpp:401
SoGetBoundingBoxAction::setViewportRegion
void setViewportRegion(const SbViewportRegion &newregion)
Definition: SoGetBoundingBoxAction.cpp:289
SbMatrix
The SbMatrix class is a 4x4 dimensional representation of a matrix.
Definition: SbMatrix.h:37
SbXfBox3f::setTransform
void setTransform(const SbMatrix &m)
Definition: SbXfBox3f.cpp:125
SoGetBoundingBoxAction::setCenter
void setCenter(const SbVec3f &center, const SbBool transformcenter)
Definition: SoGetBoundingBoxAction.cpp:529
SoGetBoundingBoxAction::isInCameraSpace
SbBool isInCameraSpace(void) const
Definition: SoGetBoundingBoxAction.cpp:359
SoGetBoundingBoxAction::resetCenter
void resetCenter(void)
Definition: SoGetBoundingBoxAction.cpp:571
SoGetBoundingBoxAction::beginTraversal
virtual void beginTraversal(SoNode *node)
Definition: SoGetBoundingBoxAction.cpp:580
SbMatrix::multVecMatrix
void multVecMatrix(const SbVec3f &src, SbVec3f &dst) const
Definition: SbMatrix.cpp:1357
SoAction::beginTraversal
virtual void beginTraversal(SoNode *node)
Definition: SoAction.cpp:1208
SoGetBoundingBoxAction::getXfBoundingBox
SbXfBox3f & getXfBoundingBox(void)
Definition: SoGetBoundingBoxAction.cpp:317
SbBox3f
The SbBox3f class is an abstraction for an axis aligned 3 dimensional box.
Definition: SbBox3f.h:37
SoAction::getCurPath
const SoPath * getCurPath(void)
Definition: SoAction.cpp:1044
SoDebugError::postWarning
static void postWarning(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:324
SoAction
The SoAction class is the base class for all traversal actions.
Definition: SoAction.h:67
SbXfBox3f::project
SbBox3f project(void) const
Definition: SbXfBox3f.cpp:649
SoGetBoundingBoxAction::SoGetBoundingBoxAction
SoGetBoundingBoxAction(const SbViewportRegion &vp)
Definition: SoGetBoundingBoxAction.cpp:265
SoFullPath
The SoFullPath class allows examination of hidden children in paths.
Definition: SoFullPath.h:29
SoGetBoundingBoxAction::getCenter
const SbVec3f & getCenter(void) const
Definition: SoGetBoundingBoxAction.cpp:332
SoGetBoundingBoxAction::getWhatReset
SoGetBoundingBoxAction::ResetType getWhatReset(void) const
Definition: SoGetBoundingBoxAction.cpp:424
SoGetBoundingBoxAction::~SoGetBoundingBoxAction
virtual ~SoGetBoundingBoxAction()
Definition: SoGetBoundingBoxAction.cpp:278
SbXfBox3f
The SbXfBox3f class is a 3 dimensional box with floating point coordinates and an attached transforma...
Definition: SbXfBox3f.h:31
SbMatrix::multRight
SbMatrix & multRight(const SbMatrix &m)
Definition: SbMatrix.cpp:1240
SoFullPath::getTail
SoNode * getTail(void) const
Definition: SoFullPath.cpp:74
SoPath::containsPath
SbBool containsPath(const SoPath *const path) const
Definition: SoPath.cpp:611
SbXfBox3f::transform
void transform(const SbMatrix &m)
Definition: SbXfBox3f.cpp:116
SoPath
The SoPath class is a container class for traversal path descriptions.
Definition: SoPath.h:43
SoDebugError::postInfo
static void postInfo(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:334
SoGetBoundingBoxAction::checkResetAfter
void checkResetAfter(void)
Definition: SoGetBoundingBoxAction.cpp:458
SbBox3f::makeEmpty
void makeEmpty(void)
Definition: SbBox3f.cpp:424
SoGetBoundingBoxAction::getViewportRegion
const SbViewportRegion & getViewportRegion(void) const
Definition: SoGetBoundingBoxAction.cpp:298
SbVec3f::setValue
SbVec3f & setValue(const float v[3])
Definition: SbVec3f.cpp:461
SoAction::getState
SoState * getState(void) const
Definition: SoAction.cpp:1028
SoGetBoundingBoxAction::checkResetBefore
void checkResetBefore(void)
Definition: SoGetBoundingBoxAction.cpp:434
SbVec3f
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition: SbVec3f.h:37
SoGetBoundingBoxAction::setInCameraSpace
void setInCameraSpace(const SbBool flag)
Definition: SoGetBoundingBoxAction.cpp:349
SoGetBoundingBoxAction
The SoGetBoundingBoxAction class calculates bounding boxes for nodes and subgraphs.
Definition: SoGetBoundingBoxAction.h:34
SoGetBoundingBoxAction::isCenterSet
SbBool isCenterSet(void) const
Definition: SoGetBoundingBoxAction.cpp:561
SoGetBoundingBoxAction::isResetBefore
SbBool isResetBefore(void) const
Definition: SoGetBoundingBoxAction.cpp:413
SbViewportRegion
The SbViewportRegion class is a viewport within a full window.
Definition: SbViewportRegion.h:31
SbXfBox3f::extendBy
void extendBy(const SbVec3f &pt)
Definition: SbXfBox3f.cpp:169
SoGetBoundingBoxAction::getResetPath
const SoPath * getResetPath(void) const
Definition: SoGetBoundingBoxAction.cpp:390
SoAction::initClass
static void initClass(void)
Definition: SoAction.cpp:392
SoGetBoundingBoxAction::getBoundingBox
SbBox3f getBoundingBox(void) const
Definition: SoGetBoundingBoxAction.cpp:307
SoGetBoundingBoxAction::extendBy
void extendBy(const SbBox3f &box)
Definition: SoGetBoundingBoxAction.cpp:485
SoNode
The SoNode class is the base class for nodes used in scene graphs.
Definition: SoNode.h:47
SoGetBoundingBoxAction::ResetType
ResetType
Definition: SoGetBoundingBoxAction.h:45
SbMatrix::identity
static SbMatrix identity(void)
Definition: SbMatrix.cpp:748
SbBox3f::isEmpty
SbBool isEmpty(void) const
Definition: SbBox3f.cpp:436
SoGetBoundingBoxAction::setResetPath
void setResetPath(const SoPath *path, const SbBool resetbefore=1, const ResetType what=ALL)
Definition: SoGetBoundingBoxAction.cpp:374
SoAction::state
SoState * state
Definition: SoAction.h:132

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Mon Jul 27 2020 for Coin by Doxygen. 1.8.18