FougTools  0.7.0dev-046fb6a
Handy tools for C++, Qt and OpenCascade
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
occ::down_cast< TYPE > Class Template Reference

Downcasting operator for OpenCascade handles. More...

#include <down_cast.h>

Public Member Functions

 down_cast (const Handle_Standard_Transient &handle)
 Construct the operator that will down cast object to an handle of type TYPE. More...
 
 operator TYPE () const
 Downcasted handle to type TYPE. More...
 
const TYPE operator-> () const
 Downcasted handle to type TYPE. More...
 

Detailed Description

template<typename TYPE>
class occ::down_cast< TYPE >

Downcasting operator for OpenCascade handles.

It wraps up into a syntactic C++ sugar the way casting of handles is supported in OpenCascade

Example : suppose you would like to downcast an Handle_Geom_Curve into a Handle_Geom_Circle. With OpenCascade it can be done by :

Handle_Geom_Circle gcircle = Handle_Geom_Circle::DownCast(gcurve);

The equivalent with the down_cast<> operator is :

Handle_Geom_Circle gcircle = occ::down_cast<Handle_Geom_Circle>(gcurve);

Constructor & Destructor Documentation

template<typename TYPE >
occ::down_cast< TYPE >::down_cast ( const Handle_Standard_Transient &  handle)
explicit

Construct the operator that will down cast object to an handle of type TYPE.

Member Function Documentation

template<typename TYPE >
occ::down_cast< TYPE >::operator TYPE ( ) const

Downcasted handle to type TYPE.

template<typename TYPE >
const TYPE occ::down_cast< TYPE >::operator-> ( ) const

Downcasted handle to type TYPE.


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