Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00015
00016
00017 #include "pcl/surface/3rdparty/opennurbs/opennurbs.h"
00018
00019 ON_OBJECT_IMPLEMENT( ON_Point, ON_Geometry, "C3101A1D-F157-11d3-BFE7-0010830122F0" );
00020
00021 ON_BOOL32 ON_Point::IsValid( ON_TextLog* text_log ) const
00022 {
00023 bool rc = point.IsValid();
00024 if ( !rc && text_log )
00025 {
00026 text_log->Print("ON_Point::point is not a valid 3d point.\n");
00027 }
00028 return rc;
00029 }
00030
00031 void ON_Point::Dump( ON_TextLog& dump ) const
00032 {
00033 dump.Print("ON_Point: ");
00034 dump.Print(point);
00035 dump.Print("\n");
00036 }
00037
00038 ON_BOOL32 ON_Point::Write( ON_BinaryArchive& file ) const
00039 {
00040 ON_BOOL32 rc = file.Write3dmChunkVersion(1,0);
00041 if (rc) rc = file.WritePoint( point );
00042 return rc;
00043 }
00044
00045 ON_BOOL32 ON_Point::Read( ON_BinaryArchive& file )
00046 {
00047 int major_version = 0;
00048 int minor_version = 0;
00049 ON_BOOL32 rc = file.Read3dmChunkVersion(&major_version,&minor_version);
00050 if (rc && major_version==1) {
00051
00052 rc = file.ReadPoint(point);
00053 }
00054 return rc;
00055 }
00056
00057 ON::object_type ON_Point::ObjectType() const
00058 {
00059 return ON::point_object;
00060 }
00061
00062 int ON_Point::Dimension() const
00063 {
00064 return 3;
00065 }
00066
00067 ON_BOOL32 ON_Point::GetBBox( double* boxmin, double* boxmax, ON_BOOL32 bGrowBox ) const
00068 {
00069 return ON_GetPointListBoundingBox( 3, 0, 1, 3, &point.x, boxmin, boxmax, bGrowBox?true:false );
00070 }
00071
00072 bool ON_Point::IsDeformable() const
00073 {
00074 return true;
00075 }
00076
00077 bool ON_Point::MakeDeformable()
00078 {
00079 return true;
00080 }
00081
00082 ON_BOOL32 ON_Point::Transform( const ON_Xform& xform )
00083 {
00084 TransformUserData(xform);
00085 return ON_TransformPointList(3,0,1,3,&point.x,xform);
00086 }
00087
00088 ON_BOOL32 ON_Point::SwapCoordinates( int i, int j )
00089 {
00090 return ON_SwapPointListCoordinates( 1, 3, &point.x, i, j );
00091 }
00092
00093 ON_Point::ON_Point() : point(0.0,0.0,0.0)
00094 {}
00095
00096 ON_Point::ON_Point(const ON_Point& src) : ON_Geometry(src), point(src.point)
00097 {}
00098
00099 ON_Point::ON_Point(const ON_3dPoint& pt) : point(pt)
00100 {}
00101
00102 ON_Point::ON_Point(double x,double y,double z) : point(x,y,z)
00103 {}
00104
00105 ON_Point::~ON_Point()
00106 {}
00107
00108 ON_Point& ON_Point::operator=(const ON_Point& src)
00109 {
00110 if ( this != &src ) {
00111 ON_Geometry::operator=(src);
00112 point=src.point;
00113 }
00114 return *this;
00115 }
00116
00117 ON_Point& ON_Point::operator=(const ON_3dPoint& pt)
00118 {
00119 point=pt;
00120 return *this;
00121 }
00122
00123 ON_Point::operator double*()
00124 {
00125 return &point.x;
00126 }
00127
00128 ON_Point::operator const double*() const
00129 {
00130 return &point.x;
00131 }
00132
00133 ON_Point::operator ON_3dPoint*()
00134 {
00135 return &point;
00136 }
00137
00138 ON_Point::operator const ON_3dPoint*() const
00139 {
00140 return &point;
00141 }
00142
00143 ON_Point::operator ON_3dPoint&()
00144 {
00145 return point;
00146 }
00147
00148 ON_Point::operator const ON_3dPoint&() const
00149 {
00150 return point;
00151 }