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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
//! # World of Warcraft WMO (World Map Object) Parser
//!
//! This library provides comprehensive support for parsing, editing, validating, and converting
//! World of Warcraft WMO files across all game expansions from Classic to The War Within.
//!
//! ## Features
//!
//! - **Parsing**: Read WMO root and group files with full chunk support
//! - **Validation**: Verify file integrity and format compliance
//! - **Conversion**: Convert between different WoW expansion formats
//! - **Editing**: Modify WMO properties, geometry, and metadata
//! - **Export**: Export to common 3D formats (OBJ/MTL)
//! - **Type Safety**: Strongly typed structures for all WMO components
//!
//! ## Quick Start
//!
//! ```no_run
//! use std::fs::File;
//! use std::io::BufReader;
//! use wow_wmo::{parse_wmo, ParsedWmo};
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Parse a WMO file
//! let file = File::open("example.wmo")?;
//! let mut reader = BufReader::new(file);
//! let wmo = parse_wmo(&mut reader)?;
//!
//! // Access WMO data based on type
//! match &wmo {
//! ParsedWmo::Root(root) => {
//! println!("Root file - Version: {}", root.version);
//! println!("Groups: {}", root.n_groups);
//! println!("Materials: {}", root.n_materials);
//! }
//! ParsedWmo::Group(group) => {
//! println!("Group file - Version: {}", group.version);
//! println!("Vertices: {}", group.n_vertices);
//! println!("Triangles: {}", group.n_triangles);
//! }
//! }
//! # Ok(())
//! # }
//! ```
//!
//! ## Example: Validating a WMO File
//!
//! ```no_run
//! use std::fs::File;
//! use std::io::BufReader;
//! use wow_wmo::{WmoParser, WmoValidator};
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Parse the WMO
//! let file = File::open("building.wmo")?;
//! let mut reader = BufReader::new(file);
//! let wmo = WmoParser::new().parse_root(&mut reader)?;
//!
//! // Validate it
//! let validator = WmoValidator::new();
//! let report = validator.validate_root(&wmo)?;
//!
//! if !report.errors.is_empty() {
//! println!("Validation errors found:");
//! for error in &report.errors {
//! println!(" - {:?}", error);
//! }
//! }
//!
//! if !report.warnings.is_empty() {
//! println!("Validation warnings:");
//! for warning in &report.warnings {
//! println!(" - {:?}", warning);
//! }
//! }
//! # Ok(())
//! # }
//! ```
//!
//! ## Modules
//!
//! - [`chunk`]: Low-level chunk reading/writing functionality
//! - [`parser`]: WMO root file parser
//! - [`group_parser`]: WMO group file parser
//! - [`types`]: Common data types (Vec3, Color, BoundingBox, etc.)
//! - [`wmo_types`]: WMO root file structures
//! - [`wmo_group_types`]: WMO group file structures
//! - [`validator`]: File validation and integrity checking
//! - [`converter`]: Version conversion between expansions
//! - [`editor`]: High-level editing API
//! - [`writer`]: Binary serialization
//! - [`visualizer`]: 3D export functionality
//! - [`version`]: Version detection and feature support
//! - [`error`]: Error types and handling
//!
//! ## Supported Formats
//!
//! This library supports WMO files from all World of Warcraft expansions:
//! - Classic (1.12)
//! - The Burning Crusade (2.4.3)
//! - Wrath of the Lich King (3.3.5)
//! - Cataclysm (4.3.4)
//! - Mists of Pandaria (5.4.8)
//! - Warlords of Draenor (6.2.4)
//! - Legion (7.3.5)
//! - Battle for Azeroth (8.3.7)
//! - Shadowlands (9.2.7)
//! - Dragonflight (10.2.0)
//! - The War Within (11.0+)
// Additional modules
// Test modules (only compiled for tests)
// #[cfg(test)]
// mod tests; // Temporarily disabled while refactoring
pub use WmoConverter;
pub use WmoEditor;
pub use ;
pub use WmoGroupParser;
pub use WmoParser;
pub use ;
pub use ;
pub use ;
pub use WmoVisualizer;
// Re-export all types from wmo_types
pub use ;
// Re-export all types from wmo_group_types (except WmoGroupFlags which conflicts)
pub use ;
pub use WmoWriter;
// Portal culling exports
pub use ;
// BSP tree exports
pub use ;
/// Re-export of chunk-related types
pub use Chunk;
pub use ChunkHeader;
pub use ChunkId;
/// Re-export API types from our binrw implementation
pub use ;
// Internal parsers are accessed via the ParsedWmo enum from api module
// Validation and conversion functionality will use the new parser
// These can be implemented later when the legacy structures are removed