Esempio n. 1
0
// ****************************************************************************
//
//  Function Name:	RSingleSelection::DrawResizeTrackingRect( )
//
//  Description:		Draws the selection tracking rect for resizing.
//
//  Returns:			Nothing
//
//  Exceptions:		Memory
//
// ****************************************************************************
//
void RSingleSelection::DrawResizeTrackingFeedback( RDrawingSurface& drawingSurface,
																	const R2dTransform& transform,
																	const RRealPoint& scalingCenter,
																	const RRealSize& scaleFactor,
																	BOOLEAN fMaintainAspectRatio ) const
	{
	if( m_pSelectedObject->GetComponentAttributes( ).IsResizable( ) )
		{
		// Setup the drawing surface
		drawingSurface.SetPenWidth( kSelectionOutlineWidth );
		drawingSurface.SetPenStyle( kSolidPen );

		// Get the components bounding rect
		YComponentBoundingRect boundingRect = m_pSelectedObject->GetBoundingRect( );

		// Constrain the scale factor
		RRealSize constrainedScaleFactor = m_pSelectedObject->ApplyResizeConstraint( scaleFactor );

		// Dont force to maintain aspect ratio if it really doesnt want to
		fMaintainAspectRatio = fMaintainAspectRatio && ::AreFloatsEqual( constrainedScaleFactor.m_dx, constrainedScaleFactor.m_dy );

		// Add the scale operation
		boundingRect.UnrotateAndScaleAboutPoint( scalingCenter, constrainedScaleFactor, m_pSelectedObject->GetMinimumSize( ), m_pSelectedObject->GetMaximumSize( ), fMaintainAspectRatio );

		// Tell the object to draw tracking feedback
		m_pSelectedObject->RenderTrackingFeedback( drawingSurface, boundingRect.GetTransform( ) * transform, *GetView( ) );
		}
	}
Esempio n. 2
0
// ****************************************************************************
//
//  Function Name:	RSingleSelection::GetDragTrackingFeedbackBoundingRect( )
//
//  Description:		Gets the bounding rect of drag tracking feedback
//
//  Returns:			Bounding rect
//
//  Exceptions:		Memory
//
// ****************************************************************************
//
RRealRect RSingleSelection::GetDragTrackingFeedbackBoundingRect( const R2dTransform& transform,
																					  const RRealSize& offset ) const
	{
	// Get the components bounding rect
	YComponentBoundingRect boundingRect = m_pSelectedObject->GetBoundingRect( );

	// Add the translate operation
	boundingRect.Offset( offset );

	// Get the objects feedback size
	return m_pSelectedObject->GetTrackingFeedbackBoundingRect( boundingRect.GetTransform( ) * transform );
	}
Esempio n. 3
0
// ****************************************************************************
//
//  Function Name:	RSingleSelection::GetRotateTrackingFeedbackBoundingRect( )
//
//  Description:		Gets the bounding rect of resize tracking feedback
//
//  Returns:			Bounding rect
//
//  Exceptions:		Memory
//
// ****************************************************************************
//
RRealRect RSingleSelection::GetRotateTrackingFeedbackBoundingRect( const R2dTransform& transform,
																						 const RRealPoint& rotationCenter,
																						 YAngle rotationAngle ) const
	{
	// Get the components bounding rect
	YComponentBoundingRect boundingRect = m_pSelectedObject->GetBoundingRect( );

	// Add the rotate operation
	boundingRect.RotateAboutPoint( rotationCenter, rotationAngle );

	// Get the objects feedback size
	return m_pSelectedObject->GetTrackingFeedbackBoundingRect( boundingRect.GetTransform( ) * transform );
	}
Esempio n. 4
0
// ****************************************************************************
//
//  Function Name:	RSingleSelection::GetResizeTrackingFeedbackBoundingRect( )
//
//  Description:		Gets the bounding rect of resize tracking feedback
//
//  Returns:			Bounding rect
//
//  Exceptions:		Memory
//
// ****************************************************************************
//
RRealRect RSingleSelection::GetResizeTrackingFeedbackBoundingRect( const R2dTransform& transform,
																						 const RRealPoint& scalingCenter,
																						 const RRealSize& scaleFactor,
																						 BOOLEAN fMaintainAspectRatio ) const
	{	
	// Get the components bounding rect
	YComponentBoundingRect boundingRect = m_pSelectedObject->GetBoundingRect( );

	// Constrain the scale factor
	RRealSize constrainedScaleFactor = m_pSelectedObject->ApplyResizeConstraint( scaleFactor );

	// Dont force to maintain aspect ratio if it really doesnt want to
	fMaintainAspectRatio = fMaintainAspectRatio && ::AreFloatsEqual( constrainedScaleFactor.m_dx, constrainedScaleFactor.m_dy );

	// Add the scale operation
	boundingRect.UnrotateAndScaleAboutPoint( scalingCenter, constrainedScaleFactor, m_pSelectedObject->GetMinimumSize( ), m_pSelectedObject->GetMaximumSize( ), fMaintainAspectRatio );

	// Get the objects feedback size
	return m_pSelectedObject->GetTrackingFeedbackBoundingRect( boundingRect.GetTransform( ) * transform );
	}
Esempio n. 5
0
// ****************************************************************************
//
//  Function Name:	RSingleSelection::DrawDragTrackingRect( )
//
//  Description:		Draws the selection tracking rect for dragging
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RSingleSelection::DrawDragTrackingFeedback( RDrawingSurface& drawingSurface,
																 const R2dTransform& transform,
																 const RRealSize& offset ) const
	{
	if( m_pSelectedObject->GetComponentAttributes( ).IsMovable( ) )
		{
		// Setup the drawing surface
		drawingSurface.SetPenWidth( kSelectionOutlineWidth );
		drawingSurface.SetPenStyle( kSolidPen );

		// Get the components bounding rect
		YComponentBoundingRect boundingRect = m_pSelectedObject->GetBoundingRect( );

		// Add the translate operation
		boundingRect.Offset( offset );

		// Tell the object to draw tracking feedback
		m_pSelectedObject->RenderTrackingFeedback( drawingSurface, boundingRect.GetTransform( ) * transform, *GetView( ) );
		}
	}
Esempio n. 6
0
void RSingleSelection::DrawRotateTrackingFeedback( RDrawingSurface& drawingSurface,
																	const R2dTransform& transform,
																	const RRealPoint& rotationCenter,
																	YAngle rotationAngle ) const
	{
	if( m_pSelectedObject->GetComponentAttributes( ).IsRotatable( ) )
		{
		// Setup the drawing surface
		drawingSurface.SetPenWidth( kSelectionOutlineWidth );
		drawingSurface.SetPenStyle( kSolidPen );

		// Get the components bounding rect
		YComponentBoundingRect boundingRect = m_pSelectedObject->GetBoundingRect( );

		// Add the rotate operation
		boundingRect.RotateAboutPoint( rotationCenter, rotationAngle );

		// Tell the object to draw tracking feedback
		m_pSelectedObject->RenderTrackingFeedback( drawingSurface, boundingRect.GetTransform( ) * transform, *GetView( ) );
		}
	}