OCC.Standard module¶
The package Standard provides the minimum services necessaryfor other toolkits to handle persistent and transient objects.It is the Standard run-time encapsulation of the CAS.CADEdatabase, that is, it defines a single programming interfacefor creating and accessing persistent objects manipulated byhandles.
-
class
Handle_Standard_Failure
(*args)¶ Bases:
OCC.Standard.Handle_Standard_Transient
-
static
DownCast
()¶
-
GetObject
()¶
-
IsNull
()¶
-
Nullify
()¶
-
thisown
¶ The membership flag
-
static
-
class
Handle_Standard_Transient
(*args)¶ Bases:
object
-
static
DownCast
()¶
-
DumpToString
()¶
-
GetObject
()¶
-
IsNull
()¶
-
Nullify
()¶
-
thisown
¶ The membership flag
-
static
-
class
Handle_Standard_Type
(*args)¶ Bases:
OCC.Standard.Handle_Standard_Transient
-
static
DownCast
()¶
-
GetObject
()¶
-
IsNull
()¶
-
Nullify
()¶
-
thisown
¶ The membership flag
-
static
-
class
Standard_ErrorHandler
(*args)¶ Bases:
object
- Create a ErrorHandler (to be used with try{}catch(){}). It uses the ‘setjmp’ and ‘longjmp’ routines.
Return type: None -
Catches
()¶ - Returns ‘True’ if the caught exception has the same type or inherits from ‘aType’
Parameters: aType (Handle_Standard_Type &) – Return type: bool
-
Error
()¶ - Returns the current Error.
Return type: Handle_Standard_Failure
-
Label
()¶ - Returns label for jump
Return type: Standard_JmpBuf
-
static
LastCaughtError
(*args) → OCC.Standard.Handle_Standard_Failure¶ - Returns the caught exception.
Return type: Handle_Standard_Failure
-
thisown
¶ The membership flag
-
class
Standard_ErrorHandlerCallback
(*args, **kwargs)¶ Bases:
object
-
DestroyCallback
()¶ - The callback function to perform necessary callback action. Called by the exception handler when it is being destroyed but still has this callback registered.
Return type: void
-
thisown
¶ The membership flag
-
-
Standard_ErrorHandler_IsInTryBlock
()¶ - Test if the code is currently running in a try block
Return type: bool
-
Standard_ErrorHandler_LastCaughtError
(*args) → OCC.Standard.Handle_Standard_Failure¶ - Returns the caught exception.
Return type: Handle_Standard_Failure
-
class
Standard_Failure
(*args)¶ Bases:
OCC.Standard.Standard_Transient
- Creates a status object of type ‘Failure’.
Return type: None Parameters: f (Standard_Failure &) – Return type: None - Creates a status object of type ‘Failure’.
Parameters: aString (char *) – Return type: None -
static
Caught
(*args) → OCC.Standard.Handle_Standard_Failure¶ - Returns the last caught exception. Needed when exceptions are emulated by C longjumps, in other cases is also provided for compatibility.
Return type: Handle_Standard_Failure
-
GetHandle
()¶
-
GetMessageString
()¶ - Returns error message
Return type: char *
-
Jump
()¶ - Used to throw CASCADE exception from C signal handler. On platforms that do not allow throwing C++ exceptions from this handler (e.g. Linux), uses longjump to get to the current active signal handler, and only then is converted to C++ exception.
Return type: None
-
static
NewInstance
(*args) → OCC.Standard.Handle_Standard_Failure¶ - Used to construct an instance of the exception object as a handle. Shall be used to protect against possible construction of exception object in C stack – that is dangerous since some of methods require that object was allocated dynamically.
Parameters: aMessage (char *) – Return type: Handle_Standard_Failure
-
PrintToString
()¶ Standard_Failure_PrintToString(Standard_Failure self) -> std::string
-
thisown
¶ The membership flag
-
Standard_Failure_Caught
(*args) → OCC.Standard.Handle_Standard_Failure¶ - Returns the last caught exception. Needed when exceptions are emulated by C longjumps, in other cases is also provided for compatibility.
Return type: Handle_Standard_Failure
-
Standard_Failure_NewInstance
(*args) → OCC.Standard.Handle_Standard_Failure¶ - Used to construct an instance of the exception object as a handle. Shall be used to protect against possible construction of exception object in C stack – that is dangerous since some of methods require that object was allocated dynamically.
Parameters: aMessage (char *) – Return type: Handle_Standard_Failure
-
class
Standard_GUID
(*args)¶ Bases:
object
Return type: None - build a GUID from an ascii string with the following format: Length : 36 char ‘00000000-0000-0000-0000-000000000000’
Parameters: aGuid (char *) – Return type: None - build a GUID from an unicode string with the following format: //! ‘00000000-0000-0000-0000-000000000000’
Parameters: - aGuid (Standard_GUID &) –
- a32b (int) –
- a16b1 (Standard_ExtCharacter) –
- a16b2 (Standard_ExtCharacter) –
- a16b3 (Standard_ExtCharacter) –
- a8b1 (Standard_Byte) –
- a8b2 (Standard_Byte) –
- a8b3 (Standard_Byte) –
- a8b4 (Standard_Byte) –
- a8b5 (Standard_Byte) –
- a8b6 (Standard_Byte) –
- aGuid –
- aGuid –
Return type: Return type: Return type: Return type: -
static
CheckGUIDFormat
()¶ - Check the format of a GUID string. It checks the size, the position of the ‘-‘ and the correct size of fields.
Parameters: aGuid (char *) – Return type: bool
-
static
HashCode
()¶ - H method used by collections.
Parameters: - aguid (Standard_GUID &) –
- Upper (int) –
Return type:
-
static
IsEqual
()¶ - Returns True when the two GUID are the same.
Parameters: - string1 (Standard_GUID &) –
- string2 (Standard_GUID &) –
Return type:
-
ShallowDumpToString
()¶ Standard_GUID_ShallowDumpToString(Standard_GUID self) -> std::string
-
ToCString
()¶ - translate the GUID into ascii string the aStrGuid is allocated by user. the guid have the following format: //! ‘00000000-0000-0000-0000-000000000000’
Parameters: aStrGuid (Standard_PCharacter) – Return type: None
-
ToExtString
()¶ - translate the GUID into unicode string the aStrGuid is allocated by user. the guid have the following format: //! ‘00000000-0000-0000-0000-000000000000’
Parameters: aStrGuid (Standard_PExtCharacter) – Return type: None
-
ToUUID
()¶ Return type: Standard_UUID
-
thisown
¶ The membership flag
-
Standard_GUID_CheckGUIDFormat
()¶ - Check the format of a GUID string. It checks the size, the position of the ‘-‘ and the correct size of fields.
Parameters: aGuid (char *) – Return type: bool
-
Standard_GUID_HashCode
()¶ - H method used by collections.
Parameters: - aguid (Standard_GUID &) –
- Upper (int) –
Return type:
-
Standard_GUID_IsEqual
()¶ - Returns True when the two GUID are the same.
Parameters: - string1 (Standard_GUID &) –
- string2 (Standard_GUID &) –
Return type:
-
class
Standard_MMgrOpt
(*args)¶ Bases:
OCC.Standard.Standard_MMgrRoot
- Constructor. If aClear is True, the allocated emmory will be nullified. For description of other parameters, see description of the class above.
Parameters: Return type: -
thisown
¶ The membership flag
-
class
Standard_MMgrRaw
(*args)¶ Bases:
OCC.Standard.Standard_MMgrRoot
- Constructor; if aClear is True, the memory will be nullified upon allocation.
Parameters: aClear (bool) – default value is Standard_False Return type: None -
thisown
¶ The membership flag
-
class
Standard_MMgrRoot
(*args, **kwargs)¶ Bases:
object
-
Allocate
()¶ - Allocate specified number of bytes. The actually allocated space should be rounded up to double word size (4 bytes), as this is expected by implementation of some classes in OCC (e.g. TCollection_AsciiString)
Parameters: theSize (Standard_Size) – Return type: Standard_Address
-
Free
()¶ - Frees previously allocated memory at specified address.
Parameters: thePtr (Standard_Address) – Return type: void
-
Purge
()¶ - Purge internally cached unused memory blocks (if any) by releasing them to the operating system. Must return non-zero if some memory has been actually released, or zero otherwise. If option isDestroyed is True, this means that memory manager is not expected to be used any more; note however that in general case it is still possible to have calls to that instance of memory manager after this (e.g. to free memory of static objects in OCC). Thus this option should command the memory manager to release any cached memory to the system and not cache any more, but still remain operable… //! Default implementation does nothing and returns 0.
Parameters: isDestroyed (bool) – default value is Standard_False Return type: int
-
Reallocate
()¶ - Reallocate previously allocated memory to contain at least theSize bytes. In case of success, new pointer is returned.
Parameters: - thePtr (Standard_Address) –
- theSize (Standard_Size) –
Return type: Standard_Address
-
thisown
¶ The membership flag
-
-
class
Standard_MMgrTBBalloc
(*args)¶ Bases:
OCC.Standard.Standard_MMgrRoot
- Constructor; if aClear is True, the memory will be nullified upon allocation.
Parameters: aClear (bool) – default value is Standard_False Return type: None -
thisown
¶ The membership flag
-
class
Standard_Mutex
(*args)¶ Bases:
OCC.Standard.Standard_ErrorHandlerCallback
- Constructor: creates a mutex object and initializes it. It is strongly recommended that mutexes were created as static objects whenever possible.
Return type: None -
Lock
()¶ - Method to lock the mutex; waits until the mutex is released by other threads, locks it and then returns
Return type: None
-
TryLock
()¶ - Method to test the mutex; if the mutex is not hold by other thread, locks it and returns True; otherwise returns False without waiting mutex to be released.
Return type: bool
-
thisown
¶ The membership flag
-
class
Standard_Storable
¶ Bases:
object
-
Delete
()¶ Return type: void
-
HashCode
()¶ - Returns a hashed value denoting <self>. This value is in the range 1..<Upper>.
Parameters: Upper (int) – Return type: int
-
IsEqual
()¶ - Returns true if the direct contents of <self> and <Other> are memberwise equal.
Parameters: Other (Standard_Storable &) – Return type: bool
-
IsSimilar
()¶ - Returns true if the Deep contents of <self> and <Other> are memberwise equal.
Parameters: Other (Standard_Storable &) – Return type: bool
-
thisown
¶ The membership flag
-
-
class
Standard_Transient
(*args)¶ Bases:
object
- Empty constructor
Return type: None - Copy constructor – does nothing
Parameters: & (Standard_Transient) – Return type: None -
Delete
()¶ - Memory deallocator for transient classes
Return type: void
-
DynamicType
()¶ - Returns a type information object about this object.
Return type: Handle_Standard_Type
-
GetHandle
()¶
-
IsInstance
()¶ - Returns a true value if this is an instance of Type.
Parameters: theType (Handle_Standard_Type &) – Return type: bool - Returns a true value if this is an instance of TypeName.
Parameters: theTypeName (char *) – Return type: bool
-
IsKind
()¶ - 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.
Parameters: theType (Handle_Standard_Type &) – Return type: bool - 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.
Parameters: theTypeName (char *) – Return type: bool
-
Set
()¶ - Assignment operator, needed to avoid copying reference counter
Parameters: & (Standard_Transient) – Return type: Standard_Transient
-
This
()¶ - Returns a Handle which references this object. Must never be called to objects created in stack.
Return type: Handle_Standard_Transient
-
thisown
¶ The membership flag
-
class
Standard_Type
(*args)¶ Bases:
OCC.Standard.Standard_Transient
- The constructor for a imported type.
Parameters: - aName (char *) –
- aSize (int) –
Return type: - The constructor for a primitive.
Parameters: Return type: - The constructor for an enumeration.
Parameters: Return type: - The constructor for a class.
Parameters: Return type: -
GetHandle
()¶
-
Name
()¶ - Returns the type name of <self>.
Return type: char *
-
PrintToString
()¶ Standard_Type_PrintToString(Standard_Type self) -> std::string
-
SubType
()¶ - Returns ‘True’, if <self> is the same as <aOther>, or inherits from <aOther>. Note that multiple inheritance is not supported.
Parameters: aOther (Handle_Standard_Type &) – Return type: bool - Returns ‘True’, if <self> or one of its ancestors has the name equal to theName. Note that multiple inheritance is not supported.
Parameters: theName (char *) – Return type: bool
-
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
standard
¶ Bases:
object
-
static
Allocate
()¶ - Allocates memory blocks aSize - bytes to allocate
Parameters: aSize (Standard_Size) – Return type: Standard_Address
-
static
AllocateAligned
()¶ - Allocates aligned memory blocks. Should be used with CPU instructions which require specific alignment. For example: SSE requires 16 bytes, AVX requires 32 bytes. @param theSize bytes to allocate @param theAlign alignment in bytes
Parameters: - theSize (Standard_Size) –
- theAlign (Standard_Size) –
Return type: Standard_Address
-
static
Purge
()¶ - Deallocates the storage retained on the free list and clears the list. Returns non-zero if some memory has been actually freed.
Return type: int
-
static
Reallocate
()¶ - Reallocates memory blocks aStorage - previously allocated memory block aNewSize - new size in bytes
Parameters: - aStorage (Standard_Address) –
- aNewSize (Standard_Size) –
Return type: Standard_Address
-
thisown
¶ The membership flag
-
static
-
standard_Allocate
()¶ - Allocates memory blocks aSize - bytes to allocate
Parameters: aSize (Standard_Size) – Return type: Standard_Address
-
standard_AllocateAligned
()¶ - Allocates aligned memory blocks. Should be used with CPU instructions which require specific alignment. For example: SSE requires 16 bytes, AVX requires 32 bytes. @param theSize bytes to allocate @param theAlign alignment in bytes
Parameters: - theSize (Standard_Size) –
- theAlign (Standard_Size) –
Return type: Standard_Address
-
standard_Purge
()¶ - Deallocates the storage retained on the free list and clears the list. Returns non-zero if some memory has been actually freed.
Return type: int
-
standard_Reallocate
()¶ - Reallocates memory blocks aStorage - previously allocated memory block aNewSize - new size in bytes
Parameters: - aStorage (Standard_Address) –
- aNewSize (Standard_Size) –
Return type: Standard_Address