$search
00001 /* 00002 * Copyright (C) 2008 00003 * Robert Bosch LLC 00004 * Research and Technology Center North America 00005 * Palo Alto, California 00006 * 00007 * All rights reserved. 00008 * 00009 *------------------------------------------------------------------------------ 00010 * project ....: PUMA: Probablistic Unsupervised Model Acquisition 00011 * file .......: MeshSet3D.h 00012 * authors ....: Benjamin Pitzer 00013 * organization: Robert Bosch LLC 00014 * creation ...: 02/29/2008 00015 * modified ...: $Date:2008-03-03 10:26:02 -0800 (Mon, 03 Mar 2008) $ 00016 * changed by .: $Author:benjaminpitzer $ 00017 * revision ...: $Revision:141 $ 00018 */ 00019 #ifndef MESHSET3D_H 00020 #define MESHSET3D_H 00021 00022 //== INCLUDES ================================================================== 00023 #include <vector> 00024 #include <iostream> 00025 #include <rtc/rtcIOObject.h> 00026 #include "rtc/rtcMesh3D.h" 00027 00028 //== NAMESPACES ================================================================ 00029 namespace rtc { 00030 #define MESHSET3D_HAS_AABB 0x01 00031 00032 //== TYPE DECLARATIONS ========================================================= 00033 typedef std::vector<Mesh3D*> VecMesh3D; 00034 00035 //== CLASS DEFINITION ========================================================== 00036 class MeshSet3D : public IOObject 00037 { 00038 public: 00039 using IOObject::writeToFile; 00040 using IOObject::readFromFile; 00041 00042 // standard c'tor and d'tor 00043 MeshSet3D(); 00044 MeshSet3D(const MeshSet3D& other); 00045 const MeshSet3D &operator=(const MeshSet3D& other); 00046 ~MeshSet3D(); 00047 00048 // Accessors 00049 int numMeshes() const; 00050 00051 // Mutators 00052 void clear(); 00053 void set(const MeshSet3D& other); 00054 // updates the normals in all meshes 00055 void updateNormals(); 00056 00057 // flags 00058 void setFlag(int flag, bool value); 00059 bool getFlag(int flag) const; 00060 bool hasAABB() const; 00061 00062 // stream IO 00063 virtual bool write(OutputHandler &oh) const; 00064 virtual bool read(InputHandler &ih); 00065 void write(FILE *fp) const; 00066 void read(FILE *fp); 00067 bool writeToFile( const char* filename ) const; 00068 bool readFromFile( const char* filename ); 00069 00070 00071 void loadToGPU(); 00072 void unloadGPU(); 00073 00074 // Protected Data 00075 int flags; 00076 VecMesh3D meshes; 00077 Point3Df topleft,bottomright; 00078 }; 00079 00080 //============================================================================== 00081 } // NAMESPACE rtc 00082 //============================================================================== 00083 #endif // MESHSET3D_H defined 00084 //==============================================================================