PxCollection.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
3  *
4  * NVIDIA CORPORATION and its licensors retain all intellectual property
5  * and proprietary rights in and to this software, related documentation
6  * and any modifications thereto. Any use, reproduction, disclosure or
7  * distribution of this software and related documentation without an express
8  * license agreement from NVIDIA CORPORATION is strictly prohibited.
9  */
10 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
11 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
12 
13 
14 #ifndef PX_PHYSICS_PX_COLLECTION
15 #define PX_PHYSICS_PX_COLLECTION
16 
17 #include "PxSerialFramework.h"
18 
23 #ifndef PX_DOXYGEN
24 namespace physx
25 {
26 #endif
27 
28 class PxBase;
29 
89 {
90 public:
91 
105  virtual void add(PxBase& object, PxSerialObjectId id = PX_SERIAL_OBJECT_ID_INVALID) = 0;
106 
114  virtual void remove(PxBase& object) = 0;
115 
125  PX_DEPRECATED PX_INLINE void addRequired(PxBase& object) { if(!contains(object)) add(object); }
126 
133  virtual bool contains(PxBase& object) const = 0;
134 
145  virtual void addId(PxBase& object, PxSerialObjectId id) = 0;
146 
154  virtual void removeId(PxSerialObjectId id) = 0;
155 
164  virtual void add(PxCollection& collection) = 0;
165 
174  virtual void remove(PxCollection& collection) = 0;
175 
181  virtual PxU32 getNbObjects() const = 0;
182 
189  virtual PxBase& getObject(PxU32 index) const = 0;
190 
199  virtual PxU32 getObjects(PxBase** userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const = 0;
200 
209  virtual PxBase* find(PxSerialObjectId id) const = 0;
210 
216  virtual PxU32 getNbIds() const = 0;
217 
226  virtual PxU32 getIds(PxSerialObjectId* userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const = 0;
227 
236  virtual PxSerialObjectId getId(const PxBase& object) const = 0;
237 
247  virtual void release() = 0;
248 
249 protected:
251  virtual ~PxCollection() {}
252 };
253 
254 #ifndef PX_DOXYGEN
255 } // namespace physx
256 #endif
257 
270 
271 
273 #endif


Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com