Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
vhacdCircularList.h
Go to the documentation of this file.
1/* Copyright (c) 2011 Khaled Mamou (kmamou at gmail dot com)
2 All rights reserved.
3
4
5 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
6 following conditions are met:
7
8 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
9 disclaimer.
10
11 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
12 disclaimer in the documentation and/or other materials provided with the distribution.
13
14 3. The names of the contributors may not be used to endorse or promote products derived from this software without
15 specific prior written permission.
16
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
18 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25#pragma once
26
27#include <stdlib.h>
28
29namespace tesseract_collision
30{
31namespace VHACD
32{
34template <typename T>
36{
37public:
38 T& GetData() { return m_data; }
39 const T& GetData() const { return m_data; }
42 const CircularListElement<T>*& GetNext() const { return m_next; }
43 const CircularListElement<T>*& GetPrev() const { return m_prev; }
49
50private:
54
56};
58template <typename T>
60{
61public:
63 const CircularListElement<T>* GetHead() const { return m_head; }
64 bool IsEmpty() const { return (m_size == 0); }
65 size_t GetSize() const { return m_size; }
66 const T& GetData() const { return m_head->GetData(); }
67 T& GetData() { return m_head->GetData(); }
68 bool Delete();
70 CircularListElement<T>* Add(const T* data = 0);
72 bool Next();
73 bool Prev();
74 void Clear()
75 {
76 while (Delete())
77 ;
78 };
79 const CircularList& operator=(const CircularList& rhs);
82 {
83 m_head = 0;
84 m_size = 0;
85 }
86 CircularList(const CircularList& rhs);
88 ~CircularList(void) { Clear(); };
89
90private:
92 size_t m_size;
93};
94} // namespace VHACD
95} // namespace tesseract_collision
96#include "vhacdCircularList.inl"
CircularListElement class.
Definition: vhacdCircularList.h:36
CircularListElement(void)
Definition: vhacdCircularList.h:46
~CircularListElement(void)
Destructor.
Definition: vhacdCircularList.h:48
CircularListElement< T > *& GetNext()
Definition: vhacdCircularList.h:40
CircularListElement(const T &data)
Constructor.
Definition: vhacdCircularList.h:45
const T & GetData() const
Definition: vhacdCircularList.h:39
T & GetData()
Definition: vhacdCircularList.h:38
const CircularListElement< T > *& GetNext() const
Definition: vhacdCircularList.h:42
const CircularListElement< T > *& GetPrev() const
Definition: vhacdCircularList.h:43
T m_data
Definition: vhacdCircularList.h:51
CircularListElement(const CircularListElement &rhs)
CircularListElement< T > * m_prev
Definition: vhacdCircularList.h:53
CircularListElement< T > *& GetPrev()
Definition: vhacdCircularList.h:41
CircularListElement< T > * m_next
Definition: vhacdCircularList.h:52
CircularList class.
Definition: vhacdCircularList.h:60
T & GetData()
Definition: vhacdCircularList.h:67
const CircularListElement< T > * GetHead() const
Definition: vhacdCircularList.h:63
bool Delete()
Definition: vhacdCircularList.inl:43
CircularList()
Constructor.
Definition: vhacdCircularList.h:81
bool Prev()
Definition: vhacdCircularList.inl:120
~CircularList(void)
Destructor.
Definition: vhacdCircularList.h:88
bool IsEmpty() const
Definition: vhacdCircularList.h:64
CircularListElement< T > * m_head
a pointer to the head of the circular list
Definition: vhacdCircularList.h:91
CircularListElement< T > *& GetHead()
Definition: vhacdCircularList.h:62
size_t GetSize() const
Definition: vhacdCircularList.h:65
void Clear()
Definition: vhacdCircularList.h:74
const T & GetData() const
Definition: vhacdCircularList.h:66
CircularListElement< T > * Add(const T *data=0)
Definition: vhacdCircularList.inl:69
size_t m_size
number of element in the circular list
Definition: vhacdCircularList.h:92
bool Next()
Definition: vhacdCircularList.inl:110
const CircularList & operator=(const CircularList &rhs)
Definition: vhacdCircularList.inl:144
Definition: vhacdVHACD.h:53
Definition: polygon_mesh.h:46
CollisionMarginData data(default_margin)
Definition: collision_margin_data_unit.cpp:34
Definition: bullet_cast_bvh_manager.h:49
tinyxml2::XMLElement * element
Definition: tesseract_srdf_unit.cpp:815