Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

mitkOoCTriangleMesh.h

00001 /*=========================================================================
00002 
00003   Program:   3DMed
00004   Date:      $Date: 2014-02-25 18:30:00 +0800 $
00005   Version:   $Version: 4.6.0 $
00006   Copyright: MIPG, Institute of Automation, Chinese Academy of Sciences
00007 
00008 =========================================================================*/
00009 
00010 
00011 #ifndef __mitkOoCTriangleMesh_h
00012 #define __mitkOoCTriangleMesh_h
00013 
00014 #include "mitkTriangleMesh.h"
00015 
00016 class VertexStorage;
00017 class FaceStorage;
00018 
00025 class MITK_COMMON_API mitkOoCTriangleMesh : public mitkTriangleMesh
00026 {
00027 public:
00028     MITK_TYPE(mitkOoCTriangleMesh, mitkTriangleMesh)
00029 
00030     virtual void PrintSelf(ostream &os);
00031 
00035     mitkOoCTriangleMesh();
00036 
00041     void SetVertexBlockSize(unsigned int vn);
00042 
00047     void SetFaceBlockSize(unsigned int fn);
00048 
00053     virtual int GetDataObjectType() const {return MITK_OOC_TRIANGLE_MESH;};
00054 
00058     virtual void Initialize();
00059 
00064     virtual unsigned long long GetActualMemorySize() const;
00065 
00070     virtual void ShallowCopy(mitkDataObject *src);
00071 
00076     virtual void DeepCopy(mitkDataObject *src);
00077 
00082     virtual void SetVertexNumber(size_type number) {}
00083 
00088     virtual void SetFaceNumber(size_type number) {}
00089 
00099     virtual float* GetVertexData() { return NULL; }
00100 
00110     virtual index_type* GetFaceData() { return NULL; }
00111 
00115     virtual void ReverseNormals();
00116 
00122     virtual bool TestClockwise();
00123 
00131     void SetVertexBufferSize(size_type s);
00132 
00140     void SetFaceBufferSize(size_type s);
00141 
00149     void SetBufferedVertexBlockNum(unsigned int n);
00150 
00155     unsigned int GetBufferedVertexBlockNum();
00156 
00164     void SetBufferedFaceBlockNum(unsigned int n);
00165 
00170     unsigned int GetBufferedFaceBlockNum();
00171 
00176     void SetPathOfDiskBuffer(char const *path);
00177 
00183     char const* GetPathOfDiskBuffer();
00184 
00185 protected:
00186     virtual ~mitkOoCTriangleMesh();
00187 
00188     virtual index_type _addVertex(Vertex3f &vert);
00189     virtual index_type _addFace(unsigned int num, index_type *verts);
00190     virtual Vertex3f const* _getVertex(index_type vertIdx);
00191     virtual index_type const* _getFace(index_type faceIdx);
00192     virtual Vertex3f* _getVertexForWrite(index_type vertIdx);
00193     virtual index_type* _getFaceForWrite(index_type faceIdx);
00194     virtual size_type _getVertices(index_type startIdx, size_type num, Vertex3f *verts);
00195     virtual size_type _getTriangleFaces(index_type startIdx, size_type num, TriangleFace *faces);
00196     virtual size_type _getTriangleFaces(index_type startIdx, size_type num, Vertex3f *verts);
00197 
00198     //helper to test triangle orientation 
00199     Orientation _testOrientation(index_type faceIdx);
00200 
00201     void _flushVertexTempBuffer();
00202     void _flushFaceTempBuffer();
00203     void _flushTempBuffer();
00204 
00205 
00206     VertexStorage *m_VertStor;
00207     FaceStorage *m_FaceStor;
00208 
00209     index_type m_CurVertBlkIdx;
00210     index_type m_CurFaceBlkIdx;
00211     Vertex3f *m_CurVertBlk;
00212     TriangleFace *m_CurFaceBlk;
00213 
00214     size_type m_VertBlkSize;
00215     size_type m_FaceBlkSize;
00216 
00217     index_type m_VertIdxMask;
00218     unsigned int m_VertIdxLen;
00219     index_type m_VertBlkMask;
00220     index_type m_FaceIdxMask;
00221     unsigned int m_FaceIdxLen;
00222     index_type m_FaceBlkMask;
00223 
00224 private:
00225     mitkOoCTriangleMesh(const mitkOoCTriangleMesh&);
00226     void operator = (const mitkOoCTriangleMesh&);
00227 
00228 };
00229 
00230 
00231 //#define DEFINED_mitkOoCTriangleMesh
00232 
00233 
00234 
00235 #endif
00236 

Generated on Tue Feb 25 15:00:37 2014 for MITK (Medical Imaging ToolKit) by  doxygen 1.4.3