Open CASCADE Technology
7.6.0
|
The history keeps the following relations between the input shapes (S1, ..., Sm) and output shapes (T1, ..., Tn): 1) an output shape Tj is generated from an input shape Si: Tj <= G(Si); 2) a output shape Tj is modified from an input shape Si: Tj <= M(Si); 3) an input shape (Si) is removed: R(Si) == 1. More...
#include <BRepTools_History.hxx>
Constructors for History creation | |
enum | TRelationType { TRelationType_Removed , TRelationType_Generated , TRelationType_Modified } |
The types of the historical relations. More... | |
BRepTools_History () | |
Empty constructor. More... | |
template<class TheAlgo > | |
BRepTools_History (const TopTools_ListOfShape &theArguments, TheAlgo &theAlgo) | |
Template constructor for History creation from the algorithm having standard history methods such as IsDeleted(), Modified() and Generated(). More... | |
void | AddGenerated (const TopoDS_Shape &theInitial, const TopoDS_Shape &theGenerated) |
Methods to set the history. More... | |
void | AddModified (const TopoDS_Shape &theInitial, const TopoDS_Shape &theModified) |
Set the second shape as modified one from the first shape. More... | |
void | Remove (const TopoDS_Shape &theRemoved) |
Set the shape as removed one. More... | |
void | ReplaceGenerated (const TopoDS_Shape &theInitial, const TopoDS_Shape &theGenerated) |
Set the second shape as the only generated one from the first one. More... | |
void | ReplaceModified (const TopoDS_Shape &theInitial, const TopoDS_Shape &theModified) |
Set the second shape as the only modified one from the first one. More... | |
void | Clear () |
Clears the history. More... | |
const TopTools_ListOfShape & | Generated (const TopoDS_Shape &theInitial) const |
Methods to read the history. More... | |
const TopTools_ListOfShape & | Modified (const TopoDS_Shape &theInitial) const |
Returns all shapes modified from the shape. More... | |
Standard_Boolean | IsRemoved (const TopoDS_Shape &theInitial) const |
Returns 'true' if the shape is removed. More... | |
Standard_Boolean | HasGenerated () const |
Returns 'true' if there any shapes with Generated elements present. More... | |
Standard_Boolean | HasModified () const |
Returns 'true' if there any Modified shapes present. More... | |
Standard_Boolean | HasRemoved () const |
Returns 'true' if there any removed shapes present. More... | |
void | Merge (const Handle< BRepTools_History > &theHistory23) |
A method to merge a next history to this history. More... | |
void | Merge (const BRepTools_History &theHistory23) |
Merges the next history to this history. More... | |
template<class TheAlgo > | |
void | Merge (const TopTools_ListOfShape &theArguments, TheAlgo &theAlgo) |
Template method for merging history of the algorithm having standard history methods such as IsDeleted(), Modified() and Generated() into current history object. More... | |
void | Dump (Standard_OStream &theS) |
A method to dump a history. More... | |
static Standard_Boolean | IsSupportedType (const TopoDS_Shape &theShape) |
Returns 'true' if the type of the shape is supported by the history. More... | |
Additional Inherited Members | |
Public Types inherited from Standard_Transient | |
typedef void | base_type |
Returns a type descriptor about this object. 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... | |
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... | |
The history keeps the following relations between the input shapes (S1, ..., Sm) and output shapes (T1, ..., Tn): 1) an output shape Tj is generated from an input shape Si: Tj <= G(Si); 2) a output shape Tj is modified from an input shape Si: Tj <= M(Si); 3) an input shape (Si) is removed: R(Si) == 1.
The relations are kept only for shapes of types vertex, edge, face, and solid.
The last relation means that: 1) shape Si is not an output shape and 2) no any shape is modified (produced) from shape Si: R(Si) == 1 ==> Si != Tj, M(Si) == 0.
It means that the input shape cannot be removed and modified simultaneously. However, the shapes may be generated from the removed shape. For instance, in Fillet operation the edges generate faces and then are removed.
No any shape could be generated and modified from the same shape simultaneously: sets G(Si) and M(Si) are not intersected (G(Si) ^ M(Si) == 0).
Each output shape should be: 1) an input shape or 2) generated or modified from an input shape (even generated from the implicit null shape if necessary): Tj == Si V (exists Si that Tj <= G(Si) U M(Si)).
Recommendations to choose between relations 'generated' and 'modified': 1) a shape is generated from input shapes if it dimension is greater or smaller than the dimensions of the input shapes; 2) a shape is generated from input shapes if these shapes are also output shapes; 3) a shape is generated from input shapes of the same dimension if it is produced by joining shapes generated from these shapes; 4) a shape is modified from an input shape if it replaces the input shape by changes of the location, the tolerance, the bounds of the parametric space (the faces for a solid), the parametrization and/or by applying of an approximation; 5) a shape is modified from input shapes of the same dimension if it is produced by joining shapes modified from these shapes.
Two sequential histories:
During the merge: 1) if shape Tj is generated from shape Si then each shape generated or modified from shape Tj is considered as a shape generated from shape Si among shapes Q1, ..., Ql: Tj <= G12(Si), Qk <= G23(Tj) U M23(Tj) ==> Qk <= G13(Si). 2) if shape Tj is modified from shape Si, shape Qk is generated from shape Tj then shape Qk is considered as a shape generated from shape Si among shapes Q1, ..., Ql: Tj <= M12(Si), Qk <= G23(Tj) ==> Qk <= G13(Si); 3) if shape Tj is modified from shape Si, shape Qk is modified from shape Tj then shape Qk is considered as a shape modified from shape Si among shapes Q1, ..., Ql: Tj <= M12(Si), Qk <= M23(Tj) ==> Qk <= M13(Si);
|
inline |
Empty constructor.
|
inline |
Template constructor for History creation from the algorithm having standard history methods such as IsDeleted(), Modified() and Generated().
theArguments | [in] Arguments of the algorithm; |
theAlgo | [in] The algorithm. |
void BRepTools_History::AddGenerated | ( | const TopoDS_Shape & | theInitial, |
const TopoDS_Shape & | theGenerated | ||
) |
Methods to set the history.
Set the second shape as generated one from the first shape.
void BRepTools_History::AddModified | ( | const TopoDS_Shape & | theInitial, |
const TopoDS_Shape & | theModified | ||
) |
Set the second shape as modified one from the first shape.
|
inline |
Clears the history.
|
inline |
A method to dump a history.
Prints the brief description of the history into a stream
const TopTools_ListOfShape& BRepTools_History::Generated | ( | const TopoDS_Shape & | theInitial | ) | const |
Methods to read the history.
Returns all shapes generated from the shape.
|
inline |
Returns 'true' if there any shapes with Generated elements present.
|
inline |
Returns 'true' if there any Modified shapes present.
|
inline |
Returns 'true' if there any removed shapes present.
Standard_Boolean BRepTools_History::IsRemoved | ( | const TopoDS_Shape & | theInitial | ) | const |
Returns 'true' if the shape is removed.
|
inlinestatic |
Returns 'true' if the type of the shape is supported by the history.
void BRepTools_History::Merge | ( | const BRepTools_History & | theHistory23 | ) |
Merges the next history to this history.
void BRepTools_History::Merge | ( | const Handle< BRepTools_History > & | theHistory23 | ) |
A method to merge a next history to this history.
Merges the next history to this history.
|
inline |
Template method for merging history of the algorithm having standard history methods such as IsDeleted(), Modified() and Generated() into current history object.
theArguments | [in] Arguments of the algorithm; |
theAlgo | [in] The algorithm. |
const TopTools_ListOfShape& BRepTools_History::Modified | ( | const TopoDS_Shape & | theInitial | ) | const |
Returns all shapes modified from the shape.
void BRepTools_History::Remove | ( | const TopoDS_Shape & | theRemoved | ) |
Set the shape as removed one.
void BRepTools_History::ReplaceGenerated | ( | const TopoDS_Shape & | theInitial, |
const TopoDS_Shape & | theGenerated | ||
) |
Set the second shape as the only generated one from the first one.
void BRepTools_History::ReplaceModified | ( | const TopoDS_Shape & | theInitial, |
const TopoDS_Shape & | theModified | ||
) |
Set the second shape as the only modified one from the first one.