CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
OdTraceRuntime Class Reference

#include <OdTraceRuntime.h>

Public Member Functions

OdResult appendDwgAsTrace (const OdString &sPath2DwgFileAsTrace, OdString &traceName)
 
OdResult appendDwgAsTrace (OdDbDatabase *pDbTrace, OdString &traceName)
 
OdResult newTrace ()
 
OdResult openTrace (const OdTraceUserInfo &traceInfo)
 
OdResult renameTrace (const OdTraceUserInfo &trace, const OdString &newTraceName)
 
OdResult removeTrace (const OdTraceUserInfo &traceInfo)
 
OdResult removeSubTrace (const OdTraceUserInfo &traceInfo, const OdTraceCollaborator &subTrace)
 
OdResult closeTrace ()
 
OdResult traceFront () const
 
OdResult traceBack () const
 
OdResult getOpenTraceCollaborators (OdArray< OdTraceCollaborator > &traceCollaborators) const
 
OdResult getTraceCollaborators (const OdTraceUserInfo &trace, OdArray< OdTraceCollaborator > &traceCollaborators) const
 
OdResult showOpenTraceCollaborators (const OdArray< OdTraceCollaborator > &traceCollaborators) const
 
OdResult getTracesUserInfo (OdArray< OdTraceUserInfo > &userInfoArr) const
 
bool isObjectFromTrace (const OdDbObject *pSubject) const
 
OdResult setCurrentUserInfo (const OdTraceUserProfile &currentUserInfo)
 
OdTraceUserProfile getCurrentUserInfo () const
 
OdResult getOpenTraceExtents (OdGeExtents3d &) const
 
OdDbObjectId getTraceRuntimeId () const
 
virtual ~OdTraceRuntime ()
 

Static Public Member Functions

static OdTraceRuntimegetInstance (OdDbDatabase *pDb, const bool bCreateIfNotFound=false)
 

Protected Member Functions

 OdTraceRuntime (OdDbDatabase *, const bool)
 
 OdTraceRuntime ()=delete
 

Protected Attributes

OdDbObjectId m_traceRuntimeId
 

Detailed Description

This class is designed to work with tracing. Corresponding C++ library: AcTrace

<group Other_Classes>

Definition at line 136 of file OdTraceRuntime.h.

Constructor & Destructor Documentation

◆ ~OdTraceRuntime()

virtual OdTraceRuntime::~OdTraceRuntime ( )
virtual

◆ OdTraceRuntime() [1/2]

OdTraceRuntime::OdTraceRuntime ( OdDbDatabase * ,
const bool  )
protected

Builds an instance of the OdTraceRuntime object.

Remarks
Use the static OdTraceRuntime::getInstance(OdDbDatabase, bool) instead it.

◆ OdTraceRuntime() [2/2]

OdTraceRuntime::OdTraceRuntime ( )
protecteddelete

Builds an instance of the OdTraceRuntime object.

Remarks
Use the static OdTraceRuntime::getInstance(OdDbDatabase, bool) instead it.

Member Function Documentation

◆ appendDwgAsTrace() [1/2]

OdResult OdTraceRuntime::appendDwgAsTrace ( const OdString & sPath2DwgFileAsTrace,
OdString & traceName )

Adds the specified .dwg file to the current database as a trace.

Parameters
sPath2DwgFileAsTrace[in] A string containing the path to the dwg file.
traceName[in/out] String with the name which will given to the trace. If the name is not unique, traceName will be changed.
Returns
* eOk if dwg file added as trace successful. eNoFileName if the argument sPath2DwgFileAsTrace is empty. eFileAccessErr if the file sPath2DwgFileAsTrace is not available. eInvalidContext if OdDbTraceStore in the current database is not available. eCantOpenFile if can't create temporary zip file in temporary folder. eAlreadyActive if some trace is open.

◆ appendDwgAsTrace() [2/2]

OdResult OdTraceRuntime::appendDwgAsTrace ( OdDbDatabase * pDbTrace,
OdString & traceName )

Adds the specified .dwg file to the current database as a trace.

Parameters
sPath2DwgFileAsTrace[in] A dwg database.
traceName[in/out] String with the name which will given to the trace. If the name is not unique, traceName will be changed.
Returns
* eOk if dwg file added as trace successful. eNoFileName if the argument sPath2DwgFileAsTrace is empty. eFileAccessErr if the file sPath2DwgFileAsTrace is not available. eInvalidContext if OdDbTraceStore in the current database is not available. eCantOpenFile if can't create temporary zip file in temporary folder. eAlreadyActive if some trace is open.

