Commit 333c45d8 authored by Sylvain Thery's avatar Sylvain Thery

resolve some problems in marching-cube

parent 4f6dd032
...@@ -121,17 +121,17 @@ protected: ...@@ -121,17 +121,17 @@ protected:
/** /**
* position of the first slice in image * position of the first slice in image
*/ */
int32 m_lZpos; int m_lZpos;
/** /**
* width of slice * width of slice
*/ */
int32 m_lWidth; int m_lWidth;
/** /**
* heigth of slice * heigth of slice
*/ */
int32 m_lHeight; int m_lHeight;
public: public:
...@@ -142,15 +142,15 @@ public: ...@@ -142,15 +142,15 @@ public:
* @param _lWidth the width of image to buffer * @param _lWidth the width of image to buffer
* @param _lHeight the height of image to buffer * @param _lHeight the height of image to buffer
*/ */
Buffer(int32 _lWidth, int32 _lHeight); Buffer(int _lWidth, int _lHeight);
~Buffer(); ~Buffer();
/** /**
* @name Function to store the index of a point on edge O..11 of a cube * @name Function to store the index of a point on edge O..11 of a cube
* @param int32 _lX coordinate of the cube * @param int _lX coordinate of the cube
* @param int32 _lY coordinate of the cube * @param int _lY coordinate of the cube
* @param int32 _lPoint the index of the point * @param int _lPoint the index of the point
*/ */
//@{ //@{
/** /**
...@@ -159,26 +159,26 @@ public: ...@@ -159,26 +159,26 @@ public:
* @param _lY coordinate of the cube * @param _lY coordinate of the cube
* @param _lPoint the embedding * @param _lPoint the embedding
*/ */
void setPointEdge0 (int32 _lX,int32 _lY, unsigned int _lPoint); void setPointEdge0 (int _lX,int _lY, unsigned int _lPoint);
void setPointEdge1 (int32 _lX,int32 _lY, unsigned int _lPoint); void setPointEdge1 (int _lX,int _lY, unsigned int _lPoint);
void setPointEdge2 (int32 _lX,int32 _lY, unsigned int _lPoint); void setPointEdge2 (int _lX,int _lY, unsigned int _lPoint);
void setPointEdge3 (int32 _lX,int32 _lY, unsigned int _lPoint); void setPointEdge3 (int _lX,int _lY, unsigned int _lPoint);
void setPointEdge4 (int32 _lX,int32 _lY, unsigned int _lPoint); void setPointEdge4 (int _lX,int _lY, unsigned int _lPoint);
void setPointEdge5 (int32 _lX,int32 _lY, unsigned int _lPoint); void setPointEdge5 (int _lX,int _lY, unsigned int _lPoint);
void setPointEdge6 (int32 _lX,int32 _lY, unsigned int _lPoint); void setPointEdge6 (int _lX,int _lY, unsigned int _lPoint);
void setPointEdge7 (int32 _lX,int32 _lY, unsigned int _lPoint); void setPointEdge7 (int _lX,int _lY, unsigned int _lPoint);
void setPointEdge8 (int32 _lX,int32 _lY, unsigned int _lPoint); void setPointEdge8 (int _lX,int _lY, unsigned int _lPoint);
void setPointEdge9 (int32 _lX,int32 _lY, unsigned int _lPoint); void setPointEdge9 (int _lX,int _lY, unsigned int _lPoint);
void setPointEdge10(int32 _lX,int32 _lY, unsigned int _lPoint); void setPointEdge10(int _lX,int _lY, unsigned int _lPoint);
void setPointEdge11(int32 _lX,int32 _lY, unsigned int _lPoint); void setPointEdge11(int _lX,int _lY, unsigned int _lPoint);
//@} //@}
/** /**
* @name Function to get the index of point store on edge O..11 of a cube * @name Function to get the index of point store on edge O..11 of a cube
**************************************************** ****************************************************
* @param int32 _lX coordinate of the cube * @param int _lX coordinate of the cube
* @param int32 _lY coordinate of the cube * @param int _lY coordinate of the cube
* @param int32 _lPoint the index of the point * @param int _lPoint the index of the point
*/ */
//@{ //@{
/** /**
...@@ -188,18 +188,18 @@ public: ...@@ -188,18 +188,18 @@ public:
* @param _lY coordinate of the cube * @param _lY coordinate of the cube
* @return the index of the point * @return the index of the point
*/ */
unsigned int getPointEdge0 (int32 _lX,int32 _lY); unsigned int getPointEdge0 (int _lX,int _lY);
unsigned int getPointEdge1 (int32 _lX,int32 _lY); unsigned int getPointEdge1 (int _lX,int _lY);
unsigned int getPointEdge2 (int32 _lX,int32 _lY); unsigned int getPointEdge2 (int _lX,int _lY);
unsigned int getPointEdge3 (int32 _lX,int32 _lY); unsigned int getPointEdge3 (int _lX,int _lY);
unsigned int getPointEdge4 (int32 _lX,int32 _lY); unsigned int getPointEdge4 (int _lX,int _lY);
unsigned int getPointEdge5 (int32 _lX,int32 _lY); unsigned int getPointEdge5 (int _lX,int _lY);
unsigned int getPointEdge6 (int32 _lX,int32 _lY); unsigned int getPointEdge6 (int _lX,int _lY);
unsigned int getPointEdge7 (int32 _lX,int32 _lY); unsigned int getPointEdge7 (int _lX,int _lY);
unsigned int getPointEdge8 (int32 _lX,int32 _lY); unsigned int getPointEdge8 (int _lX,int _lY);
unsigned int getPointEdge9 (int32 _lX,int32 _lY); unsigned int getPointEdge9 (int _lX,int _lY);
unsigned int getPointEdge10(int32 _lX,int32 _lY); unsigned int getPointEdge10(int _lX,int _lY);
unsigned int getPointEdge11(int32 _lX,int32 _lY); unsigned int getPointEdge11(int _lX,int _lY);
//@} //@}
/** /**
...@@ -209,7 +209,7 @@ public: ...@@ -209,7 +209,7 @@ public:
* @param _lY y coordinate of cube * @param _lY y coordinate of cube
* @return table of faces * @return table of faces
*/ */
DART* getFacesCubeTableAdr(int32 _lX,int32 _lY); DART* getFacesCubeTableAdr(int _lX,int _lY);
/** /**
* get dart table of faces stored on edge O..11 of a cube * get dart table of faces stored on edge O..11 of a cube
...@@ -219,7 +219,7 @@ public: ...@@ -219,7 +219,7 @@ public:
* @param _lZ z coordinate of the cube * @param _lZ z coordinate of the cube
* @return table of faces * @return table of faces
*/ */
const DART* getFacesCube(int32 _lX,int32 _lY,int32 _lZ) const; const DART* getFacesCube(int _lX,int _lY,int _lZ) const;
/** /**
...@@ -229,7 +229,7 @@ public: ...@@ -229,7 +229,7 @@ public:
* @param _lY y coordinate of the cube * @param _lY y coordinate of the cube
* @param _lFace table of faces index * @param _lFace table of faces index
*/ */
void setFacesCube(int32 _lX,int32 _lY, const DART* const _lFace); void setFacesCube(int _lX,int _lY, const DART* const _lFace);
/** /**
...@@ -246,7 +246,7 @@ public: ...@@ -246,7 +246,7 @@ public:
* @param _lNeighbour neighbour to store * @param _lNeighbour neighbour to store
*/ */
void setExternalNeighbour(int8 _cEdge, int32 _lX, int32 _lY, DART _lNeighbour); void setExternalNeighbour(char _cEdge, int _lX, int _lY, DART _lNeighbour);
/** /**
* get neighbour stored on edge O..11 of a cube * get neighbour stored on edge O..11 of a cube
...@@ -256,7 +256,7 @@ public: ...@@ -256,7 +256,7 @@ public:
* @param _lY y coordinate of the cube * @param _lY y coordinate of the cube
* @return the neighbour * @return the neighbour
*/ */
DART getExternalNeighbour(int8 _cEdge, int32 _lX, int32 _lY) const ; DART getExternalNeighbour(char _cEdge, int _lX, int _lY) const ;
}; };
......
...@@ -35,7 +35,7 @@ namespace MC ...@@ -35,7 +35,7 @@ namespace MC
* constructor * constructor
*/ */
template<typename DART> template<typename DART>
Buffer<DART>::Buffer(int32 _lWidth, int32 _lHeight) Buffer<DART>::Buffer(int _lWidth, int _lHeight)
{ {
m_lWidth = _lWidth+1; m_lWidth = _lWidth+1;
m_lHeight = _lHeight+1; m_lHeight = _lHeight+1;
...@@ -62,7 +62,7 @@ Buffer<DART>::~Buffer() ...@@ -62,7 +62,7 @@ Buffer<DART>::~Buffer()
* get the face inside a cube of the buffer * get the face inside a cube of the buffer
*/ */
// template <typename DART> // template <typename DART>
// const DART* Buffer<DART>::getFacesCube(int32 _lX, int32 _lY, int32 _lZ) const // const DART* Buffer<DART>::getFacesCube(int _lX, int _lY, int _lZ) const
// { // {
// //
// if (_lZ == m_lZpos) // if current slice .. // if (_lZ == m_lZpos) // if current slice ..
...@@ -83,7 +83,7 @@ Buffer<DART>::~Buffer() ...@@ -83,7 +83,7 @@ Buffer<DART>::~Buffer()
* set the face inside a cube of the buffer * set the face inside a cube of the buffer
*/ */
template <typename DART> template <typename DART>
void Buffer<DART>::setFacesCube(int32 _lX,int32 _lY, const DART* const _lFace) void Buffer<DART>::setFacesCube(int _lX,int _lY, const DART* const _lFace)
{ {
// get the address of cube's table // get the address of cube's table
DART* lLocFaces = m_hcSlice1[_lX + _lY*m_lWidth].m_lFaceEdges; DART* lLocFaces = m_hcSlice1[_lX + _lY*m_lWidth].m_lFaceEdges;
...@@ -114,7 +114,7 @@ void Buffer<DART>::nextSlice() ...@@ -114,7 +114,7 @@ void Buffer<DART>::nextSlice()
* get address of face table for direct access * get address of face table for direct access
*/ */
template <typename DART> template <typename DART>
DART* Buffer<DART>::getFacesCubeTableAdr(int32 _lX,int32 _lY) DART* Buffer<DART>::getFacesCubeTableAdr(int _lX,int _lY)
{ {
return m_hcSlice0[_lX + _lY*m_lWidth].m_lFaceEdges; return m_hcSlice0[_lX + _lY*m_lWidth].m_lFaceEdges;
} }
...@@ -125,84 +125,84 @@ DART* Buffer<DART>::getFacesCubeTableAdr(int32 _lX,int32 _lY) ...@@ -125,84 +125,84 @@ DART* Buffer<DART>::getFacesCubeTableAdr(int32 _lX,int32 _lY)
*/ */
template <typename DART> template <typename DART>
void Buffer<DART>::setPointEdge0(int32 _lX,int32 _lY, unsigned int _lPoint) void Buffer<DART>::setPointEdge0(int _lX,int _lY, unsigned int _lPoint)
{ {
m_hcSlice0[_lX + _lY*m_lWidth].m_lX = _lPoint; m_hcSlice0[_lX + _lY*m_lWidth].m_lX = _lPoint;
} }
template <typename DART> template <typename DART>
void Buffer<DART>::setPointEdge3(int32 _lX,int32 _lY, unsigned int _lPoint) void Buffer<DART>::setPointEdge3(int _lX,int _lY, unsigned int _lPoint)
{ {
m_hcSlice0[_lX +(_lY-1)*m_lWidth].m_lY = _lPoint; m_hcSlice0[_lX +(_lY-1)*m_lWidth].m_lY = _lPoint;
} }
template <typename DART> template <typename DART>
void Buffer<DART>::setPointEdge8(int32 _lX,int32 _lY, unsigned int _lPoint) void Buffer<DART>::setPointEdge8(int _lX,int _lY, unsigned int _lPoint)
{ {
m_hcSlice0[_lX + _lY*m_lWidth].m_lZ = _lPoint; m_hcSlice0[_lX + _lY*m_lWidth].m_lZ = _lPoint;
} }
template <typename DART> template <typename DART>
void Buffer<DART>::setPointEdge2(int32 _lX,int32 _lY, unsigned int _lPoint) void Buffer<DART>::setPointEdge2(int _lX,int _lY, unsigned int _lPoint)
{ {
m_hcSlice0[(_lX-1) +_lY*m_lWidth].m_lX =_lPoint; m_hcSlice0[(_lX-1) +_lY*m_lWidth].m_lX =_lPoint;
} }
template <typename DART> template <typename DART>
void Buffer<DART>::setPointEdge11(int32 _lX,int32 _lY, unsigned int _lPoint) void Buffer<DART>::setPointEdge11(int _lX,int _lY, unsigned int _lPoint)
{ {
m_hcSlice0[_lX + _lY*m_lWidth].m_lZ = _lPoint; m_hcSlice0[_lX + _lY*m_lWidth].m_lZ = _lPoint;
} }
template <typename DART> template <typename DART>
void Buffer<DART>::setPointEdge1(int32 _lX,int32 _lY, unsigned int _lPoint) void Buffer<DART>::setPointEdge1(int _lX,int _lY, unsigned int _lPoint)
{ {
m_hcSlice0[_lX +_lY*m_lWidth].m_lY =_lPoint; m_hcSlice0[_lX +_lY*m_lWidth].m_lY =_lPoint;
} }
template <typename DART> template <typename DART>
void Buffer<DART>::setPointEdge9(int32 _lX,int32 _lY, unsigned int _lPoint) void Buffer<DART>::setPointEdge9(int _lX,int _lY, unsigned int _lPoint)
{ {
m_hcSlice0[_lX +_lY*m_lWidth].m_lZ =_lPoint; m_hcSlice0[_lX +_lY*m_lWidth].m_lZ =_lPoint;
} }
template <typename DART> template <typename DART>
void Buffer<DART>::setPointEdge10(int32 _lX,int32 _lY, unsigned int _lPoint) void Buffer<DART>::setPointEdge10(int _lX,int _lY, unsigned int _lPoint)
{ {
m_hcSlice0[_lX +_lY*m_lWidth].m_lZ =_lPoint; m_hcSlice0[_lX +_lY*m_lWidth].m_lZ =_lPoint;
} }
template <typename DART> template <typename DART>
void Buffer<DART>::setPointEdge7(int32 _lX,int32 _lY, unsigned int _lPoint) void Buffer<DART>::setPointEdge7(int _lX,int _lY, unsigned int _lPoint)
{ {
m_hcSlice1[_lX +(_lY-1)*m_lWidth].m_lY =_lPoint; m_hcSlice1[_lX +(_lY-1)*m_lWidth].m_lY =_lPoint;
} }
template <typename DART> template <typename DART>
void Buffer<DART>::setPointEdge4(int32 _lX,int32 _lY, unsigned int _lPoint) void Buffer<DART>::setPointEdge4(int _lX,int _lY, unsigned int _lPoint)
{ {
m_hcSlice1[_lX +_lY*m_lWidth].m_lX =_lPoint; m_hcSlice1[_lX +_lY*m_lWidth].m_lX =_lPoint;
} }
template <typename DART> template <typename DART>
void Buffer<DART>::setPointEdge6(int32 _lX,int32 _lY, unsigned int _lPoint) void Buffer<DART>::setPointEdge6(int _lX,int _lY, unsigned int _lPoint)
{ {
m_hcSlice1[(_lX-1) + _lY*m_lWidth].m_lX =_lPoint; m_hcSlice1[(_lX-1) + _lY*m_lWidth].m_lX =_lPoint;
} }
template <typename DART> template <typename DART>
void Buffer<DART>::setPointEdge5(int32 _lX,int32 _lY, unsigned int _lPoint) void Buffer<DART>::setPointEdge5(int _lX,int _lY, unsigned int _lPoint)
{ {
m_hcSlice1[_lX +_lY*m_lWidth].m_lY =_lPoint; m_hcSlice1[_lX +_lY*m_lWidth].m_lY =_lPoint;
} }
...@@ -213,91 +213,91 @@ void Buffer<DART>::setPointEdge5(int32 _lX,int32 _lY, unsigned int _lPoint) ...@@ -213,91 +213,91 @@ void Buffer<DART>::setPointEdge5(int32 _lX,int32 _lY, unsigned int _lPoint)
*/ */
template <typename DART> template <typename DART>
unsigned int Buffer<DART>::getPointEdge0(int32 _lX,int32 _lY) unsigned int Buffer<DART>::getPointEdge0(int _lX,int _lY)
{ {
return m_hcSlice0[_lX + _lY*m_lWidth].m_lX; return m_hcSlice0[_lX + _lY*m_lWidth].m_lX;
} }
template <typename DART> template <typename DART>
unsigned int Buffer<DART>::getPointEdge3(int32 _lX,int32 _lY) unsigned int Buffer<DART>::getPointEdge3(int _lX,int _lY)
{ {
return m_hcSlice0[_lX +_lY*m_lWidth].m_lY; return m_hcSlice0[_lX +_lY*m_lWidth].m_lY;
} }
template <typename DART> template <typename DART>
unsigned int Buffer<DART>::getPointEdge8(int32 _lX,int32 _lY) unsigned int Buffer<DART>::getPointEdge8(int _lX,int _lY)
{ {
return m_hcSlice0[_lX + _lY*m_lWidth].m_lZ; return m_hcSlice0[_lX + _lY*m_lWidth].m_lZ;
} }
template <typename DART> template <typename DART>
unsigned int Buffer<DART>::getPointEdge2(int32 _lX,int32 _lY) unsigned int Buffer<DART>::getPointEdge2(int _lX,int _lY)
{ {
return m_hcSlice0[_lX +(_lY+1)*m_lWidth].m_lX; return m_hcSlice0[_lX +(_lY+1)*m_lWidth].m_lX;
} }
template <typename DART> template <typename DART>
unsigned int Buffer<DART>::getPointEdge11(int32 _lX,int32 _lY) unsigned int Buffer<DART>::getPointEdge11(int _lX,int _lY)
{ {
return m_hcSlice0[_lX + (_lY+1)*m_lWidth].m_lZ; return m_hcSlice0[_lX + (_lY+1)*m_lWidth].m_lZ;
} }
template <typename DART> template <typename DART>
unsigned int Buffer<DART>::getPointEdge1(int32 _lX,int32 _lY) unsigned int Buffer<DART>::getPointEdge1(int _lX,int _lY)
{ {
return m_hcSlice0[(_lX+1) +_lY*m_lWidth].m_lY; return m_hcSlice0[(_lX+1) +_lY*m_lWidth].m_lY;
} }
template <typename DART> template <typename DART>
unsigned int Buffer<DART>::getPointEdge9(int32 _lX,int32 _lY) unsigned int Buffer<DART>::getPointEdge9(int _lX,int _lY)
{ {
return m_hcSlice0[(_lX+1) +_lY*m_lWidth].m_lZ; return m_hcSlice0[(_lX+1) +_lY*m_lWidth].m_lZ;
} }
template <typename DART> template <typename DART>
unsigned int Buffer<DART>::getPointEdge10(int32 _lX,int32 _lY) unsigned int Buffer<DART>::getPointEdge10(int _lX,int _lY)
{ {
return m_hcSlice0[(_lX+1) +(_lY+1)*m_lWidth].m_lZ; return m_hcSlice0[(_lX+1) +(_lY+1)*m_lWidth].m_lZ;
} }
template <typename DART> template <typename DART>
unsigned int Buffer<DART>::getPointEdge7(int32 _lX,int32 _lY) unsigned int Buffer<DART>::getPointEdge7(int _lX,int _lY)
{ {
return m_hcSlice1[_lX +_lY*m_lWidth].m_lY; return m_hcSlice1[_lX +_lY*m_lWidth].m_lY;
} }
template <typename DART> template <typename DART>
unsigned int Buffer<DART>::getPointEdge4(int32 _lX,int32 _lY) unsigned int Buffer<DART>::getPointEdge4(int _lX,int _lY)
{ {
return m_hcSlice1[_lX +_lY*m_lWidth].m_lX; return m_hcSlice1[_lX +_lY*m_lWidth].m_lX;
} }
template <typename DART> template <typename DART>
unsigned int Buffer<DART>::getPointEdge6(int32 _lX,int32 _lY) unsigned int Buffer<DART>::getPointEdge6(int _lX,int _lY)
{ {
return m_hcSlice1[_lX +(_lY+1)*m_lWidth].m_lX; return m_hcSlice1[_lX +(_lY+1)*m_lWidth].m_lX;
} }
template <typename DART> template <typename DART>
unsigned int Buffer<DART>::getPointEdge5(int32 _lX,int32 _lY) unsigned int Buffer<DART>::getPointEdge5(int _lX,int _lY)
{ {
return m_hcSlice1[(_lX+1) +_lY*m_lWidth].m_lY; return m_hcSlice1[(_lX+1) +_lY*m_lWidth].m_lY;
} }
template <typename DART> template <typename DART>
DART Buffer<DART>::getExternalNeighbour(int8 _cEdge, int32 _lX, int32 _lY) const DART Buffer<DART>::getExternalNeighbour(char _cEdge, int _lX, int _lY) const
{ {
switch(_cEdge) switch(_cEdge)
...@@ -362,7 +362,7 @@ CGoGNerr << "ERROR"<<CGoGNendl; ...@@ -362,7 +362,7 @@ CGoGNerr << "ERROR"<<CGoGNendl;
template <typename DART> template <typename DART>
void Buffer<DART>::setExternalNeighbour(int8 _cEdge, int32 _lX, int32 _lY, DART _lNeighbour) void Buffer<DART>::setExternalNeighbour(char _cEdge, int _lX, int _lY, DART _lNeighbour)
{ {
switch(_cEdge) switch(_cEdge)
{ {
......
...@@ -128,17 +128,17 @@ protected: ...@@ -128,17 +128,17 @@ protected:
/** /**
* position of the first slice in image * position of the first slice in image
*/ */
int32 m_lZpos; int m_lZpos;
/** /**
* width of slice * width of slice
*/ */
int32 m_lWidth; int m_lWidth;
/** /**
* heigth of slice * heigth of slice
*/ */
int32 m_lHeight; int m_lHeight;
public: public:
...@@ -149,7 +149,7 @@ public: ...@@ -149,7 +149,7 @@ public:
* @param _lWidth the width of image to buffer * @param _lWidth the width of image to buffer
* @param _lHeight the height of image to buffer * @param _lHeight the height of image to buffer
*/ */
BufferGen(int32 _lWidth, int32 _lHeight); BufferGen(int _lWidth, int _lHeight);