fix code + dummy dac
This commit is contained in:
parent
ce86a1cecb
commit
f307fea63c
16 changed files with 88 additions and 26 deletions
|
|
@ -1,5 +1,7 @@
|
|||
use crate::transformer::Transformers;
|
||||
use crate::point::Point;
|
||||
use crate::worldstate::WorldState;
|
||||
|
||||
use serde::{Serialize,Deserialize};
|
||||
|
||||
/// Flip Horizontal
|
||||
|
|
@ -10,7 +12,7 @@ pub struct FlipHorizontal {
|
|||
}
|
||||
|
||||
impl Transformers for FlipHorizontal {
|
||||
fn apply(&self, point_list: &[Point]) -> Vec<Point> {
|
||||
fn apply(&self, point_list: &[Point], _ws: &WorldState) -> Vec<Point> {
|
||||
point_list.iter()
|
||||
.map(| pt | {
|
||||
let dx = pt.x - self.x;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
use crate::transformer::Transformers;
|
||||
use crate::point::Point;
|
||||
use crate::worldstate::WorldState;
|
||||
|
||||
use serde::{Serialize,Deserialize};
|
||||
|
||||
/// Flip Vertical
|
||||
|
|
@ -10,7 +12,7 @@ pub struct FlipVertical {
|
|||
}
|
||||
|
||||
impl Transformers for FlipVertical {
|
||||
fn apply(&self, point_list: &[Point]) -> Vec<Point> {
|
||||
fn apply(&self, point_list: &[Point], _ws: &WorldState) -> Vec<Point> {
|
||||
point_list.iter()
|
||||
.map(| pt | {
|
||||
let dy = pt.y - self.y;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
use crate::transformer::Transformers;
|
||||
use crate::point::Point;
|
||||
use crate::worldstate::WorldState;
|
||||
|
||||
use serde::{Serialize,Deserialize};
|
||||
|
||||
/// Translate
|
||||
|
|
@ -44,7 +46,7 @@ fn square_box(size: f32, color: u32) -> Vec<(f32, f32, u32)> {
|
|||
}
|
||||
|
||||
impl Transformers for Grid {
|
||||
fn apply(&self, _point_list: &[Point]) -> Vec<Point> {
|
||||
fn apply(&self, _point_list: &[Point], _ws: &WorldState) -> Vec<Point> {
|
||||
let mut sq1 = square_box(1000.0, 255 << 8);
|
||||
let mut line = square_box(2000.0, 255);
|
||||
line.append(&mut sq1);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
use crate::transformer::Transformers;
|
||||
use crate::point::Point;
|
||||
use crate::worldstate::WorldState;
|
||||
|
||||
use serde::{Serialize,Deserialize};
|
||||
|
||||
/// Replicate
|
||||
|
|
@ -12,7 +14,7 @@ pub enum Replicate {
|
|||
}
|
||||
|
||||
impl Transformers for Replicate {
|
||||
fn apply(&self, point_list: &[Point]) -> Vec<Point> {
|
||||
fn apply(&self, point_list: &[Point], _ws: &WorldState) -> Vec<Point> {
|
||||
let mut point_list2 = vec![];
|
||||
match self {
|
||||
Replicate::Until(n) => {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
use crate::transformer::Transformers;
|
||||
use crate::point::Point;
|
||||
use crate::worldstate::WorldState;
|
||||
|
||||
use serde::{Serialize,Deserialize};
|
||||
//use std::f32::consts::PI;
|
||||
|
||||
|
|
@ -14,7 +16,7 @@ pub struct Rotate {
|
|||
}
|
||||
|
||||
impl Transformers for Rotate {
|
||||
fn apply(&self, point_list: &[Point]) -> Vec<Point> {
|
||||
fn apply(&self, point_list: &[Point], _ws: &WorldState) -> Vec<Point> {
|
||||
point_list.iter()
|
||||
.map(| pt | {
|
||||
let dx = pt.x - self.cx;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
use crate::transformer::Transformers;
|
||||
use crate::point::Point;
|
||||
use crate::worldstate::WorldState;
|
||||
use serde::{Serialize,Deserialize};
|
||||
|
||||
/// Translate
|
||||
|
|
@ -11,7 +12,7 @@ pub struct Translate {
|
|||
}
|
||||
|
||||
impl Transformers for Translate {
|
||||
fn apply(&self, point_list: &[Point]) -> Vec<Point> {
|
||||
fn apply(&self, point_list: &[Point], _ws: &WorldState) -> Vec<Point> {
|
||||
point_list.iter()
|
||||
.map(| pt | {
|
||||
Point { x: pt.x + self.x,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue