|
Open CASCADE Technology
6.7.1
|
This class is intended to create a shell from the composite
surface (grid of surfaces) and set of wires.
It may be either division of the supporting surface of the
face, or creating a shape corresponding to face on composite
surface which is missing in CAS.CADE but exists in some other
systems.
It splits (if necessary) original face to several ones by
splitting lines which are joint lines on a supplied grid of
surfaces (U- and V- isolines of the composite surface).
There are two modes of work, which differ in the way of
handling faces on periodic surfaces:
More...
#include <ShapeFix_ComposeShell.hxx>

Public Member Functions | |
| ShapeFix_ComposeShell () | |
| Creates empty tool. More... | |
| void | Init (const Handle< ShapeExtend_CompositeSurface > &Grid, const TopLoc_Location &L, const TopoDS_Face &Face, const Standard_Real Prec) |
| Initializes with composite surface, face and precision. Here face defines both set of wires and way of getting pcurves. Precision is used (together with tolerance of edges) for handling subtle cases, such as tangential intersections. More... | |
| Standard_Boolean & | ClosedMode () |
| Returns (modifiable) flag for special 'closed' mode which forces ComposeShell to consider all pcurves on closed surface as modulo period. This can reduce reliability, but allows to deal with wires closed in 3d but open in 2d (missing seam) Default is False More... | |
| virtual Standard_Boolean | Perform () |
| Performs the work on already loaded data. More... | |
| void | SplitEdges () |
Splits edges in the original shape by grid. <br>
This is a part of Perform() which does not produce any <br>
resulting shape; the only result is filled context <br>
where splittings are recorded. <br>
| |
| const TopoDS_Shape & | Result () const |
| Returns resulting shell or face (or Null shape if not done) More... | |
| Standard_Boolean | Status (const ShapeExtend_Status status) const |
Queries status of last call to Perform() <br> OK : nothing done (some kind of error) | |
| void | DispatchWires (TopTools_SequenceOfShape &faces, ShapeFix_SequenceOfWireSegment &wires) const |
| Creates new faces from the set of (closed) wires. Each wire is put on corresponding patch in the composite surface, and all pcurves on the initial (pseudo)face are reassigned to that surface. If several wires are one inside another, single face is created. More... | |
| void | SetTransferParamTool (const Handle< ShapeAnalysis_TransferParameters > &TransferParam) |
| Sets tool for transfer parameters from 3d to 2d and vice versa. More... | |
| Handle_ShapeAnalysis_TransferParameters | GetTransferParamTool () const |
| Gets tool for transfer parameters from 3d to 2d and vice versa. More... | |
Public Member Functions inherited from ShapeFix_Root | |
| ShapeFix_Root () | |
| Empty Constructor (no context is created) More... | |
| virtual void | Set (const Handle< ShapeFix_Root > &Root) |
| Copy all fields from another Root object More... | |
| virtual void | SetContext (const Handle< ShapeBuild_ReShape > &context) |
| Sets context More... | |
| Handle_ShapeBuild_ReShape | Context () const |
| Returns context More... | |
| virtual void | SetMsgRegistrator (const Handle< ShapeExtend_BasicMsgRegistrator > &msgreg) |
| Sets message registrator More... | |
| Handle_ShapeExtend_BasicMsgRegistrator | MsgRegistrator () const |
| Returns message registrator More... | |
| virtual void | SetPrecision (const Standard_Real preci) |
| Sets basic precision value More... | |
| Standard_Real | Precision () const |
| Returns basic precision value More... | |
| virtual void | SetMinTolerance (const Standard_Real mintol) |
| Sets minimal allowed tolerance More... | |
| Standard_Real | MinTolerance () const |
| Returns minimal allowed tolerance More... | |
| virtual void | SetMaxTolerance (const Standard_Real maxtol) |
| Sets maximal allowed tolerance More... | |
| Standard_Real | MaxTolerance () const |
| Returns maximal allowed tolerance More... | |
| Standard_Real | LimitTolerance (const Standard_Real toler) const |
| Returns tolerance limited by [myMinTol,myMaxTol] More... | |
| void | SendMsg (const TopoDS_Shape &shape, const Message_Msg &message, const Message_Gravity gravity=Message_Info) const |
| Sends a message to be attached to the shape. Calls corresponding message of message registrator. More... | |
| void | SendMsg (const Message_Msg &message, const Message_Gravity gravity=Message_Info) const |
| Sends a message to be attached to myShape. Calls previous method. More... | |
| void | SendWarning (const TopoDS_Shape &shape, const Message_Msg &message) const |
| Sends a warning to be attached to the shape. Calls SendMsg with gravity set to Message_Warning. More... | |
| void | SendWarning (const Message_Msg &message) const |
| Calls previous method for myShape. More... | |
| void | SendFail (const TopoDS_Shape &shape, const Message_Msg &message) const |
| Sends a fail to be attached to the shape. Calls SendMsg with gravity set to Message_Fail. More... | |
| void | SendFail (const Message_Msg &message) const |
| Calls previous method for myShape. More... | |
Public Member Functions inherited from MMgt_TShared | |
| virtual void | Delete () const |
| Memory deallocator for transient classes. More... | |
Public Member Functions inherited from Standard_Transient | |
| Standard_Transient () | |
| Empty constructor. More... | |
| Standard_Transient (const Standard_Transient &) | |
| Copy constructor – does nothing. More... | |
| Standard_Transient & | operator= (const Standard_Transient &) |
| Assignment operator, needed to avoid copying reference counter. More... | |
| virtual | ~Standard_Transient () |
| Destructor must be virtual. More... | |
| virtual void | ShallowDump (Standard_OStream &) const |
| virtual const Handle_Standard_Type & | DynamicType () const |
| Returns a type information object about this object. More... | |
| Standard_Boolean | IsInstance (const Handle_Standard_Type &theType) const |
| Returns a true value if this is an instance of Type. More... | |
| Standard_Boolean | IsInstance (const Standard_CString theTypeName) const |
| Returns a true value if this is an instance of TypeName. More... | |
| Standard_Boolean | IsKind (const Handle_Standard_Type &theType) const |
| Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More... | |
| Standard_Boolean | IsKind (const Standard_CString theTypeName) const |
| Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More... | |
| virtual Handle_Standard_Transient | This () const |
| Returns a Handle which references this object. Must never be called to objects created in stack. More... | |
| Standard_Integer | GetRefCount () const |
| Get the reference counter of this object. More... | |
Protected Member Functions | |
| void | LoadWires (ShapeFix_SequenceOfWireSegment &seqw) const |
| Fill sequence of wire segments by wires from myFace (pre-loaded). It performs reorder so that edges in segments are well-ordered. The context is applied to all wires before using them. More... | |
| Standard_Integer | ComputeCode (const Handle< ShapeExtend_WireData > &wire, const gp_Lin2d &line, const Standard_Integer begInd, const Standard_Integer endInd, const Standard_Real begPar, const Standard_Real endPar, const Standard_Boolean IsInternal=Standard_False) |
| Analyze tangencies and compute orientation code for wire segment between two intersections: tells if segment is on left or right side of cutting line, or tangent to it (by several points recomputed to 3d, distance is compared with tolerance of corresponding edge). More... | |
| ShapeFix_WireSegment | SplitWire (ShapeFix_WireSegment &wire, TColStd_SequenceOfInteger &indexes, const TColStd_SequenceOfReal &values, TopTools_SequenceOfShape &vertices, const TColStd_SequenceOfInteger &segcodes, const Standard_Boolean cutbyu, const Standard_Integer cutindex) |
Splits edges in the wire by given indices of edges and <br>
parameters on them. Returns resulting wire and vertices <br>
corresponding to splitting parameters. If two consequtive <br>
splitting points are too near one to another (with tolerance <br>
of edge), edge is divided in single point. In the same way, <br>
splitting which is too near to end of edge, is not applied <br>
(end vertex is returned instead). <br>
| |
| Standard_Boolean | SplitByLine (ShapeFix_WireSegment &wire, const gp_Lin2d &line, const Standard_Boolean cutbyu, const Standard_Integer cutindex, TColStd_SequenceOfReal &SplitLinePar, TColStd_SequenceOfInteger &SplitLineCode, TopTools_SequenceOfShape &SplitLineVertex) |
Split edges in the wire by cutting line. <br>
Wires with FORWARD or REVERSED orientation are considered <br>
as closed. <br>
| |
| void | SplitByLine (ShapeFix_SequenceOfWireSegment &seqw, const gp_Lin2d &line, const Standard_Boolean cutbyu, const Standard_Integer cutindex) |
Split edges in the sequence of wires by cutting line. <br>
Wires with FORWARD or REVERSED orientation are considered <br>
as closed. <br>
| |
| void | SplitByGrid (ShapeFix_SequenceOfWireSegment &seqw) |
| Split initial set of (closed) wires by grid of lines corresponding to joints between patches on the composite surface. Parts of joint lines which get inside the face are also added into the sequence as wires with orientation EXTERNAL. They share common vertices with all wires they intersect. All modifications (splitting) are recorded in context, except splitting of joint edge itself and wires marked as EXTERNAL (they supposed to be another joint edges). More... | |
| void | BreakWires (ShapeFix_SequenceOfWireSegment &seqw) |
| Break wires into open wire segments by common vertices (splitting points), so that each segment is either closed and not touching others, or touches others at ends (have common vertices). After that, each wire segment lies on its own patch of grid. More... | |
| void | CollectWires (ShapeFix_SequenceOfWireSegment &wires, ShapeFix_SequenceOfWireSegment &seqw) |
| Collect set of wire segments (already splitted) into closed wires. This is done by traversing all the segments in allowed directions, starting only from the REVERSED and FORWARD and taking EXTERNAL as necessary in fork points. Forks are detected by common vertices. In fork point, most left way is seleccted among all possible ways. More... | |
| void | MakeFacesOnPatch (TopTools_SequenceOfShape &faces, const Handle< Geom_Surface > &surf, TopTools_SequenceOfShape &loops) const |
| Creates new faces on one path of grid. It dispatches given loops (wires) into one or several faces depending on their mutual position. More... | |
Protected Attributes | |
| TopAbs_Orientation | myOrient |
| TopoDS_Shape | myResult |
| Standard_Integer | myStatus |
Protected Attributes inherited from ShapeFix_Root | |
| TopoDS_Shape | myShape |
Additional Inherited Members | |
Static Protected Member Functions inherited from ShapeFix_Root | |
| static Standard_Boolean | NeedFix (const Standard_Integer flag, const Standard_Boolean def=Standard_True) |
| Auxiliary method for work with three-position (on/off/default) flags (modes) in ShapeFix. More... | |
This class is intended to create a shell from the composite
surface (grid of surfaces) and set of wires.
It may be either division of the supporting surface of the
face, or creating a shape corresponding to face on composite
surface which is missing in CAS.CADE but exists in some other
systems.
It splits (if necessary) original face to several ones by
splitting lines which are joint lines on a supplied grid of
surfaces (U- and V- isolines of the composite surface).
There are two modes of work, which differ in the way of
handling faces on periodic surfaces:
- if ClosedMode is False (default), when splitting itself is <br>
done as if surface were not periodic. The periodicity of the <br>
underlying surface is taken into account by duplicating splitting <br>
lines in the periodic direction, as necessary to split all <br>
the wires (whole parametrical range of a face) <br>
In this mode, some regularization procedures are performed <br>
(indexation of splitted segments by patch numbers), and it is <br>
expected to be more reliable and robust in case of bad shapes <br>
| ShapeFix_ComposeShell::ShapeFix_ComposeShell | ( | ) |
Creates empty tool.
|
protected |
Break wires into open wire segments by common vertices
(splitting points), so that each segment is either closed and
not touching others, or touches others at ends (have common
vertices).
After that, each wire segment lies on its own patch of grid.
| Standard_Boolean& ShapeFix_ComposeShell::ClosedMode | ( | ) |
Returns (modifiable) flag for special 'closed'
mode which forces ComposeShell to consider
all pcurves on closed surface as modulo period.
This can reduce reliability, but allows to deal
with wires closed in 3d but open in 2d (missing seam)
Default is False
|
protected |
Collect set of wire segments (already splitted) into closed
wires. This is done by traversing all the segments in allowed
directions, starting only from the REVERSED and FORWARD and
taking EXTERNAL as necessary in fork points. Forks are detected
by common vertices. In fork point, most left way is seleccted
among all possible ways.
|
protected |
Analyze tangencies and compute orientation code for wire segment
between two intersections: tells if segment is on left or right side
of cutting line, or tangent to it (by several points recomputed to 3d,
distance is compared with tolerance of corresponding edge).
| void ShapeFix_ComposeShell::DispatchWires | ( | TopTools_SequenceOfShape & | faces, |
| ShapeFix_SequenceOfWireSegment & | wires | ||
| ) | const |
Creates new faces from the set of (closed) wires. Each wire
is put on corresponding patch in the composite surface,
and all pcurves on the initial (pseudo)face are reassigned to
that surface. If several wires are one inside another, single
face is created.
| Handle_ShapeAnalysis_TransferParameters ShapeFix_ComposeShell::GetTransferParamTool | ( | ) | const |
Gets tool for transfer parameters from 3d to 2d and vice versa.
| void ShapeFix_ComposeShell::Init | ( | const Handle< ShapeExtend_CompositeSurface > & | Grid, |
| const TopLoc_Location & | L, | ||
| const TopoDS_Face & | Face, | ||
| const Standard_Real | Prec | ||
| ) |
Initializes with composite surface, face and precision.
Here face defines both set of wires and way of getting
pcurves. Precision is used (together with tolerance of edges)
for handling subtle cases, such as tangential intersections.
|
protected |
Fill sequence of wire segments by wires from myFace
(pre-loaded). It performs reorder so that edges in segments
are well-ordered. The context is applied to all wires
before using them.
|
protected |
Creates new faces on one path of grid. It dispatches given loops
(wires) into one or several faces depending on their mutual
position.
|
virtual |
Performs the work on already loaded data.
| const TopoDS_Shape& ShapeFix_ComposeShell::Result | ( | ) | const |
Returns resulting shell or face (or Null shape if not done)
| void ShapeFix_ComposeShell::SetTransferParamTool | ( | const Handle< ShapeAnalysis_TransferParameters > & | TransferParam | ) |
Sets tool for transfer parameters from 3d to 2d and vice versa.
|
protected |
Split initial set of (closed) wires by grid of lines corresponding
to joints between patches on the composite surface.
Parts of joint lines which get inside the face are also added
into the sequence as wires with orientation EXTERNAL.
They share common vertices with all wires they intersect.
All modifications (splitting) are recorded in context,
except splitting of joint edge itself and wires marked as
EXTERNAL (they supposed to be another joint edges).
|
protected |
Split edges in the wire by cutting line. <br>
Wires with FORWARD or REVERSED orientation are considered <br>
as closed. <br>
All modifications (splitting) are recorded in context,
except splitting of wires marked as EXTERNAL
(they are supposed to be former cutting lines).
Method fills sequences of parameters of intersection points
of cutting line with all edges, their types, and corresponding
vertices (including ones created during splitting edges).
|
protected |
Split edges in the sequence of wires by cutting line. <br>
Wires with FORWARD or REVERSED orientation are considered <br>
as closed. <br>
Parts of cutting line which get inside the face (defined by
parity check of intersections with all wires) are added
into that sequence (with orientation EXTERNAL). Each part
is represented by one-edge wire segment with no 3d curve.
They share common vertices with all wires they intersect.
All modifications (splitting) are recorded in context,
except splitting of wires marked as EXTERNAL
(they are supposed to be former cutting lines).
| void ShapeFix_ComposeShell::SplitEdges | ( | ) |
Splits edges in the original shape by grid. <br>
This is a part of Perform() which does not produce any <br>
resulting shape; the only result is filled context <br>
where splittings are recorded. <br>
NOTE: If edge is splitted, it is replaced by wire, and
order of edges in the wire corresponds to FORWARD orientation
of the edge.
|
protected |
Splits edges in the wire by given indices of edges and <br>
parameters on them. Returns resulting wire and vertices <br>
corresponding to splitting parameters. If two consequtive <br>
splitting points are too near one to another (with tolerance <br>
of edge), edge is divided in single point. In the same way, <br>
splitting which is too near to end of edge, is not applied <br>
(end vertex is returned instead). <br>
NOTE: If edge is splitted, it is replaced by wire, and
order of edges in the wire corresponds to FORWARD orientation
of the edge.
| Standard_Boolean ShapeFix_ComposeShell::Status | ( | const ShapeExtend_Status | status | ) | const |
Queries status of last call to Perform() <br>
OK : nothing done (some kind of error)
DONE1: splitting is done, at least one new face created
DONE2: splitting is done, several new faces obtained
FAIL1: misoriented wire encountered (handled)
FAIL2: recoverable parity error
FAIL3: edge with no pcurve on supporting face
FAIL4: unrecoverable algorithm error (parity check)
|
protected |
|
protected |
|
protected |
1.8.5