forked from 1b-agent/opencadstudio-upstream
Track mixed paper and viewport dimension references
This commit is contained in:
1 parent
bd00d679a9
commit
5424a19482
28 files changed
+823
-846
No files matched your search
@@ -161,7 +161,7 @@ impl CadCommand for AlignedDimensionCommand {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
|
||||
/// PR2: points and object picks may come through a paper-space viewport;
|
||||
/// 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
|
||||
@@ -169,7 +169,8 @@ impl CadCommand for AlignedDimensionCommand {
|
||||
|
||||
fn dimension_acquired_points(&self) -> Vec<DVec3> {
|
||||
match self.step {
|
||||
Step::First => vec![], Step::Second(p) => vec![p],
|
||||
Step::First => vec![],
|
||||
Step::Second(p) => vec![p],
|
||||
Step::DimLine { p1, p2 } => vec![p1, p2],
|
||||
}
|
||||
}
|
||||
|
||||
@@ -482,7 +482,7 @@ impl CadCommand for AngularDimensionCommand {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
|
||||
/// PR2: points and object picks may come through a paper-space viewport;
|
||||
/// 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
|
||||
@@ -490,11 +490,27 @@ impl CadCommand for AngularDimensionCommand {
|
||||
|
||||
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],
|
||||
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],
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ impl CadCommand for DiameterDimensionCommand {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
|
||||
/// PR2: points and object picks may come through a paper-space viewport;
|
||||
/// 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
|
||||
@@ -140,7 +140,8 @@ impl CadCommand for DiameterDimensionCommand {
|
||||
|
||||
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))],
|
||||
Step::SelectObject => vec![],
|
||||
Step::DimLine(source) => vec![dvec(source.point_at_angle(source.start_angle))],
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@ impl CadCommand for LinearDimensionCommand {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
|
||||
/// PR2: points and object picks may come through a paper-space viewport;
|
||||
/// 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
|
||||
@@ -225,7 +225,8 @@ impl CadCommand for LinearDimensionCommand {
|
||||
|
||||
fn dimension_acquired_points(&self) -> Vec<DVec3> {
|
||||
match self.step {
|
||||
Step::FirstPoint => vec![], Step::SecondPoint(p) => vec![p],
|
||||
Step::FirstPoint => vec![],
|
||||
Step::SecondPoint(p) => vec![p],
|
||||
Step::DimensionLine { first, second } => vec![first, second],
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ impl CadCommand for RadiusDimensionCommand {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
|
||||
/// PR2: points and object picks may come through a paper-space viewport;
|
||||
/// 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
|
||||
@@ -138,7 +138,8 @@ impl CadCommand for RadiusDimensionCommand {
|
||||
|
||||
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))],
|
||||
Step::SelectObject => vec![],
|
||||
Step::DimLine(source) => vec![dvec(source.point_at_angle(source.start_angle))],
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user