| 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) by Kongsberg Oil & Gas Technologies.
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 Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, 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/tools/SbLazyPimplPtr.h>
30 #include <Inventor/SbViewportRegion.h>
31 #include <Inventor/SbBox3f.h>
32 #include <Inventor/SbXfBox3f.h>
33
34 class SoGetBoundingBoxActionP;
35
36 class COIN_DLL_API SoGetBoundingBoxAction : public SoAction {
37 typedef SoAction inherited;
38
39 SO_ACTION_HEADER(SoGetBoundingBoxAction);
40
41 public:
42 static void initClass(void);
43
44 SoGetBoundingBoxAction(const SbViewportRegion & vp);
45 virtual ~SoGetBoundingBoxAction(void);
46
47 enum ResetType { TRANSFORM = 0x1, BBOX = 0x2, ALL = TRANSFORM | BBOX };
48
49 void setViewportRegion(const SbViewportRegion & newregion);
50 const SbViewportRegion & getViewportRegion(void) const;
51
52 SbBox3f getBoundingBox(void) const;
53 SbXfBox3f & getXfBoundingBox(void);
54
55 const SbVec3f & getCenter(void) const;
56
57 void setInCameraSpace(const SbBool flag);
58 SbBool isInCameraSpace(void) const;
59
60 void setResetPath(const SoPath * path, const SbBool resetbefore = TRUE,
61 const ResetType what = ALL);
62 const SoPath * getResetPath(void) const;
63 SbBool isResetPath(void) const;
64 SbBool isResetBefore(void) const;
65 SoGetBoundingBoxAction::ResetType getWhatReset(void) const;
66
67
68 void checkResetBefore(void);
69 void checkResetAfter(void);
70
71 void extendBy(const SbBox3f & box);
72 void extendBy(const SbXfBox3f & box);
73
74 void setCenter(const SbVec3f & center, const SbBool transformcenter);
75 SbBool isCenterSet(void) const;
76 void resetCenter(void);
77
78 protected:
79 virtual void beginTraversal(SoNode * node);
80
81 private:
82 enum { CENTER_SET = 0x1, CAMERA_SPACE = 0x2, RESET_BEFORE= 0x4 };
83
84 SbXfBox3f bbox;
85 SbVec3f center;
86 SbViewportRegion vpregion;
87 ResetType resettype;
88 const SoPath * resetpath;
89 unsigned int flags;
90
91 private:
92 SbLazyPimplPtr<SoGetBoundingBoxActionP> pimpl;
93
94 SoGetBoundingBoxAction(const SoGetBoundingBoxAction & rhs);
95 SoGetBoundingBoxAction & operator = (const SoGetBoundingBoxAction & rhs);
96 }; // SoGetBoundingBoxAction
97
98 #endif // !COIN_SOGETBOUNDINGBOXACTION_H
SoAction::initClass
static void initClass(void)
Definition: SoAction.cpp:366
SbBox3f
The SbBox3f class is an abstraction for an axis aligned 3 dimensional box.This box abstraction class ...
Definition: SbBox3f.h:37
SoNode
The SoNode class is the base class for nodes used in scene graphs.Coin is a retained mode 3D visualiz...
Definition: SoNode.h:47
SbXfBox3f
The SbXfBox3f class is a 3 dimensional box with floating point coordinates and an attached transforma...
Definition: SbXfBox3f.h:31
SoPath
The SoPath class is a container class for traversal path descriptions.SoPath objects contain a list o...
Definition: SoPath.h:43
SoAction
The SoAction class is the base class for all traversal actions.Applying actions is the basic mechanis...
Definition: SoAction.h:68
SbVec3f
The SbVec3f class is a 3 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec3f.h:40
SoGetBoundingBoxAction::ResetType
ResetType
Definition: SoGetBoundingBoxAction.h:47
SoGetBoundingBoxAction
The SoGetBoundingBoxAction class calculates bounding boxes for nodes and subgraphs.If this action is applied to a path or scene graph root, it will calculate the bounding box and the center point of the geometry contained within the scene.
Definition: SoGetBoundingBoxAction.h:36
SoAction::beginTraversal
virtual void beginTraversal(SoNode *node)
Definition: SoAction.cpp:1263
SbViewportRegion
The SbViewportRegion class is a viewport within a full window.The SbViewportRegion class contains inf...
Definition: SbViewportRegion.h:31

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.