15 #ifndef __PYIPSDKBASE_PYTHONPLANINDEXEDCOLL_H__ 16 #define __PYIPSDKBASE_PYTHONPLANINDEXEDCOLL_H__ 18 #include <IPSDKBaseData/PlanIndex/PlanIndex.h> 20 #include <IPSDKBaseData/PlanIndex/BasePlanIndexedColl.h> 21 #include <IPSDKBaseData/DataItem/Node/BaseDataItemNode.h> 23 #include <Python/PyIPSDKBase/PythonDataItem.h> 25 #include <boost/python/dict.hpp> 26 #include <boost/python/tuple.hpp> 27 #include <boost/utility/enable_if.hpp> 28 #include <boost/type_traits/is_base_of.hpp> 39 template <
typename CollType>
40 typename boost::enable_if<boost::is_base_of<BaseDataItemNode, typename CollType::ValueType>, boost::python::dict>::type
41 toPyDict(
const boost::shared_ptr<const CollType>& pPlanIndexedColl)
44 boost::python::dict resDict;
46 const BaseCollType& baseColl = pPlanIndexedColl->getBaseColl();
47 typename BaseCollType::const_iterator iter = baseColl.begin();
48 while (iter != baseColl.end()) {
51 const PlanIndex& curPlanIndex = iter->first;
59 resDict[boost::python::make_tuple(curZPlanIdx, curCPlanIdx, curTPlanIdx)] =
toPyDict(pCurObject);
68 template <
typename CollType>
69 typename boost::enable_if<boost::is_base_of<BaseDataItemNode, typename CollType::ValueType>,
bool>::type
70 equal(
const boost::shared_ptr<const CollType>& pPlanIndexedColl1,
71 const boost::shared_ptr<const CollType>& pPlanIndexedColl2,
75 if (pPlanIndexedColl1->getNbPlans() != pPlanIndexedColl2->getNbPlans())
80 const BaseCollType& baseColl1 = pPlanIndexedColl1->getBaseColl();
81 const BaseCollType& baseColl2 = pPlanIndexedColl2->getBaseColl();
82 typename BaseCollType::const_iterator iter1 = baseColl1.begin();
83 typename BaseCollType::const_iterator iter2 = baseColl2.begin();
84 while (iter1 != baseColl1.end()) {
87 const PlanIndex& curPlanIndex1 = iter1->first;
92 const PlanIndex& curPlanIndex2 = iter2->first;
94 const ipUInt32& curCPlanIdx2 = curPlanIndex2.getCPlanIdx();
95 const ipUInt32& curTPlanIdx2 = curPlanIndex2.getTPlanIdx();
99 if (curZPlanIdx1 != curZPlanIdx2)
101 if (curCPlanIdx1 != curCPlanIdx2)
103 if (curTPlanIdx1 != curTPlanIdx2)
107 if (
equal(*pCurObject1, *pCurObject2, tolerance) ==
false)
118 template <
typename CollType>
119 typename boost::enable_if<boost::is_base_of<BaseDataItemNode, typename CollType::ValueType>,
bool>::type
120 equalWithoutTol(
const boost::shared_ptr<const CollType>& pPlanIndexedColl1,
121 const boost::shared_ptr<const CollType>& pPlanIndexedColl2)
153 #endif // __PYIPSDKBASE_PYTHONPLANINDEXEDCOLL_H__ Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
boost::shared_ptr< const BaseDataItemNode > DataItemNodeConstPtr
shared pointer to const DataItemNode
Definition: DataItemTypes.h:161
boost::shared_ptr< const BaseSerializationObject > SerializationObjectConstPtr
shared pointer to a const base serialization object
Definition: SerializationTypes.h:32
boost::enable_if< boost::is_base_of< BaseDataItemNode, typename CollType::ValueType >, boost::python::dict >::type toPyDict(const boost::shared_ptr< const CollType > &pPlanIndexedColl)
Definition: PythonPlanIndexedColl.h:41
boost::shared_ptr< const BaseDataItem > DataItemConstPtr
shared pointer to const DataItem
Definition: DataItemTypes.h:149
Macros allowing to handle ipsdk to python wrapping.
ipUInt64 getZPlanIdx() const
access to plan indexes associated to object
Definition: PlanIndex.h:108
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
Definition: NumericLimits.h:27
Predefined constants for ipsdk math library.
Utility functions for data item management.
Predefined types for plan indexed collection management.
Base class for data item nodes.
Definition: BaseDataItemNode.h:29
ipUInt64 getCPlanIdx() const
access to plan indexes associated to object
Definition: PlanIndex.h:114
Class used to store image plan index.
Definition: PlanIndex.h:26
std::map< PlanIndex, SerializationObjectConstPtr > PlanIndexedConstColl
collection of plan indexed serializable object shared pointers
Definition: BasePlanIndexedColl.h:45
boost::enable_if< boost::is_base_of< BaseDataItemNode, typename CollType::ValueType >, bool >::type equal(const boost::shared_ptr< const CollType > &pPlanIndexedColl1, const boost::shared_ptr< const CollType > &pPlanIndexedColl2, const ipReal64 &tolerance=NumericLimits< ipReal64 >::sqrt_epsilon())
function allowing to compare two plan indexed data item collections
Definition: PythonPlanIndexedColl.h:70
ipUInt64 getTPlanIdx() const
access to plan indexes associated to object
Definition: PlanIndex.h:120
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53