SbPlane.h Source File

| http://www.sim.no/ http://www.coin3d.org/

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

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
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) const;
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
SbBox2d::operator!=
int operator!=(const SbBox2d &b1, const SbBox2d &b2)
Definition: SbBox2d.h:92
SbBox2d::operator==
int operator==(const SbBox2d &b1, const SbBox2d &b2)
Definition: SbBox2d.h:88
SbVec3f
The SbVec3f class is a 3 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec3f.h:40
SbLine
The SbLine class represents a line in 3D space.SbLine provides a way of specifying a directed line...
Definition: SbLine.h:32
SbMatrix
The SbMatrix class is a 4x4 dimensional representation of a matrix.SbMatrix is used by many other cla...
Definition: SbMatrix.h:37
SbPlane
The SbPlane class represents a plane in 3D space.SbDPPlane is used by many other classes in Coin...
Definition: SbPlane.h:34

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