Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions
IFSelect_ModelCopier Class Reference

This class performs the Copy operations involved by the description of a ShareOut (evaluated by a ShareOutResult) plus, if there are, the Modifications on the results, with the help of Modifiers. Each Modifier can work on one or more resulting packets, according to its criteria : it operates on a Model once copied and filled with the content of the packet. More...

#include <IFSelect_ModelCopier.hxx>

Inheritance diagram for IFSelect_ModelCopier:
Inheritance graph
[legend]

Public Member Functions

 IFSelect_ModelCopier ()
 Creates an empty ModelCopier.
 
void SetShareOut (const occ::handle< IFSelect_ShareOut > &sho)
 Sets the ShareOut, which is used to define Modifiers to apply.
 
void ClearResult ()
 Clears the list of produced Models.
 
bool AddFile (const TCollection_AsciiString &filename, const occ::handle< Interface_InterfaceModel > &content)
 Records a new File to be sent, as a couple (Name as AsciiString, Content as InterfaceModel) Returns True if Done, False if <filename> is already attached to another File.
 
bool NameFile (const int num, const TCollection_AsciiString &filename)
 Changes the Name attached to a File which was formerly defined by a call to AddFile Returns True if Done, False else : if <num> out of range or if the new <filename> is already attached to another File Remark : Giving an empty File Name is equivalent to ClearFile.
 
bool ClearFile (const int num)
 Clears the Name attached to a File which was formerly defined by a call to AddFile. This Clearing can be undone by a call to NameFile (with same <num>) Returns True if Done, False else : if <num> is out of range.
 
bool SetAppliedModifiers (const int num, const occ::handle< IFSelect_AppliedModifiers > &applied)
 Sets a list of File Modifiers to be applied on a file.
 
bool ClearAppliedModifiers (const int num)
 Clears the list of File Modifiers to be applied on a file.
 
Interface_CheckIterator Copy (IFSelect_ShareOutResult &eval, const occ::handle< IFSelect_WorkLibrary > &WL, const occ::handle< Interface_Protocol > &protocol)
 Performs the Copy Operations, which include the Modifications defined by the list of Modifiers. Memorizes the result, as a list of InterfaceModels with the corresponding FileNames They can then be sent, by the method Send, or queried Copy calls internal method Copying. Returns the produced CheckList.
 
Interface_CheckIterator SendCopied (const occ::handle< IFSelect_WorkLibrary > &WL, const occ::handle< Interface_Protocol > &protocol)
 Sends the formerly defined results (see method Copy) to files, then clears it Remark : A Null File Name cause file to be not produced.
 
Interface_CheckIterator Send (IFSelect_ShareOutResult &eval, const occ::handle< IFSelect_WorkLibrary > &WL, const occ::handle< Interface_Protocol > &protocol)
 Performs the Copy Operations (which include the Modifications) and Sends the result on files, without memorizing it. (the memorized result is ignored : neither queried not filled)
 
Interface_CheckIterator SendAll (const char *const filename, const Interface_Graph &G, const occ::handle< IFSelect_WorkLibrary > &WL, const occ::handle< Interface_Protocol > &protocol)
 Sends a model (defined in <G>) into one file, without managing remaining data, already sent files, etc. Applies the Model and File Modifiers. Returns True if well done, False else.
 
Interface_CheckIterator SendSelected (const char *const filename, const Interface_Graph &G, const occ::handle< IFSelect_WorkLibrary > &WL, const occ::handle< Interface_Protocol > &protocol, const Interface_EntityIterator &iter)
 Sends a part of a model into one file. Model is gotten from <G>, the part is defined in <iter>. Remaining data are managed and can be later be worked on. Returns True if well done, False else.
 
occ::handle< Interface_InterfaceModelCopiedRemaining (const Interface_Graph &G, const occ::handle< IFSelect_WorkLibrary > &WL, Interface_CopyTool &TC)
 Produces a Model copied from the Remaining List as <newmod> <newmod> is a Null Handle if this list is empty <WL> performs the copy by using <TC> <TC> is assumed to have been defined with the starting model same as defined by <G>. Produces a model copied from the remaining list.
 
void CopiedRemaining (const Interface_Graph &G, const occ::handle< IFSelect_WorkLibrary > &WL, Interface_CopyTool &TC, occ::handle< Interface_InterfaceModel > &newmod)
 
bool SetRemaining (Interface_Graph &CG) const
 Updates Graph status for remaining data, for each entity :
 
int NbFiles () const
 Returns the count of Files produced, i.e. the count of Models memorized (produced by the mmethod Copy) with their file names.
 
