comparison Framework/Toolbox/SliceGeometry.cpp @ 66:298f375dcb68 wasm

LayerWidget
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 17 May 2017 22:03:09 +0200
parents 28956ed68280
children f244018a4e4b
comparison
equal deleted inserted replaced
65:885932a893de 66:298f375dcb68
150 // offset of the origin of the slice wrt. the origin of the 150 // offset of the origin of the slice wrt. the origin of the
151 // reference plane https://en.wikipedia.org/wiki/Vector_projection 151 // reference plane https://en.wikipedia.org/wiki/Vector_projection
152 offsetX = boost::numeric::ublas::inner_prod(axisX_, projection - origin_); 152 offsetX = boost::numeric::ublas::inner_prod(axisX_, projection - origin_);
153 offsetY = boost::numeric::ublas::inner_prod(axisY_, projection - origin_); 153 offsetY = boost::numeric::ublas::inner_prod(axisY_, projection - origin_);
154 } 154 }
155
156
157 bool SliceGeometry::IsSamePlane(const SliceGeometry& other,
158 double sliceThickness) const
159 {
160 return (GeometryToolbox::IsParallel(GetNormal(), other.GetNormal()) &&
161 GeometryToolbox::IsNear(ProjectAlongNormal(other.GetOrigin()),
162 ProjectAlongNormal(GetOrigin()),
163 sliceThickness / 2.0));
164 }
155 } 165 }