Skip to content

Commit c836474

Browse files
shinmili38
authored andcommitted
Rename Cubiod to Cuboid
1 parent f674554 commit c836474

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

plotters/src/element/basic_shapes_3d.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@ drawing_area.fill(&WHITE).unwrap();
1414
let mut chart_builder = ChartBuilder::on(&drawing_area);
1515
let mut chart_context = chart_builder.margin(20).build_cartesian_3d(0.0..3.5, 0.0..2.5, 0.0..1.5).unwrap();
1616
chart_context.configure_axes().x_labels(4).y_labels(3).z_labels(2).draw().unwrap();
17-
let cubiod = Cubiod::new([(0.,0.,0.), (3.,2.,1.)], BLUE.mix(0.2), BLUE);
18-
chart_context.draw_series(std::iter::once(cubiod)).unwrap();
17+
let cuboid = Cuboid::new([(0.,0.,0.), (3.,2.,1.)], BLUE.mix(0.2), BLUE);
18+
chart_context.draw_series(std::iter::once(cuboid)).unwrap();
1919
```
2020
2121
The result is a semi-transparent cuboid with blue edges:
2222
2323
![](https://cdn.jsdelivr.net/gh/facorread/plotters-doc-data@b6703f7/apidoc/cuboid.svg)
2424
*/
25-
pub struct Cubiod<X, Y, Z> {
25+
pub struct Cuboid<X, Y, Z> {
2626
face_style: ShapeStyle,
2727
edge_style: ShapeStyle,
2828
vert: [(X, Y, Z); 8],
2929
}
3030

31-
impl<X: Clone, Y: Clone, Z: Clone> Cubiod<X, Y, Z> {
31+
impl<X: Clone, Y: Clone, Z: Clone> Cuboid<X, Y, Z> {
3232
/**
3333
Creates a cuboid.
3434
35-
See [`Cubiod`] for more information and examples.
35+
See [`Cuboid`] for more information and examples.
3636
*/
3737
#[allow(clippy::redundant_clone)]
3838
pub fn new<FS: Into<ShapeStyle>, ES: Into<ShapeStyle>>(
@@ -58,7 +58,7 @@ impl<X: Clone, Y: Clone, Z: Clone> Cubiod<X, Y, Z> {
5858
}
5959

6060
impl<'a, X: 'a, Y: 'a, Z: 'a> PointCollection<'a, (X, Y, Z), BackendCoordAndZ>
61-
for &'a Cubiod<X, Y, Z>
61+
for &'a Cuboid<X, Y, Z>
6262
{
6363
type Point = &'a (X, Y, Z);
6464
type IntoIter = &'a [(X, Y, Z)];
@@ -67,7 +67,7 @@ impl<'a, X: 'a, Y: 'a, Z: 'a> PointCollection<'a, (X, Y, Z), BackendCoordAndZ>
6767
}
6868
}
6969

70-
impl<X, Y, Z, DB: DrawingBackend> Drawable<DB, BackendCoordAndZ> for Cubiod<X, Y, Z> {
70+
impl<X, Y, Z, DB: DrawingBackend> Drawable<DB, BackendCoordAndZ> for Cuboid<X, Y, Z> {
7171
fn draw<I: Iterator<Item = (BackendCoord, i32)>>(
7272
&self,
7373
points: I,
@@ -106,3 +106,7 @@ impl<X, Y, Z, DB: DrawingBackend> Drawable<DB, BackendCoordAndZ> for Cubiod<X, Y
106106
Ok(())
107107
}
108108
}
109+
110+
#[deprecated(note = "Use Cuboid instead.")]
111+
/// Use [`Cuboid`] instead. This type definition is only for backward-compatibility.
112+
pub type Cubiod<X, Y, Z> = Cuboid<X, Y, Z>;

plotters/src/element/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ impl CoordMapper for BackendCoordOnly {
272272
/**
273273
Used for 3d coordinate transformations.
274274
275-
See [`Cubiod`] for more information and an example.
275+
See [`Cuboid`] for more information and an example.
276276
*/
277277
pub struct BackendCoordAndZ;
278278

plotters/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,8 +832,10 @@ pub mod prelude {
832832
};
833833

834834
// Elements
835+
#[allow(deprecated)]
836+
pub use crate::element::Cubiod;
835837
pub use crate::element::{
836-
Circle, Cross, Cubiod, DynElement, EmptyElement, IntoDynElement, MultiLineText,
838+
Circle, Cross, Cuboid, DynElement, EmptyElement, IntoDynElement, MultiLineText,
837839
PathElement, Pie, Pixel, Polygon, Rectangle, Text, TriangleMarker,
838840
};
839841

0 commit comments

Comments
 (0)