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

SbPlane.h
1#ifndef COIN_SBPLANE_H
2#define COIN_SBPLANE_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 <stdio.h>
28
29#include <Inventor/SbVec3f.h>
30
31class SbLine;
32class SbMatrix;
33
34class COIN_DLL_API SbPlane {
35public:
36 SbPlane(void);
37 SbPlane(const SbVec3f& normal, const float D);
38 SbPlane(const SbVec3f& p0, const SbVec3f& p1, const SbVec3f& p2);
39 SbPlane(const SbVec3f& normal, const SbVec3f& point);
40
41 void offset(const float d);
42 SbBool intersect(const SbLine& l, SbVec3f& intersection) const;
43 void transform(const SbMatrix& matrix);
44 SbBool isInHalfSpace(const SbVec3f& point) const;
45 float getDistance(const SbVec3f &point) const;
46 const SbVec3f& getNormal(void) const;
47 float getDistanceFromOrigin(void) const;
48 friend COIN_DLL_API int operator ==(const SbPlane& p1, const SbPlane& p2);
49 friend COIN_DLL_API int operator !=(const SbPlane& p1, const SbPlane& p2);
50
51 void print(FILE * file) const;
52
53 SbBool intersect(const SbPlane & pl, SbLine & line) const;
54
55private:
56 SbVec3f normal;
57 float distance;
58};
59
60COIN_DLL_API int operator ==(const SbPlane& p1, const SbPlane& p2);
61COIN_DLL_API int operator !=(const SbPlane& p1, const SbPlane& p2);
62
63#endif // !COIN_SBPLANE_H
The SbLine class represents a line in 3D space.
Definition SbLine.h:32
The SbMatrix class is a 4x4 dimensional representation of a matrix.
Definition SbMatrix.h:37
The SbPlane class represents a plane in 3D space.
Definition SbPlane.h:34
void print(FILE *file) const
Definition SbPlane.cpp:368
SbBool intersect(const SbLine &l, SbVec3f &intersection) const
Definition SbPlane.cpp:153
SbPlane(void)
Definition SbPlane.cpp:51
float getDistanceFromOrigin(void) const
Definition SbPlane.cpp:270
void offset(const float d)
Definition SbPlane.cpp:139
float getDistance(const SbVec3f &point) const
Definition SbPlane.cpp:243
void transform(const SbMatrix &matrix)
Definition SbPlane.cpp:204
SbBool isInHalfSpace(const SbVec3f &point) const
Definition SbPlane.cpp:230
const SbVec3f & getNormal(void) const
Definition SbPlane.cpp:258
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition SbVec3f.h:40

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

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