Ejemplo n.º 1
0
// ****************************************************************************
//
//  Function Name:	RCompositeSelection::GetBoundingRectIncludingHandles
//
//  Description:		Calculates a bounding rect for the specified object that
//							includes the resize and rotate handles
//
//  Returns:			See above.
//
//  Exceptions:		None
//
// ****************************************************************************
//
RRealRect RCompositeSelection::GetBoundingRectIncludingHandles( ) const
{
    TpsAssert( !IsEmpty( ), "Nothing selected" );

    YSelectionIterator iterator = Start( );

    // Use the first rectangle as the starting point, and union from there
    RRealRect boundingRect = RSingleSelection::GetBoundingRectIncludingHandles( *iterator );
    ++iterator;

    for( ; iterator != End( ); ++iterator )
        boundingRect.Union( boundingRect, RSingleSelection::GetBoundingRectIncludingHandles( *iterator ) );

    return boundingRect;
}
Ejemplo n.º 2
0
// ****************************************************************************
//
//  Function Name:	RCompositeSelection::GetBoundingRect( )
//
//  Description:		Gets the bounding rect of all objects in this selection
//
//  Returns:			The bounding rect
//
//  Exceptions:		None
//
// ****************************************************************************
//
RRealRect RCompositeSelection::GetBoundingRect( ) const
{
    TpsAssert( !IsEmpty( ), "Nothing selected" );

    YSelectionIterator iterator = Start( );

    // Use the first rectangle as the starting point, and union from there
    RRealRect boundingRect = ( *iterator )->GetBoundingRect( ).m_TransformedBoundingRect;
    ++iterator;

    for( ; iterator != End( ); ++iterator )
        boundingRect.Union( boundingRect, ( *iterator )->GetBoundingRect( ).m_TransformedBoundingRect );

    return boundingRect;
}
Ejemplo n.º 3
0
// ****************************************************************************
//
//  Function Name:	RCompositeSelection::GetDragTrackingFeedbackBoundingRect( )
//
//  Description:		Gets the bounding rect of drag tracking feedback
//
//  Returns:			Bounding rect
//
//  Exceptions:		Memory
//
// ****************************************************************************
//
RRealRect RCompositeSelection::GetDragTrackingFeedbackBoundingRect( const R2dTransform& transform,
        const RRealSize& offset ) const
{
    TpsAssert( !IsEmpty( ), "Nothing selected" );

    YSelectionCollectionIterator iterator = m_SelectionCollection.Start( );

    // Use the first rectangle as the starting point, and union from there
    RRealRect boundingRect = ( *iterator )->GetDragTrackingFeedbackBoundingRect( transform, offset );
    ++iterator;

    for( ; iterator != m_SelectionCollection.End( ); ++iterator )
        boundingRect.Union( boundingRect, ( *iterator )->GetDragTrackingFeedbackBoundingRect( transform, offset ) );

    return boundingRect;
}
Ejemplo n.º 4
0
// ****************************************************************************
//
//  Function Name:	RCompositeSelection::GetSelectionBoundingRect( )
//
//  Description:		Retrieves the bounding rect of this selection
//
//  Returns:			Nothing
//
//  Exceptions:		Memory
//
// ****************************************************************************
//
void RCompositeSelection::GetSelectionBoundingRect( YSelectionBoundingRect& boundingRect ) const
{
    // Get the first bounding rect
    YSelectionCollectionIterator iterator = m_SelectionCollection.Start( );
    ( *iterator )->GetSelectionBoundingRect( boundingRect );
    RRealRect unionRect = boundingRect.m_TransformedBoundingRect;
    ++iterator;

    // Union in the rest of the bounding rects
    for( ; iterator != m_SelectionCollection.End( ); ++iterator )
    {
        ( *iterator )->GetSelectionBoundingRect( boundingRect );
        unionRect.Union( unionRect, boundingRect.m_TransformedBoundingRect );
    }

    // Set the rect
    boundingRect.Set( unionRect );
}
Ejemplo n.º 5
0
// ****************************************************************************
//
//  Function Name:	RCompositeSelection::GetResizeTrackingFeedbackBoundingRect( )
//
//  Description:		Gets the bounding rect of resize tracking feedback
//
//  Returns:			Bounding rect
//
//  Exceptions:		Memory
//
// ****************************************************************************
//
RRealRect RCompositeSelection::GetResizeTrackingFeedbackBoundingRect( const R2dTransform& transform,
        const RRealPoint& scalingCenter,
        const RRealSize& scaleFactor,
        BOOLEAN fMaintainAspectRatio ) const
{
    TpsAssert( !IsEmpty( ), "Nothing selected" );

    YSelectionCollectionIterator iterator = m_SelectionCollection.Start( );

    // Use the first rectangle as the starting point, and union from there
    RRealRect boundingRect = ( *iterator )->GetResizeTrackingFeedbackBoundingRect( transform, scalingCenter, scaleFactor, fMaintainAspectRatio );
    ++iterator;

    for( ; iterator != m_SelectionCollection.End( ); ++iterator )
        boundingRect.Union( boundingRect, ( *iterator )->GetResizeTrackingFeedbackBoundingRect( transform, scalingCenter, scaleFactor, fMaintainAspectRatio ) );

    return boundingRect;
}