-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include <Precision.hxx>
class GEOM_Engine;
-class Handle(GEOM_Object);
+class GEOM_Object;
class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
public:
- Standard_EXPORT GEOMImpl_IMeasureOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IMeasureOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IMeasureOperations();
enum ShapeKind {
SK_ARC_ELLIPSE, // arc of ellipse
SK_LINE, // infinite segment
SK_SEGMENT, // segment
+ SK_CRV_BSPLINE, // B-Spline curve (open or closed)
+ SK_CRV_BEZIER, // Bezier curve (open or closed)
+ SK_HYPERBOLA, // hyperbola
+ SK_PARABOLA, // parabola
SK_EDGE, // other edge
// VERTEX
- SK_VERTEX,
+ SK_VERTEX, // vertex
// ADVANCED shapes
+ SK_LCS, // local coordinate system
+ // (other advanced shapes)
SK_ADVANCED, // all advanced shapes (temporary implementation)
};
Standard_EXPORT Handle(GEOM_Object) GetCentreOfMass (Handle(GEOM_Object) theShape);
Standard_EXPORT Handle(GEOM_Object) GetVertexByIndex (Handle(GEOM_Object) theShape,
- Standard_Integer theIndex);
+ Standard_Integer theIndex,
+ Standard_Boolean theUseOri);
Standard_EXPORT Handle(GEOM_Object) GetNormal (Handle(GEOM_Object) theFace,
Handle(GEOM_Object) theOptionalPoint);
Standard_EXPORT void GetBasicProperties (Handle(GEOM_Object) theShape,
+ const Standard_Real theTolerance,
Standard_Real& theLength,
Standard_Real& theSurfArea,
Standard_Real& theVolume);
const SICheckLevel theCheckLevel,
Handle(TColStd_HSequenceOfInteger)& theIntersections);
+ Standard_EXPORT bool CheckSelfIntersectionsFast (Handle(GEOM_Object) theShape,
+ float deflection,
+ double tolerance,
+ Handle(TColStd_HSequenceOfInteger)& theIntersections);
+
+ Standard_EXPORT bool CheckBOPArguments (const Handle(GEOM_Object) &theShape);
+
Standard_EXPORT bool FastIntersect (Handle(GEOM_Object) theShape1, Handle(GEOM_Object) theShape2,
double tolerance, float deflection,
Handle(TColStd_HSequenceOfInteger)& theIntersections1,
Standard_EXPORT Standard_Real GetAngleBtwVectors (Handle(GEOM_Object) theVec1, Handle(GEOM_Object) theVec2);
+ Standard_EXPORT Handle(TColStd_HSequenceOfTransient) PatchFace(Handle(GEOM_Object) theShape);
- // Methods for recieving radiuses of curvature of curves and surfaces
+ // Methods for receiving radiuses of curvature of curves and surfaces
// in the given point
Standard_EXPORT Standard_Real CurveCurvatureByParam (Handle(GEOM_Object) theCurve,
Standard_Real& theParam);
Standard_EXPORT Standard_Real MinSurfaceCurvatureByPoint (Handle(GEOM_Object) theSurf,
Handle(GEOM_Object) thePoint);
+ // Methods checking the shapes which are not applicable to modelling operations
+ typedef std::pair< Handle(GEOM_Object), Handle(GEOM_Object)> CoupleOfObjects;
+ struct FailedChecks
+ {
+ Standard_Integer TypeOfCheck;
+ CoupleOfObjects FailedShapes;
+ };
+
+ Standard_EXPORT std::list<CoupleOfObjects> SelfIntersected2D(const std::list<FailedChecks>& theChecks);
+ Standard_EXPORT std::list<CoupleOfObjects> InterferingSubshapes(const std::list<FailedChecks>& theChecks,
+ const int theShapeType1,
+ const int theShapeType2);
+ Standard_EXPORT Handle(TColStd_HSequenceOfTransient) SmallEdges(const std::list<FailedChecks>& theChecks);
+ Standard_EXPORT std::list<CoupleOfObjects> DistantShapes(const std::list<FailedChecks>& theChecks,
+ const int theShapeType,
+ const int theSubShapeType,
+ double theTolerance);
+ Standard_EXPORT void CheckConformityShape(Handle(GEOM_Object) theShape, std::list<FailedChecks>& theChecks);
+
+ Standard_EXPORT double ComputeTolerance(Handle(GEOM_Object) theEdge, Handle(GEOM_Object) theFace);
+ Standard_EXPORT double UpdateTolerance(Handle(GEOM_Object) theShape);
+
+ Standard_EXPORT Handle(GEOM_Object) SurfaceCurvatureByPointAndDirection
+ (Handle(GEOM_Object) theSurf,
+ Handle(GEOM_Object) thePoint,
+ Handle(GEOM_Object) theDirection);
+
+ // Methods to convert X,Y,Z coordinates of point to U,V parameters on surface and back
+ Standard_EXPORT Handle(TColStd_HArray1OfReal) XYZtoUV
+ (Handle(GEOM_Object) theSurf,
+ const Handle(TColStd_HArray1OfReal)& theXYZlist,
+ bool isNormalized);
+
+ Standard_EXPORT Handle(TColStd_HArray1OfReal) UVtoXYZ
+ (Handle(GEOM_Object) theSurf,
+ const Handle(TColStd_HArray1OfReal)& theUVlist,
+ bool isNormalized);
+
+ // Methods to compute proximity between two shapes
+ Standard_EXPORT Handle(GEOM_Object) ShapeProximityCalculator(Handle(GEOM_Object) theShape1,
+ Handle(GEOM_Object) theShape2);
+ Standard_EXPORT Standard_Real GetCoarseProximity(Handle(GEOM_Object) theCalculator,
+ bool doPythonDump = true);
+ Standard_EXPORT Standard_Real GetPreciseProximity(Handle(GEOM_Object) theCalculator);
+ Standard_EXPORT void SetShapeSampling(Handle(GEOM_Object) theCalculator,
+ Handle(GEOM_Object) theShape,
+ const Standard_Integer theNbSamples);
+
private:
void FillErrorsSub