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) 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 SbLine;
32 class SbMatrix;
33 
34 class COIN_DLL_API SbPlane {
35 public:
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);
54 
55 private:
56  SbVec3f normal;
57  float distance;
58 };
59 
60 COIN_DLL_API int operator ==(const SbPlane& p1, const SbPlane& p2);
61 COIN_DLL_API int operator !=(const SbPlane& p1, const SbPlane& p2);
62 
63 #endif // !COIN_SBPLANE_H
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition: SbVec3f.h:37
The SbLine class represents a line in 3D space.SbLine provides a way of specifying a directed line...
Definition: SbLine.h:32
The SbMatrix class is a 4x4 dimensional representation of a matrix.SbMatrix is used by many other cla...
Definition: SbMatrix.h:37
The SbPlane class represents a plane in 3D space.SbPlane is used by many other classes in Coin...
Definition: SbPlane.h:34

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

Generated on Fri Feb 17 2017 for Coin by Doxygen. 1.8.13