From 1b32573046f33050b9300324e6c74e10abb6caaf Mon Sep 17 00:00:00 2001
From: "Daniel M. Pelt" <D.M.Pelt@cwi.nl>
Date: Thu, 9 Apr 2015 15:44:01 +0200
Subject: Add 'link' feature to Python (for 2D and 3D data)

---
 src/Float32ProjectionData2D.cpp | 19 +++++++++++++++++++
 src/Float32VolumeData2D.cpp     | 20 ++++++++++++++++++++
 2 files changed, 39 insertions(+)

(limited to 'src')

diff --git a/src/Float32ProjectionData2D.cpp b/src/Float32ProjectionData2D.cpp
index 85e0cdd..f7f83e3 100644
--- a/src/Float32ProjectionData2D.cpp
+++ b/src/Float32ProjectionData2D.cpp
@@ -75,6 +75,16 @@ CFloat32ProjectionData2D::CFloat32ProjectionData2D(const CFloat32ProjectionData2
 	m_bInitialized = true;
 }
 
+//----------------------------------------------------------------------------------------
+// Create an instance of the CFloat32ProjectionData2D class with pre-allocated data
+CFloat32ProjectionData2D::CFloat32ProjectionData2D(CProjectionGeometry2D* _pGeometry, CFloat32CustomMemory* _pCustomMemory)
+{
+	m_bInitialized = false;
+	m_bInitialized = initialize(_pGeometry, _pCustomMemory);
+}
+ 
+
+
 // Assignment operator
 
 CFloat32ProjectionData2D& CFloat32ProjectionData2D::operator=(const CFloat32ProjectionData2D& _other)
@@ -118,6 +128,15 @@ bool CFloat32ProjectionData2D::initialize(CProjectionGeometry2D* _pGeometry, flo
 	return m_bInitialized;
 }
 
+//----------------------------------------------------------------------------------------
+// Initialization
+bool CFloat32ProjectionData2D::initialize(CProjectionGeometry2D* _pGeometry, CFloat32CustomMemory* _pCustomMemory) 
+{
+	m_pGeometry = _pGeometry->clone();
+	m_bInitialized = _initialize(m_pGeometry->getDetectorCount(), m_pGeometry->getProjectionAngleCount(), _pCustomMemory);
+	return m_bInitialized;
+}
+
 //----------------------------------------------------------------------------------------
 // Destructor
 CFloat32ProjectionData2D::~CFloat32ProjectionData2D() 
diff --git a/src/Float32VolumeData2D.cpp b/src/Float32VolumeData2D.cpp
index e11c4e4..c903c66 100644
--- a/src/Float32VolumeData2D.cpp
+++ b/src/Float32VolumeData2D.cpp
@@ -72,6 +72,15 @@ CFloat32VolumeData2D::CFloat32VolumeData2D(const CFloat32VolumeData2D& _other) :
 	m_bInitialized = true;
 }
 
+//----------------------------------------------------------------------------------------
+// Create an instance of the CFloat32VolumeData2D class with pre-allocated data
+CFloat32VolumeData2D::CFloat32VolumeData2D(CVolumeGeometry2D* _pGeometry, CFloat32CustomMemory* _pCustomMemory)
+{
+	m_bInitialized = false;
+	m_bInitialized = initialize(_pGeometry, _pCustomMemory);
+}
+
+
 // Assignment operator
 
 CFloat32VolumeData2D& CFloat32VolumeData2D::operator=(const CFloat32VolumeData2D& _other)
@@ -122,6 +131,17 @@ bool CFloat32VolumeData2D::initialize(CVolumeGeometry2D* _pGeometry, float32 _fS
 	m_bInitialized = _initialize(m_pGeometry->getGridColCount(), m_pGeometry->getGridRowCount(), _fScalar);
 	return m_bInitialized;
 }
+
+//----------------------------------------------------------------------------------------
+// Initialization
+bool CFloat32VolumeData2D::initialize(CVolumeGeometry2D* _pGeometry, CFloat32CustomMemory* _pCustomMemory) 
+{
+	m_pGeometry = _pGeometry->clone();
+	m_bInitialized = _initialize(m_pGeometry->getGridColCount(), m_pGeometry->getGridRowCount(), _pCustomMemory);
+	return m_bInitialized;
+}
+
+
 //----------------------------------------------------------------------------------------
 void CFloat32VolumeData2D::changeGeometry(CVolumeGeometry2D* _pGeometry)
 {
-- 
cgit v1.2.3