forked from 1b-agent/opencadstudio-upstream
Fix viewport dimension acquisition and preserve measurement scaling
This commit is contained in:
1 parent
369e0c9fc5
commit
2ee3782850
18 files changed
+957
-577
No files matched your search
@@ -167,6 +167,17 @@ impl CadCommand for AlignedDimensionCommand {
|
||||
true
|
||||
}
|
||||
|
||||
fn dimension_acquired_points(&self) -> Vec<DVec3> {
|
||||
match self.step {
|
||||
Step::First => vec![], Step::Second(p) => vec![p],
|
||||
Step::DimLine { p1, p2 } => vec![p1, p2],
|
||||
}
|
||||
}
|
||||
|
||||
fn dimension_placement_pending(&self) -> bool {
|
||||
matches!(self.step, Step::DimLine { .. })
|
||||
}
|
||||
|
||||
fn input_kind(&self) -> InputKind {
|
||||
if self.awaiting_text {
|
||||
InputKind::FreeText
|
||||
|
||||
@@ -488,6 +488,20 @@ impl CadCommand for AngularDimensionCommand {
|
||||
true
|
||||
}
|
||||
|
||||
fn dimension_acquired_points(&self) -> Vec<DVec3> {
|
||||
match self.step {
|
||||
Step::Vertex => vec![], Step::FirstRay(p) => vec![p],
|
||||
Step::SecondRay { vertex, first } | Step::CircleSecondRay { vertex, first, .. } => vec![vertex, first],
|
||||
Step::SecondLine { first_start, first_end, .. } => vec![first_start, first_end],
|
||||
Step::ArcPoint3 { vertex, first, second } => vec![vertex, first, second],
|
||||
Step::ArcPoint2 { first_start, first_end, second_start, second_end } => vec![first_start, first_end, second_start, second_end],
|
||||
}
|
||||
}
|
||||
|
||||
fn dimension_placement_pending(&self) -> bool {
|
||||
matches!(self.step, Step::ArcPoint3 { .. } | Step::ArcPoint2 { .. })
|
||||
}
|
||||
|
||||
fn on_escape(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
|
||||
@@ -138,6 +138,16 @@ impl CadCommand for DiameterDimensionCommand {
|
||||
true
|
||||
}
|
||||
|
||||
fn dimension_acquired_points(&self) -> Vec<DVec3> {
|
||||
match self.step {
|
||||
Step::SelectObject => vec![], Step::DimLine(source) => vec![dvec(source.point_at_angle(source.start_angle))],
|
||||
}
|
||||
}
|
||||
|
||||
fn dimension_placement_pending(&self) -> bool {
|
||||
matches!(self.step, Step::DimLine(_))
|
||||
}
|
||||
|
||||
fn on_escape(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
|
||||
@@ -223,6 +223,17 @@ impl CadCommand for LinearDimensionCommand {
|
||||
true
|
||||
}
|
||||
|
||||
fn dimension_acquired_points(&self) -> Vec<DVec3> {
|
||||
match self.step {
|
||||
Step::FirstPoint => vec![], Step::SecondPoint(p) => vec![p],
|
||||
Step::DimensionLine { first, second } => vec![first, second],
|
||||
}
|
||||
}
|
||||
|
||||
fn dimension_placement_pending(&self) -> bool {
|
||||
matches!(self.step, Step::DimensionLine { .. })
|
||||
}
|
||||
|
||||
fn on_escape(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
|
||||
@@ -136,6 +136,16 @@ impl CadCommand for RadiusDimensionCommand {
|
||||
true
|
||||
}
|
||||
|
||||
fn dimension_acquired_points(&self) -> Vec<DVec3> {
|
||||
match self.step {
|
||||
Step::SelectObject => vec![], Step::DimLine(source) => vec![dvec(source.point_at_angle(source.start_angle))],
|
||||
}
|
||||
}
|
||||
|
||||
fn dimension_placement_pending(&self) -> bool {
|
||||
matches!(self.step, Step::DimLine(_))
|
||||
}
|
||||
|
||||
fn on_escape(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user