#include <CSOGeometry.h>
Classes | |
| class | PositionObj |
Public Types | |
| enum | ReductionMode { REDUCTION_MODE_ANGLE = 0, REDUCTION_MODE_LENGTH, REDUCTION_MODE_ANGLE_AND_LENGTH } |
Public Member Functions | |
| CSOGeometry () | |
| Constructor. | |
| ~CSOGeometry () | |
| Destructor. | |
Static Public Member Functions | |
| static bool | computeIsInPlane (const CSO *cso, Vector3 &planeNormal) |
| Returns if all the seed points lie in one plane, and fills the plane normal. | |
| static bool | isSelfIntersecting (const std::vector< Vector3 > &positions, bool isClosed) |
| Returns if the given list of points interpreted as a contour intersects itself. | |
| static bool | isSelfIntersecting (const std::vector< Vector3 > &positions, std::vector< Vector3 > &intersectPoints, bool isClosed) |
| Returns if the given list of points interpreted as a contour intersects itself. | |
| static bool | isSelfIntersecting (const CSO *cso) |
| Returns if the given contour intersects itself. | |
| static bool | isSelfIntersecting (const CSO *cso, std::vector< Vector3 > &intersectPositions) |
Returns if the given contour intersects itself. Fills up the given intersectPositions vector. | |
| static 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 given segments. If this distance is 0, the intersectionPoint is valid. | |
| static double | computeSegmentSegmentDistance (const Vector3 &start0, const Vector3 &end0, const Vector3 &start1, const Vector3 &end1, Vector3 &intersectionPoint) |
| /deprecated | |
| static bool | areInSamePlane (CSO *cso0, CSO *cso1) |
| Returns if the two given CSOs lie in the same plane. | |
| static void | rotateAndProject (Rotation &rot, Vector3 &voxelPos, bool shouldProject=true) |
| Transforms and projects a voxelPos according to a rotation. | |
| static void | level (CSO *cso) |
| Determines the normal and the center of gravity of the given CSO. | |
| static void | translate (CSO *cso, const Vector3 &translation) |
| Translates a CSO with all its seed- and path points by the given translation vector. | |
| static bool | isPointInsidePolygon (const std::vector< Vector3 > &polygonPoints, const Vector3 &point) |
| Tests if a point is inside the polygon defined by the given list of positions. | |
| static void | appendUniquePosition (std::vector< Vector3 > &positions, Vector3 pos) |
| Appends a new point to the given vector without double insertions. | |
| static Vector3 | getCenterOfGravity (CSO *cso, bool considerSeedPointsExtra=false) |
| Returns the center of gravity of a given CSO. | |
| static double | distanceToLine (const Vector3 &point, const Vector3 &linePoint1, const Vector3 &linePoint2) |
| Computes distance of point to (infinite) line given by two other points:. | |
| static double | distanceToLine2 (const Vector3 &linePoint1, const Vector3 &linePoint2, const Vector3 &point, Vector3 &resultPoint) |
| Computes the squared distance of point to line segment given by two other points. | |
| static void | computeClosestSeedPoint (CSO *cso, const Vector3 &referencePoint, unsigned int &resultSeedPointIndex) |
| Returns the closest point on a cso to the given reference point. | |
| static void | computeClosestPoint (CSO *cso, const Vector3 &referencePoint, unsigned int &resultPathPointListIndex, unsigned int &resultPathPointIndex, Vector3 &resultPosition) |
| Returns the closest point on a cso to the given reference point. | |
| static void | computeClosestPoint (const std::vector< Vector3 > &pointList, const Vector3 &referencePoint, unsigned int &resultPointIndex, Vector3 &resultPosition) |
| Returns the closest point on the given list of positions. | |
| static double | computeDistance (CSO *cso, const Vector3 &referencePoint) |
| Returns the distance of the given point to the given CSO . | |
| static double | computeLength (const CSOPathPointIterator &startIter, const CSOPathPointIterator &endIter) |
| Computes the length of a CSO between two PathPointIterators. | |
| static void | 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 given cso by removing all positions that do not contribute to the overall geometry (angle and length criterion). | |
| static 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) |
| Thins out the given list of positions by removing all positions that do not contribute to the overall geometry (angle and length criterion). | |
Static Public Attributes | |
| static const unsigned int | INVALID_INDEX |
| A symbolic value that indicates an invalid index (-1). | |
Definition at line 34 of file CSOGeometry.h.
Definition at line 39 of file CSOGeometry.h.
| ml::CSOGeometry::CSOGeometry | ( | ) |
Constructor.
| ml::CSOGeometry::~CSOGeometry | ( | ) |
Destructor.
| static void ml::CSOGeometry::appendUniquePosition | ( | std::vector< Vector3 > & | positions, | |
| Vector3 | pos | |||
| ) | [static] |
Appends a new point to the given vector without double insertions.
Returns if the two given CSOs lie in the same plane.
| static void ml::CSOGeometry::computeClosestPoint | ( | const std::vector< Vector3 > & | pointList, | |
| const Vector3 & | referencePoint, | |||
| unsigned int & | resultPointIndex, | |||
| Vector3 & | resultPosition | |||
| ) | [static] |
Returns the closest point on the given list of positions.
| static void ml::CSOGeometry::computeClosestPoint | ( | CSO * | cso, | |
| const Vector3 & | referencePoint, | |||
| unsigned int & | resultPathPointListIndex, | |||
| unsigned int & | resultPathPointIndex, | |||
| Vector3 & | resultPosition | |||
| ) | [static] |
Returns the closest point on a cso to the given reference point.
| static void ml::CSOGeometry::computeClosestSeedPoint | ( | CSO * | cso, | |
| const Vector3 & | referencePoint, | |||
| unsigned int & | resultSeedPointIndex | |||
| ) | [static] |
Returns the closest point on a cso to the given reference point.
| static double ml::CSOGeometry::computeDistance | ( | CSO * | cso, | |
| const Vector3 & | referencePoint | |||
| ) | [static] |
Returns the distance of the given point to the given CSO .
Returns if all the seed points lie in one plane, and fills the plane normal.
| static double ml::CSOGeometry::computeLength | ( | const CSOPathPointIterator & | startIter, | |
| const CSOPathPointIterator & | endIter | |||
| ) | [static] |
Computes the length of a CSO between two PathPointIterators.
| static double ml::CSOGeometry::computeSegmentSegmentDistance | ( | const Vector3 & | start0, | |
| const Vector3 & | end0, | |||
| const Vector3 & | start1, | |||
| const Vector3 & | end1, | |||
| Vector3 & | intersectionPoint, | |||
| bool & | isParallel | |||
| ) | [static] |
Returns the minimum distance between the two given segments. If this distance is 0, the intersectionPoint is valid.
| static double ml::CSOGeometry::distanceToLine | ( | const Vector3 & | point, | |
| const Vector3 & | linePoint1, | |||
| const Vector3 & | linePoint2 | |||
| ) | [static] |
Computes distance of point to (infinite) line given by two other points:.
| static double ml::CSOGeometry::distanceToLine2 | ( | const Vector3 & | linePoint1, | |
| const Vector3 & | linePoint2, | |||
| const Vector3 & | point, | |||
| Vector3 & | resultPoint | |||
| ) | [static] |
Computes the squared distance of point to line segment given by two other points.
| static Vector3 ml::CSOGeometry::getCenterOfGravity | ( | CSO * | cso, | |
| bool | considerSeedPointsExtra = false | |||
| ) | [static] |
Returns the center of gravity of a given 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.
| static bool ml::CSOGeometry::isPointInsidePolygon | ( | const std::vector< Vector3 > & | polygonPoints, | |
| const Vector3 & | point | |||
| ) | [static] |
Tests if a point is inside the polygon defined by the given 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).
| static bool ml::CSOGeometry::isSelfIntersecting | ( | const CSO * | cso, | |
| std::vector< Vector3 > & | intersectPositions | |||
| ) | [static] |
Returns if the given contour intersects itself. Fills up the given intersectPositions vector.
| static bool ml::CSOGeometry::isSelfIntersecting | ( | const CSO * | cso | ) | [inline, static] |
| static bool ml::CSOGeometry::isSelfIntersecting | ( | const std::vector< Vector3 > & | positions, | |
| std::vector< Vector3 > & | intersectPoints, | |||
| bool | isClosed | |||
| ) | [static] |
Returns if the given list of points interpreted as a contour intersects itself.
Fills up the given intersectPoints vector.
| static bool ml::CSOGeometry::isSelfIntersecting | ( | const std::vector< Vector3 > & | positions, | |
| bool | isClosed | |||
| ) | [inline, static] |
Returns if the given list of points interpreted as a contour intersects itself.
Definition at line 54 of file CSOGeometry.h.
| static void ml::CSOGeometry::level | ( | CSO * | cso | ) | [static] |
Determines the normal and the center of gravity of the given CSO.
Then, all seed points and all path points are projected onto the plane that is defined by the normal and the point (CoG).
| static void ml::CSOGeometry::rotateAndProject | ( | Rotation & | rot, | |
| Vector3 & | voxelPos, | |||
| bool | shouldProject = true | |||
| ) | [static] |
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).
| static 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 | |||
| ) | [static] |
Thins out the given 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(...).
| static 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 | |||
| ) | [static] |
Thins out the given list of positions by removing all positions that do not contribute to the overall geometry (angle and length criterion).
Translates a CSO with all its seed- and path points by the given translation vector.
const unsigned int ml::CSOGeometry::INVALID_INDEX [static] |
A symbolic value that indicates an invalid index (-1).
Definition at line 130 of file CSOGeometry.h.
1.5.8