OCC.ShapeProcess module¶
Shape Processing moduleallows to define and apply general Shape Processing as acustomizable sequence of Shape Healing operators. Thecustomization is implemented via user-editable resourcefile which defines sequence of operators to be executedand their parameters.
-
class
Handle_ShapeProcess_Context(*args)¶ Bases:
OCC.MMgt.Handle_MMgt_TShared-
static
DownCast()¶
-
GetObject()¶
-
IsNull()¶
-
Nullify()¶
-
thisown¶ The membership flag
-
static
-
class
Handle_ShapeProcess_DictionaryOfOperator(*args)¶ Bases:
OCC.MMgt.Handle_MMgt_TShared-
static
DownCast()¶
-
GetObject()¶
-
IsNull()¶
-
Nullify()¶
-
thisown¶ The membership flag
-
static
-
class
Handle_ShapeProcess_Operator(*args)¶ Bases:
OCC.MMgt.Handle_MMgt_TShared-
static
DownCast()¶
-
GetObject()¶
-
IsNull()¶
-
Nullify()¶
-
thisown¶ The membership flag
-
static
-
class
Handle_ShapeProcess_ShapeContext(*args)¶ Bases:
OCC.ShapeProcess.Handle_ShapeProcess_Context-
static
DownCast()¶
-
GetObject()¶
-
IsNull()¶
-
Nullify()¶
-
thisown¶ The membership flag
-
static
-
class
Handle_ShapeProcess_StackItemOfDictionaryOfOperator(*args)¶ Bases:
OCC.MMgt.Handle_MMgt_TShared-
static
DownCast()¶
-
GetObject()¶
-
IsNull()¶
-
Nullify()¶
-
thisown¶ The membership flag
-
static
-
class
Handle_ShapeProcess_UOperator(*args)¶ Bases:
OCC.ShapeProcess.Handle_ShapeProcess_Operator-
static
DownCast()¶
-
GetObject()¶
-
IsNull()¶
-
Nullify()¶
-
thisown¶ The membership flag
-
static
-
class
ShapeProcess_Context(*args)¶ Bases:
OCC.MMgt.MMgt_TShared- Creates an empty tool
Return type: None - Creates a new tool and initialises by name of resource file and (if specified) starting scope Calls method Init()
Parameters: - file (char *) –
- scope (char *) – default value is
Return type: -
GetHandle()¶
-
GetString()¶ - Get value of parameter as being of specific type Returns False if parameter is not defined or has a wrong type
Parameters: - param (char *) –
- val (TCollection_AsciiString &) –
Return type:
-
Init()¶ - Initialises a tool by loading resource file and (if specified) sets starting scope Returns False if resource file not found
Parameters: - file (char *) –
- scope (char *) – default value is
Return type:
-
IsParamSet()¶ - Returns True if parameter is defined in the resource file
Parameters: param (char *) – Return type: bool
-
LoadResourceManager()¶ - Loading Resource_Manager object if this object not equal internal static Resource_Manager object or internal static Resource_Manager object is null
Parameters: file (char *) – Return type: Handle_Resource_Manager
-
Messenger()¶ - Returns Messenger used for outputting messages.
Return type: Handle_Message_Messenger
-
Progress()¶ - Returns Progress Indicator.
Return type: Handle_Message_ProgressIndicator
-
ResourceManager()¶ - Returns internal Resource_Manager object
Return type: Handle_Resource_Manager
-
SetMessenger()¶ - Sets Messenger used for outputting messages.
Parameters: messenger (Handle_Message_Messenger &) – Return type: None
-
SetProgress()¶ - Sets Progress Indicator.
Parameters: theProgress (Handle_Message_ProgressIndicator &) – Return type: None
-
SetTraceLevel()¶ - Sets trace level used for outputting messages - 0: no trace at all - 1: errors - 2: errors and warnings - 3: all messages Default is 1 : Errors traced
Parameters: tracelev (int) – Return type: None
-
StringVal()¶ - Get value of parameter as being of specific type If parameter is not defined or does not have expected type, returns default value as specified
Parameters: - param (char *) –
- def (char *) –
Return type: char *
-
thisown¶ The membership flag
-
class
ShapeProcess_DictionaryOfOperator(*args)¶ Bases:
OCC.MMgt.MMgt_TSharedReturn type: None -
Copy()¶ Return type: Handle_ShapeProcess_DictionaryOfOperator
-
GetHandle()¶
-
GetItem()¶ Parameters: - name (TCollection_AsciiString &) –
- anitem (Handle_ShapeProcess_Operator &) –
- exact (bool) – default value is Standard_True
- name –
- anitem –
- exact – default value is Standard_True
Return type: Return type:
-
HasItem()¶ Parameters: - name (TCollection_AsciiString &) –
- exact (bool) – default value is Standard_False
- name –
- exact – default value is Standard_True
Return type: Return type:
-
Item()¶ Parameters: - name (TCollection_AsciiString &) –
- exact (bool) – default value is Standard_True
- name –
- exact – default value is Standard_True
Return type: Return type:
-
NewItem()¶ Parameters: Return type: Return type:
-
RemoveItem()¶ Parameters: Return type: Return type:
-
SetItem()¶ Parameters: - name (TCollection_AsciiString &) –
- anitem (Handle_ShapeProcess_Operator &) –
- exact (bool) – default value is Standard_True
- name –
- anitem –
- exact – default value is Standard_True
Return type: Return type:
-
thisown¶ The membership flag
-
-
class
ShapeProcess_IteratorOfDictionaryOfOperator(*args)¶ Bases:
objectParameters: - acell (Handle_ShapeProcess_DictionaryOfOperator &) –
- acell –
- basename (TCollection_AsciiString &) –
- acell –
- basename –
Return type: Return type: Return type: -
Name()¶ Return type: TCollection_AsciiString
-
Value()¶ Return type: Handle_ShapeProcess_Operator
-
thisown¶ The membership flag
-
class
ShapeProcess_OperLibrary¶ Bases:
object-
static
ApplyModifier()¶ - Applies BRepTools_Modification to a shape, taking into account sharing of components of compounds.
Parameters: - S (TopoDS_Shape &) –
- context (Handle_ShapeProcess_ShapeContext &) –
- M (Handle_BRepTools_Modification &) –
- map (TopTools_DataMapOfShapeShape &) –
- msg (Handle_ShapeExtend_MsgRegistrator &) – default value is 0
Return type:
-
static
Init()¶ - Registers all the operators
Return type: void
-
thisown¶ The membership flag
-
static
-
ShapeProcess_OperLibrary_ApplyModifier()¶ - Applies BRepTools_Modification to a shape, taking into account sharing of components of compounds.
Parameters: - S (TopoDS_Shape &) –
- context (Handle_ShapeProcess_ShapeContext &) –
- M (Handle_BRepTools_Modification &) –
- map (TopTools_DataMapOfShapeShape &) –
- msg (Handle_ShapeExtend_MsgRegistrator &) – default value is 0
Return type:
-
ShapeProcess_OperLibrary_Init()¶ - Registers all the operators
Return type: void
-
class
ShapeProcess_Operator(*args, **kwargs)¶ Bases:
OCC.MMgt.MMgt_TShared-
GetHandle()¶
-
Perform()¶ - Performs operation and eventually records changes in the context
Parameters: context (Handle_ShapeProcess_Context &) – Return type: bool
-
thisown¶ The membership flag
-
-
class
ShapeProcess_ShapeContext(*args)¶ Bases:
OCC.ShapeProcess.ShapeProcess_ContextParameters: - file (char *) –
- seq (char *) – default value is
Return type: - Initializes a tool by resource file and shape to be processed
Parameters: - S (TopoDS_Shape &) –
- file (char *) –
- seq (char *) – default value is
Return type: -
AddMessage()¶ - Record a message for shape S Shape S should be one of subshapes of original shape (or whole one), but not one of intermediate shapes Records only if Message() is not Null
Parameters: - S (TopoDS_Shape &) –
- msg (Message_Msg &) –
- gravity (Message_Gravity) – default value is Message_Warning
Return type:
-
ContinuityVal()¶ - Get value of parameter as being of the type GeomAbs_Shape If parameter is not defined or does not have expected type, returns default value as specified
Parameters: - param (char *) –
- def (GeomAbs_Shape) –
Return type: GeomAbs_Shape
-
GetContinuity()¶ - Get value of parameter as being of the type GeomAbs_Shape Returns False if parameter is not defined or has a wrong type
Parameters: - param (char *) –
- val (GeomAbs_Shape &) –
Return type:
-
GetDetalisation()¶ - Set and get value for detalisation level Only shapes of types from TopoDS_COMPOUND and until specified detalisation level will be recorded in maps To cancel mapping, use TopAbs_SHAPE To force full mapping, use TopAbs_VERTEX The default level is TopAbs_FACE
Return type: TopAbs_ShapeEnum
-
GetHandle()¶
-
Init()¶ - Initializes tool by a new shape and clears all results
Parameters: S (TopoDS_Shape &) – Return type: None
-
Map()¶ - Returns map of replacements shape -> shape This map is not recursive
Return type: TopTools_DataMapOfShapeShape
-
Messages()¶ Return type: Handle_ShapeExtend_MsgRegistrator
-
PrintStatistics()¶ - Prints statistics on Shape Processing onto the current Messenger.
Return type: None
-
RecordModification()¶ Parameters: - repl (Handle_ShapeBuild_ReShape &) –
- msg (Handle_ShapeExtend_MsgRegistrator &) – default value is 0
- repl –
- msg –
- repl –
Return type: Return type: Return type: - Records modifications and resets result accordingly NOTE: modification of resulting shape should be explicitly defined in the maps along with modifications of subshapes //! In the last function, sh is the shape on which Modifier was run. It can be different from the whole shape, but in that case result as a whole should be reset later either by call to SetResult(), or by another call to RecordModification() which contains mapping of current result to a new one explicitly
Parameters: - sh (TopoDS_Shape &) –
- repl (BRepTools_Modifier &) –
- msg (Handle_ShapeExtend_MsgRegistrator &) – default value is 0
Return type:
-
Result()¶ - Returns current result
Return type: TopoDS_Shape
-
SetResult()¶ - Sets a new result shape NOTE: this method should be used very carefully to keep consistency of modifications It is recommended to use RecordModification() methods with explicit definition of mapping from current result to a new one
Parameters: S (TopoDS_Shape &) – Return type: None
-
Shape()¶ - Returns shape being processed
Return type: TopoDS_Shape
-
thisown¶ The membership flag
-
class
ShapeProcess_StackItemOfDictionaryOfOperator(*args)¶ Bases:
OCC.MMgt.MMgt_TSharedReturn type: None Parameters: previous (Handle_ShapeProcess_StackItemOfDictionaryOfOperator &) – Return type: None -
GetHandle()¶
-
Previous()¶ Return type: Handle_ShapeProcess_StackItemOfDictionaryOfOperator
-
Value()¶ Return type: Handle_ShapeProcess_DictionaryOfOperator
-
thisown¶ The membership flag
-
-
class
ShapeProcess_UOperator(*args)¶ Bases:
OCC.ShapeProcess.ShapeProcess_Operator- Creates operator with implementation defined as OperFunc (static function)
Parameters: func (ShapeProcess_OperFunc) – Return type: None -
GetHandle()¶
-
thisown¶ The membership flag
-
class
SwigPyIterator(*args, **kwargs)¶ Bases:
object-
advance()¶
-
copy()¶
-
decr()¶
-
distance()¶
-
equal()¶
-
incr()¶
-
next()¶
-
previous()¶
-
thisown¶ The membership flag
-
value()¶
-
-
new_instancemethod(func, inst, cls)¶
-
register_handle(handle, base_object)¶ Inserts the handle into the base object to prevent memory corruption in certain cases
-
class
shapeprocess¶ Bases:
object-
static
FindOperator()¶ - Finds operator by its name
Parameters: - name (char *) –
- op (Handle_ShapeProcess_Operator &) –
Return type:
-
static
Perform()¶ - Performs a specified sequence of operators on Context Resource file and other data should be already loaded to Context (including description of sequence seq)
Parameters: - context (Handle_ShapeProcess_Context &) –
- seq (char *) –
Return type:
-
static
RegisterOperator()¶ - Registers operator to make it visible for Performer
Parameters: - name (char *) –
- op (Handle_ShapeProcess_Operator &) –
Return type:
-
thisown¶ The membership flag
-
static
-
shapeprocess_FindOperator()¶ - Finds operator by its name
Parameters: - name (char *) –
- op (Handle_ShapeProcess_Operator &) –
Return type:
-
shapeprocess_Perform()¶ - Performs a specified sequence of operators on Context Resource file and other data should be already loaded to Context (including description of sequence seq)
Parameters: - context (Handle_ShapeProcess_Context &) –
- seq (char *) –
Return type: