00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __mitkHEOoCTriangleMesh_h
00012 #define __mitkHEOoCTriangleMesh_h
00013
00014 #include "mitkHETriangleMesh.h"
00015
00016 class HEVertexStorage;
00017 class HEEdgeStorage;
00018 class HEFaceStorage;
00019
00027 class MITK_COMMON_API mitkHEOoCTriangleMesh : public mitkHETriangleMesh
00028 {
00029 public:
00030 MITK_TYPE(mitkHEOoCTriangleMesh, mitkHETriangleMesh)
00031
00032 virtual void PrintSelf(ostream &os);
00033
00037 mitkHEOoCTriangleMesh();
00038
00043 void SetVertexBlockSize(unsigned int vn);
00044
00049 void SetEdgeBlockSize(unsigned int en);
00050
00055 void SetFaceBlockSize(unsigned int fn);
00056
00064 void SetVertexBufferSize(size_type s);
00065
00073 void SetEdgeBufferSize(size_type s);
00074
00082 void SetFaceBufferSize(size_type s);
00083
00091 void SetBufferedVertexBlockNum(unsigned int n);
00092
00097 unsigned int GetBufferedVertexBlockNum();
00098
00106 void SetBufferedEdgeBlockNum(unsigned int n);
00107
00112 unsigned int GetBufferedEdgeBlockNum();
00113
00121 void SetBufferedFaceBlockNum(unsigned int n);
00122
00127 unsigned int GetBufferedFaceBlockNum();
00128
00133 void SetPathOfDiskBuffer(char const *path);
00134
00140 char const* GetPathOfDiskBuffer();
00141
00146 virtual int GetDataObjectType() const { return MITK_HE_OOC_TRIANGLE_MESH; }
00147
00151 virtual void Initialize();
00152
00157 virtual unsigned long long GetActualMemorySize() const;
00158
00163 virtual void ShallowCopy(mitkDataObject *src);
00164
00169 virtual void DeepCopy(mitkDataObject *src);
00170
00177 virtual void SetVertexNumber(size_type number);
00178
00185 virtual void SetFaceNumber(size_type number);
00186
00192 virtual Vertex& GetVertex(VertexHandle v) const;
00193
00199 virtual Edge& GetEdge(EdgeHandle e) const;
00200
00207 virtual Edge& GetEdge(HalfEdgeHandle he) const;
00208
00214 virtual HalfEdge& GetHalfEdge(HalfEdgeHandle he) const;
00215
00221 virtual Face& GetFace(FaceHandle f) const;
00222
00228 virtual Vertex const& GetVertexForRead(VertexHandle v) const;
00229
00235 virtual Edge const& GetEdgeForRead(EdgeHandle e) const;
00236
00243 virtual Edge const& GetEdgeForRead(HalfEdgeHandle he) const;
00244
00250 virtual HalfEdge const& GetHalfEdgeForRead(HalfEdgeHandle he) const;
00251
00257 virtual Face const& GetFaceForRead(FaceHandle f) const;
00258
00264 virtual VertexHandle GetHandle(Vertex const &vert) const;
00265
00271 virtual EdgeHandle GetHandle(Edge const &edge) const;
00272
00278 virtual HalfEdgeHandle GetHandle(HalfEdge const &he) const
00279 { return this->PairHalfEdge(he.pairHalfEdge); }
00280
00286 virtual FaceHandle GetHandle(Face const &face) const;
00287
00297 virtual float* GetVertexData() { return NULL; }
00298
00308 virtual index_type* GetFaceData() { return NULL; }
00309
00310 protected:
00311 virtual ~mitkHEOoCTriangleMesh();
00312
00313 virtual size_type _getVertices(index_type startIdx, size_type num, Vertex3f *verts);
00314 virtual size_type _getTriangleFaces(index_type startIdx, size_type num, TriangleFace *faces);
00315 virtual size_type _getTriangleFaces(index_type startIdx, size_type num, Vertex3f *verts);
00316
00317
00318
00319 virtual VertexHandle _addNewVertex(float x, float y, float z,
00320 float nx = 0.0f, float ny = 0.0f, float nz = 0.0f,
00321 HalfEdgeHandle edge = HalfEdgeHandle());
00322 virtual HalfEdgeHandle _addNewEdge(VertexHandle start, VertexHandle end);
00323 virtual FaceHandle _addNewFace(HalfEdgeHandle halfedge = HalfEdgeHandle());
00324
00325
00326 virtual void _clearDeletedVertices();
00327 virtual void _clearDeletedEdges();
00328 virtual void _clearDeletedFaces();
00329
00330 size_type _getVertexBlock(index_type blkIdx, Vertex3f *verts);
00331 size_type _getTriangleFaceBlock(index_type blkIdx, TriangleFace *faces);
00332 size_type _getTriangleFaceBlock(index_type blkIdx, Vertex3f *verts);
00333
00334 HEVertexStorage *m_VertStor;
00335 HEEdgeStorage *m_EdgeStor;
00336 HEFaceStorage *m_FaceStor;
00337
00338 size_type m_VertBlkSize;
00339 size_type m_EdgeBlkSize;
00340 size_type m_FaceBlkSize;
00341
00342 index_type m_VertIdxMask;
00343 unsigned int m_VertIdxLen;
00344 index_type m_VertBlkMask;
00345 index_type m_EdgeIdxMask;
00346 unsigned int m_EdgeIdxLen;
00347 index_type m_EdgeBlkMask;
00348 index_type m_FaceIdxMask;
00349 unsigned int m_FaceIdxLen;
00350 index_type m_FaceBlkMask;
00351
00352
00353 private:
00354 mitkHEOoCTriangleMesh(const mitkHEOoCTriangleMesh&);
00355 void operator = (const mitkHEOoCTriangleMesh&);
00356
00357 };
00358
00359 #endif
00360