forked from 1b-agent/opencadstudio-upstream
Merge pull request #1301: Add associative viewport dimensions
Refresh associations after complete SpaceMouse camera updates and recognize imported paper-space owners without Layout objects. Use kernel containment, intersection, perpendicular and spline tangent solving; pin cadkernel 7ce27f2 and add regressions.
This commit is contained in:
commit
d10a0cf798
35 files changed
+7077
-85
No files matched your search
@@ -161,6 +161,24 @@ impl CadCommand for AlignedDimensionCommand {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
|
||||
/// Points and object picks may come through a paper-space viewport;
|
||||
/// the committed dimension then reports the model measurement.
|
||||
fn measures_through_viewports(&self) -> bool {
|
||||
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
|
||||
|
||||
@@ -482,6 +482,42 @@ impl CadCommand for AngularDimensionCommand {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
|
||||
/// Points and object picks may come through a paper-space viewport;
|
||||
/// the committed dimension then reports the model measurement.
|
||||
fn measures_through_viewports(&self) -> bool {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -132,6 +132,23 @@ impl CadCommand for DiameterDimensionCommand {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
|
||||
/// Points and object picks may come through a paper-space viewport;
|
||||
/// the committed dimension then reports the model measurement.
|
||||
fn measures_through_viewports(&self) -> bool {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -217,6 +217,24 @@ impl CadCommand for LinearDimensionCommand {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
|
||||
/// Points and object picks may come through a paper-space viewport;
|
||||
/// the committed dimension then reports the model measurement.
|
||||
fn measures_through_viewports(&self) -> bool {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -130,6 +130,23 @@ impl CadCommand for RadiusDimensionCommand {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
|
||||
/// Points and object picks may come through a paper-space viewport;
|
||||
/// the committed dimension then reports the model measurement.
|
||||
fn measures_through_viewports(&self) -> bool {
|
||||
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