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

SbDPPlane.h
1#ifndef COIN_SBDPPLANE_H
2#define COIN_SBDPPLANE_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/SbVec3d.h>
30
31class SbDPLine;
32class SbDPMatrix;
33
34class COIN_DLL_API SbDPPlane {
35public:
36 SbDPPlane(void);
37 SbDPPlane(const SbVec3d & normal, const double D);
38 SbDPPlane(const SbVec3d & p0, const SbVec3d & p1, const SbVec3d & p2);
39 SbDPPlane(const SbVec3d & normal, const SbVec3d & point);
40
41 void offset(const double d);
42 SbBool intersect(const SbDPLine & l, SbVec3d & intersection) const;
43 void transform(const SbDPMatrix & matrix);
44 SbBool isInHalfSpace(const SbVec3d & point) const;
45 double getDistance(const SbVec3d & point) const;
46 const SbVec3d & getNormal(void) const;
47 double getDistanceFromOrigin(void) const;
48 friend COIN_DLL_API int operator ==(const SbDPPlane & p1, const SbDPPlane & p2);
49 friend COIN_DLL_API int operator !=(const SbDPPlane & p1, const SbDPPlane & p2);
50
51 void print(FILE * file) const;
52
53 SbBool intersect(const SbDPPlane & pl, SbDPLine & line) const;
54
55private:
56 SbVec3d normal;
57 double distance;
58};
59
60COIN_DLL_API int operator ==(const SbDPPlane & p1, const SbDPPlane & p2);
61COIN_DLL_API int operator !=(const SbDPPlane & p1, const SbDPPlane & p2);
62
63#endif // !COIN_SBPLANE_H
The SbDPLine class represents a line in 3D space.
Definition SbDPLine.h:32
The SbDPMatrix class is a 4x4 dimensional representation of a double-precision matrix.
Definition SbDPMatrix.h:38
The SbVec3d class is a 3 dimensional vector with double precision floating point coordinates.
Definition SbVec3d.h:39

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

Generated on Wed Jul 17 2024 for Coin by Doxygen 1.12.0.