SCIRun
5.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
Core
GeometryPrimitives
Plane.h
Go to the documentation of this file.
1
/*
2
For more information, please see: http://software.sci.utah.edu
3
4
The MIT License
5
6
Copyright (c) 2009 Scientific Computing and Imaging Institute,
7
University of Utah.
8
9
10
Permission is hereby granted, free of charge, to any person obtaining a
11
copy of this software and associated documentation files (the "Software"),
12
to deal in the Software without restriction, including without limitation
13
the rights to use, copy, modify, merge, publish, distribute, sublicense,
14
and/or sell copies of the Software, and to permit persons to whom the
15
Software is furnished to do so, subject to the following conditions:
16
17
The above copyright notice and this permission notice shall be included
18
in all copies or substantial portions of the Software.
19
20
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26
DEALINGS IN THE SOFTWARE.
27
*/
28
29
/// @todo Documentation Core/GeometryPrimitives/Plane.h
30
31
#ifndef CORE_GEOMETRY_PLANE_H
32
#define CORE_GEOMETRY_PLANE_H 1
33
34
#include <
Core/GeometryPrimitives/Point.h
>
35
#include <
Core/GeometryPrimitives/Vector.h
>
36
37
#include <
Core/GeometryPrimitives/share.h
>
38
39
namespace
SCIRun {
40
namespace
Core {
41
namespace
Geometry {
42
43
class
Point;
44
class
SCISHARE
Plane
{
45
private
:
46
Vector
n
;
47
double
d;
48
49
public
:
50
Plane
(
const
Plane
©);
51
Plane
(
const
Point
&p1,
const
Point
&p2,
const
Point
&p3);
52
Plane
(
const
Point
&p,
const
Vector
&
n
);
53
Plane
(
const
Vector
& normal,
double
distance);
54
Plane
();
55
Plane
(
double
a,
double
b,
double
c,
double
d);
56
~
Plane
();
57
58
double
eval_point(
const
Point
&p)
const
;
59
void
flip();
60
Point
project(
const
Point
& p)
const
;
61
Vector
project(
const
Vector
&
v
)
const
;
62
Vector
normal()
const
;
63
double
distance()
const
;
64
void
get
(double (&abcd)[4])
const
;
65
66
// Not a great ==, doesnt take into account for floating point error.
67
bool
operator==
(
const
Plane
&rhs)
const
;
68
// changes the plane ( n and d )
69
70
void
ChangePlane(
const
Point
&p1,
const
Point
&p2,
const
Point
&p3 );
71
void
ChangePlane(
const
Point
&p1,
const
Vector
&v);
72
73
// returns true if the line v*t+s for -inf < t < inf intersects
74
// the plane. if so, hit contains the point of intersection.
75
76
int
Intersect(
const
Point
& s,
const
Vector
& v,
Point
& hit )
const
;
77
int
Intersect(
const
Point
& s,
const
Vector
& v,
double
&t )
const
;
78
};
79
80
}}}
81
82
83
#endif
Point.h
Vector.h
SCIRun::Core::Geometry::Point
Definition:
Point.h:49
SCISHARE
#define SCISHARE
Definition:
share.h:39
share.h
SCIRun::Core::Geometry::Vector
Definition:
Vector.h:63
SCIRun::Core::Geometry::Plane
Definition:
Plane.h:44
readAllFields.v
v
Definition:
readAllFields.py:42
eab.n
int n
Definition:
eab.py:9
SCIRun::Core::Geometry::operator==
SCISHARE bool operator==(const Point &p1, const Point &p2)
Definition:
Point.cc:44
Generated on Wed Jul 9 2014 14:31:48 for SCIRun by
1.8.5