1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282
|
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to
// this header file considered to be the "object code" form of the original source.
#ifndef _ShapeFix_Face_HeaderFile
#define _ShapeFix_Face_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineHandle.hxx>
#include <Handle_ShapeFix_Face.hxx>
#include <Handle_ShapeAnalysis_Surface.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
#include <Handle_ShapeFix_Wire.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <ShapeFix_Root.hxx>
#include <Handle_Geom_Surface.hxx>
#include <Standard_Real.hxx>
#include <Handle_ShapeExtend_BasicMsgRegistrator.hxx>
#include <Handle_ShapeExtend_WireData.hxx>
#include <ShapeExtend_Status.hxx>
class ShapeAnalysis_Surface;
class ShapeFix_Wire;
class TopoDS_Face;
class Geom_Surface;
class ShapeExtend_BasicMsgRegistrator;
class TopoDS_Wire;
class TopTools_DataMapOfShapeListOfShape;
class TopTools_SequenceOfShape;
class ShapeExtend_WireData;
class TopoDS_Vertex;
class ShapeFix_DataMapOfShapeBox2d;
//! This operator allows to perform various fixes on face
//! and its wires: fixes provided by ShapeFix_Wire,
//! fixing orientation of wires, addition of natural bounds,
//! fixing of missing seam edge,
//! and detection and removal of null-area wires
class ShapeFix_Face : public ShapeFix_Root
{
public:
//! Creates an empty tool
Standard_EXPORT ShapeFix_Face();
//! Creates a tool and loads a face
Standard_EXPORT ShapeFix_Face(const TopoDS_Face& face);
//! Sets all modes to default
Standard_EXPORT virtual void ClearModes() ;
//! Loads a whole face already created, with its wires, sense and
//! location
Standard_EXPORT void Init (const TopoDS_Face& face) ;
//! Starts the creation of the face
//! By default it will be FORWARD, or REVERSED if <fwd> is False
Standard_EXPORT void Init (const Handle(Geom_Surface)& surf, const Standard_Real preci, const Standard_Boolean fwd = Standard_True) ;
//! Starts the creation of the face
//! By default it will be FORWARD, or REVERSED if <fwd> is False
Standard_EXPORT void Init (const Handle(ShapeAnalysis_Surface)& surf, const Standard_Real preci, const Standard_Boolean fwd = Standard_True) ;
//! Sets message registrator
Standard_EXPORT virtual void SetMsgRegistrator (const Handle(ShapeExtend_BasicMsgRegistrator)& msgreg) ;
//! Sets basic precision value (also to FixWireTool)
Standard_EXPORT virtual void SetPrecision (const Standard_Real preci) ;
//! Sets minimal allowed tolerance (also to FixWireTool)
Standard_EXPORT virtual void SetMinTolerance (const Standard_Real mintol) ;
//! Sets maximal allowed tolerance (also to FixWireTool)
Standard_EXPORT virtual void SetMaxTolerance (const Standard_Real maxtol) ;
//! Returns (modifiable) the mode for applying fixes of
//! ShapeFix_Wire, by default True.
Standard_Integer& FixWireMode() ;
//! Returns (modifiable) the fix orientation mode, by default
//! True. If True, wires oriented to border limited square.
Standard_Integer& FixOrientationMode() ;
//! Returns (modifiable) the add natural bound mode.
//! If true, natural boundary is added on faces that miss them.
//! Default is False for faces with single wire (they are
//! handled by FixOrientation in that case) and True for others.
Standard_Integer& FixAddNaturalBoundMode() ;
//! Returns (modifiable) the fix missing seam mode, by default
//! True. If True, tries to insert seam is missed.
Standard_Integer& FixMissingSeamMode() ;
//! Returns (modifiable) the fix small area wire mode, by default
//! False. If True, drops small wires.
Standard_Integer& FixSmallAreaWireMode() ;
//! Returns (modifiable) the remove face with small area, by default
//! False. If True, drops faces with small outer wires.
Standard_Integer& RemoveSmallAreaFaceMode() ;
//! Returns (modifiable) the fix intersecting wires mode
//! by default True.
Standard_Integer& FixIntersectingWiresMode() ;
//! Returns (modifiable) the fix loop wires mode
//! by default True.
Standard_Integer& FixLoopWiresMode() ;
//! Returns (modifiable) the fix split face mode
//! by default True.
Standard_Integer& FixSplitFaceMode() ;
//! Returns (modifiable) the auto-correct precision mode
//! by default False.
Standard_Integer& AutoCorrectPrecisionMode() ;
//! Returns (modifiable) the activation flag for periodic
//! degenerated fix. False by default.
Standard_Integer& FixPeriodicDegeneratedMode() ;
//! Returns a face which corresponds to the current state
//! Warning: The finally produced face may be another one ... but with the
//! same support
TopoDS_Face Face() const;
//! Returns resulting shape (Face or Shell if splitted)
//! To be used instead of Face() if FixMissingSeam involved
TopoDS_Shape Result() const;
//! Add a wire to current face using BRep_Builder.
//! Wire is added without taking into account orientation of face
//! (as if face were FORWARD).
Standard_EXPORT void Add (const TopoDS_Wire& wire) ;
//! Performs all the fixes, depending on modes
//! Function Status returns the status of last call to Perform()
//! ShapeExtend_OK : face was OK, nothing done
//! ShapeExtend_DONE1: some wires are fixed
//! ShapeExtend_DONE2: orientation of wires fixed
//! ShapeExtend_DONE3: missing seam added
//! ShapeExtend_DONE4: small area wire removed
//! ShapeExtend_DONE5: natural bounds added
//! ShapeExtend_FAIL1: some fails during fixing wires
//! ShapeExtend_FAIL2: cannot fix orientation of wires
//! ShapeExtend_FAIL3: cannot add missing seam
//! ShapeExtend_FAIL4: cannot remove small area wire
Standard_EXPORT Standard_Boolean Perform() ;
//! Fixes orientation of wires on the face
//! It tries to make all wires lie outside all others (according
//! to orientation) by reversing orientation of some of them.
//! If face lying on sphere or torus has single wire and
//! AddNaturalBoundMode is True, that wire is not reversed in
//! any case (supposing that natural bound will be added).
//! Returns True if wires were reversed
Standard_EXPORT Standard_Boolean FixOrientation() ;
//! Fixes orientation of wires on the face
//! It tries to make all wires lie outside all others (according
//! to orientation) by reversing orientation of some of them.
//! If face lying on sphere or torus has single wire and
//! AddNaturalBoundMode is True, that wire is not reversed in
//! any case (supposing that natural bound will be added).
//! Returns True if wires were reversed
//! OutWires return information about out wires + list of
//! internal wires for each (for performing split face).
Standard_EXPORT Standard_Boolean FixOrientation (TopTools_DataMapOfShapeListOfShape& MapWires) ;
//! Adds natural boundary on face if it is missing.
//! Two cases are supported:
//! - face has no wires
//! - face lies on geometrically double-closed surface
//! (sphere or torus) and none of wires is left-oriented
//! Returns True if natural boundary was added
Standard_EXPORT Standard_Boolean FixAddNaturalBound() ;
//! Detects and fixes the special case when face on a closed
//! surface is given by two wires closed in 3d but with gap in 2d.
//! In that case it creates a new wire from the two, and adds a
//! missing seam edge
//! Returns True if missing seam was added
Standard_EXPORT Standard_Boolean FixMissingSeam() ;
//! Detects wires with small area (that is less than
//! 100*Precision::PConfusion(). Removes these wires if they are internal.
//! Returns : True if at least one small wire removed,
//! False if does nothing.
Standard_EXPORT Standard_Boolean FixSmallAreaWire (const Standard_Boolean theIsRemoveSmallFace) ;
//! Detects if wire has a loop and fixes this situation by splitting on the few parts.
//! if wire has a loops and it was splitted Status was set to value ShapeExtend_DONE6.
Standard_EXPORT Standard_Boolean FixLoopWire (TopTools_SequenceOfShape& aResWires) ;
//! Detects and fixes the special case when face has more than one wire
//! and this wires have intersection point
Standard_EXPORT Standard_Boolean FixIntersectingWires() ;
//! If wire contains two coincidence edges it must be removed
//! Queries on status after Perform()
Standard_EXPORT Standard_Boolean FixWiresTwoCoincEdges() ;
//! Split face if there are more than one out wire
//! using inrormation after FixOrientation()
Standard_EXPORT Standard_Boolean FixSplitFace (const TopTools_DataMapOfShapeListOfShape& MapWires) ;
//! Fixes topology for a specific case when face is composed
//! by a single wire belting a periodic surface. In that case
//! a degenerated edge is reconstructed in the degenerated pole
//! of the surface. Initial wire gets consistent orientation.
//! Must be used in couple and before FixMissingSeam routine
Standard_EXPORT Standard_Boolean FixPeriodicDegenerated() ;
//! Returns the status of last call to Perform()
//! ShapeExtend_OK : face was OK, nothing done
//! ShapeExtend_DONE1: some wires are fixed
//! ShapeExtend_DONE2: orientation of wires fixed
//! ShapeExtend_DONE3: missing seam added
//! ShapeExtend_DONE4: small area wire removed
//! ShapeExtend_DONE5: natural bounds added
//! ShapeExtend_DONE8: face may be splited
//! ShapeExtend_FAIL1: some fails during fixing wires
//! ShapeExtend_FAIL2: cannot fix orientation of wires
//! ShapeExtend_FAIL3: cannot add missing seam
//! ShapeExtend_FAIL4: cannot remove small area wire
Standard_Boolean Status (const ShapeExtend_Status status) const;
//! Returns tool for fixing wires.
Handle(ShapeFix_Wire) FixWireTool() ;
DEFINE_STANDARD_RTTI(ShapeFix_Face)
protected:
Handle(ShapeAnalysis_Surface) mySurf;
TopoDS_Face myFace;
TopoDS_Shape myResult;
Handle(ShapeFix_Wire) myFixWire;
Standard_Boolean myFwd;
Standard_Integer myStatus;
private:
Standard_EXPORT Standard_Boolean SplitEdge (const Handle(ShapeExtend_WireData)& sewd, const Standard_Integer num, const Standard_Real param, const TopoDS_Vertex& vert, const Standard_Real preci, ShapeFix_DataMapOfShapeBox2d& boxes) ;
Standard_EXPORT Standard_Boolean SplitEdge (const Handle(ShapeExtend_WireData)& sewd, const Standard_Integer num, const Standard_Real param1, const Standard_Real param2, const TopoDS_Vertex& vert, const Standard_Real preci, ShapeFix_DataMapOfShapeBox2d& boxes) ;
Standard_Integer myFixWireMode;
Standard_Integer myFixOrientationMode;
Standard_Integer myFixAddNaturalBoundMode;
Standard_Integer myFixMissingSeamMode;
Standard_Integer myFixSmallAreaWireMode;
Standard_Integer myRemoveSmallAreaFaceMode;
Standard_Integer myFixLoopWiresMode;
Standard_Integer myFixIntersectingWiresMode;
Standard_Integer myFixSplitFaceMode;
Standard_Integer myAutoCorrectPrecisionMode;
Standard_Integer myFixPeriodicDegenerated;
};
#include <ShapeFix_Face.lxx>
#endif // _ShapeFix_Face_HeaderFile
|