8 #ifndef ssClosestIntersectionFunctor_H_
9 #define ssClosestIntersectionFunctor_H_
11 #include <vlutil/vlConfig.h>
31 template <
typename TypeToIntersect,
typename Container,
typename T_IntersectionRecordType>
55 virtual bool operator()(TypeToIntersect& itemToIntersect, Container& container);
77 template <
typename TypeToIntersect,
typename Container,
typename T_IntersectionRecordType>
80 , myIntersectionRecord(0)
81 , myIntersectionRecordType(
DtGdbNode::IRT_IPOINT)
86 template <
typename TypeToIntersect,
typename Container,
typename T_IntersectionRecordType>
91 template <
typename TypeToIntersect,
typename Container,
typename T_IntersectionRecordType>
93 (TypeToIntersect& itemToIntersect, Container& containerToIntersect)
97 assert(myIntersectionRecord != 0);
99 typename Container::iterator iter = containerToIntersect.begin();
100 typename Container::iterator endIter = containerToIntersect.end();
101 for (; iter != endIter; ++iter)
103 if ((*iter)->intersect(itemToIntersect, *myIntersectionRecord, myIntersectionRecordType))
105 assert(myIntersectionRecord->intersectionFound());
114 template <
typename TypeToIntersect,
typename Container,
typename T_IntersectionRecordType>
115 T_IntersectionRecordType*
118 return myIntersectionRecord;
122 template <
typename TypeToIntersect,
typename Container,
typename T_IntersectionRecordType>
126 assert(newIntersectionRecord != 0);
127 myIntersectionRecord = newIntersectionRecord;
131 template <
typename TypeToIntersect,
typename Container,
typename T_IntersectionRecordType>
135 return myIntersectionRecordType;
138 template <
typename TypeToIntersect,
typename Container,
typename T_IntersectionRecordType>
142 myIntersectionRecordType = newIntersectionRecordType;