Open CASCADE Technology
7.7.0
|
This tool tries to unify faces and edges of the shape which lie on the same geometry. Faces/edges are considering as 'same-domain' if a group of neighbouring faces/edges are lying on coincident surfaces/curves. In this case these faces/edges can be unified into one face/edge. ShapeUpgrade_UnifySameDomain is initialized by a shape and the next optional parameters: UnifyFaces - tries to unify all possible faces UnifyEdges - tries to unify all possible edges ConcatBSplines - if this flag is set to true then all neighbouring edges, which lay on BSpline or Bezier curves with C1 continuity on their common vertices, will be merged into one common edge. More...
#include <ShapeUpgrade_UnifySameDomain.hxx>
Public Types | |
typedef NCollection_DataMap< TopoDS_Shape, Handle< Geom_Plane >, TopTools_ShapeMapHasher > | DataMapOfFacePlane |
Public Types inherited from Standard_Transient | |
typedef void | base_type |
Returns a type descriptor about this object. More... | |
Public Member Functions | |
ShapeUpgrade_UnifySameDomain () | |
Empty constructor. More... | |
ShapeUpgrade_UnifySameDomain (const TopoDS_Shape &aShape, const Standard_Boolean UnifyEdges=Standard_True, const Standard_Boolean UnifyFaces=Standard_True, const Standard_Boolean ConcatBSplines=Standard_False) | |
Constructor defining input shape and necessary flags. It does not perform unification. More... | |
void | Initialize (const TopoDS_Shape &aShape, const Standard_Boolean UnifyEdges=Standard_True, const Standard_Boolean UnifyFaces=Standard_True, const Standard_Boolean ConcatBSplines=Standard_False) |
Initializes with a shape and necessary flags. It does not perform unification. If you intend to nullify the History place holder do it after initialization. More... | |
void | AllowInternalEdges (const Standard_Boolean theValue) |
Sets the flag defining whether it is allowed to create internal edges inside merged faces in the case of non-manifold topology. Without this flag merging through multi connected edge is forbidden. Default value is false. More... | |
void | KeepShape (const TopoDS_Shape &theShape) |
Sets the shape for avoid merging of the faces/edges. This shape can be vertex or edge. If the shape is a vertex it forbids merging of connected edges. If the shape is a edge it forbids merging of connected faces. This method can be called several times to keep several shapes. More... | |
void | KeepShapes (const TopTools_MapOfShape &theShapes) |
Sets the map of shapes for avoid merging of the faces/edges. It allows passing a ready to use map instead of calling many times the method KeepShape. More... | |
void | SetSafeInputMode (Standard_Boolean theValue) |
Sets the flag defining the behavior of the algorithm regarding modification of input shape. If this flag is equal to True then the input (original) shape can't be modified during modification process. Default value is true. More... | |
void | SetLinearTolerance (const Standard_Real theValue) |
Sets the linear tolerance. It plays the role of chord error when taking decision about merging of shapes. Default value is Precision::Confusion(). More... | |
void | SetAngularTolerance (const Standard_Real theValue) |
Sets the angular tolerance. If two shapes form a connection angle greater than this value they will not be merged. Default value is Precision::Angular(). More... | |
void | Build () |
Performs unification and builds the resulting shape. More... | |
const TopoDS_Shape & | Shape () const |
Gives the resulting shape. More... | |
const Handle< BRepTools_History > & | History () const |
Returns the history of the processed shapes. More... | |
Handle< BRepTools_History > & | History () |
Returns the history of the processed shapes. 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 | Delete () const |
Memory deallocator for transient classes. More... | |
virtual const opencascade::handle< Standard_Type > & | DynamicType () const |
Returns a type descriptor about this object. More... | |
Standard_Boolean | IsInstance (const opencascade::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 opencascade::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... | |
Standard_Transient * | This () const |
Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. More... | |
Standard_Integer | GetRefCount () const |
Get the reference counter of this object. More... | |
void | IncrementRefCounter () const |
Increments the reference counter of this object. More... | |
Standard_Integer | DecrementRefCounter () const |
Decrements the reference counter of this object; returns the decremented value. More... | |
Protected Member Functions | |
void | UnifyFaces () |
This method makes if possible a common face from each group of faces lying on coincident surfaces. More... | |
void | UnifyEdges () |
This method makes if possible a common edge from each group of smothly connected edges, which are common for the same couple of faces. More... | |
void | IntUnifyFaces (const TopoDS_Shape &theInpShape, TopTools_IndexedDataMapOfShapeListOfShape &theGMapEdgeFaces, const TopTools_MapOfShape &theFreeBoundMap) |
Standard_Boolean | MergeEdges (TopTools_SequenceOfShape &SeqEdges, const TopTools_IndexedDataMapOfShapeListOfShape &theVFmap, NCollection_Sequence< SubSequenceOfEdges > &SeqOfSubSeqOfEdges, const TopTools_MapOfShape &NonMergVrt) |
Splits the sequence of edges into the sequence of chains. More... | |
Standard_Boolean | MergeSeq (TopTools_SequenceOfShape &SeqEdges, const TopTools_IndexedDataMapOfShapeListOfShape &theVFmap, const TopTools_MapOfShape &nonMergVert) |
Tries to unify the sequence of edges with the set of another edges which lies on the same geometry. More... | |
Standard_Boolean | MergeSubSeq (const TopTools_SequenceOfShape &theChain, const TopTools_IndexedDataMapOfShapeListOfShape &theVFmap, TopoDS_Edge &OutEdge) |
Merges a sequence of edges into one edge if possible. More... | |
void | UnionPCurves (const TopTools_SequenceOfShape &theChain, TopoDS_Edge &theEdge) |
Unifies the pcurve of the chain into one pcurve of the edge. More... | |
void | FillHistory () |
Fills the history of the modifications during the operation. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Standard_Transient | |
static const char * | get_type_name () |
Returns a type descriptor about this object. More... | |
static const opencascade::handle< Standard_Type > & | get_type_descriptor () |
Returns type descriptor of Standard_Transient class. More... | |
This tool tries to unify faces and edges of the shape which lie on the same geometry. Faces/edges are considering as 'same-domain' if a group of neighbouring faces/edges are lying on coincident surfaces/curves. In this case these faces/edges can be unified into one face/edge. ShapeUpgrade_UnifySameDomain is initialized by a shape and the next optional parameters: UnifyFaces - tries to unify all possible faces UnifyEdges - tries to unify all possible edges ConcatBSplines - if this flag is set to true then all neighbouring edges, which lay on BSpline or Bezier curves with C1 continuity on their common vertices, will be merged into one common edge.
The input shape can be of any type containing faces or edges - compsolid, solid, shell, wire, compound of any kind of shapes. The algorithm preserves the structure of compsolids, solids, shells and wires. E.g., if two shells have a common edge and the faces sharing this edge lie on the same surface the algorithm will not unify these faces, otherwise the structure of shells would be broken. However, if such faces belong to different compounds of faces they will be unified.
The output result of the tool is the unified shape.
All the modifications of initial shape are recorded during unifying. Methods History are intended to:
typedef NCollection_DataMap<TopoDS_Shape, Handle< Geom_Plane >, TopTools_ShapeMapHasher> ShapeUpgrade_UnifySameDomain::DataMapOfFacePlane |
ShapeUpgrade_UnifySameDomain::ShapeUpgrade_UnifySameDomain | ( | ) |
Empty constructor.
ShapeUpgrade_UnifySameDomain::ShapeUpgrade_UnifySameDomain | ( | const TopoDS_Shape & | aShape, |
const Standard_Boolean | UnifyEdges = Standard_True , |
||
const Standard_Boolean | UnifyFaces = Standard_True , |
||
const Standard_Boolean | ConcatBSplines = Standard_False |
||
) |
Constructor defining input shape and necessary flags. It does not perform unification.
void ShapeUpgrade_UnifySameDomain::AllowInternalEdges | ( | const Standard_Boolean | theValue | ) |
Sets the flag defining whether it is allowed to create internal edges inside merged faces in the case of non-manifold topology. Without this flag merging through multi connected edge is forbidden. Default value is false.
void ShapeUpgrade_UnifySameDomain::Build | ( | ) |
Performs unification and builds the resulting shape.
|
protected |
Fills the history of the modifications during the operation.
|
inline |
Returns the history of the processed shapes.
|
inline |
Returns the history of the processed shapes.
void ShapeUpgrade_UnifySameDomain::Initialize | ( | const TopoDS_Shape & | aShape, |
const Standard_Boolean | UnifyEdges = Standard_True , |
||
const Standard_Boolean | UnifyFaces = Standard_True , |
||
const Standard_Boolean | ConcatBSplines = Standard_False |
||
) |
Initializes with a shape and necessary flags. It does not perform unification. If you intend to nullify the History place holder do it after initialization.
|
protected |
void ShapeUpgrade_UnifySameDomain::KeepShape | ( | const TopoDS_Shape & | theShape | ) |
Sets the shape for avoid merging of the faces/edges. This shape can be vertex or edge. If the shape is a vertex it forbids merging of connected edges. If the shape is a edge it forbids merging of connected faces. This method can be called several times to keep several shapes.
void ShapeUpgrade_UnifySameDomain::KeepShapes | ( | const TopTools_MapOfShape & | theShapes | ) |
Sets the map of shapes for avoid merging of the faces/edges. It allows passing a ready to use map instead of calling many times the method KeepShape.
|
protected |
Splits the sequence of edges into the sequence of chains.
|
protected |
Tries to unify the sequence of edges with the set of another edges which lies on the same geometry.
|
protected |
Merges a sequence of edges into one edge if possible.
|
inline |
Sets the angular tolerance. If two shapes form a connection angle greater than this value they will not be merged. Default value is Precision::Angular().
|
inline |
Sets the linear tolerance. It plays the role of chord error when taking decision about merging of shapes. Default value is Precision::Confusion().
void ShapeUpgrade_UnifySameDomain::SetSafeInputMode | ( | Standard_Boolean | theValue | ) |
Sets the flag defining the behavior of the algorithm regarding modification of input shape. If this flag is equal to True then the input (original) shape can't be modified during modification process. Default value is true.
|
inline |
Gives the resulting shape.
|
protected |
This method makes if possible a common edge from each group of smothly connected edges, which are common for the same couple of faces.
|
protected |
This method makes if possible a common face from each group of faces lying on coincident surfaces.
|
protected |
Unifies the pcurve of the chain into one pcurve of the edge.