TCollection_AsciiString FileName (const int num) const
 Returns the File Name for a file given its rank It is empty after a call to ClearFile on same <num>
 
occ::handle< Interface_InterfaceModelFileModel (const int num) const
 Returns the content of a file before sending, under the form of an InterfaceModel, given its rank.
 
occ::handle< IFSelect_AppliedModifiersAppliedModifiers (const int num) const
 Returns the list of File Modifiers to be applied on a file when it will be sent, as computed by CopiedModel : If it is a null handle, no File Modifier has to be applied.
 
void BeginSentFiles (const occ::handle< IFSelect_ShareOut > &sho, const bool record)
 Begins a sequence of recording the really sent files <sho> : the default file numbering is cleared If <record> is False, clears the list and stops recording If <record> is True, clears the list and commands recording Creation time corresponds to "stop recording".
 
void AddSentFile (const char *const filename)
 Adds the name of a just sent file, if BeginSentFiles has commanded recording; else does nothing It is called by methods SendCopied Sending.
 
occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > SentFiles () const
 Returns the list of recorded names of sent files. Can be empty (if no file has been sent). Returns a Null Handle if BeginSentFiles has stopped recording.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()=default
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
bool IsInstance (const char *const theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
bool 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.
 
bool IsKind (const char *const 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.
 
Standard_TransientThis () 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.
 
int GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
 
int DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

Protected Member Functions

Interface_CheckIterator Copying (IFSelect_ShareOutResult &eval, const occ::handle< IFSelect_WorkLibrary > &WL, const occ::handle< Interface_Protocol > &protocol, Interface_CopyTool &TC)
 Internal routine which does the effective Copy. It allows to work, either with a standard CopyTool, or a specialised one Copying itself is done by <WL> which uses a CopyTool.
 
Interface_CheckIterator Sending (IFSelect_ShareOutResult &eval, const occ::handle< IFSelect_WorkLibrary > &WL, const occ::handle< Interface_Protocol > &protocol, Interface_CopyTool &TC)
 Internal routine which does the effective Send. It allows to work, either with a standard CopyTool, or a specialised one.
 
void CopiedModel (const Interface_Graph &G, const occ::handle< IFSelect_WorkLibrary > &WL, const occ::handle< Interface_Protocol > &protocol, const Interface_EntityIterator &topcopy, const TCollection_AsciiString &filename, const int dispnum, const int numod, Interface_CopyTool &TC, occ::handle< Interface_InterfaceModel > &newmod, occ::handle< IFSelect_AppliedModifiers > &applied, Interface_CheckIterator &checks) const
 Performs the Copy of a unitary Packet Input parameters are : <G> is the graph which defines the starting entities, it contains the original InterfaceModel <WL> performs the copy by using <TC> <protocol> is the used protocol (can be useful for Modifiers) <topcopy> is the list of Entities which are the Roots of the packet to be copied <filename> is the name of the file which will receive it <dispid> is the Identifier of the Dispatch which have produced this packet, <numod> is the rank of the packet for this Dispatch <TC> is a CopyTool, which performs the copy.
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_type_name ()
 Returns a type descriptor about this object.
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.
 

Detailed Description

This class performs the Copy operations involved by the description of a ShareOut (evaluated by a ShareOutResult) plus, if there are, the Modifications on the results, with the help of Modifiers. Each Modifier can work on one or more resulting packets, according to its criteria : it operates on a Model once copied and filled with the content of the packet.

Modifiers can be :

The Copy operations can be :

In addition, a list of really written files is managed : A first call to BeginSentFiles clears the list and commands, either to begin a new list, or to stop recording it. A call to SentFiles returns the list (if recording has been required) This list allows to globally exploit the set of produced files

Remark : For operations which concern specific Entities, see also in package IFAdapt : a sub-class of ModelCopier allows to work with EntityModifier, in addition to Modifier itself which still applies to a whole copied Model.

Constructor & Destructor Documentation

◆ IFSelect_ModelCopier()

IFSelect_ModelCopier::IFSelect_ModelCopier ( )

Creates an empty ModelCopier.

Member Function Documentation

◆ AddFile()

bool IFSelect_ModelCopier::AddFile ( const TCollection_AsciiString & filename,
const occ::handle< Interface_InterfaceModel > & content )

Records a new File to be sent, as a couple (Name as AsciiString, Content as InterfaceModel) Returns True if Done, False if <filename> is already attached to another File.

◆ AddSentFile()

void IFSelect_ModelCopier::AddSentFile ( const char *const filename)

Adds the name of a just sent file, if BeginSentFiles has commanded recording; else does nothing It is called by methods SendCopied Sending.

◆ AppliedModifiers()

occ::handle< IFSelect_AppliedModifiers > IFSelect_ModelCopier::AppliedModifiers ( const int num) const

Returns the list of File Modifiers to be applied on a file when it will be sent, as computed by CopiedModel : If it is a null handle, no File Modifier has to be applied.

◆ BeginSentFiles()

void IFSelect_ModelCopier::BeginSentFiles ( const occ::handle< IFSelect_ShareOut > & sho,
const bool record )

Begins a sequence of recording the really sent files <sho> : the default file numbering is cleared If <record> is False, clears the list and stops recording If <record> is True, clears the list and commands recording Creation time corresponds to "stop recording".

◆ ClearAppliedModifiers()

bool IFSelect_ModelCopier::ClearAppliedModifiers ( const int num)

Clears the list of File Modifiers to be applied on a file.

◆ ClearFile()

bool IFSelect_ModelCopier::ClearFile ( const int num)

Clears the Name attached to a File which was formerly defined by a call to AddFile. This Clearing can be undone by a call to NameFile (with same <num>) Returns True if Done, False else : if <num> is out of range.

◆ ClearResult()

void IFSelect_ModelCopier::ClearResult ( )

Clears the list of produced Models.

◆ CopiedModel()

void IFSelect_ModelCopier::CopiedModel ( const Interface_Graph & G,
const occ::handle< IFSelect_WorkLibrary > & WL,
const occ::handle< Interface_Protocol > & protocol,
const Interface_EntityIterator & topcopy,
const TCollection_AsciiString & filename,
const int dispnum,
const int numod,
Interface_CopyTool & TC,
occ::handle< Interface_InterfaceModel > & newmod,
occ::handle< IFSelect_AppliedModifiers > & applied,
Interface_CheckIterator & checks ) const
protected

Performs the Copy of a unitary Packet Input parameters are : <G> is the graph which defines the starting entities, it contains the original InterfaceModel <WL> performs the copy by using <TC> <protocol> is the used protocol (can be useful for Modifiers) <topcopy> is the list of Entities which are the Roots of the packet to be copied <filename> is the name of the file which will receive it <dispid> is the Identifier of the Dispatch which have produced this packet, <numod> is the rank of the packet for this Dispatch <TC> is a CopyTool, which performs the copy.

Returned values (as arguments) are : <newmod> is the result of the copy, as a new InterfaceModel on which Model Modifiers have already been applied (if there are) <applied> determines the File Modifiers which remain to be applied (when the file itself will be output) : for each File Modifier recorded in <me>, <applied>'s Value is :

  • Null if this Modifier has not to be applied
  • an empty list if this Modifier has to be applied without distinguishing specific entities
  • a list of numbers of entities in <model> if this Modifier concerns particularly these entities (which are the results of copying the result of its input selection) <checks> is the produced Check List (by Modifiers as required)

Warning : File Modifiers are evaluated at the time of Copy itself If their list is changed between this Copy and the Sending itself of the file, these changes are ignored

◆ CopiedRemaining() [1/2]

occ::handle< Interface_InterfaceModel > IFSelect_ModelCopier::CopiedRemaining ( const Interface_Graph & G,
const occ::handle< IFSelect_WorkLibrary > & WL,
Interface_CopyTool & TC )

Produces a Model copied from the Remaining List as <newmod> <newmod> is a Null Handle if this list is empty <WL> performs the copy by using <TC> <TC> is assumed to have been defined with the starting model same as defined by <G>. Produces a model copied from the remaining list.

Parameters
[in]Gthe interface graph
[in]WLthe work library performing the copy
[in,out]TCthe copy tool
Returns
the new model with remaining data, or null handle if empty

◆ CopiedRemaining() [2/2]

void IFSelect_ModelCopier::CopiedRemaining ( const Interface_Graph & G,
const occ::handle< IFSelect_WorkLibrary > & WL,
Interface_CopyTool & TC,
occ::handle< Interface_InterfaceModel > & newmod )
Deprecated

Use CopiedRemaining() returning handle by value instead.

("Use CopiedRemaining() returning handle by value instead")

◆ Copy()

Interface_CheckIterator IFSelect_ModelCopier::Copy ( IFSelect_ShareOutResult & eval,
const occ::handle< IFSelect_WorkLibrary > & WL,
const occ::handle< Interface_Protocol > & protocol )

Performs the Copy Operations, which include the Modifications defined by the list of Modifiers. Memorizes the result, as a list of InterfaceModels with the corresponding FileNames They can then be sent, by the method Send, or queried Copy calls internal method Copying. Returns the produced CheckList.

◆ Copying()

Interface_CheckIterator IFSelect_ModelCopier::Copying ( IFSelect_ShareOutResult & eval,
const occ::handle< IFSelect_WorkLibrary > & WL,
const occ::handle< Interface_Protocol > & protocol,
Interface_CopyTool & TC )
protected

Internal routine which does the effective Copy. It allows to work, either with a standard CopyTool, or a specialised one Copying itself is done by <WL> which uses a CopyTool.

◆ FileModel()

occ::handle< Interface_InterfaceModel > IFSelect_ModelCopier::FileModel ( const int num) const

Returns the content of a file before sending, under the form of an InterfaceModel, given its rank.

◆ FileName()

TCollection_AsciiString IFSelect_ModelCopier::FileName ( const int num) const

Returns the File Name for a file given its rank It is empty after a call to ClearFile on same <num>

◆ NameFile()

bool IFSelect_ModelCopier::NameFile ( const int num,
const TCollection_AsciiString & filename )

Changes the Name attached to a File which was formerly defined by a call to AddFile Returns True if Done, False else : if <num> out of range or if the new <filename> is already attached to another File Remark : Giving an empty File Name is equivalent to ClearFile.

◆ NbFiles()

int IFSelect_ModelCopier::NbFiles ( ) const

Returns the count of Files produced, i.e. the count of Models memorized (produced by the mmethod Copy) with their file names.

◆ Send()

Interface_CheckIterator IFSelect_ModelCopier::Send ( IFSelect_ShareOutResult & eval,
const occ::handle< IFSelect_WorkLibrary > & WL,
const occ::handle< Interface_Protocol > & protocol )

Performs the Copy Operations (which include the Modifications) and Sends the result on files, without memorizing it. (the memorized result is ignored : neither queried not filled)

◆ SendAll()

Interface_CheckIterator IFSelect_ModelCopier::SendAll ( const char *const filename,
const Interface_Graph & G,
const occ::handle< IFSelect_WorkLibrary > & WL,
const occ::handle< Interface_Protocol > & protocol )

Sends a model (defined in <G>) into one file, without managing remaining data, already sent files, etc. Applies the Model and File Modifiers. Returns True if well done, False else.

◆ SendCopied()

Interface_CheckIterator IFSelect_ModelCopier::SendCopied ( const occ::handle< IFSelect_WorkLibrary > & WL,
const occ::handle< Interface_Protocol > & protocol )

Sends the formerly defined results (see method Copy) to files, then clears it Remark : A Null File Name cause file to be not produced.

◆ Sending()

Interface_CheckIterator IFSelect_ModelCopier::Sending ( IFSelect_ShareOutResult & eval,
const occ::handle< IFSelect_WorkLibrary > & WL,
const occ::handle< Interface_Protocol > & protocol,
Interface_CopyTool & TC )
protected

Internal routine which does the effective Send. It allows to work, either with a standard CopyTool, or a specialised one.

◆ SendSelected()

Interface_CheckIterator IFSelect_ModelCopier::SendSelected ( const char *const filename,
const Interface_Graph & G,
const occ::handle< IFSelect_WorkLibrary > & WL,
const occ::handle< Interface_Protocol > & protocol,
const Interface_EntityIterator & iter )

Sends a part of a model into one file. Model is gotten from <G>, the part is defined in <iter>. Remaining data are managed and can be later be worked on. Returns True if well done, False else.

◆ SentFiles()

occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > IFSelect_ModelCopier::SentFiles ( ) const

Returns the list of recorded names of sent files. Can be empty (if no file has been sent). Returns a Null Handle if BeginSentFiles has stopped recording.

◆ SetAppliedModifiers()

bool IFSelect_ModelCopier::SetAppliedModifiers ( const int num,
const occ::handle< IFSelect_AppliedModifiers > & applied )

Sets a list of File Modifiers to be applied on a file.

◆ SetRemaining()

bool IFSelect_ModelCopier::SetRemaining ( Interface_Graph & CG) const

Updates Graph status for remaining data, for each entity :

  • Entities just Sent to file or Copied (by CopiedRemaining) have their status set to 1
  • the other keep their former status (1 for Send/Copied, 0 for Remaining) These status are computed by Copying/Sending/CopiedRemaining Then, SetRemaining updates graph status, and mustr be called just after one of these method has been called Returns True if done, False if remaining info if not in phase which the Graph (not same counts of items)

◆ SetShareOut()

void IFSelect_ModelCopier::SetShareOut ( const occ::handle< IFSelect_ShareOut > & sho)

Sets the ShareOut, which is used to define Modifiers to apply.


The documentation for this class was generated from the following file: