forked from 1b-agent/opencadstudio-upstream
Move parametric tools to their own ribbon tab
This commit is contained in:
1 parent
d07e8cf7d4
commit
cf33455e93
35 files changed
+114
-76
No files matched your search
@@ -29,9 +29,10 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = رسم
|
.draw = رسم
|
||||||
|
.parametric = بارامتري
|
||||||
.annotate = تعليقات توضيحية
|
.annotate = تعليقات توضيحية
|
||||||
.insert = إدراج
|
.insert = إدراج
|
||||||
.model = النمذجة
|
.model = نموذج
|
||||||
.layout = تخطيط
|
.layout = تخطيط
|
||||||
.manage = إدارة
|
.manage = إدارة
|
||||||
.view = عرض
|
.view = عرض
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = Чертане
|
.draw = Чертане
|
||||||
|
.parametric = Параметричен
|
||||||
.annotate = Анотиране
|
.annotate = Анотиране
|
||||||
.insert = Вмъкване
|
.insert = Вмъкване
|
||||||
.model = Моделиране
|
.model = Модел
|
||||||
.layout = Оформление
|
.layout = Оформление
|
||||||
.manage = Управление
|
.manage = Управление
|
||||||
.view = Изглед
|
.view = Изглед
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = Kreslení
|
.draw = Kreslení
|
||||||
|
.parametric = Parametrické
|
||||||
.annotate = Poznámky
|
.annotate = Poznámky
|
||||||
.insert = Vložit
|
.insert = Vložit
|
||||||
.model = Modelování
|
.model = Model
|
||||||
.layout = Rozvržení
|
.layout = Rozvržení
|
||||||
.manage = Správa
|
.manage = Správa
|
||||||
.view = Zobrazení
|
.view = Zobrazení
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = Zeichnen
|
.draw = Zeichnen
|
||||||
|
.parametric = Parametrisch
|
||||||
.annotate = Beschriften
|
.annotate = Beschriften
|
||||||
.insert = Einfügen
|
.insert = Einfügen
|
||||||
.model = Modell
|
.model = Modell
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = Σχεδίαση
|
.draw = Σχεδίαση
|
||||||
|
.parametric = Παραμετρικό
|
||||||
.annotate = Επισημείωση
|
.annotate = Επισημείωση
|
||||||
.insert = Εισαγωγή
|
.insert = Εισαγωγή
|
||||||
.model = Μοντελοποίηση
|
.model = Μοντέλο
|
||||||
.layout = Διάταξη
|
.layout = Διάταξη
|
||||||
.manage = Διαχείριση
|
.manage = Διαχείριση
|
||||||
.view = Προβολή
|
.view = Προβολή
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = Draw
|
.draw = Draw
|
||||||
|
.parametric = Parametric
|
||||||
.annotate = Annotate
|
.annotate = Annotate
|
||||||
.insert = Insert
|
.insert = Insert
|
||||||
.model = Modelling
|
.model = Model
|
||||||
.layout = Layout
|
.layout = Layout
|
||||||
.manage = Manage
|
.manage = Manage
|
||||||
.view = View
|
.view = View
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = Dibujo
|
.draw = Dibujo
|
||||||
|
.parametric = Paramétrico
|
||||||
.annotate = Anotar
|
.annotate = Anotar
|
||||||
.insert = Insertar
|
.insert = Insertar
|
||||||
.model = Modelado
|
.model = Modelo
|
||||||
.layout = Presentación
|
.layout = Presentación
|
||||||
.manage = Administrar
|
.manage = Administrar
|
||||||
.view = Vista
|
.view = Vista
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = Piirrä
|
.draw = Piirrä
|
||||||
|
.parametric = Parametrinen
|
||||||
.annotate = Merkinnät
|
.annotate = Merkinnät
|
||||||
.insert = Lisää
|
.insert = Lisää
|
||||||
.model = Mallinnus
|
.model = Malli
|
||||||
.layout = Asettelu
|
.layout = Asettelu
|
||||||
.manage = Hallinta
|
.manage = Hallinta
|
||||||
.view = Näkymä
|
.view = Näkymä
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = Dessin
|
.draw = Dessin
|
||||||
|
.parametric = Paramétrique
|
||||||
.annotate = Annoter
|
.annotate = Annoter
|
||||||
.insert = Insérer
|
.insert = Insérer
|
||||||
.model = Modélisation
|
.model = Modèle
|
||||||
.layout = Mise en page
|
.layout = Mise en page
|
||||||
.manage = Gérer
|
.manage = Gérer
|
||||||
.view = Affichage
|
.view = Affichage
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = ड्रॉ
|
.draw = ड्रॉ
|
||||||
|
.parametric = पैरामीट्रिक
|
||||||
.annotate = एनोटेट
|
.annotate = एनोटेट
|
||||||
.insert = सम्मिलित करें
|
.insert = सम्मिलित करें
|
||||||
.model = मॉडलिंग
|
.model = मॉडल
|
||||||
.layout = लेआउट
|
.layout = लेआउट
|
||||||
.manage = प्रबंधित करें
|
.manage = प्रबंधित करें
|
||||||
.view = देखें
|
.view = देखें
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = Rajz
|
.draw = Rajz
|
||||||
|
.parametric = Parametrikus
|
||||||
.annotate = Feliratozás
|
.annotate = Feliratozás
|
||||||
.insert = Beszúrás
|
.insert = Beszúrás
|
||||||
.model = Modellezés
|
.model = Modell
|
||||||
.layout = Elrendezés
|
.layout = Elrendezés
|
||||||
.manage = Kezelés
|
.manage = Kezelés
|
||||||
.view = Nézet
|
.view = Nézet
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = Disegno
|
.draw = Disegno
|
||||||
|
.parametric = Parametrico
|
||||||
.annotate = Annotazione
|
.annotate = Annotazione
|
||||||
.insert = Inserisci
|
.insert = Inserisci
|
||||||
.model = Modellazione
|
.model = Modello
|
||||||
.layout = Disposizione
|
.layout = Disposizione
|
||||||
.manage = Gestisci
|
.manage = Gestisci
|
||||||
.view = Vista
|
.view = Vista
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = 作図
|
.draw = 作図
|
||||||
|
.parametric = パラメトリック
|
||||||
.annotate = 注釈
|
.annotate = 注釈
|
||||||
.insert = 挿入
|
.insert = 挿入
|
||||||
.model = モデリング
|
.model = モデル
|
||||||
.layout = レイアウト
|
.layout = レイアウト
|
||||||
.manage = 管理
|
.manage = 管理
|
||||||
.view = 表示
|
.view = 表示
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = 그리기
|
.draw = 그리기
|
||||||
|
.parametric = 파라메트릭
|
||||||
.annotate = 주석
|
.annotate = 주석
|
||||||
.insert = 삽입
|
.insert = 삽입
|
||||||
.model = 모델링
|
.model = 모델
|
||||||
.layout = 배치
|
.layout = 배치
|
||||||
.manage = 관리
|
.manage = 관리
|
||||||
.view = 보기
|
.view = 보기
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = Tekenen
|
.draw = Tekenen
|
||||||
|
.parametric = Parametrisch
|
||||||
.annotate = Annoteren
|
.annotate = Annoteren
|
||||||
.insert = Invoegen
|
.insert = Invoegen
|
||||||
.model = Model
|
.model = Model
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = Rysowanie
|
.draw = Rysowanie
|
||||||
|
.parametric = Parametryczne
|
||||||
.annotate = Opisy
|
.annotate = Opisy
|
||||||
.insert = Wstaw
|
.insert = Wstaw
|
||||||
.model = Modelowanie
|
.model = Model
|
||||||
.layout = Układ
|
.layout = Układ
|
||||||
.manage = Zarządzaj
|
.manage = Zarządzaj
|
||||||
.view = Widok
|
.view = Widok
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = Desenhar
|
.draw = Desenhar
|
||||||
|
.parametric = Paramétrico
|
||||||
.annotate = Anotar
|
.annotate = Anotar
|
||||||
.insert = Inserir
|
.insert = Inserir
|
||||||
.model = Modelagem
|
.model = Modelo
|
||||||
.layout = Layout
|
.layout = Layout
|
||||||
.manage = Gerenciar
|
.manage = Gerenciar
|
||||||
.view = Exibir
|
.view = Exibir
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = Начертить
|
.draw = Начертить
|
||||||
|
.parametric = Параметрический
|
||||||
.annotate = Аннотации
|
.annotate = Аннотации
|
||||||
.insert = Вставка
|
.insert = Вставка
|
||||||
.model = Моделирование
|
.model = Модель
|
||||||
.layout = Расположение
|
.layout = Расположение
|
||||||
.manage = Управление
|
.manage = Управление
|
||||||
.view = Просмотр
|
.view = Просмотр
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = Çizim
|
.draw = Çizim
|
||||||
|
.parametric = Parametrik
|
||||||
.annotate = Açıklama
|
.annotate = Açıklama
|
||||||
.insert = Ekle
|
.insert = Ekle
|
||||||
.model = Modelleme
|
.model = Model
|
||||||
.layout = Yerleşim
|
.layout = Yerleşim
|
||||||
.manage = Yönet
|
.manage = Yönet
|
||||||
.view = Görünüm
|
.view = Görünüm
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = 绘制
|
.draw = 绘制
|
||||||
|
.parametric = 参数化
|
||||||
.annotate = 注释
|
.annotate = 注释
|
||||||
.insert = 插入
|
.insert = 插入
|
||||||
.model = 建模
|
.model = 模型
|
||||||
.layout = 布局
|
.layout = 布局
|
||||||
.manage = 管理
|
.manage = 管理
|
||||||
.view = 视图
|
.view = 视图
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ action =
|
|||||||
|
|
||||||
ribbon-tab =
|
ribbon-tab =
|
||||||
.draw = 繪製
|
.draw = 繪製
|
||||||
|
.parametric = 參數化
|
||||||
.annotate = 註解
|
.annotate = 註解
|
||||||
.insert = 插入
|
.insert = 插入
|
||||||
.model = 建模
|
.model = 模型
|
||||||
.layout = 配置
|
.layout = 配置
|
||||||
.manage = 管理
|
.manage = 管理
|
||||||
.view = 視圖
|
.view = 視圖
|
||||||
|
|||||||
@@ -1006,14 +1006,14 @@ impl OpenCADStudio {
|
|||||||
}
|
}
|
||||||
|
|
||||||
"CCONSTRAINT" => {
|
"CCONSTRAINT" => {
|
||||||
use crate::modules::draw::constrain::CoincidentConstraintCommand;
|
use crate::modules::parametric::CoincidentConstraintCommand;
|
||||||
let new_cmd = CoincidentConstraintCommand::new();
|
let new_cmd = CoincidentConstraintCommand::new();
|
||||||
self.command_line.push_info(&new_cmd.prompt());
|
self.command_line.push_info(&new_cmd.prompt());
|
||||||
self.tabs[i].active_cmd = Some(Box::new(new_cmd));
|
self.tabs[i].active_cmd = Some(Box::new(new_cmd));
|
||||||
}
|
}
|
||||||
|
|
||||||
"EDCONSTRAINT" => {
|
"EDCONSTRAINT" => {
|
||||||
use crate::modules::draw::constrain::EqualDistanceConstraintCommand;
|
use crate::modules::parametric::EqualDistanceConstraintCommand;
|
||||||
let new_cmd = EqualDistanceConstraintCommand::new();
|
let new_cmd = EqualDistanceConstraintCommand::new();
|
||||||
self.command_line.push_info(&new_cmd.prompt());
|
self.command_line.push_info(&new_cmd.prompt());
|
||||||
self.tabs[i].active_cmd = Some(Box::new(new_cmd));
|
self.tabs[i].active_cmd = Some(Box::new(new_cmd));
|
||||||
@@ -1106,7 +1106,7 @@ impl OpenCADStudio {
|
|||||||
"Select exactly one entity (the circle or line the point should attach to), then run this constraint again.",
|
"Select exactly one entity (the circle or line the point should attach to), then run this constraint again.",
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
use crate::modules::draw::constrain::PointOnEntityConstraintCommand;
|
use crate::modules::parametric::PointOnEntityConstraintCommand;
|
||||||
use crate::scene::sketch_constraints::ConstraintKind;
|
use crate::scene::sketch_constraints::ConstraintKind;
|
||||||
let (name, kind, label) = match cmd {
|
let (name, kind, label) = match cmd {
|
||||||
"CPCONSTRAINT" => ("CPCONSTRAINT", ConstraintKind::CenterPoint, "Center point constraint"),
|
"CPCONSTRAINT" => ("CPCONSTRAINT", ConstraintKind::CenterPoint, "Center point constraint"),
|
||||||
@@ -1130,7 +1130,7 @@ impl OpenCADStudio {
|
|||||||
self.command_line
|
self.command_line
|
||||||
.push_output("Select exactly one line or circle, then run this constraint again.");
|
.push_output("Select exactly one line or circle, then run this constraint again.");
|
||||||
} else {
|
} else {
|
||||||
use crate::modules::draw::constrain::DistanceConstraintCommand;
|
use crate::modules::parametric::DistanceConstraintCommand;
|
||||||
match DistanceConstraintCommand::new(&self.tabs[i].scene, handles[0]) {
|
match DistanceConstraintCommand::new(&self.tabs[i].scene, handles[0]) {
|
||||||
Some(new_cmd) => {
|
Some(new_cmd) => {
|
||||||
self.command_line.push_info(&new_cmd.prompt());
|
self.command_line.push_info(&new_cmd.prompt());
|
||||||
@@ -1153,7 +1153,7 @@ impl OpenCADStudio {
|
|||||||
"Select exactly two lines (first = reference, second = the one that rotates), then run this constraint again.",
|
"Select exactly two lines (first = reference, second = the one that rotates), then run this constraint again.",
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
use crate::modules::draw::constrain::AngleConstraintCommand;
|
use crate::modules::parametric::AngleConstraintCommand;
|
||||||
match AngleConstraintCommand::new(&self.tabs[i].scene, handles[0], handles[1]) {
|
match AngleConstraintCommand::new(&self.tabs[i].scene, handles[0], handles[1]) {
|
||||||
Some(new_cmd) => {
|
Some(new_cmd) => {
|
||||||
self.command_line.push_info(&new_cmd.prompt());
|
self.command_line.push_info(&new_cmd.prompt());
|
||||||
|
|||||||
+2
-2
@@ -1446,7 +1446,7 @@ pub enum CmdResult {
|
|||||||
label: &'static str,
|
label: &'static str,
|
||||||
},
|
},
|
||||||
/// Add a persistent `CenterPoint`/`Midpoint`/`PointOnCurve` constraint
|
/// Add a persistent `CenterPoint`/`Midpoint`/`PointOnCurve` constraint
|
||||||
/// (`crate::modules::draw::constrain::point_on_entity`) between one
|
/// (`crate::modules::parametric::point_on_entity`) between one
|
||||||
/// picked point and `target`, a whole entity selected before the tool
|
/// picked point and `target`, a whole entity selected before the tool
|
||||||
/// ran. Like `AddCoincidentConstraint`, the host resolves `point` via
|
/// ran. Like `AddCoincidentConstraint`, the host resolves `point` via
|
||||||
/// `sketch_constraints::nearest_sketch_point` (a `CadCommand` has no
|
/// `sketch_constraints::nearest_sketch_point` (a `CadCommand` has no
|
||||||
@@ -1462,7 +1462,7 @@ pub enum CmdResult {
|
|||||||
label: &'static str,
|
label: &'static str,
|
||||||
},
|
},
|
||||||
/// Add a persistent `EqualDistance` constraint
|
/// Add a persistent `EqualDistance` constraint
|
||||||
/// (`crate::modules::draw::constrain::equal_distance`): the distance
|
/// (`crate::modules::parametric::equal_distance`): the distance
|
||||||
/// between `points[0]`/`points[1]` equals the distance between
|
/// between `points[0]`/`points[1]` equals the distance between
|
||||||
/// `points[2]`/`points[3]`. The host resolves each point via
|
/// `points[2]`/`points[3]`. The host resolves each point via
|
||||||
/// `sketch_constraints::nearest_sketch_point`, same reasoning as
|
/// `sketch_constraints::nearest_sketch_point`, same reasoning as
|
||||||
|
|||||||
@@ -339,6 +339,7 @@ fn format_values(template: &str, rendered: &str) -> Option<Vec<String>> {
|
|||||||
pub fn ribbon_module_title(id: &str, fallback: &str) -> String {
|
pub fn ribbon_module_title(id: &str, fallback: &str) -> String {
|
||||||
match id {
|
match id {
|
||||||
"draw" => crate::tr!("ribbon-tab", "draw"),
|
"draw" => crate::tr!("ribbon-tab", "draw"),
|
||||||
|
"parametric" => crate::tr!("ribbon-tab", "parametric"),
|
||||||
"annotate" => crate::tr!("ribbon-tab", "annotate"),
|
"annotate" => crate::tr!("ribbon-tab", "annotate"),
|
||||||
"insert" => crate::tr!("ribbon-tab", "insert"),
|
"insert" => crate::tr!("ribbon-tab", "insert"),
|
||||||
"model" => crate::tr!("ribbon-tab", "model"),
|
"model" => crate::tr!("ribbon-tab", "model"),
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
mod changelog;
|
mod changelog;
|
||||||
pub mod clipboard;
|
pub mod clipboard;
|
||||||
pub mod constrain;
|
|
||||||
pub mod defaults;
|
pub mod defaults;
|
||||||
mod donate;
|
mod donate;
|
||||||
pub mod draw;
|
pub mod draw;
|
||||||
@@ -34,11 +33,6 @@ impl CadModule for DrawModule {
|
|||||||
};
|
};
|
||||||
use crate::modules::insert::{create_block, insert_block};
|
use crate::modules::insert::{create_block, insert_block};
|
||||||
use clipboard::{copy_clip, cut, paste};
|
use clipboard::{copy_clip, cut, paste};
|
||||||
use constrain::{
|
|
||||||
angle_tool, center_point_tool, coincident_tool, colinear, concentric, distance_tool, equal,
|
|
||||||
equal_distance_tool, fixed, horizontal, midpoint_tool, normal, parallel, perpendicular, point_on_curve_tool,
|
|
||||||
symmetric, tangent, vertical,
|
|
||||||
};
|
|
||||||
use draw::{arc, circle, ellipse, hatch, line, polyline, shapes};
|
use draw::{arc, circle, ellipse, hatch, line, polyline, shapes};
|
||||||
use groups::{group, ungroup};
|
use groups::{group, ungroup};
|
||||||
use layers::{
|
use layers::{
|
||||||
@@ -126,29 +120,6 @@ impl CadModule for DrawModule {
|
|||||||
offset::tool().into(),
|
offset::tool().into(),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
RibbonGroup {
|
|
||||||
title: "Constraints",
|
|
||||||
tools: vec![
|
|
||||||
horizontal::tool().into(),
|
|
||||||
vertical::tool().into(),
|
|
||||||
parallel::tool().into(),
|
|
||||||
perpendicular::tool().into(),
|
|
||||||
equal::tool().into(),
|
|
||||||
tangent::tool().into(),
|
|
||||||
normal::tool().into(),
|
|
||||||
coincident_tool::tool().into(),
|
|
||||||
distance_tool::tool().into(),
|
|
||||||
angle_tool::tool().into(),
|
|
||||||
concentric::tool().into(),
|
|
||||||
colinear::tool().into(),
|
|
||||||
fixed::tool().into(),
|
|
||||||
symmetric::tool().into(),
|
|
||||||
center_point_tool::tool().into(),
|
|
||||||
midpoint_tool::tool().into(),
|
|
||||||
point_on_curve_tool::tool().into(),
|
|
||||||
equal_distance_tool::tool().into(),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
RibbonGroup {
|
RibbonGroup {
|
||||||
title: "Annotation",
|
title: "Annotation",
|
||||||
tools: vec![
|
tools: vec![
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ pub use ocs_plugin_api::ribbon::{
|
|||||||
pub mod annotate;
|
pub mod annotate;
|
||||||
pub mod draw;
|
pub mod draw;
|
||||||
pub mod insert;
|
pub mod insert;
|
||||||
|
pub mod parametric;
|
||||||
pub mod model;
|
pub mod model;
|
||||||
pub mod layout;
|
pub mod layout;
|
||||||
pub mod manage;
|
pub mod manage;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ impl CadModule for ModelModule {
|
|||||||
"model"
|
"model"
|
||||||
}
|
}
|
||||||
fn title(&self) -> &'static str {
|
fn title(&self) -> &'static str {
|
||||||
"Modelling"
|
"Model"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn ribbon_groups(&self) -> &[RibbonGroup] {
|
fn ribbon_groups(&self) -> &[RibbonGroup] {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ pub mod coincident_tool {
|
|||||||
id: "CCONSTRAINT",
|
id: "CCONSTRAINT",
|
||||||
label: "Coincident",
|
label: "Coincident",
|
||||||
icon: IconKind::Svg(include_bytes!(
|
icon: IconKind::Svg(include_bytes!(
|
||||||
"../../../../assets/icons/constrain/coincident.svg"
|
"../../../assets/icons/constrain/coincident.svg"
|
||||||
)),
|
)),
|
||||||
event: ModuleEvent::Command("CCONSTRAINT".to_string()),
|
event: ModuleEvent::Command("CCONSTRAINT".to_string()),
|
||||||
}
|
}
|
||||||
+1
-1
@@ -17,7 +17,7 @@ pub mod equal_distance_tool {
|
|||||||
id: "EDCONSTRAINT",
|
id: "EDCONSTRAINT",
|
||||||
label: "Equal Distance",
|
label: "Equal Distance",
|
||||||
icon: IconKind::Svg(include_bytes!(
|
icon: IconKind::Svg(include_bytes!(
|
||||||
"../../../../assets/icons/constrain/equal_distance.svg"
|
"../../../assets/icons/constrain/equal_distance.svg"
|
||||||
)),
|
)),
|
||||||
event: ModuleEvent::Command("EDCONSTRAINT".to_string()),
|
event: ModuleEvent::Command("EDCONSTRAINT".to_string()),
|
||||||
}
|
}
|
||||||
@@ -36,3 +36,46 @@ pub use tools::{
|
|||||||
tangent, vertical,
|
tangent, vertical,
|
||||||
};
|
};
|
||||||
pub use value::{angle_tool, distance_tool, AngleConstraintCommand, DistanceConstraintCommand};
|
pub use value::{angle_tool, distance_tool, AngleConstraintCommand, DistanceConstraintCommand};
|
||||||
|
|
||||||
|
use crate::modules::{CadModule, RibbonGroup};
|
||||||
|
|
||||||
|
pub struct ParametricModule;
|
||||||
|
|
||||||
|
impl CadModule for ParametricModule {
|
||||||
|
fn id(&self) -> &'static str {
|
||||||
|
"parametric"
|
||||||
|
}
|
||||||
|
|
||||||
|
fn title(&self) -> &'static str {
|
||||||
|
"Parametric"
|
||||||
|
}
|
||||||
|
|
||||||
|
fn ribbon_groups(&self) -> &[RibbonGroup] {
|
||||||
|
static GROUPS: std::sync::OnceLock<Vec<RibbonGroup>> = std::sync::OnceLock::new();
|
||||||
|
GROUPS.get_or_init(|| {
|
||||||
|
vec![RibbonGroup {
|
||||||
|
title: "Constraints",
|
||||||
|
tools: vec![
|
||||||
|
horizontal::tool().into(),
|
||||||
|
vertical::tool().into(),
|
||||||
|
parallel::tool().into(),
|
||||||
|
perpendicular::tool().into(),
|
||||||
|
equal::tool().into(),
|
||||||
|
tangent::tool().into(),
|
||||||
|
normal::tool().into(),
|
||||||
|
coincident_tool::tool().into(),
|
||||||
|
distance_tool::tool().into(),
|
||||||
|
angle_tool::tool().into(),
|
||||||
|
concentric::tool().into(),
|
||||||
|
colinear::tool().into(),
|
||||||
|
fixed::tool().into(),
|
||||||
|
symmetric::tool().into(),
|
||||||
|
center_point_tool::tool().into(),
|
||||||
|
midpoint_tool::tool().into(),
|
||||||
|
point_on_curve_tool::tool().into(),
|
||||||
|
equal_distance_tool::tool().into(),
|
||||||
|
],
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
+3
-3
@@ -25,7 +25,7 @@ pub mod center_point_tool {
|
|||||||
id: "CPCONSTRAINT",
|
id: "CPCONSTRAINT",
|
||||||
label: "Center Point",
|
label: "Center Point",
|
||||||
icon: IconKind::Svg(include_bytes!(
|
icon: IconKind::Svg(include_bytes!(
|
||||||
"../../../../assets/icons/constrain/center_point.svg"
|
"../../../assets/icons/constrain/center_point.svg"
|
||||||
)),
|
)),
|
||||||
event: ModuleEvent::Command("CPCONSTRAINT".to_string()),
|
event: ModuleEvent::Command("CPCONSTRAINT".to_string()),
|
||||||
}
|
}
|
||||||
@@ -39,7 +39,7 @@ pub mod midpoint_tool {
|
|||||||
id: "MPCONSTRAINT",
|
id: "MPCONSTRAINT",
|
||||||
label: "Midpoint",
|
label: "Midpoint",
|
||||||
icon: IconKind::Svg(include_bytes!(
|
icon: IconKind::Svg(include_bytes!(
|
||||||
"../../../../assets/icons/constrain/midpoint.svg"
|
"../../../assets/icons/constrain/midpoint.svg"
|
||||||
)),
|
)),
|
||||||
event: ModuleEvent::Command("MPCONSTRAINT".to_string()),
|
event: ModuleEvent::Command("MPCONSTRAINT".to_string()),
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ pub mod point_on_curve_tool {
|
|||||||
id: "OCCONSTRAINT",
|
id: "OCCONSTRAINT",
|
||||||
label: "Point on Curve",
|
label: "Point on Curve",
|
||||||
icon: IconKind::Svg(include_bytes!(
|
icon: IconKind::Svg(include_bytes!(
|
||||||
"../../../../assets/icons/constrain/point_on_curve.svg"
|
"../../../assets/icons/constrain/point_on_curve.svg"
|
||||||
)),
|
)),
|
||||||
event: ModuleEvent::Command("OCCONSTRAINT".to_string()),
|
event: ModuleEvent::Command("OCCONSTRAINT".to_string()),
|
||||||
}
|
}
|
||||||
@@ -9,7 +9,7 @@ pub mod horizontal {
|
|||||||
id: "HCONSTRAINT",
|
id: "HCONSTRAINT",
|
||||||
label: "Horizontal",
|
label: "Horizontal",
|
||||||
icon: IconKind::Svg(include_bytes!(
|
icon: IconKind::Svg(include_bytes!(
|
||||||
"../../../../assets/icons/constrain/horizontal.svg"
|
"../../../assets/icons/constrain/horizontal.svg"
|
||||||
)),
|
)),
|
||||||
event: ModuleEvent::Command("HCONSTRAINT".to_string()),
|
event: ModuleEvent::Command("HCONSTRAINT".to_string()),
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,7 @@ pub mod vertical {
|
|||||||
id: "VCONSTRAINT",
|
id: "VCONSTRAINT",
|
||||||
label: "Vertical",
|
label: "Vertical",
|
||||||
icon: IconKind::Svg(include_bytes!(
|
icon: IconKind::Svg(include_bytes!(
|
||||||
"../../../../assets/icons/constrain/vertical.svg"
|
"../../../assets/icons/constrain/vertical.svg"
|
||||||
)),
|
)),
|
||||||
event: ModuleEvent::Command("VCONSTRAINT".to_string()),
|
event: ModuleEvent::Command("VCONSTRAINT".to_string()),
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ pub mod parallel {
|
|||||||
id: "PCONSTRAINT",
|
id: "PCONSTRAINT",
|
||||||
label: "Parallel",
|
label: "Parallel",
|
||||||
icon: IconKind::Svg(include_bytes!(
|
icon: IconKind::Svg(include_bytes!(
|
||||||
"../../../../assets/icons/constrain/parallel.svg"
|
"../../../assets/icons/constrain/parallel.svg"
|
||||||
)),
|
)),
|
||||||
event: ModuleEvent::Command("PCONSTRAINT".to_string()),
|
event: ModuleEvent::Command("PCONSTRAINT".to_string()),
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@ pub mod perpendicular {
|
|||||||
id: "QCONSTRAINT",
|
id: "QCONSTRAINT",
|
||||||
label: "Perpendicular",
|
label: "Perpendicular",
|
||||||
icon: IconKind::Svg(include_bytes!(
|
icon: IconKind::Svg(include_bytes!(
|
||||||
"../../../../assets/icons/constrain/perpendicular.svg"
|
"../../../assets/icons/constrain/perpendicular.svg"
|
||||||
)),
|
)),
|
||||||
event: ModuleEvent::Command("QCONSTRAINT".to_string()),
|
event: ModuleEvent::Command("QCONSTRAINT".to_string()),
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,7 @@ pub mod equal {
|
|||||||
id: "ECONSTRAINT",
|
id: "ECONSTRAINT",
|
||||||
label: "Equal",
|
label: "Equal",
|
||||||
icon: IconKind::Svg(include_bytes!(
|
icon: IconKind::Svg(include_bytes!(
|
||||||
"../../../../assets/icons/constrain/equal.svg"
|
"../../../assets/icons/constrain/equal.svg"
|
||||||
)),
|
)),
|
||||||
event: ModuleEvent::Command("ECONSTRAINT".to_string()),
|
event: ModuleEvent::Command("ECONSTRAINT".to_string()),
|
||||||
}
|
}
|
||||||
@@ -79,7 +79,7 @@ pub mod tangent {
|
|||||||
id: "TCONSTRAINT",
|
id: "TCONSTRAINT",
|
||||||
label: "Tangent",
|
label: "Tangent",
|
||||||
icon: IconKind::Svg(include_bytes!(
|
icon: IconKind::Svg(include_bytes!(
|
||||||
"../../../../assets/icons/constrain/tangent.svg"
|
"../../../assets/icons/constrain/tangent.svg"
|
||||||
)),
|
)),
|
||||||
event: ModuleEvent::Command("TCONSTRAINT".to_string()),
|
event: ModuleEvent::Command("TCONSTRAINT".to_string()),
|
||||||
}
|
}
|
||||||
@@ -93,7 +93,7 @@ pub mod concentric {
|
|||||||
id: "NCONSTRAINT",
|
id: "NCONSTRAINT",
|
||||||
label: "Concentric",
|
label: "Concentric",
|
||||||
icon: IconKind::Svg(include_bytes!(
|
icon: IconKind::Svg(include_bytes!(
|
||||||
"../../../../assets/icons/constrain/concentric.svg"
|
"../../../assets/icons/constrain/concentric.svg"
|
||||||
)),
|
)),
|
||||||
event: ModuleEvent::Command("NCONSTRAINT".to_string()),
|
event: ModuleEvent::Command("NCONSTRAINT".to_string()),
|
||||||
}
|
}
|
||||||
@@ -114,7 +114,7 @@ pub mod normal {
|
|||||||
id: "NRCONSTRAINT",
|
id: "NRCONSTRAINT",
|
||||||
label: "Normal",
|
label: "Normal",
|
||||||
icon: IconKind::Svg(include_bytes!(
|
icon: IconKind::Svg(include_bytes!(
|
||||||
"../../../../assets/icons/constrain/normal.svg"
|
"../../../assets/icons/constrain/normal.svg"
|
||||||
)),
|
)),
|
||||||
event: ModuleEvent::Command("NRCONSTRAINT".to_string()),
|
event: ModuleEvent::Command("NRCONSTRAINT".to_string()),
|
||||||
}
|
}
|
||||||
@@ -128,7 +128,7 @@ pub mod colinear {
|
|||||||
id: "LCONSTRAINT",
|
id: "LCONSTRAINT",
|
||||||
label: "Colinear",
|
label: "Colinear",
|
||||||
icon: IconKind::Svg(include_bytes!(
|
icon: IconKind::Svg(include_bytes!(
|
||||||
"../../../../assets/icons/constrain/colinear.svg"
|
"../../../assets/icons/constrain/colinear.svg"
|
||||||
)),
|
)),
|
||||||
event: ModuleEvent::Command("LCONSTRAINT".to_string()),
|
event: ModuleEvent::Command("LCONSTRAINT".to_string()),
|
||||||
}
|
}
|
||||||
@@ -142,7 +142,7 @@ pub mod fixed {
|
|||||||
id: "FXCONSTRAINT",
|
id: "FXCONSTRAINT",
|
||||||
label: "Fixed",
|
label: "Fixed",
|
||||||
icon: IconKind::Svg(include_bytes!(
|
icon: IconKind::Svg(include_bytes!(
|
||||||
"../../../../assets/icons/constrain/fixed.svg"
|
"../../../assets/icons/constrain/fixed.svg"
|
||||||
)),
|
)),
|
||||||
event: ModuleEvent::Command("FXCONSTRAINT".to_string()),
|
event: ModuleEvent::Command("FXCONSTRAINT".to_string()),
|
||||||
}
|
}
|
||||||
@@ -156,7 +156,7 @@ pub mod symmetric {
|
|||||||
id: "SYCONSTRAINT",
|
id: "SYCONSTRAINT",
|
||||||
label: "Symmetric",
|
label: "Symmetric",
|
||||||
icon: IconKind::Svg(include_bytes!(
|
icon: IconKind::Svg(include_bytes!(
|
||||||
"../../../../assets/icons/constrain/symmetric.svg"
|
"../../../assets/icons/constrain/symmetric.svg"
|
||||||
)),
|
)),
|
||||||
event: ModuleEvent::Command("SYCONSTRAINT".to_string()),
|
event: ModuleEvent::Command("SYCONSTRAINT".to_string()),
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ pub mod distance_tool {
|
|||||||
id: "DCONSTRAINT",
|
id: "DCONSTRAINT",
|
||||||
label: "Distance",
|
label: "Distance",
|
||||||
icon: IconKind::Svg(include_bytes!(
|
icon: IconKind::Svg(include_bytes!(
|
||||||
"../../../../assets/icons/constrain/distance.svg"
|
"../../../assets/icons/constrain/distance.svg"
|
||||||
)),
|
)),
|
||||||
event: ModuleEvent::Command("DCONSTRAINT".to_string()),
|
event: ModuleEvent::Command("DCONSTRAINT".to_string()),
|
||||||
}
|
}
|
||||||
@@ -67,7 +67,7 @@ pub mod angle_tool {
|
|||||||
id: "ACONSTRAINT",
|
id: "ACONSTRAINT",
|
||||||
label: "Angle",
|
label: "Angle",
|
||||||
icon: IconKind::Svg(include_bytes!(
|
icon: IconKind::Svg(include_bytes!(
|
||||||
"../../../../assets/icons/constrain/angle.svg"
|
"../../../assets/icons/constrain/angle.svg"
|
||||||
)),
|
)),
|
||||||
event: ModuleEvent::Command("ACONSTRAINT".to_string()),
|
event: ModuleEvent::Command("ACONSTRAINT".to_string()),
|
||||||
}
|
}
|
||||||
@@ -14,6 +14,7 @@ use crate::modules::CadModule;
|
|||||||
pub fn all_modules() -> Vec<Box<dyn CadModule>> {
|
pub fn all_modules() -> Vec<Box<dyn CadModule>> {
|
||||||
vec![
|
vec![
|
||||||
Box::new(super::draw::DrawModule),
|
Box::new(super::draw::DrawModule),
|
||||||
|
Box::new(super::parametric::ParametricModule),
|
||||||
Box::new(super::model::ModelModule),
|
Box::new(super::model::ModelModule),
|
||||||
Box::new(super::insert::InsertModule),
|
Box::new(super::insert::InsertModule),
|
||||||
Box::new(super::annotate::AnnotateModule),
|
Box::new(super::annotate::AnnotateModule),
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ impl SketchRef {
|
|||||||
/// click" vocabulary, one layer above the `cadkernel_constraints` primitives each maps
|
/// click" vocabulary, one layer above the `cadkernel_constraints` primitives each maps
|
||||||
/// onto (that mapping is `constraint_map`, a later stage; see the design
|
/// onto (that mapping is `constraint_map`, a later stage; see the design
|
||||||
/// doc §2). Named and grouped the same way the existing one-shot ribbon
|
/// doc §2). Named and grouped the same way the existing one-shot ribbon
|
||||||
/// tools are (`crate::modules::draw::constrain::tools`), plus the
|
/// tools are (`crate::modules::parametric::tools`), plus the
|
||||||
/// endpoint-picking kinds (`Coincident`, `Radius`, `Tangent`) that one-shot
|
/// endpoint-picking kinds (`Coincident`, `Radius`, `Tangent`) that one-shot
|
||||||
/// group never needed.
|
/// group never needed.
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
|
||||||
@@ -390,7 +390,7 @@ pub(crate) fn infer_coincident_refs(
|
|||||||
|
|
||||||
impl ConstraintKind {
|
impl ConstraintKind {
|
||||||
/// The short symbol a constraint glyph shows — matches the existing
|
/// The short symbol a constraint glyph shows — matches the existing
|
||||||
/// ribbon icons (`crate::modules::draw::constrain::{tools,value}`) for
|
/// ribbon icons (`crate::modules::parametric::{tools,value}`) for
|
||||||
/// the kinds that have a one-click button, so the same glyph means the
|
/// the kinds that have a one-click button, so the same glyph means the
|
||||||
/// same thing in both places.
|
/// same thing in both places.
|
||||||
pub fn glyph_symbol(&self) -> &'static str {
|
pub fn glyph_symbol(&self) -> &'static str {
|
||||||
|
|||||||
Reference in new issue
Block a user