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>
50 inline 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);
179 Standard_EXPORT TopoDS_Shape
GetEdgeNearPoint (
const TopoDS_Shape& theShape,
180 const TopoDS_Vertex& thePoint);
189 Standard_EXPORT Standard_Boolean
PreciseBoundingBox(
const TopoDS_Shape &theShape, Bnd_Box &theBox);
202 const TopoDS_Shape& aSh2,
203 gp_Pnt& Ptmp1, gp_Pnt& Ptmp2);
214 Standard_EXPORT Standard_Real
GetMinDistance(
const TopoDS_Shape& theShape1,
215 const TopoDS_Shape& theShape2,
216 gp_Pnt& thePnt1, gp_Pnt& thePnt2);
229 const TopoDS_Shape& theFace,
230 double& theU,
double& theV,
231 const double theTol = 1e-04);
250 std::string& dependencyStr );
269 Standard_EXPORT
bool CheckShape( TopoDS_Shape& shape,
bool checkGeometry =
false );
296 TopAbs_ShapeEnum type,
297 Standard_Real tolerance = Precision::Confusion(),
298 bool checkGeometry =
false );
305 Standard_Real tolerance = Precision::Confusion(),
306 bool checkGeometry =
false );
313 bool checkGeometry );
335 Standard_EXPORT
bool Write(
const TopoDS_Shape& shape,
336 const char* fileName );
348 Standard_EXPORT TopoDS_Shape
ReduceCompound(
const TopoDS_Shape& shape );
357 Standard_EXPORT
void MeshShape(
const TopoDS_Shape shape,
358 double deflection,
bool forced =
true );
376 Standard_EXPORT
bool IsOpenPath(
const TopoDS_Shape &theShape);
393 const double theTolRef);
405 const double theTolShape,
406 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:684
Standard_EXPORT bool Write(const TopoDS_Shape &shape, const char *fileName)
Write shape to the BREP file.
Definition: GEOMUtils.cxx:1265
Standard_EXPORT int CompareToleranceValues(const double theTolShape, const double theTolRef)
This function compares two tolerances.
Definition: GEOMUtils.cxx:1384
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:734
Standard_EXPORT TopoDS_Shape ReduceCompound(const TopoDS_Shape &shape)
Extract single SOLID from COMPSOLID or COMPOUND.
Definition: GEOMUtils.cxx:1270
Standard_EXPORT void ConvertTreeToString(const TreeModel &tree, std::string &dependencyStr)
Convert dependency tree data to the string representation.
Definition: GEOMUtils.cxx:1116
Standard_EXPORT TopoDS_Shape GetEdgeNearPoint(const TopoDS_Shape &theShape, const TopoDS_Vertex &thePoint)
Find an edge of theShape, closest to thePoint.
Definition: GEOMUtils.cxx:755
Standard_EXPORT Standard_Real GetMinDistanceSingular(const TopoDS_Shape &aSh1, const TopoDS_Shape &aSh2, gp_Pnt &Ptmp1, gp_Pnt &Ptmp2)
Computes minumal distance between two shapes for singular cases (workaround for bugs 19899,...
Definition: GEOMUtils.cxx:891
Standard_EXPORT gp_Ax3 GetPosition(const TopoDS_Shape &theShape)
Get Local Coordinate System, corresponding to the given shape.
Definition: GEOMUtils.cxx:342
Standard_EXPORT bool FixShapeTolerance(TopoDS_Shape &shape, TopAbs_ShapeEnum type, Standard_Real tolerance=Precision::Confusion(), bool checkGeometry=false)
Limit shape tolerance to the given value.
Definition: GEOMUtils.cxx:1187
Standard_EXPORT gp_Pnt ConvertClickToPoint(int x, int y, Handle(V3d_View) theView)
Returns the point clicked in 3D view.
Definition: GEOMUtils.cxx:1090
Standard_EXPORT double DefaultDeflection()
Get default deflection coefficient used for triangulation.
Definition: GEOMUtils.cxx:1324
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:1136
Standard_EXPORT std::pair< double, double > ShapeToDouble(const TopoDS_Shape &theShape, bool isOldSorting=false)
Compute numerical functor for the shape.
Definition: GEOMUtils.cxx:302
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:1030
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:491
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:824
Standard_EXPORT bool CheckBOPArguments(const TopoDS_Shape &theShape)
Check boolean and partition operations arguments.
Definition: GEOMUtils.cxx:1164
Standard_EXPORT bool CheckShape(TopoDS_Shape &shape, bool checkGeometry=false)
Check shape.
Definition: GEOMUtils.cxx:1157
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:1405
Standard_EXPORT bool FixShapeCurves(TopoDS_Shape &shape)
Fix curves of the given shape.
Definition: GEOMUtils.cxx:1213
std::vector< LevelInfo > LevelsList
Definition: GEOMUtils.hxx:70
Standard_EXPORT void MeshShape(const TopoDS_Shape shape, double deflection, bool forced=true)
Generate triangulation for the shape.
Definition: GEOMUtils.cxx:1289
Standard_EXPORT bool IsOpenPath(const TopoDS_Shape &theShape)
Check if the shape is not a closed wire or edge.
Definition: GEOMUtils.cxx:1333
Standard_EXPORT gp_Vec GetVector(const TopoDS_Shape &theShape, Standard_Boolean doConsiderOrientation)
Get vector, defined by the given edge.
Definition: GEOMUtils.cxx:402
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:961
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:656
Standard_EXPORT TopoDS_Shape CompsolidToCompound(const TopoDS_Shape &theCompsolid)
Convert TopoDS_COMPSOLID to TopoDS_COMPOUND.
Definition: GEOMUtils.cxx:629
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
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:431
GEOMUtils_DataMapOfShapeDouble myMap
Definition: GEOMUtils.hxx:127
bool myIsOldSorting
Definition: GEOMUtils.hxx:128
CompareShapes(bool isOldSorting)
Definition: GEOMUtils.hxx:121