# IRsCoordinateSystemManager Interface Reference

Inherits IUnknown.

List of all members.

## Public Member Functions
HRESULT | RegisterCoordinatesEvaluator ([in] IRsCoordinateSystemEvaluator *pEvaluator)
HRESULT | UnRegisterCoordinatesEvaluator ([in] IRsCoordinateSystemEvaluator *pEvaluator)
HRESULT | ValidateCoordinateSystem ([in] IRsObjectList *pObjList)
HRESULT | GetCoordinateSystemLocal ([in] IRsObjectList *pObjList,[in] BSTR szCoordSystemName,[out] RtMatrixf *pMatrix)
HRESULT | GetCoordinateSystemGlobal ([in] IRsObjectList *pObjList,[in] BSTR szCoordSystemName,[out] RtMatrixf *pMatrix)
HRESULT | GetReferencePosition ([in] IRsObjectList *pObjList,[in] BSTR szCoordSystemName,[out] RtVector3f *pPostion)
HRESULT | UpdateBoundingBox ([in] IRsObjectList *pObjList)
HRESULT | GetBoundingBox ([in] IRsObjectList *pObjList,[in] BSTR szCoordSystemName,[in] RtMatrixf *pCoordinates,[out] RtBoundingBox *pBBox)
HRESULT | RegisterObjects ([in] IRsObjectList *pObjList,[in] IRsCoordinateSystemsEventsListener *pEventsListener)
HRESULT | UnregisterObjects ([in] IRsObjectList *pObjList,[in] IRsCoordinateSystemsEventsListener *pEventsListener)
HRESULT | SendBoundingBoxInvalidatedNotify ([in] IRsObject *pObj)
HRESULT | SendCoordSysInvalidatedNotify ([in] IRsObject *pObj)
HRESULT | GetActiveCoordinatesEvaluator ([out, retval] IRsCoordinateSystemEvaluator **ppTopEval)

## Detailed Description

Coordinate system manager is used to get bounding boxes and coordinate systems of objects. It handles calculations of these properties by calling registered evaluators and caches the results.

To get coordinate system, you first need to register a node or nodes for validation. Next you need to call validate so that coordinate system evaluator can evaluate runtime properties for specified node(s). Then you can call GetXXXX to read actual coordinate systems or bounding boxes.

: When coordinate system for specified node(s) is no longer required, you should unregister it.

## Member Function Documentation

HRESULT IRsCoordinateSystemManager::RegisterCoordinatesEvaluator | ( | [in] IRsCoordinateSystemEvaluator * | pEvaluator | ) |

Register coordinate system evaluator.

Parameters:

  | pEvaluator | [in] Coordinate system evaluator to register.

Returns:
  Standard HRESULT processing can be applied on function return value.

HRESULT IRsCoordinateSystemManager::UnRegisterCoordinatesEvaluator | ( | [in] IRsCoordinateSystemEvaluator * | pEvaluator | ) |

UnRegister coordinate system evaluator.

Parameters:

  | pEvaluator | [in] Coordinate system evaluator to unregister.

Returns:
  Standard HRESULT processing can be applied on function return value.

HRESULT IRsCoordinateSystemManager::ValidateCoordinateSystem | ( | [in] IRsObjectList * | pObjList | ) |

Validate coordinate system for specified node; allows reception of invalidation notifications.

- : invalidated flags are managed globally.
- One validation of an object will result in the invalidation of all listeners, if object coordinate system or reference position change.

Parameters:

  | pObjectList | [in] List of objects to validate.

Returns:
  Standard HRESULT processing can be applied on function return value.

HRESULT IRsCoordinateSystemManager::GetCoordinateSystemLocal | ( | [in] IRsObjectList * | pObjList,
|  | [in] BSTR | szCoordSystemName,
|  | [out] RtMatrixf * | pMatrix |
| ) |  |  |

Get coordinate system matrix for specified list of objects.
Method uses registered coordinate evaluators to calculate coordinate system that is defined by selections in edit modes.

Parameters:

  | pObjList | [in] List of objects for which coordinate system is requested.
  | szCoordSystemName | [in] Requested coordinate system name.
  | pMatrix | [out] Calculated coordinate system.

Returns:
  Standard HRESULT processing can be applied on function return value.

HRESULT IRsCoordinateSystemManager::GetCoordinateSystemGlobal | ( | [in] IRsObjectList * | pObjList,
|  | [in] BSTR | szCoordSystemName,
|  | [out] RtMatrixf * | pMatrix |
| ) |  |  |

