Beispiel #1
0
// ****************************************************************************
//
//  Function Name:	RResizeSelectionTracker::Render( )
//
//  Description:		Called to render the tracker feedback
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RResizeSelectionTracker::Render( RDrawingSurface& drawingSurface, const R2dTransform& transform, const RRealPoint& point ) const
	{
	RRealSize scaleFactor = CalcScaleFactor( point );

	// Draw the tracking rectangle
	m_pSelection->DrawResizeTrackingFeedback( drawingSurface, transform, m_ScalingCenter, scaleFactor, m_fMaintainAspectRatio );
	}
Beispiel #2
0
// ****************************************************************************
//
//  Function Name:	RResizeSelectionTracker::GetFeedbackBoundingRect( )
//
//  Description:		Returns the feedback bounding rect
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
RRealRect RResizeSelectionTracker::GetFeedbackBoundingRect( const RRealPoint& point ) const
	{
	// Get the view transform
	R2dTransform transform;
	m_pView->GetViewTransform( transform, TRUE );

	RRealSize scaleFactor = CalcScaleFactor( point );

	RRealRect boundingRect = m_pSelection->GetResizeTrackingFeedbackBoundingRect( transform, m_ScalingCenter, scaleFactor, m_fMaintainAspectRatio );

	// Convert back to logical units
	transform.Invert( );
	return boundingRect * transform;
	}
Beispiel #3
0
static void _do_LDScale10x( ld_arg ld, int scale )
{
    long_double factor;

    if( scale != 0 ) {
#if defined( _LONG_DOUBLE_ ) && defined( __FPI__ )
        unsigned short _8087cw = __Get87CW();
        __Set87CW( _8087cw | _PC_64 ); // make sure extended precision is on
#endif
        factor.exponent  = 0x3FFF;              // set factor = 1.0
        factor.high_word = 0x80000000;
        factor.low_word  = 0x00000000;
        if( scale < 0 ) {
            CalcScaleFactor( &factor, -scale );
            __FLDD( ld, &factor, ld );
        } else {
            CalcScaleFactor( &factor, scale );
            __FLDM( ld, &factor, ld );
        }
#if defined( _LONG_DOUBLE_ ) && defined( __FPI__ )
        __Set87CW( _8087cw );       // restore control word
#endif
    }
}
Beispiel #4
0
// ****************************************************************************
//
//  Function Name:	RResizeSelectionTracker::EndTracking( )
//
//  Description:		Called when tracking ends; ie. when the mouse button goes
//							up.
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RResizeSelectionTracker::EndTracking( const RRealPoint& mousePoint, YModifierKey modifierKeys )
	{
	// Constrain the mouse point
	RRealPoint constrainedPoint = mousePoint;
	ApplyConstraint( constrainedPoint );

	// Call the base class
	RSelectionTracker::EndTracking( constrainedPoint, modifierKeys );

	// Compute the final scale factor
	RRealSize scaleFactor = CalcScaleFactor( constrainedPoint );

	// Create and do a resize selection action
	RResizeSelectionAction* pAction = new RResizeSelectionAction( m_pSelection, m_ScalingCenter, scaleFactor, m_fMaintainAspectRatio );
	m_pView->GetRDocument( )->SendAction( pAction );
	}
TSSWRealizedVolatility::TSSWRealizedVolatility( Prices& prices, time_duration tdWindowWidth, double p )
  : m_dblSum( 0.0 ), m_dblP( p ), m_n( 0 ), m_dt( not_a_date_time ), m_tdScaledWidth( hours( 365 * 24 ) + hours( 6 ) ),
    TimeSeriesSlidingWindow<TSSWRealizedVolatility, Price>( prices, tdWindowWidth, 0 )
{
  CalcScaleFactor();
}