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

class Handle_ShapeProcess_DictionaryOfOperator(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_ShapeProcess_Operator(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_ShapeProcess_ShapeContext(*args)

Bases: OCC.ShapeProcess.Handle_ShapeProcess_Context

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_ShapeProcess_StackItemOfDictionaryOfOperator(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_ShapeProcess_UOperator(*args)

Bases: OCC.ShapeProcess.Handle_ShapeProcess_Operator

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

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:

None

BooleanVal()
Parameters:
  • param (char *) –
  • def (bool) –
Return type:

bool

GetBoolean()
Parameters:
  • param (char *) –
  • val (bool) –
Return type:

bool

GetHandle()
GetInteger()
Parameters:
  • param (char *) –
  • val (int &) –
Return type:

bool

GetReal()
Parameters:
  • param (char *) –
  • val (float &) –
Return type:

bool

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:

bool

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:

bool

IntegerVal()
Parameters:
  • param (char *) –
  • def (int) –
Return type:

int

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
RealVal()
Parameters:
  • param (char *) –
  • def (float) –
Return type:

float

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
SetScope()
  • Set a new (sub)scope
Parameters:scope (char *) –
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 *

TraceLevel()
  • Returns trace level used for outputting messages.
Return type:int
UnSetScope()
  • Go out of current scope
Return type:None
thisown

The membership flag

class ShapeProcess_DictionaryOfOperator(*args)

Bases: OCC.MMgt.MMgt_TShared

Return type:None
Clean()
Return type:None
Clear()
Return type:None
Complete()
Parameters:acell (Handle_ShapeProcess_DictionaryOfOperator &) –
Return type:bool
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:

bool

Return type:

bool

HasItem()
Parameters:
  • name (TCollection_AsciiString &) –
  • exact (bool) – default value is Standard_False
  • name
  • exact – default value is Standard_True
Return type:

bool

Return type:

bool

IsEmpty()
Return type:bool
Item()
Parameters:
  • name (TCollection_AsciiString &) –
  • exact (bool) – default value is Standard_True
  • name
  • exact – default value is Standard_True
Return type:

Handle_ShapeProcess_Operator

Return type:

Handle_ShapeProcess_Operator

NewItem()
Parameters:
  • name (TCollection_AsciiString &) –
  • isvalued (bool) –
  • exact (bool) – default value is Standard_True
  • name
  • isvalued
  • exact – default value is Standard_True
Return type:

Handle_ShapeProcess_Operator

Return type:

Handle_ShapeProcess_Operator

RemoveItem()
Parameters:
  • name (TCollection_AsciiString &) –
  • cln (bool) – default value is Standard_True
  • exact (bool) – default value is Standard_True
  • name
  • cln – default value is Standard_True
  • exact – default value is Standard_True
Return type:

bool

Return type:

bool

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:

None

Return type:

None

thisown

The membership flag

class ShapeProcess_IteratorOfDictionaryOfOperator(*args)

Bases: object

Parameters:
  • acell (Handle_ShapeProcess_DictionaryOfOperator &) –
  • acell
  • basename (TCollection_AsciiString &) –
  • acell
  • basename
Return type:

None

Return type:

None

Return type:

None

More()
Return type:bool
Name()
Return type:TCollection_AsciiString
Next()
Return type:None
Start()
Return type:None
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:

TopoDS_Shape

static Init()
  • Registers all the operators
Return type:void
thisown

The membership flag

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:

TopoDS_Shape

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_Context

Parameters:
  • file (char *) –
  • seq (char *) – default value is
Return type:

None

  • Initializes a tool by resource file and shape to be processed
Parameters:
  • S (TopoDS_Shape &) –
  • file (char *) –
  • seq (char *) – default value is
Return type:

None

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:

None

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:

bool

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:

None

Return type:

None

Return type:

None

  • 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:

None

Result()
  • Returns current result
Return type:TopoDS_Shape
SetDetalisation()
Parameters:level (TopAbs_ShapeEnum) –
Return type:None
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_TShared

Return type:None
Parameters:previous (Handle_ShapeProcess_StackItemOfDictionaryOfOperator &) –
Return type:None
GetHandle()
Previous()
Return type:Handle_ShapeProcess_StackItemOfDictionaryOfOperator
SetValue()
Parameters:cval (Handle_ShapeProcess_DictionaryOfOperator &) –
Return type:None
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:

bool

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:

bool

static RegisterOperator()
  • Registers operator to make it visible for Performer
Parameters:
  • name (char *) –
  • op (Handle_ShapeProcess_Operator &) –
Return type:

bool

thisown

The membership flag

shapeprocess_FindOperator()
  • Finds operator by its name
Parameters:
  • name (char *) –
  • op (Handle_ShapeProcess_Operator &) –
Return type:

bool

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:

bool

shapeprocess_RegisterOperator()
  • Registers operator to make it visible for Performer
Parameters:
  • name (char *) –
  • op (Handle_ShapeProcess_Operator &) –
Return type:

bool