23#ifndef _GEOMUtils_HXX_
24#define _GEOMUtils_HXX_
26#include <Standard_Macro.hxx>
27#include <TopoDS_Shape.hxx>
28#include <TopoDS_Vertex.hxx>
30#include <TopTools_ListOfShape.hxx>
37#include <V3d_View.hxx>
39#include <NCollection_DataMap.hxx>
50inline Standard_Boolean
IsEqual (
const TopoDS_Shape& S1,
const TopoDS_Shape& S2)
71 typedef std::map<std::string,std::pair<LevelsList,LevelsList> >
TreeModel;
92 Standard_EXPORT std::pair<double, double>
ShapeToDouble (
const TopoDS_Shape& theShape,
93 bool isOldSorting =
false);
102 Standard_EXPORT gp_Ax3
GetPosition (
const TopoDS_Shape& theShape);
112 Standard_EXPORT gp_Vec
GetVector (
const TopoDS_Shape& theShape,
113 Standard_Boolean doConsiderOrientation);
124 bool operator() (
const TopoDS_Shape& lhs,
const TopoDS_Shape& rhs);
134 Standard_EXPORT
void SortShapes (TopTools_ListOfShape& SL,
135 const Standard_Boolean isOldSorting = Standard_True);
156 TopTools_ListOfShape& theList);
183 Standard_EXPORT TopoDS_Shape
GetEdgeNearPoint (
const TopoDS_Shape& theShape,
184 const TopoDS_Vertex& thePoint);
193 Standard_EXPORT Standard_Boolean
PreciseBoundingBox(
const TopoDS_Shape &theShape, Bnd_Box &theBox);
204 Standard_EXPORT Standard_Real
GetMinDistance(
const TopoDS_Shape& theShape1,
205 const TopoDS_Shape& theShape2,
206 gp_Pnt& thePnt1, gp_Pnt& thePnt2);
219 const TopoDS_Shape& theFace,
220 double& theU,
double& theV,
221 const double theTol = 1e-04);
232 const TopoDS_Shape& theFace,
233 const double theTol = 1e-04);
252 std::string& dependencyStr );
272 Standard_EXPORT
bool CheckShape( TopoDS_Shape& shape,
273 bool checkGeometry =
false,
274 bool isExact =
false );
301 TopAbs_ShapeEnum type = TopAbs_SHAPE,
302 Standard_Real tolerance = Precision::Confusion(),
303 bool checkGeometry =
false,
304 bool isExactAdjust =
false );
326 Standard_EXPORT
bool Write(
const TopoDS_Shape& shape,
327 const char* fileName );
339 Standard_EXPORT TopoDS_Shape
ReduceCompound(
const TopoDS_Shape& shape );
361 Standard_EXPORT
bool MeshShape(
const TopoDS_Shape theShape,
363 const bool theForced =
true,
364 const double theAngleDeflection = 0.5,
365 const bool isRelative =
true,
366 const bool doPostCheck =
false);
385 Standard_EXPORT
bool IsOpenPath(
const TopoDS_Shape &theShape);
402 const double theTolRef);
414 const double theTolShape,
415 const double theTolRef);
Handle(TColStd_HSequenceOfTransient) AdvancedEngine_IOperations
Create a T-shape object with specified caracteristics for the main and the incident pipes (radius,...
Definition: AdvancedEngine_IOperations.cxx:1907
Standard_Boolean IsEqual(const TopoDS_Shape &S1, const TopoDS_Shape &S2)
Definition: GEOMUtils.hxx:50
Definition: GEOMUtils.hxx:56
Standard_EXPORT bool CheckTriangulation(const TopoDS_Shape &theShape)
Build a triangulation on theShape if it is absent.
Definition: GEOMUtils.cxx:1134
Standard_EXPORT bool Write(const TopoDS_Shape &shape, const char *fileName)
Write shape to the BREP file.
Definition: GEOMUtils.cxx:1082
Standard_EXPORT int CompareToleranceValues(const double theTolShape, const double theTolRef)
This function compares two tolerances.
Definition: GEOMUtils.cxx:1195
Standard_EXPORT TopAbs_ShapeEnum GetTypeOfSimplePart(const TopoDS_Shape &theShape)
Return type of shape for explode. In case of compound it will be a type of its first sub shape.
Definition: GEOMUtils.cxx:578
Standard_EXPORT TopoDS_Shape ReduceCompound(const TopoDS_Shape &shape)
Extract single SOLID from COMPSOLID or COMPOUND.
Definition: GEOMUtils.cxx:1087
Standard_EXPORT bool FixShapeTolerance(TopoDS_Shape &shape, TopAbs_ShapeEnum type=TopAbs_SHAPE, Standard_Real tolerance=Precision::Confusion(), bool checkGeometry=false, bool isExactAdjust=false)
Limit shape tolerance to the given value.
Definition: GEOMUtils.cxx:1014
Standard_EXPORT void ConvertTreeToString(const TreeModel &tree, std::string &dependencyStr)
Convert dependency tree data to the string representation.
Definition: GEOMUtils.cxx:939
Standard_EXPORT TopoDS_Shape GetEdgeNearPoint(const TopoDS_Shape &theShape, const TopoDS_Vertex &thePoint)
Find an edge of theShape, closest to thePoint.
Definition: GEOMUtils.cxx:627
Standard_EXPORT gp_Ax3 GetPosition(const TopoDS_Shape &theShape)
Get Local Coordinate System, corresponding to the given shape.
Definition: GEOMUtils.cxx:236
Standard_EXPORT gp_Pnt ConvertClickToPoint(int x, int y, Handle(V3d_View) theView)
Returns the point clicked in 3D view.
Definition: GEOMUtils.cxx:913
Standard_EXPORT double DefaultDeflection()
Get default deflection coefficient used for triangulation.
Definition: GEOMUtils.cxx:1110
std::vector< std::string > NodeLinks
Definition: GEOMUtils.hxx:68
Standard_EXPORT void ConvertStringToTree(const std::string &dependencyStr, TreeModel &tree)
Restore dependency tree data from the string representation.
Definition: GEOMUtils.cxx:959
Standard_EXPORT std::pair< double, double > ShapeToDouble(const TopoDS_Shape &theShape, bool isOldSorting=false)
Compute numerical functor for the shape.
Definition: GEOMUtils.cxx:196
Standard_EXPORT gp_Pnt ProjectPointOnFace(const gp_Pnt &thePoint, const TopoDS_Shape &theFace, double &theU, double &theV, const double theTol=1e-04)
Computes normal projection of thePoint to theFace.
Definition: GEOMUtils.cxx:794
Standard_EXPORT void SortShapes(TopTools_ListOfShape &SL, const Standard_Boolean isOldSorting=Standard_True)
Sort shapes by their centers of mass, using formula X*999 + Y*99 + Z*0.9.
Definition: GEOMUtils.cxx:385
std::map< std::string, std::pair< LevelsList, LevelsList > > TreeModel
Definition: GEOMUtils.hxx:71
Standard_EXPORT Standard_Boolean PreciseBoundingBox(const TopoDS_Shape &theShape, Bnd_Box &theBox)
Compute precise bounding box of the shape based on the rough bounding box.
Definition: GEOMUtils.cxx:696
Standard_EXPORT bool CheckShape(TopoDS_Shape &shape, bool checkGeometry=false, bool isExact=false)
Check shape.
Definition: GEOMUtils.cxx:980
Standard_EXPORT bool CheckBOPArguments(const TopoDS_Shape &theShape)
Check boolean and partition operations arguments.
Definition: GEOMUtils.cxx:991
Standard_EXPORT Standard_Real DistanceToProjectionOnFace(const gp_Pnt &thePoint, const TopoDS_Shape &theFace, const double theTol=1e-04)
Computes distance from thePoint to its normal projection on theFace.
Definition: GEOMUtils.cxx:855
Standard_EXPORT bool IsFitCondition(const ComparisonCondition theCondition, const double theTolShape, const double theTolRef)
Check if the comarison of tolerances fit the condition.
Definition: GEOMUtils.cxx:1216
Standard_EXPORT bool FixShapeCurves(TopoDS_Shape &shape)
Fix curves of the given shape.
Definition: GEOMUtils.cxx:1030
std::vector< LevelInfo > LevelsList
Definition: GEOMUtils.hxx:70
Standard_EXPORT bool IsOpenPath(const TopoDS_Shape &theShape)
Check if the shape is not a closed wire or edge.
Definition: GEOMUtils.cxx:1144
Standard_EXPORT gp_Vec GetVector(const TopoDS_Shape &theShape, Standard_Boolean doConsiderOrientation)
Get vector, defined by the given edge.
Definition: GEOMUtils.cxx:296
Standard_EXPORT TopAbs_ShapeEnum GetCommonShapeType(const TopoDS_Shape &theShape)
Get the common shape type of the top-level shapes contained in the given shape.
Definition: GEOMUtils.cxx:599
Standard_EXPORT Standard_Real GetMinDistance(const TopoDS_Shape &theShape1, const TopoDS_Shape &theShape2, gp_Pnt &thePnt1, gp_Pnt &thePnt2)
Computes minumal distance between two shapes.
Definition: GEOMUtils.cxx:764
std::map< std::string, NodeLinks > LevelInfo
Definition: GEOMUtils.hxx:69
Standard_EXPORT void AddSimpleShapes(const TopoDS_Shape &theShape, TopTools_ListOfShape &theList)
Recursively extract all shapes from compounds and compsolids of the given shape into theList.
Definition: GEOMUtils.cxx:550
Standard_EXPORT TopoDS_Shape CompsolidToCompound(const TopoDS_Shape &theCompsolid)
Convert TopoDS_COMPSOLID to TopoDS_COMPOUND.
Definition: GEOMUtils.cxx:523
ComparisonCondition
This enumeration represents comparison conditions.
Definition: GEOMUtils.hxx:61
@ CC_LE
Less then or equal to.
Definition: GEOMUtils.hxx:65
@ CC_LT
Less then.
Definition: GEOMUtils.hxx:64
@ CC_GT
Greater then.
Definition: GEOMUtils.hxx:62
@ CC_GE
Greater then or equal to.
Definition: GEOMUtils.hxx:63
Standard_EXPORT bool MeshShape(const TopoDS_Shape theShape, const double theDeflection=DefaultDeflection(), const bool theForced=true, const double theAngleDeflection=0.5, const bool isRelative=true, const bool doPostCheck=false)
Generate triangulation for theShape.
Definition: GEOMUtils.cxx:1119
Sort shapes in the list by their coordinates.
Definition: GEOMUtils.hxx:120
NCollection_DataMap< TopoDS_Shape, std::pair< double, double > > GEOMUtils_DataMapOfShapeDouble
Definition: GEOMUtils.hxx:126
bool operator()(const TopoDS_Shape &lhs, const TopoDS_Shape &rhs)
Definition: GEOMUtils.cxx:325
GEOMUtils_DataMapOfShapeDouble myMap
Definition: GEOMUtils.hxx:127
bool myIsOldSorting
Definition: GEOMUtils.hxx:128
CompareShapes(bool isOldSorting)
Definition: GEOMUtils.hxx:121