◆ closeTrace()

OdResult OdTraceRuntime::closeTrace ( )

Closes currently open trace. All changes in trace will be saved.

Returns
* eOk if trace closed successful. eAlreadyInactive if no open trace. eNotInDatabase if this OdTraceRuntime does not have a reference to dwg database. eCantOpenFile if can't create temporary zip file in temporary folder.
Remarks
Sets value '0' to the database system variable TRACEMODE

◆ getCurrentUserInfo()

OdTraceUserProfile OdTraceRuntime::getCurrentUserInfo ( ) const

Gets information about current user.

Returns
OdTraceUserProfile object with current user information.

◆ getInstance()

static OdTraceRuntime * OdTraceRuntime::getInstance ( OdDbDatabase * pDb,
const bool bCreateIfNotFound = false )
static

Gets a pointer to the OdTraceRuntime instance associated with the specified database.

Parameters
pDb[in] Pointer to dwg database.
bCreateIfNotFound[in][optional] Create an instance of OdTraceRuntime for the specified database if not it no exist.
Returns
Pointer to the OdTraceRuntime if it exists, otherwise nullptr.

◆ getOpenTraceCollaborators()

OdResult OdTraceRuntime::getOpenTraceCollaborators ( OdArray< OdTraceCollaborator > & traceCollaborators) const

Gets trace collaborators of currently open trace.

Parameters
traceCollaborators[out] Array of OdTraceCollaborator objects.
Returns
* eOk if new user information was set correctly. eAlreadyInactive if no open trace.

◆ getOpenTraceExtents()

OdResult OdTraceRuntime::getOpenTraceExtents ( OdGeExtents3d & ) const

Gets extents of open trace.

Returns
* eOk if extents are retrieved successfully. eAlreadyInactive if no open trace.
Remarks
Returns invalid extents if trace doen't has an entities.

◆ getTraceCollaborators()

OdResult OdTraceRuntime::getTraceCollaborators ( const OdTraceUserInfo & trace,
OdArray< OdTraceCollaborator > & traceCollaborators ) const

Gets trace collaborators of the specified trace.

Parameters
trace[in] Information about trace.
traceCollaborators[out] Array of OdTraceUserProfile objects.
Returns
* eOk if new user information was set correctly. eInvalidInput if traceId from input argument 'trace' is empty. eInvalidContext if OdDbTraceStore in the current database is not available. eKeyNotFound if no trace was found with the specified data from the input argument 'trace'

◆ getTraceRuntimeId()

OdDbObjectId OdTraceRuntime::getTraceRuntimeId ( ) const

Only internal use.

Returns
OdDbObjectId to an OdDbTraceRuntimeObject.

◆ getTracesUserInfo()

OdResult OdTraceRuntime::getTracesUserInfo ( OdArray< OdTraceUserInfo > & userInfoArr) const

Gets information of traces. Get an array of OdTraceUserInfo objects. Each array object contains information about one trace.

Parameters
userInfoArr[in] Information about traces.
Returns
* eOk if new user information was set correctly. eInvalidContext if OdDbTraceStore in the current database is not available.
Remarks
The same as OdDbTraceStore::getTracesUserInfo().

◆ isObjectFromTrace()

bool OdTraceRuntime::isObjectFromTrace ( const OdDbObject * pSubject) const

This method allows to known if the object belongs to the drawing or some trace.

Parameters
pSubject[in] Pointer to object.
Returns
Return true if pSubject loaded from the trace.

◆ newTrace()

OdResult OdTraceRuntime::newTrace ( )

Creates a new trace and open it to edit.

Returns
* eOk if a trace opened successfully. eAlreadyActive if some trace is already open. eMustBeNonZero if user data is empty. eNoInternalSpace if cannot add a trace paper.
Remarks
Sets value '2' to the database system variable TRACEMODE.

◆ openTrace()

OdResult OdTraceRuntime::openTrace ( const OdTraceUserInfo & traceInfo)

Opens the specified trace.

