Point Cloud Library (PCL) 1.15.0
Loading...
Searching...
No Matches
opennurbs_box.h
1/* $NoKeywords: $ */
2/*
3//
4// Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
5// OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
6// McNeel & Associates.
7//
8// THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
9// ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
10// MERCHANTABILITY ARE HEREBY DISCLAIMED.
11//
12// For complete openNURBS copyright information see <http://www.opennurbs.org>.
13//
14////////////////////////////////////////////////////////////////
15*/
16
17#if !defined(ON_BOX_INC_)
18#define ON_BOX_INC_
19
20class ON_CLASS ON_Box
21{
22public:
24 // intervals are finite and increasing when the box is valid
28
30 ON_Box( const ON_BoundingBox& bbox );
32
33 bool IsValid() const;
34
35 bool Create( const ON_BoundingBox& bbox );
36
37 void Destroy();
38
40 bool GetCorners( ON_3dPoint* corners ) const;
41 bool GetCorners( ON_SimpleArray<ON_3dPoint>& corners ) const;
42
44
46 double r,
47 double s,
48 double t
49 ) const;
50
52 ON_3dPoint point,
53 double* r,
54 double* s,
55 double* t
56 ) const;
57
58 // returns point on box that is closest to given point
60 ON_3dPoint test_point
61 ) const;
62
63 // rotate sphere about its origin
64 bool Rotate(
65 double sin_angle, // sin(angle)
66 double cos_angle, // cos(angle)
67 const ON_3dVector& axis_of_rotation // axis of rotation
68 );
69
70 bool Rotate(
71 double angle_radians, // angle in radians
72 const ON_3dVector& axis_of_rotation // axis of rotation
73 );
74
75 // rotate sphere about a point and axis
76 bool Rotate(
77 double sin_angle, // sin(angle)
78 double cos_angle, // cos(angle)
79 const ON_3dVector& axis_of_rotation, // axis of rotation
80 const ON_3dPoint& center_of_rotation // center of rotation
81 );
82
83 bool Rotate(
84 double angle_radians, // angle in radians
85 const ON_3dVector& axis_of_rotation, // axis of rotation
86 const ON_3dPoint& center_of_rotation // center of rotation
87 );
88
90 const ON_3dVector&
91 );
92
93 bool Transform( const ON_Xform& );
94
95 /*
96 Description:
97 Test the box to see if it is degenerate (flat)
98 in one or more directions.
99 Parameters:
100 tolerance - [in] Distances <= tolerance will be considered
101 to be zero. If tolerance is negative (default), then
102 a scale invarient tolerance is used.
103 Returns:
104 @untitled table
105 0 box is not degenerate
106 1 box is a rectangle (degenerate in one direction)
107 2 box is a line (degenerate in two directions)
108 3 box is a point (degenerate in three directions)
109 4 box is not valid
110 */
112 double tolerance = ON_UNSET_VALUE
113 ) const;
114
115 double Volume() const;
116
117 double Area() const;
118};
119
120#endif
bool Rotate(double sin_angle, double cos_angle, const ON_3dVector &axis_of_rotation, const ON_3dPoint &center_of_rotation)
ON_Interval dy
ON_Interval dx
bool IsValid() const
double Volume() const
bool Rotate(double angle_radians, const ON_3dVector &axis_of_rotation, const ON_3dPoint &center_of_rotation)
bool Rotate(double sin_angle, double cos_angle, const ON_3dVector &axis_of_rotation)
bool Translate(const ON_3dVector &)
ON_3dPoint PointAt(double r, double s, double t) const
ON_Box(const ON_BoundingBox &bbox)
double Area() const
void Destroy()
bool ClosestPointTo(ON_3dPoint point, double *r, double *s, double *t) const
bool GetCorners(ON_3dPoint *corners) const
bool Transform(const ON_Xform &)
ON_BoundingBox BoundingBox() const
int IsDegenerate(double tolerance=ON_UNSET_VALUE) const
ON_3dPoint ClosestPointTo(ON_3dPoint test_point) const
ON_Plane plane
ON_Interval dz
bool Rotate(double angle_radians, const ON_3dVector &axis_of_rotation)
bool Create(const ON_BoundingBox &bbox)
bool GetCorners(ON_SimpleArray< ON_3dPoint > &corners) const
ON_3dPoint Center() const