00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Cristin Barghiel 00008 * Side Effects Software Inc. 00009 * 20 Maud St. 00010 * Toronto, Ontario, M5V 2M5 00011 * Canada 00012 * 416-366-4607 00013 * 00014 * NAME: Geometry Library (C++) 00015 * 00016 * COMMENTS: 00017 * 00018 */ 00019 00020 #ifndef __GD_Point_H__ 00021 #define __GD_Point_H__ 00022 00023 #include "GD_API.h" 00024 #include <iostream.h> 00025 #include <UT/UT_Vector3.h> 00026 #include <GB/GB_Element.h> 00027 00028 class GD_API GD_Point : public GB_Element 00029 { 00030 public: 00031 // Class constructors and destructors. 00032 GD_Point() : GB_Element() { myPos.assign(0,0,1); } 00033 GD_Point(const UT_Vector3 &pos) : GB_Element() { myPos = pos; } 00034 virtual ~GD_Point(); 00035 00036 void copy(const GD_Point &src) { myPos = src.myPos; } 00037 00038 UT_Vector3 &getPos() { return myPos; } 00039 const UT_Vector3 &getPos() const { return myPos; } 00040 00041 virtual int isPrimary(void) const; 00042 00043 // Express this point in homogeneous coordinates or vice-versa: 00044 void homogenize (void) { myPos.homogenize(); } 00045 void dehomogenize(void) { myPos.dehomogenize(); } 00046 00047 // I/O methods: 00048 int save(ostream &os, int binary) const; 00049 bool load(UT_IStream &is); 00050 00051 private: 00052 UT_Vector3 myPos; // Position of the point (homogeneous coords) 00053 }; 00054 00055 #endif
1.5.9