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
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
//! Compound-plane-angle parsing helpers for `georef.rs`'s legacy
//! `IfcSite.RefLatitude`/`RefLongitude` fallback.
//!
//! Split out of `georef.rs` to keep that module inside its module-size
//! ratchet budget (matching the `georef_tests.rs` split for test code):
//! these functions are cohesive (all exist to turn a STEP
//! `IfcCompoundPlaneAngleMeasure` list into signed decimal degrees) and are
//! only ever called from `georef.rs::extract_from_site`.
use crateStepListItems;
use crateDecodedEntity;
/// Convert an `IfcCompoundPlaneAngleMeasure` attribute (list of 3-4
/// integers: degrees, minutes, seconds, optional millionth-seconds) to
/// decimal degrees. Same sign handling as the TS parser: any negative
/// component makes the whole angle negative.
///
/// Components are read BY POSITION and the whole angle is refused when any
/// of the first three is not numeric. Compacting the list first (dropping
/// non-numeric entries, then indexing the survivors) re-indexed
/// `($,51,30,0)` as 51 deg 30 min: the fourth component slid into the
/// seconds slot and the site was placed instead of refused.
pub
/// True if any component of the compound-plane-angle list at `attr_index`
/// (0-based, matching `DecodedEntity::get`/`get_list` indexing) is the
/// literal negative-zero integer token `-0` in `bytes` (an entity's raw
/// record, `#N=TYPE(attr0,attr1,...);`).
///
/// This walks the raw bytes rather than re-tokenizing through the shared
/// STEP tokenizer: `-0` reaches `AttributeValue::Integer` as plain `0` (see
/// `compound_plane_angle_to_degrees`'s doc comment above), so by the time an
/// entity is decoded the sign is already gone. The split is the shared
/// [`StepListItems`] rule, so a comment is trivia here too (#4687).
pub