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

SbBox3f.h
1 #ifndef COIN_SBBOX3F_H
2 #define COIN_SBBOX3F_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 <stdio.h>
28 
29 #include <Inventor/SbVec3f.h>
30 
31 class SbBox3d;
32 class SbBox3i32;
33 class SbBox3s;
34 
35 class SbMatrix;
36 
37 class COIN_DLL_API SbBox3f {
38 public:
39  SbBox3f(void);
40  SbBox3f(const float minx, const float miny, const float minz,
41  const float maxx, const float maxy, const float maxz);
42  SbBox3f(const SbVec3f & min, const SbVec3f & max);
43  explicit SbBox3f(const SbBox3d & box) { setBounds(box); }
44  explicit SbBox3f(const SbBox3s & box) { setBounds(box); }
45  explicit SbBox3f(const SbBox3i32 & box) { setBounds(box); }
46  ~SbBox3f();
47 
48  void setBounds(const float minx, const float miny, const float minz,
49  const float maxx, const float maxy, const float maxz);
50  void setBounds(const SbVec3f & min, const SbVec3f & max);
51  SbBox3f & setBounds(const SbBox3d & box);
52  SbBox3f & setBounds(const SbBox3s & box);
53  SbBox3f & setBounds(const SbBox3i32 & box);
54 
55  void getBounds(float & minx, float & miny, float & minz,
56  float & maxx, float & maxy, float & maxz) const;
57  void getBounds(SbVec3f & min, SbVec3f & max) const;
58 
59  const SbVec3f & getMin(void) const;
60  SbVec3f & getMin(void);
61  const SbVec3f & getMax(void) const;
62  SbVec3f & getMax(void);
63 
64  void extendBy(const SbVec3f & point);
65  void extendBy(const SbBox3f & box);
66  void transform(const SbMatrix & matrix);
67  void makeEmpty(void);
68  SbBool isEmpty(void) const;
69  SbBool hasVolume(void) const;
70  float getVolume(void) const;
71 
72  SbBool intersect(const SbVec3f & point) const;
73  SbBool intersect(const SbBox3f & box) const;
74  SbVec3f getClosestPoint(const SbVec3f & point) const;
75  SbBool outside(const SbMatrix & mvp, int & cullbits) const;
76 
77  SbVec3f getCenter(void) const;
78  void getOrigin(float & x0, float & y0, float & z0) const;
79  void getSize(float & dx, float & dy, float & dz) const;
80 
81  void getSpan(const SbVec3f & dir, float & dmin, float & dmax) const;
82 
83  friend COIN_DLL_API int operator ==(const SbBox3f & b1, const SbBox3f & b2);
84  friend COIN_DLL_API int operator !=(const SbBox3f & b1, const SbBox3f & b2);
85 
86  void print(FILE * file) const;
87 
88 private:
89  SbVec3f min, max;
90 };
91 
92 COIN_DLL_API int operator ==(const SbBox3f & b1, const SbBox3f & b2);
93 COIN_DLL_API int operator !=(const SbBox3f & b1, const SbBox3f & b2);
94 
95 #endif // !COIN_SBBOX3F_H
SbBox3f::getBounds
void getBounds(float &minx, float &miny, float &minz, float &maxx, float &maxy, float &maxz) const
Definition: SbBox3f.cpp:371
SbBox3f::SbBox3f
SbBox3f(const SbBox3i32 &box)
Definition: SbBox3f.h:45
SbBox3d::isEmpty
SbBool isEmpty(void) const
Definition: SbBox3d.h:70
SbBox3f::getSpan
void getSpan(const SbVec3f &dir, float &dmin, float &dmax) const
Definition: SbBox3f.cpp:476
SbBox3f::getClosestPoint
SbVec3f getClosestPoint(const SbVec3f &point) const
Definition: SbBox3f.cpp:636
SbBox3f::SbBox3f
SbBox3f(const SbBox3d &box)
Definition: SbBox3f.h:43
SbMatrix
The SbMatrix class is a 4x4 dimensional representation of a matrix.
Definition: SbMatrix.h:37
SbBox3f::getCenter
SbVec3f getCenter(void) const
Definition: SbBox3f.cpp:161
SbMatrix::multVecMatrix
void multVecMatrix(const SbVec3f &src, SbVec3f &dst) const
Definition: SbMatrix.cpp:1357
SbBox3f::getMin
const SbVec3f & getMin(void) const
Definition: SbBox3f.cpp:122
SbBox3f
The SbBox3f class is an abstraction for an axis aligned 3 dimensional box.
Definition: SbBox3f.h:37
SoDebugError::postWarning
static void postWarning(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:324
SbBox3d::getMin
const SbVec3d & getMin(void) const
Definition: SbBox3d.h:61
SbBox3s::getMin
const SbVec3s & getMin(void) const
Definition: SbBox3s.cpp:168
SbBox3i32::getMin
const SbVec3i32 & getMin(void) const
Definition: SbBox3i32.h:59
SbBox3s
The SbBox3s class is a 3 dimensional box with short integer coordinates.
Definition: SbBox3s.h:34
SbBox3f::hasVolume
SbBool hasVolume(void) const
Definition: SbBox3f.cpp:446
SbBox3f::~SbBox3f
~SbBox3f()
Definition: SbBox3f.cpp:111
SbBox3f::getMax
const SbVec3f & getMax(void) const
Definition: SbBox3f.cpp:134
SbBox3f::print
void print(FILE *file) const
Definition: SbBox3f.cpp:554
SbBox3s::getMax
const SbVec3s & getMax(void) const
Definition: SbBox3s.cpp:189
SbBox3f::getOrigin
void getOrigin(float &x0, float &y0, float &z0) const
Definition: SbBox3f.cpp:396
SbBox3f::makeEmpty
void makeEmpty(void)
Definition: SbBox3f.cpp:424
SbVec3f::setValue
SbVec3f & setValue(const float v[3])
Definition: SbVec3f.cpp:461
SbBox3f::outside
SbBool outside(const SbMatrix &mvp, int &cullbits) const
Definition: SbBox3f.cpp:599
SbBox2i32::operator!=
int operator!=(const SbBox2i32 &b1, const SbBox2i32 &b2)
Definition: SbBox2i32.h:91
SbBox3s::isEmpty
SbBool isEmpty(void) const
Definition: SbBox3s.h:58
SbVec3f
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition: SbVec3f.h:37
SbBox3f::setBounds
void setBounds(const float minx, const float miny, const float minz, const float maxx, const float maxy, const float maxz)
Definition: SbBox3f.cpp:260
SbBox3f::getSize
void getSize(float &dx, float &dy, float &dz) const
Definition: SbBox3f.cpp:405
SbVec3f::dot
float dot(const SbVec3f &v) const
Definition: SbVec3f.cpp:282
SbVec3f::normalize
float normalize(void)
Definition: SbVec3f.cpp:436
SbVec3f::print
void print(FILE *fp) const
Definition: SbVec3f.cpp:761
SbBox3f::getVolume
float getVolume(void) const
Definition: SbBox3f.cpp:458
SbBox3i32
Definition: SbBox3i32.h:35
SbBox3i32::getMax
const SbVec3i32 & getMax(void) const
Definition: SbBox3i32.h:61
SbBox3f::SbBox3f
SbBox3f(const SbBox3s &box)
Definition: SbBox3f.h:44
SbBox3d
The SbBox3d class is an abstraction for an axis aligned 3 dimensional box.
Definition: SbBox3d.h:37
SbBox3i32::isEmpty
SbBool isEmpty(void) const
Definition: SbBox3i32.h:69
SbBox3f::transform
void transform(const SbMatrix &matrix)
Definition: SbBox3f.cpp:524
SbVec3f::getValue
const float * getValue(void) const
Definition: SbVec3f.cpp:334
SbBox3d::getMax
const SbVec3d & getMax(void) const
Definition: SbBox3d.h:63
SbBox3f::intersect
SbBool intersect(const SbVec3f &point) const
Definition: SbBox3f.cpp:224
SbBox2i32::operator==
int operator==(const SbBox2i32 &b1, const SbBox2i32 &b2)
Definition: SbBox2i32.h:87
SbBox3f::extendBy
void extendBy(const SbVec3f &point)
Definition: SbBox3f.cpp:178
SbBox3f::SbBox3f
SbBox3f(void)
Definition: SbBox3f.cpp:51
SbBox3f::isEmpty
SbBool isEmpty(void) const
Definition: SbBox3f.cpp:436

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

Generated on Wed Jul 24 2019 for Coin by Doxygen. 1.8.17