Oolite
Loading...
Searching...
No Matches
OOMeshToOctreeConverter Class Reference

#include <OOMeshToOctreeConverter.h>

Inheritance diagram for OOMeshToOctreeConverter:
Collaboration diagram for OOMeshToOctreeConverter:

Classes

struct  OOMeshToOctreeConverterInternalData

Instance Methods

(id) - initWithCapacity:
(void) - addTriangle:
(Octree *) - findOctreeToDepth:
(void) - dealloc [implementation]
(NSString *) - descriptionComponents [implementation]

Class Methods

(instancetype) + converterWithCapacity:

Private Attributes

struct OOMeshToOctreeConverter::OOMeshToOctreeConverterInternalData _data

Detailed Description

Definition at line 37 of file OOMeshToOctreeConverter.h.

Method Documentation

◆ addTriangle:

- (void) addTriangle: (Triangle) tri

Definition at line 253 of file OOMeshToOctreeConverter.m.

253 :(Triangle)tri
254{
255 if (!OOTriangleIsDegenerate(tri)) {
256 AddTriangle(&_data, tri);
257 }
258}
OOINLINE void AddTriangle(GeometryData *data, Triangle tri)
OOINLINE bool OOTriangleIsDegenerate(Triangle tri) CONST_FUNC
Definition OOTriangle.h:67
struct OOMeshToOctreeConverter::OOMeshToOctreeConverterInternalData _data

References _data, AddTriangle(), and OOTriangleIsDegenerate().

Here is the call graph for this function:

◆ converterWithCapacity:

+ (instancetype) converterWithCapacity: (NSUInteger) capacity

Definition at line 243 of file OOMeshToOctreeConverter.m.

243 :(NSUInteger)capacity
244{
245 return [[[self alloc] initWithCapacity:capacity] autorelease];
246}

◆ dealloc

- (void) dealloc
implementation

Definition at line 236 of file OOMeshToOctreeConverter.m.

237{
239
240 [super dealloc];
241}
OOINLINE void DestroyGeometryData(GeometryData *data)

References _data, dealloc, and DestroyGeometryData().

Referenced by dealloc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ descriptionComponents

- (NSString *) descriptionComponents
implementation

Definition at line 248 of file OOMeshToOctreeConverter.m.

249{
250 return [NSString stringWithFormat:@"%u triangles", _data.count];
251}

References descriptionComponents.

Referenced by descriptionComponents.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findOctreeToDepth:

- (Octree *) findOctreeToDepth: (NSUInteger) depth

Definition at line 260 of file OOMeshToOctreeConverter.m.

260 :(NSUInteger)depth
261{
262 OOOctreeBuilder* builder = [[[OOOctreeBuilder alloc] init] autorelease];
263 OOScalar halfWidth = 0.5f + MaxDimensionFromOrigin(&_data); // pad out from geometry by a half meter
264
265 BuildSubOctree(&_data, builder, halfWidth, depth);
266
267 return [builder buildOctreeWithRadius:halfWidth];
268}
GLfloat OOScalar
Definition OOMaths.h:49
void BuildSubOctree(GeometryData *data, OOOctreeBuilder *builder, OOScalar halfWidth, NSUInteger depth)
static OOScalar MaxDimensionFromOrigin(GeometryData *data)
Octree * buildOctreeWithRadius:(GLfloat radius)
Definition Octree.m:795

References _data, OOOctreeBuilder::buildOctreeWithRadius:, BuildSubOctree(), and MaxDimensionFromOrigin().

Here is the call graph for this function:

◆ initWithCapacity:

- (id) initWithCapacity: (NSUInteger) capacity

Definition at line 223 of file OOMeshToOctreeConverter.m.

223 :(NSUInteger)capacity
224{
225 NSParameterAssert(capacity < UINT32_MAX);
226 if (capacity == 0)
227 capacity = 1; // Happens for models with no faces.
228
229 if ((self = [super init])) {
230 InitGeometryData(&_data, capacity);
231 }
232
233 return self;
234}
OOINLINE void InitGeometryData(GeometryData *data, uint32_t capacity)

References _data, and InitGeometryData().

Here is the call graph for this function:

Member Data Documentation

◆ _data

- (struct OOMeshToOctreeConverterInternalData) OOMeshToOctreeConverter:
private

The documentation for this class was generated from the following files: