Skip to content

Commit

Permalink
Harmonise the functions related to attributeS
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoledoux committed Mar 5, 2024
1 parent 9230e8c commit 2a1a2e2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ impl Triangulation {
self.stars[vi].pt[2] = newz;
match a {
Some(x) => {
let _ = self.set_attribute(vi, x);
let _ = self.set_vertex_attributes(vi, x);
}
None => (),
}
Expand All @@ -644,7 +644,7 @@ impl Triangulation {
self.stars[vi].pt[2] = newz;
match a {
Some(x) => {
let _ = self.set_attribute(vi, x);
let _ = self.set_vertex_attributes(vi, x);
}
None => (),
}
Expand All @@ -655,7 +655,7 @@ impl Triangulation {
self.stars[vi].pt[2] = newz;
match a {
Some(x) => {
let _ = self.set_attribute(vi, x);
let _ = self.set_vertex_attributes(vi, x);
}
None => (),
}
Expand Down Expand Up @@ -778,7 +778,7 @@ impl Triangulation {
self.stars[vi].pt[2] = f64::NAN;
self.removed_indices.push(vi);
if self.attributes.is_some() {
let _ = self.set_attribute(vi, Value::Null);
let _ = self.set_vertex_attributes(vi, Value::Null);
}
if ns[0] != 0 {
self.cur = ns[0];
Expand All @@ -802,7 +802,7 @@ impl Triangulation {
}
}

pub fn get_attribute(&self, vi: usize) -> Result<Value, StartinError> {
pub fn get_vertex_attributes(&self, vi: usize) -> Result<Value, StartinError> {
match self.is_vertex_removed(vi) {
Err(why) => Err(why),
Ok(b) => match b {
Expand All @@ -815,7 +815,7 @@ impl Triangulation {
}
}

pub fn set_attribute(&mut self, vi: usize, a: Value) -> Result<bool, StartinError> {
pub fn set_vertex_attributes(&mut self, vi: usize, a: Value) -> Result<bool, StartinError> {
match self.is_vertex_removed(vi) {
Err(why) => Err(why),

Expand Down Expand Up @@ -1466,7 +1466,7 @@ impl Triangulation {
self.stars[vi].pt[2] = f64::NAN;
self.removed_indices.push(vi);
if self.attributes.is_some() {
let _ = self.set_attribute(vi, Value::Null);
let _ = self.set_vertex_attributes(vi, Value::Null);
}
}
match self.is_vertex_removed(vi) {
Expand Down

0 comments on commit 2a1a2e2

Please sign in to comment.