VR-Forces Developer's Guide
 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) 2025 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() override;
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,
50  Container &container) override;
51 };
52 
53 
54 //------------------------------------------------------
55 // INLINE METHODS
56 //------------------------------------------------------
57 template <typename TypeToContain, typename Container>
59 : DtSsFunctor<TypeToContain, Container>()
60 {
61 }
62 
63 
64 template <typename TypeToContain, typename Container>
66 {
67 }
68 
69 template <typename TypeToContain, typename Container>
70 bool DtSsInsertionFunctor<TypeToContain, Container>::operator()(TypeToContain& itemToInsert, Container& container)
71 {
72  container.insert(container.end(), itemToInsert);
73  return false;
74 }
75 
76 #endif
77 
78 
Definition: ssInsertionFunctor.h:26
DtSsInsertionFunctor & operator=(const DtSsInsertionFunctor &original)
virtual bool operator()(TypeToContain &itemToInsert, Container &container) override
Definition: ssInsertionFunctor.h:70
virtual ~DtSsInsertionFunctor() override
Definition: ssInsertionFunctor.h:65
DtSsInsertionFunctor()
Definition: ssInsertionFunctor.h:58
Definition: ssFunctor.h:46

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)