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

SbSphere.h
1#ifndef COIN_SBSPHERE_H
2#define COIN_SBSPHERE_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#include <Inventor/SbVec3f.h>
29
30class SbLine;
31class SbBox3f;
32
33class COIN_DLL_API SbSphere {
34public:
35 SbSphere(void);
36 SbSphere(const SbVec3f & center, const float radius);
37 void setValue(const SbVec3f & center, const float radius);
38 void setCenter(const SbVec3f & center);
39 void setRadius(const float radius);
40 const SbVec3f & getCenter(void) const;
41 float getRadius(void) const;
42 void circumscribe(const SbBox3f & box);
43 SbBool intersect(const SbLine & l, SbVec3f & intersection) const;
44 SbBool intersect(const SbLine & l, SbVec3f & enter, SbVec3f & exit) const;
45 SbBool pointInside(const SbVec3f & p) const;
46
47 void print(FILE * file) const;
48
49private:
50 SbVec3f center;
51 float radius;
52};
53
54#endif // !COIN_SBSPHERE_H
The SbBox3f class is an abstraction for an axis aligned 3 dimensional box.
Definition SbBox3f.h:37
The SbLine class represents a line in 3D space.
Definition SbLine.h:32
void setRadius(const float radius)
Definition SbSphere.cpp:98
void setCenter(const SbVec3f &center)
Definition SbSphere.cpp:87
void circumscribe(const SbBox3f &box)
Definition SbSphere.cpp:136
SbBool pointInside(const SbVec3f &p) const
Definition SbSphere.cpp:237
SbSphere(void)
Definition SbSphere.cpp:46
float getRadius(void) const
Definition SbSphere.cpp:125
void setValue(const SbVec3f &center, const float radius)
Definition SbSphere.cpp:70
void print(FILE *file) const
Definition SbSphere.cpp:247
const SbVec3f & getCenter(void) const
Definition SbSphere.cpp:114
SbBool intersect(const SbLine &l, SbVec3f &intersection) const
Definition SbSphere.cpp:161
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition SbVec3f.h:37

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

Generated on Wed Jul 23 2025 for Coin by Doxygen. 1.14.0