|
MeVisLab Toolbox Reference
|
Classes | |
| class | PositionObj |
| class | CSOPlaneGuard |
Enumerations | |
| enum | ReductionMode { REDUCTION_MODE_ANGLE = 0 , REDUCTION_MODE_LENGTH , REDUCTION_MODE_ANGLE_AND_LENGTH } |
Functions | |
| MLCSO_EXPORT bool | computeIsInPlane (const CSO *cso, Vector3 &planeNormal, double angleEpsilon=1e-3, double collinearEpsilon=1e-3) |
| MLCSO_EXPORT bool | computeIsInPlane (const std::vector< Vector3 > &points, Vector3 &planeNormal, double angleEpsilon=1e-3, double collinearEpsilon=1e-3) |
| Returns whether the specified positions form a contour that is in-plane. | |
| MLCSO_EXPORT Vector3 | computeNewellsNormal (const std::vector< Vector3 > &points) |
| Returns a normal for the specified list of points using Newell's method. | |
| MLCSO_EXPORT bool | arePointsCollinear (const std::vector< Vector3 > &points, double epsilon) |
| MLCSO_EXPORT bool | areCollinear (const Vector3 &vec1, const Vector3 &vec2, double epsilon=1e-3) |
| Returns whether the given vectors are collinear. | |
| MLCSO_EXPORT bool | canFormPlane (const Vector3 &vec1, const Vector3 &vec2, double epsilon=1e-3) |
| Returns whether both given vectors can form a plane, i.e., are not collinear or any of the vector is too short. | |
| MLCSO_EXPORT bool | isSelfIntersecting (const std::vector< Vector3 > &positions, std::vector< Vector3 > &intersectPoints, bool isClosed) |
| MLCSO_EXPORT bool | isSelfIntersecting (const std::vector< Vector3 > &positions, bool isClosed) |
| Returns whether the specified list of points interpreted as a contour intersects itself. | |
| MLCSO_EXPORT bool | isSelfIntersecting (const CSO *cso) |
| Returns whether the specified contour intersects itself. | |
| MLCSO_EXPORT bool | isSelfIntersecting (const CSO *cso, std::vector< Vector3 > &intersectPositions) |
Returns whether the specified contour intersects itself. Fills up the specified intersectPositions vector. | |
| MLCSO_EXPORT double | computeSegmentSegmentDistance (const Vector3 &start0, const Vector3 &end0, const Vector3 &start1, const Vector3 &end1, Vector3 &intersectionPoint, bool &isParallel) |
| Returns the minimum distance between the two specified segments. If this distance is 0, the intersectionPoint is valid. | |
| MLCSO_EXPORT double | computeSegmentSegmentDistance (const Vector3 &start0, const Vector3 &end0, const Vector3 &start1, const Vector3 &end1, Vector3 &intersectionPoint) |
| /deprecated | |
| MLCSO_EXPORT int | intersect2DSegments (const Vector2 &start0, const Vector2 &end0, const Vector2 &start1, const Vector2 &end1, Vector2 &intersection0, Vector2 &intersection1) |
| bool | isInSegment (const Vector2 &point, const Vector2 &segmentStart, const Vector2 &segmentEnd) |
| Helper function for intersect2DSegments. | |
| MLdouble | perp (const Vector2 &v0, const Vector2 &v1) |
| Helper function for intersect2DSegments. | |
| MLCSO_EXPORT bool | areInSamePlane (const CSO *cso0, const CSO *cso1, MLdouble angleEpsilon=10e-5, MLdouble minPlaneDistanceInMM=10e-5) |
| Returns whether the two specified CSOs lie in the same plane. | |
| MLCSO_EXPORT bool | areOverlapping (const CSO *cso0, const CSO *cso1, MLdouble epsilon=10e-5, MLdouble minPlaneDistanceInMM=10e-5) |
| Returns whether any path point of cso0 is within cso1 or vice versa. | |
| MLCSO_EXPORT void | rotateAndProject (Rotation &rot, Vector3 &voxelPos, bool shouldProject=true) |
| MLCSO_EXPORT void | rotateAroundAxis (const Vector3 &axis, const Vector3 ¢erPoint, Vector3 &pointToRotate, double angleInRadian) |
Rotates the specified pointToRotate around the axis originating from centerPoint by angleInRadian. | |
| MLCSO_EXPORT void | level (CSO *cso) |
| MLCSO_EXPORT void | level (std::vector< Vector3 > &positions) |
| Levels the specified positions so that they all lie on the average plane of the input positions. | |
| MLCSO_EXPORT void | levelToPlane (CSO &cso, const Vector3 &normal, const Vector3 &planeAnchorPoint) |
| Projects all seed points and all path points to the plane that is defined by the specified normal and plane anchor point. | |
| MLCSO_EXPORT std::vector< Vector2 > | projectTo2D (const std::vector< Vector3 > &points, const Vector3 &normal, const Vector3 &planeAnchorPoint) |
| MLCSO_EXPORT std::vector< Vector3 > | backprojectTo3D (const std::vector< Vector2 > &points, const Vector3 &normal, const Vector3 &planeAnchorPoint) |
| Back-projects the 2D points to 3D by rotating from (0,0,1) to the normal vector and adding planeAnchorPoint. | |
| MLCSO_EXPORT double | getLargestDistanceBetweenAllPathPoints (CSO &cso, Vector3 &point0, Vector3 &point1) |
| MLCSO_EXPORT void | translate (CSO *cso, const Vector3 &translation) |
| Translates a CSO with all its seed- and path points by the specified translation vector. | |
| MLCSO_EXPORT bool | isPointInsidePolygon (const std::vector< Vector3 > &polygonPoints, const Vector3 &point) |
| MLCSO_EXPORT void | appendUniquePosition (std::vector< Vector3 > &positions, Vector3 pos) |
| Appends a new point to the specified vector without double insertions. | |
| MLCSO_EXPORT Vector3 | getCenterOfGravity (CSO *cso, bool considerSeedPointsExtra=false) |
| MLCSO_EXPORT Vector3 | getCenterOfGravity (const std::vector< Vector3 > &positions) |
| Returns the center of gravity of the specified positions. | |
| MLCSO_EXPORT double | distanceToLine (const Vector3 &point, const Vector3 &linePoint1, const Vector3 &linePoint2) |
| Computes distance of point to (infinite) line specified by two other points. | |
| MLCSO_EXPORT double | squaredDistanceToLineSegment (const Vector3 &point, const Vector3 &linePoint1, const Vector3 &linePoint2) |
| Computes the squared distance of point to line segment specified by two other points. | |
| MLCSO_EXPORT double | squaredDistanceToLineSegment (const Vector3 &point, const Vector3 &linePoint1, const Vector3 &linePoint2, Vector3 &resultPoint) |
| Computes the squared distance of point to line segment specified by two other points. | |
| MLCSO_EXPORT double | squaredDistanceToLineSegment (const Vector2 &point, const Vector2 &linePoint1, const Vector2 &linePoint2) |
| Computes the squared distance of point to line segment specified by two other points. | |
| MLCSO_EXPORT void | computeClosestSeedPoint (CSO *cso, const Vector3 &referencePoint, unsigned int &resultSeedPointIndex) |
| Returns the closest point on a CSO to the specified reference point. | |
| MLCSO_EXPORT void | computeClosestPathPoint (CSO *cso, const Vector3 &referencePoint, unsigned int &resultPathPointListIndex, unsigned int &resultPathPointIndex, Vector3 &resultPosition) |
| Returns the closest path point of a CSO to the specified reference point without interpolation. | |
| MLCSO_EXPORT void | computeClosestPoint (CSO *cso, const Vector3 &referencePoint, unsigned int &resultPathPointListIndex, unsigned int &resultPathPointIndex, Vector3 &resultPosition) |
| Returns the closest point on a CSO to the specified reference point. Interpolates the closest point on the line segments. | |
| MLCSO_EXPORT void | computeClosestPoint (const std::vector< Vector3 > &pointList, const Vector3 &referencePoint, unsigned int &resultPointIndex, Vector3 &resultPosition) |
| Returns the closest point on the specified list of positions. | |
| MLCSO_EXPORT double | computeDistance (CSO *cso, const Vector3 &referencePoint) |
| Returns the distance of the specified point to the specified CSO. | |
| MLCSO_EXPORT double | computeLength (const CSOPathPointIterator &startIter, const CSOPathPointIterator &endIter) |
| Computes the length of a CSO between two PathPointIterators. | |
| MLCSO_EXPORT double | computeDiameter (const CSO *cso) |
| Computes the maximum distance between any two path points in the specified CSO. | |
| MLCSO_EXPORT double | computeDiameter (const std::vector< Vector3 > &positions) |
| Computes the maximum distance between any two points in the specified vector. | |
| MLCSO_EXPORT void | thinOutCSO (CSO *cso, float quality=0.5f, ReductionMode reductionMode=REDUCTION_MODE_ANGLE_AND_LENGTH, unsigned int minPoints=5, float maxAngleLimit=1.0) |
| MLCSO_EXPORT void | thinOutPointList (std::vector< Vector3 > &positionList, float quality=0.5f, ReductionMode reductionMode=REDUCTION_MODE_ANGLE_AND_LENGTH, unsigned int minPoints=5, float maxAngleLimit=1.0) |
| MLCSO_EXPORT bool | csoIsEnclosedByCSO (CSO *toTestInnerCSO, CSO *toTestOuterCSO) |
| Returns whether the first specified CSO lies fully within the second specified CSO without crossing. | |
| MLCSO_EXPORT size_t | getLevelOfEmbedding (const CSOListPtr &csoList, std::vector< size_t > &result) |
| MLCSO_EXPORT size_t | getLevelOfEmbedding (const std::vector< CSO * > &csos, std::vector< size_t > &result, std::vector< std::vector< size_t > > &enclosedCSOIndices) |
| MLCSO_EXPORT void | groupByLevelOfEmbedding (const std::vector< CSO * > &csos, std::vector< std::vector< CSO * > > &groupedCSOs) |
| MLCSO_EXPORT double | computeSumOfAreas (const CSOListPtr &csoList) |
| Returns the sum of areas of all CSOs in csoList. Area is counted negative if level of embedding is odd. | |
| MLCSO_EXPORT double | computeVolume (const CSOListPtr &csoList, double sliceThickness) |
| MLCSO_EXPORT bool | isApproximatelyParallel (const CSO *cso, const Vector3 &normal, double epsilon=0.1) |
| MLCSO_EXPORT void | orthogonalizePreserveLength (const Vector3 &reference, Vector3 &toAdjust) |
| template<class T> | |
| bool | isSamePosition (const T &pos1, const T &pos2) |
| Returns whether the two positions are considered equal as points of a CSO. | |
Variables | |
| const double | maxPointDiff = 10e-6 |
| Maximum distance of two points in each axis to be considered equal. | |
| const unsigned int | INVALID_INDEX = static_cast<unsigned int>(-1) |
| A symbolic value that indicates an invalid index (-1). | |
The CSOGeometry namespace offers some common methods for various geometric problems, e.g., determining whether a CSO lies in a plane, whether a CSO is self-intersecting, computing the center of gravity, or thinning out path points.
| Enumerator | |
|---|---|
| REDUCTION_MODE_ANGLE | |
| REDUCTION_MODE_LENGTH | |
| REDUCTION_MODE_ANGLE_AND_LENGTH | |
Definition at line 48 of file CSOGeometry.h.
| MLCSO_EXPORT void ml::CSOGeometry::appendUniquePosition | ( | std::vector< Vector3 > & | positions, |
| Vector3 | pos ) |
Appends a new point to the specified vector without double insertions.
References appendUniquePosition(), and MLCSO_EXPORT.
Referenced by appendUniquePosition().
| MLCSO_EXPORT bool ml::CSOGeometry::areCollinear | ( | const Vector3 & | vec1, |
| const Vector3 & | vec2, | ||
| double | epsilon = 1e-3 ) |
Returns whether the given vectors are collinear.
References areCollinear(), and MLCSO_EXPORT.
Referenced by areCollinear().
| MLCSO_EXPORT bool ml::CSOGeometry::areInSamePlane | ( | const CSO * | cso0, |
| const CSO * | cso1, | ||
| MLdouble | angleEpsilon = 10e-5, | ||
| MLdouble | minPlaneDistanceInMM = 10e-5 ) |
Returns whether the two specified CSOs lie in the same plane.
References areInSamePlane(), and MLCSO_EXPORT.
Referenced by areInSamePlane().
| MLCSO_EXPORT bool ml::CSOGeometry::areOverlapping | ( | const CSO * | cso0, |
| const CSO * | cso1, | ||
| MLdouble | epsilon = 10e-5, | ||
| MLdouble | minPlaneDistanceInMM = 10e-5 ) |
Returns whether any path point of cso0 is within cso1 or vice versa.
References areOverlapping(), and MLCSO_EXPORT.
Referenced by areOverlapping().
| MLCSO_EXPORT bool ml::CSOGeometry::arePointsCollinear | ( | const std::vector< Vector3 > & | points, |
| double | epsilon ) |
Returns whether all points are collinear. One point is assumed to be not collinear. The algorithm computes a line going through the first two points and then measures the distances of the remaining points to this line. If all distances are smaller than epsilon, the points are assumed to be collinear.
References arePointsCollinear(), and MLCSO_EXPORT.
Referenced by arePointsCollinear().
| MLCSO_EXPORT std::vector< Vector3 > ml::CSOGeometry::backprojectTo3D | ( | const std::vector< Vector2 > & | points, |
| const Vector3 & | normal, | ||
| const Vector3 & | planeAnchorPoint ) |
Back-projects the 2D points to 3D by rotating from (0,0,1) to the normal vector and adding planeAnchorPoint.
References backprojectTo3D(), and MLCSO_EXPORT.
Referenced by backprojectTo3D().
| MLCSO_EXPORT bool ml::CSOGeometry::canFormPlane | ( | const Vector3 & | vec1, |
| const Vector3 & | vec2, | ||
| double | epsilon = 1e-3 ) |
Returns whether both given vectors can form a plane, i.e., are not collinear or any of the vector is too short.
References canFormPlane(), and MLCSO_EXPORT.
Referenced by canFormPlane().
| MLCSO_EXPORT void ml::CSOGeometry::computeClosestPathPoint | ( | CSO * | cso, |
| const Vector3 & | referencePoint, | ||
| unsigned int & | resultPathPointListIndex, | ||
| unsigned int & | resultPathPointIndex, | ||
| Vector3 & | resultPosition ) |
Returns the closest path point of a CSO to the specified reference point without interpolation.
References computeClosestPathPoint(), and MLCSO_EXPORT.
Referenced by computeClosestPathPoint().
| MLCSO_EXPORT void ml::CSOGeometry::computeClosestPoint | ( | const std::vector< Vector3 > & | pointList, |
| const Vector3 & | referencePoint, | ||
| unsigned int & | resultPointIndex, | ||
| Vector3 & | resultPosition ) |
Returns the closest point on the specified list of positions.
References computeClosestPoint(), and MLCSO_EXPORT.
| MLCSO_EXPORT void ml::CSOGeometry::computeClosestPoint | ( | CSO * | cso, |
| const Vector3 & | referencePoint, | ||
| unsigned int & | resultPathPointListIndex, | ||
| unsigned int & | resultPathPointIndex, | ||
| Vector3 & | resultPosition ) |
Returns the closest point on a CSO to the specified reference point. Interpolates the closest point on the line segments.
References computeClosestPoint(), and MLCSO_EXPORT.
Referenced by computeClosestPoint(), and computeClosestPoint().
| MLCSO_EXPORT void ml::CSOGeometry::computeClosestSeedPoint | ( | CSO * | cso, |
| const Vector3 & | referencePoint, | ||
| unsigned int & | resultSeedPointIndex ) |
Returns the closest point on a CSO to the specified reference point.
References computeClosestSeedPoint(), and MLCSO_EXPORT.
Referenced by computeClosestSeedPoint().
| MLCSO_EXPORT double ml::CSOGeometry::computeDiameter | ( | const CSO * | cso | ) |
Computes the maximum distance between any two path points in the specified CSO.
References computeDiameter(), and MLCSO_EXPORT.
Referenced by computeDiameter(), and computeDiameter().
| MLCSO_EXPORT double ml::CSOGeometry::computeDiameter | ( | const std::vector< Vector3 > & | positions | ) |
Computes the maximum distance between any two points in the specified vector.
References computeDiameter(), and MLCSO_EXPORT.
| MLCSO_EXPORT double ml::CSOGeometry::computeDistance | ( | CSO * | cso, |
| const Vector3 & | referencePoint ) |
Returns the distance of the specified point to the specified CSO.
References computeDistance(), and MLCSO_EXPORT.
Referenced by computeDistance().
| MLCSO_EXPORT bool ml::CSOGeometry::computeIsInPlane | ( | const CSO * | cso, |
| Vector3 & | planeNormal, | ||
| double | angleEpsilon = 1e-3, | ||
| double | collinearEpsilon = 1e-3 ) |
Returns whether all path points lie in one plane, and fills the plane normal. Note that a CSO forming a straight line is not considered to be 'in plane' as it lies in an infinite number of planes. A collinearity check is performed by calling arePointsCollinear with collinearEpsilon. The algorithm computes the plane normal using Newell's method and tests whether the vectors starting at the first path point and ending at the remaining path points are perpendicular to that plane. The vectors are perpendicular if their dot product is less than angleEpsilon.
References computeIsInPlane(), and MLCSO_EXPORT.
Referenced by computeIsInPlane(), and computeIsInPlane().
| MLCSO_EXPORT bool ml::CSOGeometry::computeIsInPlane | ( | const std::vector< Vector3 > & | points, |
| Vector3 & | planeNormal, | ||
| double | angleEpsilon = 1e-3, | ||
| double | collinearEpsilon = 1e-3 ) |
Returns whether the specified positions form a contour that is in-plane.
References computeIsInPlane(), and MLCSO_EXPORT.
| MLCSO_EXPORT double ml::CSOGeometry::computeLength | ( | const CSOPathPointIterator & | startIter, |
| const CSOPathPointIterator & | endIter ) |
Computes the length of a CSO between two PathPointIterators.
References computeLength(), and MLCSO_EXPORT.
Referenced by computeLength().
| MLCSO_EXPORT Vector3 ml::CSOGeometry::computeNewellsNormal | ( | const std::vector< Vector3 > & | points | ) |
Returns a normal for the specified list of points using Newell's method.
References computeNewellsNormal(), and MLCSO_EXPORT.
Referenced by computeNewellsNormal().
| MLCSO_EXPORT double ml::CSOGeometry::computeSegmentSegmentDistance | ( | const Vector3 & | start0, |
| const Vector3 & | end0, | ||
| const Vector3 & | start1, | ||
| const Vector3 & | end1, | ||
| Vector3 & | intersectionPoint ) |
/deprecated
References computeSegmentSegmentDistance(), and MLCSO_EXPORT.
| MLCSO_EXPORT double ml::CSOGeometry::computeSegmentSegmentDistance | ( | const Vector3 & | start0, |
| const Vector3 & | end0, | ||
| const Vector3 & | start1, | ||
| const Vector3 & | end1, | ||
| Vector3 & | intersectionPoint, | ||
| bool & | isParallel ) |
Returns the minimum distance between the two specified segments. If this distance is 0, the intersectionPoint is valid.
References computeSegmentSegmentDistance(), and MLCSO_EXPORT.
Referenced by computeSegmentSegmentDistance(), and computeSegmentSegmentDistance().
| MLCSO_EXPORT double ml::CSOGeometry::computeSumOfAreas | ( | const CSOListPtr & | csoList | ) |
Returns the sum of areas of all CSOs in csoList. Area is counted negative if level of embedding is odd.
References computeSumOfAreas(), and MLCSO_EXPORT.
Referenced by computeSumOfAreas().
| MLCSO_EXPORT double ml::CSOGeometry::computeVolume | ( | const CSOListPtr & | csoList, |
| double | sliceThickness ) |
Returns the sum of areas of all CSOs in csoList, multiplied by the specified sliceThickness, in milliliters. Raises error when CSOs are not parallel.
References computeVolume(), and MLCSO_EXPORT.
Referenced by computeVolume().
| MLCSO_EXPORT bool ml::CSOGeometry::csoIsEnclosedByCSO | ( | CSO * | toTestInnerCSO, |
| CSO * | toTestOuterCSO ) |
Returns whether the first specified CSO lies fully within the second specified CSO without crossing.
References csoIsEnclosedByCSO(), and MLCSO_EXPORT.
Referenced by csoIsEnclosedByCSO().
| MLCSO_EXPORT double ml::CSOGeometry::distanceToLine | ( | const Vector3 & | point, |
| const Vector3 & | linePoint1, | ||
| const Vector3 & | linePoint2 ) |
Computes distance of point to (infinite) line specified by two other points.
References distanceToLine(), and MLCSO_EXPORT.
Referenced by distanceToLine().
| MLCSO_EXPORT Vector3 ml::CSOGeometry::getCenterOfGravity | ( | const std::vector< Vector3 > & | positions | ) |
Returns the center of gravity of the specified positions.
References getCenterOfGravity(), and MLCSO_EXPORT.
| MLCSO_EXPORT Vector3 ml::CSOGeometry::getCenterOfGravity | ( | CSO * | cso, |
| bool | considerSeedPointsExtra = false ) |
Returns the center of gravity of a specified CSO. An optional parameter can cause the seed points to be considered for the calculation (default = false), for example, if they are not positioned on the paths themselves.
References getCenterOfGravity(), and MLCSO_EXPORT.
Referenced by getCenterOfGravity(), and getCenterOfGravity().
| MLCSO_EXPORT double ml::CSOGeometry::getLargestDistanceBetweenAllPathPoints | ( | CSO & | cso, |
| Vector3 & | point0, | ||
| Vector3 & | point1 ) |
Returns the largest distance between any of the path points of the CSO. If the CSO has a plane normal, the calculation is done in O(N * log(N)). If the CSO does not lie in a plane, the calculation is done in O(N*N). This method also returns the two points that are furthest apart.
References getLargestDistanceBetweenAllPathPoints(), and MLCSO_EXPORT.
Referenced by getLargestDistanceBetweenAllPathPoints().
| MLCSO_EXPORT size_t ml::CSOGeometry::getLevelOfEmbedding | ( | const CSOListPtr & | csoList, |
| std::vector< size_t > & | result ) |
Writes the level of embedding of the CSOs in the specified CSOList into the specified vector of integers. Returns the maximum level of embedding. An odd number indicates an inner CSO, an even number an outer CSO. Note that the inner CSO of an inner CSO is considered an outer CSO again.
References getLevelOfEmbedding(), and MLCSO_EXPORT.
Referenced by getLevelOfEmbedding(), and getLevelOfEmbedding().
| MLCSO_EXPORT size_t ml::CSOGeometry::getLevelOfEmbedding | ( | const std::vector< CSO * > & | csos, |
| std::vector< size_t > & | result, | ||
| std::vector< std::vector< size_t > > & | enclosedCSOIndices ) |
Extension of getLevelOfEmbedding that also records the indices of the CSOs enclosed by each CSO. The input is a vector of CSOs to make it usable for CSOLists, CSOGroups, or custom collections of CSOs.
References getLevelOfEmbedding(), and MLCSO_EXPORT.
| MLCSO_EXPORT void ml::CSOGeometry::groupByLevelOfEmbedding | ( | const std::vector< CSO * > & | csos, |
| std::vector< std::vector< CSO * > > & | groupedCSOs ) |
Arranges the specified CSOs into a vector of vectors so that CSOs embedded into each other are grouped together with increasing level of embedding. The input is a vector of CSOs to make it usable for CSOLists, CSOGroups, or custom collections of CSOs.
References groupByLevelOfEmbedding(), and MLCSO_EXPORT.
Referenced by groupByLevelOfEmbedding().
| MLCSO_EXPORT int ml::CSOGeometry::intersect2DSegments | ( | const Vector2 & | start0, |
| const Vector2 & | end0, | ||
| const Vector2 & | start1, | ||
| const Vector2 & | end1, | ||
| Vector2 & | intersection0, | ||
| Vector2 & | intersection1 ) |
Computes whether the two specified 2D segments intersect; if they intersect, the intersection point is valid. Returns 0 if no intersection, 1 if intersects, and 2 if overlap from intersection0 to intersection1.
References intersect2DSegments(), and MLCSO_EXPORT.
Referenced by intersect2DSegments().
| MLCSO_EXPORT bool ml::CSOGeometry::isApproximatelyParallel | ( | const CSO * | cso, |
| const Vector3 & | normal, | ||
| double | epsilon = 0.1 ) |
Returns whether the specified CSO is approximately parallel to a plane specified by the normal vector. The optional thickness parameter epsilon is a limit to the thickness of the point cloud of the CSO points in direction of the normal. This method can also be used to determine whether a CSO is in-plane with a very small epsilon value and a normal pointing into the same direction as the assumed CSO's normal.
References isApproximatelyParallel(), and MLCSO_EXPORT.
Referenced by isApproximatelyParallel().
| MLCSO_EXPORT bool ml::CSOGeometry::isPointInsidePolygon | ( | const std::vector< Vector3 > & | polygonPoints, |
| const Vector3 & | point ) |
Returns whether a point is inside the polygon defined by the specified list of positions. Make sure that the point and the list of positions lie both in the z-plane (the plane with the z-axis as the normal).
References isPointInsidePolygon(), and MLCSO_EXPORT.
Referenced by isPointInsidePolygon().
Returns whether the two positions are considered equal as points of a CSO.
Definition at line 229 of file CSOGeometry.h.
References fabs(), isSamePosition(), maxPointDiff, and T.
Referenced by isSamePosition().
| MLCSO_EXPORT bool ml::CSOGeometry::isSelfIntersecting | ( | const CSO * | cso | ) |
Returns whether the specified contour intersects itself.
References isSelfIntersecting(), and MLCSO_EXPORT.
| MLCSO_EXPORT bool ml::CSOGeometry::isSelfIntersecting | ( | const CSO * | cso, |
| std::vector< Vector3 > & | intersectPositions ) |
Returns whether the specified contour intersects itself. Fills up the specified intersectPositions vector.
References isSelfIntersecting(), and MLCSO_EXPORT.
| MLCSO_EXPORT bool ml::CSOGeometry::isSelfIntersecting | ( | const std::vector< Vector3 > & | positions, |
| bool | isClosed ) |
Returns whether the specified list of points interpreted as a contour intersects itself.
References isSelfIntersecting(), and MLCSO_EXPORT.
| MLCSO_EXPORT bool ml::CSOGeometry::isSelfIntersecting | ( | const std::vector< Vector3 > & | positions, |
| std::vector< Vector3 > & | intersectPoints, | ||
| bool | isClosed ) |
Returns whether the specified list of points interpreted as a contour intersects itself. Fills up the specified intersectPoints vector.
References isSelfIntersecting(), and MLCSO_EXPORT.
Referenced by isSelfIntersecting(), isSelfIntersecting(), isSelfIntersecting(), and isSelfIntersecting().
| MLCSO_EXPORT void ml::CSOGeometry::level | ( | CSO * | cso | ) |
Determines the normal and the center of gravity of the specified CSO. Then, all seed points and all path points are projected onto the plane that is defined by the normal and the point (CoG). In the case you know the plane to which the CSO should be leveled, use the levelToPlane method instead.
References level(), and MLCSO_EXPORT.
| MLCSO_EXPORT void ml::CSOGeometry::level | ( | std::vector< Vector3 > & | positions | ) |
Levels the specified positions so that they all lie on the average plane of the input positions.
References level(), and MLCSO_EXPORT.
| MLCSO_EXPORT void ml::CSOGeometry::levelToPlane | ( | CSO & | cso, |
| const Vector3 & | normal, | ||
| const Vector3 & | planeAnchorPoint ) |
Projects all seed points and all path points to the plane that is defined by the specified normal and plane anchor point.
References levelToPlane(), and MLCSO_EXPORT.
Referenced by levelToPlane().
| MLCSO_EXPORT void ml::CSOGeometry::orthogonalizePreserveLength | ( | const Vector3 & | reference, |
| Vector3 & | toAdjust ) |
Makes the specified vector toAdjust perpendicular to the specified reference vector while preserving its length.
References MLCSO_EXPORT, and orthogonalizePreserveLength().
Referenced by orthogonalizePreserveLength().
| MLCSO_EXPORT std::vector< Vector2 > ml::CSOGeometry::projectTo2D | ( | const std::vector< Vector3 > & | points, |
| const Vector3 & | normal, | ||
| const Vector3 & | planeAnchorPoint ) |
Projects the 3D points to 2D by subtracting planeAnchorPoint, rotating from the normal vector to (0,0,1) and discarding the z positions.
References MLCSO_EXPORT, and projectTo2D().
Referenced by projectTo2D().
| MLCSO_EXPORT void ml::CSOGeometry::rotateAndProject | ( | Rotation & | rot, |
| Vector3 & | voxelPos, | ||
| bool | shouldProject = true ) |
Transforms and projects a voxelPos according to a rotation. Make sure that the rotation rotates the voxelPos to the z-plane (the plane with the z-axis as a normal).
References MLCSO_EXPORT, and rotateAndProject().
Referenced by rotateAndProject().
| MLCSO_EXPORT void ml::CSOGeometry::rotateAroundAxis | ( | const Vector3 & | axis, |
| const Vector3 & | centerPoint, | ||
| Vector3 & | pointToRotate, | ||
| double | angleInRadian ) |
Rotates the specified pointToRotate around the axis originating from centerPoint by angleInRadian.
References MLCSO_EXPORT, and rotateAroundAxis().
Referenced by rotateAroundAxis().
| MLCSO_EXPORT double ml::CSOGeometry::squaredDistanceToLineSegment | ( | const Vector2 & | point, |
| const Vector2 & | linePoint1, | ||
| const Vector2 & | linePoint2 ) |
Computes the squared distance of point to line segment specified by two other points.
References MLCSO_EXPORT, and squaredDistanceToLineSegment().
| MLCSO_EXPORT double ml::CSOGeometry::squaredDistanceToLineSegment | ( | const Vector3 & | point, |
| const Vector3 & | linePoint1, | ||
| const Vector3 & | linePoint2 ) |
Computes the squared distance of point to line segment specified by two other points.
References MLCSO_EXPORT, and squaredDistanceToLineSegment().
Referenced by squaredDistanceToLineSegment(), squaredDistanceToLineSegment(), and squaredDistanceToLineSegment().
| MLCSO_EXPORT double ml::CSOGeometry::squaredDistanceToLineSegment | ( | const Vector3 & | point, |
| const Vector3 & | linePoint1, | ||
| const Vector3 & | linePoint2, | ||
| Vector3 & | resultPoint ) |
Computes the squared distance of point to line segment specified by two other points.
References MLCSO_EXPORT, and squaredDistanceToLineSegment().
| MLCSO_EXPORT void ml::CSOGeometry::thinOutCSO | ( | CSO * | cso, |
| float | quality = 0.5f, | ||
| ReductionMode | reductionMode = REDUCTION_MODE_ANGLE_AND_LENGTH, | ||
| unsigned int | minPoints = 5, | ||
| float | maxAngleLimit = 1.0 ) |
Thins out the specified CSO by removing all positions that do not contribute to the overall geometry (angle and length criterion). This function is a modification of CSOMath::thinOutPathPoints(...).
References MLCSO_EXPORT, REDUCTION_MODE_ANGLE_AND_LENGTH, and thinOutCSO().
Referenced by thinOutCSO().
| MLCSO_EXPORT void ml::CSOGeometry::thinOutPointList | ( | std::vector< Vector3 > & | positionList, |
| float | quality = 0.5f, | ||
| ReductionMode | reductionMode = REDUCTION_MODE_ANGLE_AND_LENGTH, | ||
| unsigned int | minPoints = 5, | ||
| float | maxAngleLimit = 1.0 ) |
Thins out the specified list of positions by removing all positions that do not contribute to the overall geometry (angle and length criterion).
References MLCSO_EXPORT, REDUCTION_MODE_ANGLE_AND_LENGTH, and thinOutPointList().
Referenced by thinOutPointList().
| MLCSO_EXPORT void ml::CSOGeometry::translate | ( | CSO * | cso, |
| const Vector3 & | translation ) |
Translates a CSO with all its seed- and path points by the specified translation vector.
References MLCSO_EXPORT, and translate().
Referenced by translate().
| const unsigned int ml::CSOGeometry::INVALID_INDEX = static_cast<unsigned int>(-1) |
A symbolic value that indicates an invalid index (-1).
Definition at line 240 of file CSOGeometry.h.
| const double ml::CSOGeometry::maxPointDiff = 10e-6 |
Maximum distance of two points in each axis to be considered equal.
Definition at line 46 of file CSOGeometry.h.
Referenced by isSamePosition().