3#include "MRPch/MRBindingMacros.h"
16template<
typename T,
typename R = T>
19 if ( contour.size() < 3 )
25 for (
int i = 2; i < contour.size(); ++i )
29 area += cross( p2 - p0, p1 - p0 );
38template<
typename T,
typename R = T>
41 if ( contour.size() < 3 )
47 for (
int i = 2; i < contour.size(); ++i )
51 area += cross( p1 - p0, p2 - p0 );
59template<
typename V,
typename R =
typename V::ValueType>
63 for (
int i = 1; i < contour.size(); ++i )
64 l += R( ( contour[i] - contour[i - 1] ).
length() );
71template<
typename To,
typename From>
75 res.reserve( from.size() );
76 for (
const auto & p : from )
77 res.emplace_back( p );
84template<
typename To,
typename From>
88 res.reserve( from.size() );
89 for (
const auto & c : from )
98MR_BIND_TEMPLATE(
double calcOrientedArea(
const Contour2<double> & contour ) )
99MR_BIND_TEMPLATE(
float calcLength(
const Contour2<float>& contour ) )
100MR_BIND_TEMPLATE(
double calcLength(
const Contour2<double>& contour ) )
101MR_BIND_TEMPLATE(
float calcLength(
const Contour3<float>& contour ) )
102MR_BIND_TEMPLATE(
double calcLength(
const Contour3<double>& contour ) )
103MR_BIND_TEMPLATE( Vector3<float>
calcOrientedArea(
const Contour3<float> & contour ) )
104MR_BIND_TEMPLATE( Vector3<double>
calcOrientedArea(
const Contour3<double> & contour ) )
length
Definition MRObjectDimensionsEnum.h:14
Contour
Definition MRObjectLabel.h:17
R calcLength(const Contour< V > &contour)
Definition MRContour.h:60
MR_BIND_IGNORE To convertContour(const From &from)
Definition MRContour.h:72
MR_BIND_IGNORE To convertContours(const From &from)
Definition MRContour.h:85
R calcOrientedArea(const Contour2< T > &contour)
Definition MRContour.h:17
Definition MRCameraOrientationPlugin.h:8
float area(const MeshTopology &topology, const VertCoords &points, FaceId f)
returns the area of given face
Definition MRMeshMath.h:165
Contour2f convertContourTo2f(const From &from)
Definition MRContour.h:107
Contours2d convertContoursTo2d(const From &from)
Definition MRContour.h:114
Contours2f convertContoursTo2f(const From &from)
Definition MRContour.h:112
Contours3f convertContoursTo3f(const From &from)
Definition MRContour.h:113
Contour3f convertContourTo3f(const From &from)
Definition MRContour.h:108
Contour2d convertContourTo2d(const From &from)
Definition MRContour.h:109
Contour3d convertContourTo3d(const From &from)
Definition MRContour.h:110
Contours3d convertContoursTo3d(const From &from)
Definition MRContour.h:115
Definition MRVector2.h:29
Definition MRMesh/MRVector3.h:30