Get coordinate system matrix for specified list of objects.
Method uses registered coordinate evaluators to calculate coordinate system.

Parameters:

  | pObjList | [in] List of objects for which coordinate system is requested.
  | szCoordSystemName | [in] Requested coordinate system name.
  | pMatrix | [out] Calculated coordinate system.

Returns:
  Standard HRESULT processing can be applied on function return value.

HRESULT IRsCoordinateSystemManager::GetReferencePosition | ( | [in] IRsObjectList * | pObjList,
|  | [in] BSTR | szCoordSystemName,
|  | [out] RtVector3f * | pPostion |
| ) |  |  |

Get selection's default reference position.

Parameters:

  | pObjList | [in] List of objects for which reference position is requested.
  | szCoordSystemName | [in] Coordinate system name hint. NULL specifies default.
  | pPosition | [out] Calculated reference position.

Returns:
  Standard HRESULT processing can be applied on function return value.

HRESULT IRsCoordinateSystemManager::UpdateBoundingBox | ( | [in] IRsObjectList * | pObjList | ) |

Update bounding box for specified list of objects.

All objects for which bounding box is requested need to be cached.

Parameters:

  | pObjList | [in] List of objects for which coordinate system is requested.

Returns:
  Standard HRESULT processing can be applied on function return value.

HRESULT IRsCoordinateSystemManager::GetBoundingBox | ( | [in] IRsObjectList * | pObjList,
|  | [in] BSTR | szCoordSystemName,
|  | [in] RtMatrixf * | pCoordinates,
|  | [out] RtBoundingBox * | pBBox |
| ) |  |  |

Get bounding box for specified list of objects.
Method uses registered coordinate evaluators to calculate bounding box.

All objects for which bounding box is requested need to be cached.

Parameters:

  | pObjList | [in] List of objects for which coordinate system is requested.
  | szCoordSystemName | [in] Coordinate system name hint. NULL specifies default.
  | pCoordinates | [in] Coordinate system to use for bounding box calculation.
  | pBBox | [out] Calculated bounding box.

Returns:
  Standard HRESULT processing can be applied on function return value.

HRESULT IRsCoordinateSystemManager::RegisterObjects | ( | [in] IRsObjectList * | pObjList,
|  | [in] IRsCoordinateSystemsEventsListener * | pEventsListener |
| ) |  |  |

Register objects and enable caching of coordinate system calculations for them.

Calling RegisterObjects multiple times will increase reference count of object cache. To disable caching (release objects cache) you need to call UnregisterObjects corresponding number of times.

Parameters:

  | pObjList | [in] List of objects to register.
  | pEventsListener | [in] Event listener that receives invalidations in case that objects change.

Returns:
  Standard HRESULT processing can be applied on function return value.

HRESULT IRsCoordinateSystemManager::UnregisterObjects | ( | [in] IRsObjectList * | pObjList,
|  | [in] IRsCoordinateSystemsEventsListener * | pEventsListener |
| ) |  |  |

Unregister a node from coordinate system manager and disable caching for it.

Calling RegisterObjects multiple times will increase reference count of object cache.
To disable caching (release objects cache), you need to call UnregisterObjects a corresponding number of times.

Parameters:

  | pObjList | [in] List of objects to unregister
  | pEventsListener | [in] Event listener that receives invalidations in case where objects change.

Returns:
  Standard HRESULT processing can be applied on function return value.

HRESULT IRsCoordinateSystemManager::SendBoundingBoxInvalidatedNotify | ( | [in] IRsObject * | pObj | ) |

Notify listeners that object bounding box has changed.

Parameters:

  | pObj | [in] Object causing invalidation.

Returns:
  Standard HRESULT processing can be applied on function return value.

HRESULT IRsCoordinateSystemManager::SendCoordSysInvalidatedNotify | ( | [in] IRsObject * | pObj | ) |

Notify listeners that object pivot or coordinate system has changed.

Parameters:

  | pObj | [in] Object causing invalidation.

Returns:
  Standard HRESULT processing can be applied on function return value.

HRESULT IRsCoordinateSystemManager::GetActiveCoordinatesEvaluator | ( | [out, retval] IRsCoordinateSystemEvaluator ** | ppTopEval | ) |

Get active coordinate system evaluator.

Returns:
  ppTopEval [out,retval] Top most coordinate system evaluator.

  Standard HRESULT processing can be applied on function return value.