-
Notifications
You must be signed in to change notification settings - Fork 1
/
CVHFile.h
64 lines (56 loc) · 1.27 KB
/
CVHFile.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
CVHFile.h - Allegiance cvh files API header
Copyright (C) Kirth Gersen, 2001-2002. All rights reserved.
v 0.94
*/
#pragma once
#define MAXCPOINTS 100
#define MAX(x,y) ((x)>(y)?(x):(y))
typedef struct SCVHHeader
{
float biggest; // = max(max_x,max_y,max_z)/scale
float max_x;
float max_y;
float max_z;
float scale; // set to 1.0 when exporting :)
} CVHHeader;
typedef struct SCVHPoint
{
float x,y,z;
int nb_connected_points;
int connected_points[MAXCPOINTS];
} CVHPoint ;
typedef CVHPoint *PtrPoint;
typedef struct SCVHObject
{
int points;
int vertices;
float cx,cy,cz; // center
CArray<PtrPoint,PtrPoint> Points;
} CVHObject;
typedef CVHObject *PtrObject;
typedef struct SCVHNamedPoint
{
CString name;
float x1,y1,z1;
float x2,y2,z2;
} CVHNamedPoint;
typedef CVHNamedPoint *PtrNamedPoint;
class CCVHFile
{
public:
CCVHFile(void);
~CCVHFile(void);
bool ReadFromFile(CString sFileName);
bool SaveToFile(CString sFileName);
bool SaveToXFile(CString sFileName, CString sName);
void ComputeCenters(void);
void ComputeHeader(void);
void ComputeHeader(float mx, float my, float mz);
void AddConnectedPoints(PtrPoint pp,int i1, int i2);
public:
CVHHeader header;
int nbobjects;
CArray<PtrObject,PtrObject> Objects;
CArray<PtrNamedPoint,PtrNamedPoint> NamedPoints;
};