opennurbs_box.h
Go to the documentation of this file.
00001 /* $NoKeywords: $ */
00002 /*
00003 //
00004 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
00005 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
00006 // McNeel & Associates.
00007 //
00008 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
00009 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
00010 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
00011 //                              
00012 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
00013 //
00015 */
00016 
00017 #if !defined(ON_BOX_INC_)
00018 #define ON_BOX_INC_
00019 
00020 class ON_CLASS ON_Box
00021 {
00022 public:
00023   ON_Plane plane; 
00024   // intervals are finite and increasing when the box is valid
00025   ON_Interval dx;
00026   ON_Interval dy;
00027   ON_Interval dz;
00028 
00029   ON_Box();
00030   ON_Box( const ON_BoundingBox& bbox );
00031   ~ON_Box();
00032 
00033   bool IsValid() const;
00034 
00035   bool Create( const ON_BoundingBox& bbox );
00036 
00037   void Destroy();
00038 
00039   ON_3dPoint Center() const;
00040   bool GetCorners( ON_3dPoint* corners ) const;
00041   bool GetCorners( ON_SimpleArray<ON_3dPoint>& corners ) const;
00042 
00043   ON_BoundingBox BoundingBox() const;
00044 
00045   ON_3dPoint PointAt( 
00046           double r, 
00047           double s, 
00048           double t 
00049           ) const;
00050 
00051   bool ClosestPointTo( 
00052           ON_3dPoint point, 
00053           double* r, 
00054           double* s, 
00055           double* t 
00056           ) const;
00057 
00058   // returns point on box that is closest to given point
00059   ON_3dPoint ClosestPointTo( 
00060          ON_3dPoint test_point
00061          ) const;
00062 
00063   // rotate sphere about its origin
00064   bool Rotate(
00065         double sin_angle,               // sin(angle)
00066         double cos_angle,               // cos(angle)
00067         const ON_3dVector& axis_of_rotation // axis of rotation
00068         );
00069 
00070   bool Rotate(
00071         double angle_radians,               // angle in radians
00072         const ON_3dVector& axis_of_rotation // axis of rotation
00073         );
00074 
00075   // rotate sphere about a point and axis
00076   bool Rotate(
00077         double sin_angle,               // sin(angle)
00078         double cos_angle,               // cos(angle)
00079         const ON_3dVector& axis_of_rotation, // axis of rotation
00080         const ON_3dPoint& center_of_rotation  // center of rotation
00081         );
00082 
00083   bool Rotate(
00084         double angle_radians,               // angle in radians
00085         const ON_3dVector& axis_of_rotation, // axis of rotation
00086         const ON_3dPoint& center_of_rotation  // center of rotation
00087         );
00088 
00089   bool Translate(
00090         const ON_3dVector&
00091         );
00092 
00093   bool Transform( const ON_Xform& );
00094 
00095   /*
00096   Description:
00097     Test the box to see if it is degenerate (flat)
00098     in one or more directions.
00099   Parameters:
00100     tolerance - [in] Distances <= tolerance will be considered
00101         to be zero.  If tolerance is negative (default), then
00102         a scale invarient tolerance is used.
00103   Returns:
00104     @untitled table
00105     0     box is not degenerate
00106     1     box is a rectangle (degenerate in one direction)
00107     2     box is a line (degenerate in two directions)
00108     3     box is a point (degenerate in three directions)
00109     4     box is not valid
00110   */
00111   int IsDegenerate( 
00112     double tolerance = ON_UNSET_VALUE
00113     ) const;
00114 
00115   double Volume() const;
00116 
00117   double Area() const;
00118 };
00119 
00120 #endif


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:27:00