VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ssInsertionFunctor.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2005 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: ssInsertionFunctor.h,v $ $Revision: 1.3 $ $State: Exp $
7 *********************************************************************/
8 #ifndef ssInsertionFunctor_H_
9 #define ssInsertionFunctor_H_
10 
11 #include <vlutil/vlConfig.h>
13 #include "geometry/ssFunctor.h"
14 
15 //
16 // A functor intended for use with the spatial subdivision set of classes. It's
17 // primary usage is to insert the first parameter into the second.
18 //
19 // Expected usage:
20 // When passed to the intersection objects intersection functions, this fucntor
21 // inserts the first item into the second one. Used primarily for inserting the
22 // different spatial sorted elements into their appropriate spatial subdivisions.
23 // For an example, see the gdbNode inserter class.
24 //
25 template <typename TypeToContain, typename Container>
26 class DtSsInsertionFunctor : public DtSsFunctor<TypeToContain, Container>
27 {
28 public:
29  // Constructor
31 
32  // Destructor
33  virtual ~DtSsInsertionFunctor();
34 
35 private:
36  // not implemented
39 
40 public:
41  // Function operator - when applied inserts the first element into the
42  // second element.
43  // @param itemToInsert The item to insert into the second parameter.
44  // @param container The container of elements into which to insert the first
45  // parameter.
46  //
47  // @returns Always returns false as it is never done processing - it can
48  // always continue inserting elements.
49  virtual bool operator()(TypeToContain& itemToInsert, Container& container);
50 };
51 
52 
53 //------------------------------------------------------
54 // INLINE METHODS
55 //------------------------------------------------------
56 template <typename TypeToContain, typename Container>
58 : DtSsFunctor<TypeToContain, Container>()
59 {
60 }
61 
62 
63 template <typename TypeToContain, typename Container>
65 {
66 }
67 
68 template <typename TypeToContain, typename Container>
69 bool DtSsInsertionFunctor<TypeToContain, Container>::operator()(TypeToContain& itemToInsert, Container& container)
70 {
71  container.insert(container.end(), itemToInsert);
72  return false;
73 }
74 
75 #endif
76 
77 
Definition: ssInsertionFunctor.h:26
DtSsInsertionFunctor & operator=(const DtSsInsertionFunctor &original)
virtual bool operator()(TypeToContain &itemToInsert, Container &container)
Definition: ssInsertionFunctor.h:69
DtSsInsertionFunctor()
Definition: ssInsertionFunctor.h:57
Definition: ssFunctor.h:46
virtual ~DtSsInsertionFunctor()
Definition: ssInsertionFunctor.h:64

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)