Parameters
traceInfo[in] Trace information to open.
Returns
* eOk if a trace open successful. eAlreadyActive if some trace already open. eNoFileName if the trace file is not found. eInvalidContext if OdDbTraceStore in the current database is not available. eNoInternalSpace if cannot add a trace paper. eProfileDoesNotExist if user info is not set. eNoLayout if no layout is found for this trace.
Remarks
Sets value '2' to the database system variable TRACEMODE

◆ removeSubTrace()

OdResult OdTraceRuntime::removeSubTrace ( const OdTraceUserInfo & traceInfo,
const OdTraceCollaborator & subTrace )

Deletes the specified sub trace.

Parameters
traceInfo[in] Trace information in which subtrace needs to be removed.
subTrace[in] SubTrace to remove.
Returns
* eOk if a subtrace is deleted successfully. eNoFileName if the trace file is not found. eInvalidContext if OdDbTraceStore in the current database is not available. eUnableToRemoveAssociation if subTrace.m_traceFile == traceInfo.m_traceFile
Remarks
If trace to delete is open the trace mode will be closed. The main trace cannot be removed.

◆ removeTrace()

OdResult OdTraceRuntime::removeTrace ( const OdTraceUserInfo & traceInfo)

Deletes the specified trace.

Parameters
traceInfo[in] Trace information to remove.
Returns
* eOk if a trace is deleted successfully. eNoFileName if the trace file is not found. eInvalidContext if OdDbTraceStore in the current database is not available.
Remarks
If trace to delete is open the trace mode will be closed.

◆ renameTrace()

OdResult OdTraceRuntime::renameTrace ( const OdTraceUserInfo & trace,
const OdString & newTraceName )

Renames the specified trace.

Parameters
traceInfo[in] Trace information to rename.
newTraceName[in] New trace name.
Returns
* eOk if a trace renaming is successful. eNoFileName if the trace file is not found. eInvalidContext if OdDbTraceStore in the current database is not available.

◆ setCurrentUserInfo()

OdResult OdTraceRuntime::setCurrentUserInfo ( const OdTraceUserProfile & currentUserInfo)

Sets current user for working with traces.

Parameters
currentUserInfo[in] Information about user.
Returns
* eOk if new user information was set correctly. eAlreadyActive if some trace is open.
Remarks
Can't set if some trace is open. The m_oxygenId in the OdTraceUserProfile can be empty for new users.

◆ showOpenTraceCollaborators()

OdResult OdTraceRuntime::showOpenTraceCollaborators ( const OdArray< OdTraceCollaborator > & traceCollaborators) const

Display/hide trace collaborator changes.

Parameters
traceCollaborators[in] Array of OdTraceUserProfile objects.
Returns
* eOk if display collaborators are updated successfully. eAlreadyInactive if no open trace. eInvalidContext if count of elements in traceCollaborators array is not equal to trace colloborators in the open trace. eInvalidInput if at least one collaborator from the array traceCollaborators does not match any collaborator in the open trace.
Remarks
To display/hide trace collaborator changes need get information about trace collaborators by getOpenTraceCollaborators(OdArray<OdTraceCollaborator>&) or getTraceCollaborators(const OdTraceUserInfo, OdArray<OdTraceCollaborator>&). Change visible state in OdTraceCollaborator objects by the method setVisible(bool).

◆ traceBack()

OdResult OdTraceRuntime::traceBack ( ) const

Saturation is given to main drawing, and fading to the tracing. Trace view enabled. Editing the main drawing enabled.

Returns
* eOk if traceBack executed successful. eAlreadyInactive if no open trace. eNotInDatabase if this OdTraceRuntime does not have a reference to dwg database. eLongTransReferenceError if can't end editing a trace.
Remarks
Sets value '1' to the database system variable TRACEMODE

◆ traceFront()

OdResult OdTraceRuntime::traceFront ( ) const

Saturation is given to tracing, and fading to the main drawing. Trace editing enabled. Editing the main drawing disabled.

Returns
* eOk if traceFront is executed successfully. eAlreadyInactive if no open trace. eNotInDatabase if this OdTraceRuntime does not have a reference to dwg database. eLongTransReferenceError if can't start editing a trace.
Remarks
Sets value '2' to the database system variable TRACEMODE

Member Data Documentation

◆ m_traceRuntimeId

OdDbObjectId OdTraceRuntime::m_traceRuntimeId
protected

Definition at line 405 of file OdTraceRuntime.h.


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