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